diff --git a/README.md b/README.md index 72f191e..6bfab77 100644 --- a/README.md +++ b/README.md @@ -121,9 +121,9 @@ walletApi.signInModal() - `call`: Call a method that changes the contract's state. This is payable. It has the following parameters: - `method`: Contract's method name - `props?`: an optional parameter with `args` for the contract's method, `gas`, `deposit` to be attached and `callbackUrl` if you want to take the user to a specific page after a transaction succeeds. -- `callMultiple`: Call multiple methods that changes the contract's state. This is payable and has the following parameters: +- `callMultiple`: Call multiple methods that change the contract's state. This is payable and has the following parameters: - `transactionsList`: A list of Transaction props. You can use `buildTransaction(...)` to help you out - - `callbackUrl?`: A page to take the user to after all the transactions succeeds. + - `callbackUrl?`: A page to take the user to after all the transactions succeed. #### Wallet API Reference @@ -296,9 +296,9 @@ useEffect(() => { - `call`: Call a method that changes the contract's state. This is payable. It has the following parameters: - `method`: Contract's method name - `props?`: an optional parameter with `args` for the contract's method, `gas`, `deposit` to be attached and `callbackUrl` if you want to take the user to a specific page after a transaction succeeds. -- `callMultiple`: Call multiple methods that changes the contract's state. This is payable and has the following parameters: +- `callMultiple`: Call multiple methods that change the contract's state. This is payable and has the following parameters: - `transactionsList`: A list of Transaction props. You can use `buildTransaction(...)` to help you out - - `callbackUrl?`: A page to take the user to after all the transactions succeeds. + - `callbackUrl?`: A page to take the user to after all the transactions succeed. diff --git a/package.json b/package.json index 9485b27..00c2c18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wpdas/naxios", - "version": "1.2.0", + "version": "1.2.1", "description": "Promise based NEAR Contract and NEAR Wallet client for browser", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/managers/contract-manager.ts b/src/managers/contract-manager.ts index 5af0dc9..9566b0c 100644 --- a/src/managers/contract-manager.ts +++ b/src/managers/contract-manager.ts @@ -110,7 +110,7 @@ class ContractManager { type: 'FunctionCall', params: { methodName: transaction.method, - args: transaction.args, + args: transaction.args || {}, gas: transaction.gas || THIRTY_TGAS, deposit: transaction.deposit || NO_DEPOSIT, }, diff --git a/src/managers/types.ts b/src/managers/types.ts index 99f1049..374d169 100644 --- a/src/managers/types.ts +++ b/src/managers/types.ts @@ -22,7 +22,7 @@ export type ChangeMethodArgs = { export type Transaction = { receiverId?: string method: string - args: A + args?: A gas?: string /** * yoctoⓃ amount