From 11e88c51f62e04a5155dd2f72310ea29fac4b99c Mon Sep 17 00:00:00 2001 From: Prithvish Baidya Date: Tue, 8 Apr 2025 00:40:36 +0530 Subject: [PATCH] generate SDK --- sdk/src/services/ContractService.ts | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/sdk/src/services/ContractService.ts b/sdk/src/services/ContractService.ts index caef1327..7f333404 100644 --- a/sdk/src/services/ContractService.ts +++ b/sdk/src/services/ContractService.ts @@ -12,10 +12,11 @@ export class ContractService { /** * Read from contract * Call a read function on a contract. - * @param functionName Name of the function to call on Contract + * @param functionName The function to call on the contract. It is highly recommended to provide a full function signature, such as 'function balanceOf(address owner) view returns (uint256)', to avoid ambiguity and to skip ABI resolution * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param args Arguments for the function. Comma Separated + * @param abi * @returns any Default Response * @throws ApiError */ @@ -24,6 +25,33 @@ export class ContractService { chain: string, contractAddress: string, args?: string, + abi?: Array<{ + type: string; + name?: string; + inputs?: Array<{ + type?: string; + name?: string; + internalType?: string; + stateMutability?: string; + components?: Array<{ + type?: string; + name?: string; + internalType?: string; + }>; + }>; + outputs?: Array<{ + type?: string; + name?: string; + internalType?: string; + stateMutability?: string; + components?: Array<{ + type?: string; + name?: string; + internalType?: string; + }>; + }>; + stateMutability?: string; + }>, ): CancelablePromise<{ result: any; }> { @@ -37,6 +65,7 @@ export class ContractService { query: { 'functionName': functionName, 'args': args, + 'abi': abi, }, errors: { 400: `Bad Request`,