From 3d5ebeefa4632ef1a9718378d47eacadfe952500 Mon Sep 17 00:00:00 2001 From: Velenir Date: Tue, 29 Sep 2026 12:26:26 +0200 Subject: [PATCH 1/8] BASE_BUILDER_CODE_SUFFIX for fillOTC tx --- src/helpers/providers/viem.ts | 7 +++-- src/methods/otcOrders/fillOrderDirectly.ts | 7 +++++ src/types.ts | 33 ++++++++++++---------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/helpers/providers/viem.ts b/src/helpers/providers/viem.ts index 42b281b81..38bee6f92 100644 --- a/src/helpers/providers/viem.ts +++ b/src/helpers/providers/viem.ts @@ -35,7 +35,7 @@ export const constructContractCaller = ( ): ContractCallerFunctions => { const staticCall: StaticContractCallerFn = async < T, - M extends string = string + M extends string = string, >( params: ContractCallStaticInput ): Promise => { @@ -88,8 +88,8 @@ export const constructContractCaller = ( maxPriorityFeePerGas: viemTxParams.maxPriorityFeePerGas, } : 'gasPrice' in viemTxParams - ? { gasPrice: viemTxParams.gasPrice } - : {}; + ? { gasPrice: viemTxParams.gasPrice } + : {}; const txHash = await viemClient.writeContract({ // either `viemClient` has account assigned to it, @@ -100,6 +100,7 @@ export const constructContractCaller = ( abi, functionName: contractMethod, args: argsToViemArgs(args), + dataSuffix: params.dataSuffix, value: viemTxParams.value, gas: viemTxParams.gas, // ...viemTxParams, diff --git a/src/methods/otcOrders/fillOrderDirectly.ts b/src/methods/otcOrders/fillOrderDirectly.ts index 23c07d44b..8e436b522 100644 --- a/src/methods/otcOrders/fillOrderDirectly.ts +++ b/src/methods/otcOrders/fillOrderDirectly.ts @@ -1,3 +1,4 @@ +import { BASE_BUILDER_CODE_SUFFIX } from '../../helpers/buildConfig'; import type { ExtractAbiMethodNames } from '../../helpers/misc'; import type { ConstructProviderFetchInput, @@ -210,6 +211,10 @@ export function constructFillOTCOrder( // getAugustusRFQ is cached internally for the same instance of SDK // so should persist across same apiUrl & network const { getAugustusRFQ } = constructGetSpender(options); + const dataSuffix = + options.chainId === 8453 && BASE_BUILDER_CODE_SUFFIX + ? BASE_BUILDER_CODE_SUFFIX + : undefined; const fillOTCOrder: FillOTCOrcer = async ( { order, signature, takerPermit }, @@ -227,6 +232,7 @@ export function constructFillOTCOrder( contractMethod: 'fillOrder', args: [sanitizedOrder, signature], overrides, + dataSuffix, }); return res; @@ -268,6 +274,7 @@ export function constructFillOTCOrder( '0x', // permitMakerAsset, unused because hard to account for changing nonce for long running Orders ], overrides, + dataSuffix, }); return res; diff --git a/src/types.ts b/src/types.ts index e9cb0aff9..195c5141f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -13,6 +13,7 @@ import type { import type { SignableTypedData } from './methods/common/orders/buildOrderData'; import { TransactionParams } from './methods/swap/transaction'; import type { MarkRequired, Prettify } from 'ts-essentials'; +import type { Hex } from 'viem'; export type { Address, @@ -48,12 +49,14 @@ interface FetcherInputBase { headers?: Record; requestParams?: RequestParameters; } -export interface FetcherGetInput - extends FetcherInputBase { +export interface FetcherGetInput< + URL extends string = string, +> extends FetcherInputBase { method: 'GET'; } -export interface FetcherPostInput - extends FetcherInputBase { +export interface FetcherPostInput< + URL extends string = string, +> extends FetcherInputBase { method: 'POST'; data: Record; } @@ -97,14 +100,18 @@ interface ContractCallInput { args: any[]; } -export interface ContractCallStaticInput - extends ContractCallInput { +export interface ContractCallStaticInput< + T extends string, +> extends ContractCallInput { overrides: StaticCallOverrides; } -interface ContractCallTransactionInput - extends ContractCallInput { +interface ContractCallTransactionInput< + T extends string, +> extends ContractCallInput { overrides: TxSendOverrides; + /** Hex-encoded suffix to append before sending; custom callers must honor it. */ + dataSuffix?: Hex; } // may have to type result T differently if we ever use staticCalls in SDK @@ -126,7 +133,7 @@ export interface ContractCallerFunctions { export interface ConstructProviderFetchInput< T, - D extends keyof ContractCallerFunctions = keyof ContractCallerFunctions + D extends keyof ContractCallerFunctions = keyof ContractCallerFunctions, > extends ConstructFetchInput { contractCaller: Pick, D>; } @@ -173,12 +180,8 @@ export type ApiToken = Prettify< >; // if no extra keys in Checking, return Checking, otherwise never -export type NoExtraKeysCheck = Exclude< - keyof Checking, - keyof CheckAgainst -> extends never - ? Checking - : never; +export type NoExtraKeysCheck = + Exclude extends never ? Checking : never; export type PriceRouteApiResponse = { priceRoute: OptimalRate; From 3b379ac0c2501414c25c819c5ba35b93963fa8f2 Mon Sep 17 00:00:00 2001 From: Velenir Date: Tue, 29 Sep 2026 12:26:43 +0200 Subject: [PATCH 2/8] ethers/apply dataSuffix --- src/helpers/providers/dataSuffix.ts | 67 +++++++++++++++++++++++++++++ src/helpers/providers/ethers.ts | 7 ++- src/helpers/providers/ethersV6.ts | 7 ++- 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 src/helpers/providers/dataSuffix.ts diff --git a/src/helpers/providers/dataSuffix.ts b/src/helpers/providers/dataSuffix.ts new file mode 100644 index 000000000..fcff5d107 --- /dev/null +++ b/src/helpers/providers/dataSuffix.ts @@ -0,0 +1,67 @@ +import type { Signer as EthersV5Signer } from '@ethersproject/abstract-signer'; +import type { ContractRunner, Signer as EthersV6Signer } from 'ethers'; +import { bytesToHex } from 'viem'; + +export type WithDataSuffixInput = { signer: T; suffix?: string }; + +export function withEthersV5DataSuffix({ + signer, + suffix, +}: WithDataSuffixInput): EthersV5Signer { + if (!suffix) return signer; + return { + _isSigner: true, + provider: signer.provider, + getAddress: signer.getAddress.bind(signer), + signMessage: signer.signMessage.bind(signer), + signTransaction: signer.signTransaction.bind(signer), + getBalance: signer.getBalance.bind(signer), + getTransactionCount: signer.getTransactionCount.bind(signer), + estimateGas: signer.estimateGas.bind(signer), + call: signer.call.bind(signer), + getChainId: signer.getChainId.bind(signer), + getGasPrice: signer.getGasPrice.bind(signer), + getFeeData: signer.getFeeData.bind(signer), + resolveName: signer.resolveName.bind(signer), + checkTransaction: signer.checkTransaction.bind(signer), + populateTransaction: signer.populateTransaction.bind(signer), + _checkProvider: signer._checkProvider.bind(signer), + connect: (provider) => + withEthersV5DataSuffix({ signer: signer.connect(provider), suffix }), + // Contract retains its receipt decoding; the signer receives final calldata. + sendTransaction: async (tx) => + signer.sendTransaction({ + ...tx, + data: appendSuffix(await tx.data, suffix), + }), + }; +} + +export function withEthersV6DataSuffix({ + signer, + suffix, +}: WithDataSuffixInput): ContractRunner { + if (!suffix) return signer; + return { + provider: signer.provider, + resolveName: signer.resolveName.bind(signer), + sendTransaction: (tx) => + signer.sendTransaction({ + ...tx, + data: appendSuffix(tx.data, suffix), + }), + }; +} + +function appendSuffix( + data: string | ArrayLike | null | undefined, + suffix: string +): string { + const hex = + typeof data === 'string' + ? data + : data + ? bytesToHex(Uint8Array.from(data)) + : '0x'; + return `${hex}${suffix.slice(2)}`; +} diff --git a/src/helpers/providers/ethers.ts b/src/helpers/providers/ethers.ts index ac2b141f3..1ec767dee 100644 --- a/src/helpers/providers/ethers.ts +++ b/src/helpers/providers/ethers.ts @@ -1,3 +1,4 @@ +import { withEthersV5DataSuffix } from './dataSuffix'; import type { Address, ContractCallerFunctions, @@ -82,7 +83,11 @@ export const constructEthersV5ContractCaller = ( ? providerOrSigner.getSigner(account) : providerOrSigner; - const contract = new Contract(address, abi, signer); + const contract = new Contract( + address, + abi, + withEthersV5DataSuffix({ signer, suffix: params.dataSuffix }) + ); assertEthersContractHasMethodsV5(contract, contractMethod); // drop keys not in PayableOverrides diff --git a/src/helpers/providers/ethersV6.ts b/src/helpers/providers/ethersV6.ts index 9418ff457..29e43f2db 100644 --- a/src/helpers/providers/ethersV6.ts +++ b/src/helpers/providers/ethersV6.ts @@ -1,3 +1,4 @@ +import { withEthersV6DataSuffix } from './dataSuffix'; import type { Address, ContractCallerFunctions, @@ -64,7 +65,11 @@ export const constructContractCaller = ( ? await providerOrSigner.getSigner(account) : providerOrSigner; - const contract = new Contract(address, abi, signer); + const contract = new Contract( + address, + abi, + withEthersV6DataSuffix({ signer, suffix: params.dataSuffix }) + ); // drop keys not in PayableOverrides const { gas, from, ...restOverrides } = overrides; From b2cc1f960d46898dbb1b936014fc07383840f592 Mon Sep 17 00:00:00 2001 From: Velenir Date: Tue, 29 Sep 2026 12:26:52 +0200 Subject: [PATCH 3/8] web3/apply dataSuffix --- src/helpers/providers/web3.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/helpers/providers/web3.ts b/src/helpers/providers/web3.ts index 9d9687cce..71ce2a2f5 100644 --- a/src/helpers/providers/web3.ts +++ b/src/helpers/providers/web3.ts @@ -80,6 +80,16 @@ export const constructContractCaller = ( const preparedCall = contract.methods[contractMethod](...args); + if (params.dataSuffix) { + const data = `${preparedCall.encodeABI()}${params.dataSuffix.slice(2)}`; + contract.setTransactionMiddleware({ + processTransaction: async (tx) => ({ + ...tx, + data, + ...(tx.input !== undefined ? { input: data } : {}), + }), + }); + } const promiEvent = preparedCall.send(normalizedOverrides); // can't just return promiEvent, because async function returns a Promise From 73dc0ce64fa95c8d0bb25f33bd47d1ce5332d43d Mon Sep 17 00:00:00 2001 From: Velenir Date: Tue, 29 Sep 2026 12:27:41 +0200 Subject: [PATCH 4/8] inline BASE_BUILDER_CODE_SUFFIX --- dts.config.ts | 34 ++++++++++++++++++++++++++++++++++ package.json | 1 + pnpm-lock.yaml | 3 +++ src/helpers/buildConfig.ts | 3 +++ 4 files changed, 41 insertions(+) create mode 100644 dts.config.ts create mode 100644 src/helpers/buildConfig.ts diff --git a/dts.config.ts b/dts.config.ts new file mode 100644 index 000000000..db73c2dd0 --- /dev/null +++ b/dts.config.ts @@ -0,0 +1,34 @@ +import replace from '@rollup/plugin-replace'; +import { config as loadEnv } from 'dotenv'; +import type { DtsConfig } from 'dts-cli/dist/types'; + +loadEnv(); + +const code = process.env.BASE_BUILDER_CODE || ''; +if (code && (code.length > 255 || !/^[\x21-\x2b\x2d-\x7e]+$/.test(code))) { + throw new Error( + 'BASE_BUILDER_CODE must be 1-255 printable ASCII bytes without commas' + ); +} +const suffix = code + ? `0x${Buffer.from(code, 'ascii').toString('hex')}${code.length + .toString(16) + .padStart(2, '0')}0080218021802180218021802180218021` + : ''; + +const config: DtsConfig = { + rollup(config) { + return { + ...config, + plugins: [ + replace({ + 'process.env.BASE_BUILDER_CODE_SUFFIX': JSON.stringify(suffix), + preventAssignment: true, + }), + ...(Array.isArray(config.plugins) ? config.plugins : []), + ], + }; + }, +}; + +export default config; diff --git a/package.json b/package.json index 91ebff24c..ed90c19c8 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "@ethersproject/bignumber": "^5.8.0", "@ethersproject/contracts": "^5.8.0", "@ethersproject/providers": "^5.8.0", + "@rollup/plugin-replace": "^5.0.7", "@size-limit/preset-small-lib": "^12.1.0", "@tsconfig/recommended": "^1.0.8", "@types/jest": "^30.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 027b94bf3..632f42c74 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,6 +39,9 @@ importers: '@ethersproject/providers': specifier: ^5.8.0 version: 5.8.0 + '@rollup/plugin-replace': + specifier: ^5.0.7 + version: 5.0.7(rollup@3.30.0) '@size-limit/preset-small-lib': specifier: ^12.1.0 version: 12.1.0(size-limit@12.1.0) diff --git a/src/helpers/buildConfig.ts b/src/helpers/buildConfig.ts new file mode 100644 index 000000000..afe8fcd79 --- /dev/null +++ b/src/helpers/buildConfig.ts @@ -0,0 +1,3 @@ +export const BASE_BUILDER_CODE_SUFFIX = process.env.BASE_BUILDER_CODE_SUFFIX as + | `0x${string}` + | ''; From e7dbe58d95effa14a95e1a65e52e1d3e6a6530c5 Mon Sep 17 00:00:00 2001 From: Velenir Date: Tue, 29 Sep 2026 12:27:57 +0200 Subject: [PATCH 5/8] tests for dataSuffix --- tests/builderCode.test.ts | 268 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 tests/builderCode.test.ts diff --git a/tests/builderCode.test.ts b/tests/builderCode.test.ts new file mode 100644 index 000000000..d7d01c2cb --- /dev/null +++ b/tests/builderCode.test.ts @@ -0,0 +1,268 @@ +import { spawnSync } from 'child_process'; +import path from 'path'; +import { Contract as ContractV5, VoidSigner as VoidSignerV5 } from 'ethersV5'; +import { + Contract, + VoidSigner, + TransactionResponse, + ContractTransactionResponse, +} from 'ethers'; +import { createWalletClient, custom, encodeFunctionData, Hex } from 'viem'; +import { base } from 'viem/chains'; +import Web3 from 'web3'; +import { constructFillOTCOrder } from '../src/methods/otcOrders/fillOrderDirectly'; +import { constructEthersV5ContractCaller } from '../src/helpers/providers/ethers'; +import { constructContractCaller as ethersV6Caller } from '../src/helpers/providers/ethersV6'; +import { constructContractCaller as viemCaller } from '../src/helpers/providers/viem'; +import { constructContractCaller as web3Caller } from '../src/helpers/providers/web3'; +import type { FetcherFunction } from '../src/types'; +import * as buildConfig from '../src/helpers/buildConfig'; + +jest.mock('../src/helpers/buildConfig', () => ({ + __esModule: true, + BASE_BUILDER_CODE_SUFFIX: '', +})); +const suffix: Hex = + '0x62635f686d363471346a6d0b0080218021802180218021802180218021'; +const address = '0x0000000000000000000000000000000000000001'; +const hash = `0x${'ab'.repeat(32)}`; +const order = { + nonceAndMeta: '1', + expiry: 2000000000, + makerAsset: address, + takerAsset: address, + maker: address, + taker: address, + makerAmount: '100', + takerAmount: '200', +}; + +afterEach(() => { + jest.restoreAllMocks(); + Object.assign(buildConfig, { BASE_BUILDER_CODE_SUFFIX: '' }); +}); + +describe('direct RFQ attribution scope', () => { + it.each([ + [8453, suffix, suffix], + [1, suffix, undefined], + [8453, '', undefined], + ])( + 'chain %s with configured suffix %s', + async (chainId, configured, expected) => { + Object.assign(buildConfig, { BASE_BUILDER_CODE_SUFFIX: configured }); + const transactCall = jest.fn().mockResolvedValue(hash); + const fetcher: FetcherFunction = async () => + ({ AugustusRFQ: address }) as T; + const { fillOTCOrder } = constructFillOTCOrder({ + chainId: Number(chainId), + fetcher, + contractCaller: { transactCall }, + }); + await fillOTCOrder({ order, signature: '0x1234' }); + await fillOTCOrder({ + order, + signature: '0x1234', + takerPermit: { encodedPermitParams: '0x5678' }, + }); + expect(transactCall).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + contractMethod: 'fillOrder', + dataSuffix: expected, + }) + ); + expect(transactCall).toHaveBeenNthCalledWith( + 2, + expect.objectContaining({ + contractMethod: 'partialFillOrderWithTargetPermit', + dataSuffix: expected, + }) + ); + } + ); +}); + +const abi = [ + { + type: 'function', + name: 'trade', + stateMutability: 'payable', + inputs: [{ name: 'amount', type: 'uint256' }], + outputs: [], + }, +] as const; +const calldata = encodeFunctionData({ + abi, + functionName: 'trade', + args: [42n], +}); +const params = { + address, + abi, + contractMethod: 'trade', + args: ['42'], + overrides: { value: '7', gas: 100000, nonce: 3 }, +}; + +describe.each([undefined, suffix])( + 'provider calldata (suffix %s)', + (dataSuffix) => { + const expected = `${calldata}${dataSuffix?.slice(2) || ''}`; + it('ethers v5 and v6 preserve contract responses and append before signer submission', async () => { + const signerV5 = new VoidSignerV5(address); + const sendV5 = jest.spyOn(signerV5, 'sendTransaction').mockResolvedValue({ + hash, + wait: jest.fn().mockResolvedValue({ logs: [] }), + } as unknown as Awaited>); + const v5 = constructEthersV5ContractCaller( + { + ethersProviderOrSigner: signerV5, + EthersContract: ContractV5, + }, + address + ); + const responseV5 = await v5.transactCall({ ...params, dataSuffix }); + expect(responseV5.hash).toBe(hash); + expect((await responseV5.wait()).events).toEqual([]); + expect(sendV5).toHaveBeenCalledWith( + expect.objectContaining({ + data: expected, + to: address, + nonce: 3, + }) + ); + const signer = new VoidSigner(address); + const send = jest + .spyOn(signer, 'sendTransaction') + .mockResolvedValue({ hash } as TransactionResponse); + const v6 = ethersV6Caller( + { ethersV6ProviderOrSigner: signer, EthersV6Contract: Contract }, + address + ); + const response = await v6.transactCall({ ...params, dataSuffix }); + expect(response.hash).toBe(hash); + expect(response).toBeInstanceOf(ContractTransactionResponse); + expect(send).toHaveBeenCalledWith( + expect.objectContaining({ + data: expected, + to: address, + value: 7n, + gasLimit: 100000n, + nonce: 3, + }) + ); + }); + + it('viem sends suffixed calldata to the wallet RPC', async () => { + const request = jest.fn(async ({ method }: { method: string }) => { + if (method === 'eth_chainId') return '0x2105'; + if (method === 'eth_sendTransaction') return hash; + throw new Error(`Unexpected RPC ${method}`); + }); + const client = createWalletClient({ + account: address, + chain: base, + transport: custom({ request }), + }); + const caller = viemCaller(client, address); + expect(await caller.transactCall({ ...params, dataSuffix })).toBe(hash); + expect(request).toHaveBeenCalledWith( + expect.objectContaining({ + method: 'eth_sendTransaction', + params: [ + expect.objectContaining({ + data: expected, + value: '0x7', + gas: '0x186a0', + nonce: '0x3', + }), + ], + }), + undefined + ); + }); + + it('Web3 adds the suffix through contract transaction middleware and retains events', async () => { + const web3 = new Web3('http://localhost:1'); + const actualContract = web3.eth.Contract; + const sent = jest.fn(); + // Keep real ABI encoding, but stop at contract.send to avoid RPC or receipt polling. + jest.spyOn(web3.eth, 'Contract').mockImplementation((...args) => { + const contract = new actualContract(...args); + const method = contract.methods.trade!; + contract.methods.trade = (...values) => { + const prepared = method(...values); + prepared.send = jest.fn((options) => { + const middleware = contract.getTransactionMiddleware(); + const tx = { + ...options, + data: prepared.encodeABI(), + input: prepared.encodeABI(), + }; + sent( + middleware + ? middleware.processTransaction(tx) + : Promise.resolve(tx) + ); + return { on: jest.fn(), once: jest.fn() } as unknown as ReturnType< + typeof prepared.send + >; + }); + return prepared; + }; + return contract; + }); + const response = await web3Caller(web3, address).transactCall({ + ...params, + dataSuffix, + }); + expect(typeof response.on).toBe('function'); + expect(typeof response.once).toBe('function'); + expect(await sent.mock.calls[0]?.[0]).toEqual( + expect.objectContaining({ data: expected, input: expected, value: '7' }) + ); + }); + } +); + +describe('build-time configuration', () => { + const buildConfig = (code: string) => + spawnSync( + process.execPath, + [ + '-e', + ` + require( + require.resolve('ts-node', { paths: [require.resolve('dts-cli')] }) + ).register({ compilerOptions: { module: 'CommonJS' }, transpileOnly: true }); + const config = require('./dts.config.ts').default; + const { plugins } = config.rollup({ plugins: [] }); + const output = plugins[0].transform('export const BASE_BUILDER_CODE_SUFFIX = process.env.BASE_BUILDER_CODE_SUFFIX;', require('path').resolve('src/helpers/buildConfig.ts')); + process.stdout.write(output.code); + `, + ], + { + cwd: path.resolve(__dirname, '..'), + env: { ...process.env, BASE_BUILDER_CODE: code }, + encoding: 'utf8', + timeout: 5000, + } + ); + + it.each(['bc_hm64q4jm', ''])('embeds configured code %s', (code) => { + const result = buildConfig(code); + expect(result.status).toBe(0); + expect(result.stdout).toBe( + `export const BASE_BUILDER_CODE_SUFFIX = ${JSON.stringify( + code ? suffix : '' + )};` + ); + }); + + it('rejects malformed configuration during the build', () => { + const result = buildConfig('code,other'); + expect(result.status).toBe(1); + expect(result.stderr).toContain('BASE_BUILDER_CODE must be'); + }); +}); From e7dbafc5f4199c090efe703f5c7822a54a885303 Mon Sep 17 00:00:00 2001 From: Velenir Date: Tue, 29 Sep 2026 13:33:49 +0200 Subject: [PATCH 6/8] lint fix --- src/helpers/providers/viem.ts | 6 +++--- src/types.ts | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/helpers/providers/viem.ts b/src/helpers/providers/viem.ts index 38bee6f92..bda8e3f1b 100644 --- a/src/helpers/providers/viem.ts +++ b/src/helpers/providers/viem.ts @@ -35,7 +35,7 @@ export const constructContractCaller = ( ): ContractCallerFunctions => { const staticCall: StaticContractCallerFn = async < T, - M extends string = string, + M extends string = string >( params: ContractCallStaticInput ): Promise => { @@ -88,8 +88,8 @@ export const constructContractCaller = ( maxPriorityFeePerGas: viemTxParams.maxPriorityFeePerGas, } : 'gasPrice' in viemTxParams - ? { gasPrice: viemTxParams.gasPrice } - : {}; + ? { gasPrice: viemTxParams.gasPrice } + : {}; const txHash = await viemClient.writeContract({ // either `viemClient` has account assigned to it, diff --git a/src/types.ts b/src/types.ts index 195c5141f..f6762f075 100644 --- a/src/types.ts +++ b/src/types.ts @@ -49,14 +49,12 @@ interface FetcherInputBase { headers?: Record; requestParams?: RequestParameters; } -export interface FetcherGetInput< - URL extends string = string, -> extends FetcherInputBase { +export interface FetcherGetInput + extends FetcherInputBase { method: 'GET'; } -export interface FetcherPostInput< - URL extends string = string, -> extends FetcherInputBase { +export interface FetcherPostInput + extends FetcherInputBase { method: 'POST'; data: Record; } @@ -100,15 +98,13 @@ interface ContractCallInput { args: any[]; } -export interface ContractCallStaticInput< - T extends string, -> extends ContractCallInput { +export interface ContractCallStaticInput + extends ContractCallInput { overrides: StaticCallOverrides; } -interface ContractCallTransactionInput< - T extends string, -> extends ContractCallInput { +interface ContractCallTransactionInput + extends ContractCallInput { overrides: TxSendOverrides; /** Hex-encoded suffix to append before sending; custom callers must honor it. */ dataSuffix?: Hex; @@ -133,7 +129,7 @@ export interface ContractCallerFunctions { export interface ConstructProviderFetchInput< T, - D extends keyof ContractCallerFunctions = keyof ContractCallerFunctions, + D extends keyof ContractCallerFunctions = keyof ContractCallerFunctions > extends ConstructFetchInput { contractCaller: Pick, D>; } @@ -180,8 +176,12 @@ export type ApiToken = Prettify< >; // if no extra keys in Checking, return Checking, otherwise never -export type NoExtraKeysCheck = - Exclude extends never ? Checking : never; +export type NoExtraKeysCheck = Exclude< + keyof Checking, + keyof CheckAgainst +> extends never + ? Checking + : never; export type PriceRouteApiResponse = { priceRoute: OptimalRate; From 5bba62ff7070ddd6dfe0cfccab29d9a6194730a3 Mon Sep 17 00:00:00 2001 From: Velenir Date: Tue, 6 Oct 2026 15:15:46 +0200 Subject: [PATCH 7/8] Release 11.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ed90c19c8..8db569651 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@velora-dex/sdk", - "version": "11.0.0", + "version": "11.0.1", "main": "dist/index.js", "module": "dist/sdk.esm.js", "typings": "dist/index.d.ts", From 6566d9d2dee6d2569ce1c162dac7bd50a99ac529 Mon Sep 17 00:00:00 2001 From: Velenir Date: Tue, 6 Oct 2026 15:24:56 +0200 Subject: [PATCH 8/8] test:more generic suffic test --- tests/builderCode.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/builderCode.test.ts b/tests/builderCode.test.ts index d7d01c2cb..dc1b80fee 100644 --- a/tests/builderCode.test.ts +++ b/tests/builderCode.test.ts @@ -22,8 +22,10 @@ jest.mock('../src/helpers/buildConfig', () => ({ __esModule: true, BASE_BUILDER_CODE_SUFFIX: '', })); +// Stand-in for a real builder cod +const builderCode = 'bc_testcode'; const suffix: Hex = - '0x62635f686d363471346a6d0b0080218021802180218021802180218021'; + '0x62635f74657374636f64650b0080218021802180218021802180218021'; const address = '0x0000000000000000000000000000000000000001'; const hash = `0x${'ab'.repeat(32)}`; const order = { @@ -250,7 +252,7 @@ describe('build-time configuration', () => { } ); - it.each(['bc_hm64q4jm', ''])('embeds configured code %s', (code) => { + it.each([builderCode, ''])('embeds configured code %s', (code) => { const result = buildConfig(code); expect(result.status).toBe(0); expect(result.stdout).toBe(