//#region extensions/crypto/src/services/builder-code.d.ts /** * Base Builder Code (ERC-8021) — transaction attribution for base.dev analytics. * * Every transaction on Base sent through OpenClawnch includes a data suffix that * attributes the transaction to our builder code. This: * 1. Tracks on-chain usage on base.dev * 2. Qualifies for Base ecosystem rewards * 3. Shows up in app leaderboards * * The suffix is appended to the `data` field of every sendTransaction call. * For native ETH transfers (no data), the suffix becomes the entire data field. * Smart contracts ignore trailing calldata — zero impact on execution. * * @see https://docs.base.org/base-chain/builder-codes/builder-codes * @see ERC-8021: https://eip.tools/eip/8021 */ /** OpenClawnch's registered Base Builder Code. */ declare const BUILDER_CODE = "bc_z92vaimh"; /** * Pre-computed ERC-8021 data suffix for our builder code. * * Format: [1 byte: code length] [N bytes: UTF-8 code] [0x00] [8021 repeated 8 times] * * Encoding breakdown for 'bc_z92vaimh': * 0b = length 11 * 62635f7a39327661696d68 = 'bc_z92vaimh' UTF-8 * 00 = separator * 80218021802180218021802180218021 = ERC-8021 magic (8 × 0x8021) */ declare const DATA_SUFFIX: "0x0b62635f7a39327661696d680080218021802180218021802180218021"; /** * Append the ERC-8021 builder code suffix to transaction data. * * - If data is empty/undefined (native ETH transfer), the suffix becomes the data. * - If data exists (contract call), the suffix is appended to the end. * - Only applies to Base chain transactions. * * @param data - Existing transaction data (hex string or undefined) * @param chainId - The chain this transaction targets * @returns The data with suffix appended, or original data if not Base */ declare function appendBuilderCode(data: string | undefined, chainId: number | undefined): string | undefined; /** * Check if a transaction's data field already contains our builder code suffix. */ declare function hasBuilderCode(data: string | undefined): boolean; /** * Wrap a viem wallet client to automatically append the builder code suffix * to all sendTransaction calls on Base. * * This is the main integration point. Applied once at wallet client creation * in walletconnect-service.ts. * * The wrapper intercepts the `request` method on the transport, catches * `eth_sendTransaction` calls, and appends the suffix to the data field. */ declare function wrapWithBuilderCode(walletClient: any, chainId?: number): any; //#endregion export { BUILDER_CODE, DATA_SUFFIX, appendBuilderCode, hasBuilderCode, wrapWithBuilderCode }; //# sourceMappingURL=builder-code.d.mts.map