Skip to content

Commit 3c1de99

Browse files
authored
generate SDK (#876)
1 parent 7145642 commit 3c1de99

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

sdk/src/services/ContractService.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ export class ContractService {
1212
/**
1313
* Read from contract
1414
* Call a read function on a contract.
15-
* @param functionName Name of the function to call on Contract
15+
* @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
1616
* @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred.
1717
* @param contractAddress Contract address
1818
* @param args Arguments for the function. Comma Separated
19+
* @param abi
1920
* @returns any Default Response
2021
* @throws ApiError
2122
*/
@@ -24,6 +25,33 @@ export class ContractService {
2425
chain: string,
2526
contractAddress: string,
2627
args?: string,
28+
abi?: Array<{
29+
type: string;
30+
name?: string;
31+
inputs?: Array<{
32+
type?: string;
33+
name?: string;
34+
internalType?: string;
35+
stateMutability?: string;
36+
components?: Array<{
37+
type?: string;
38+
name?: string;
39+
internalType?: string;
40+
}>;
41+
}>;
42+
outputs?: Array<{
43+
type?: string;
44+
name?: string;
45+
internalType?: string;
46+
stateMutability?: string;
47+
components?: Array<{
48+
type?: string;
49+
name?: string;
50+
internalType?: string;
51+
}>;
52+
}>;
53+
stateMutability?: string;
54+
}>,
2755
): CancelablePromise<{
2856
result: any;
2957
}> {
@@ -37,6 +65,7 @@ export class ContractService {
3765
query: {
3866
'functionName': functionName,
3967
'args': args,
68+
'abi': abi,
4069
},
4170
errors: {
4271
400: `Bad Request`,

0 commit comments

Comments
 (0)