Skip to content

Commit

Permalink
Adding calbackUrl and meta to Call Contract (#1057)
Browse files Browse the repository at this point in the history
Updating the Call Contract method with a callbackUrl using the example from https://github.com/near/near-api-js/blob/master/src/contract.ts
  • Loading branch information
sandoche authored May 7, 2022
1 parent 4049c6c commit 1f5cc61
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/api/naj-quick-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,23 @@ await contract.method_name(
);
```

</TabItem>
<TabItem value="method" label="Change Method w/ callbackUrl and meta">

```js
await contract.method_name(
{
callbackUrl: 'https://example.com/callback', // callbackUrl after the transaction approved (optional)
meta: 'some info', // meta information NEAR Wallet will send back to the application. `meta` will be attached to the `callbackUrl` as a url search param
args: {
arg_name: "value" // argument name and value - pass empty object if no args required
},
gas: 300000000000000, // attached GAS (optional)
amount: 1000000000000000000000000 // attached deposit in yoctoNEAR (optional)
}
);
```

</TabItem>
<TabItem value="view" label="View Method">

Expand Down

0 comments on commit 1f5cc61

Please # to comment.