Skip to content

Commit

Permalink
insert for method
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdas committed Jan 24, 2024
1 parent a075105 commit fb45e43
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 1 addition & 3 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

## MAIN

-
- insert `callbackUrl` for `contractApi.call(...)`

## Next steps

- insert `callbackUrl` for `contractApi.call(...)`

## Backlog

- Write tests
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wpdas/naxios",
"version": "1.1.0",
"version": "1.1.1",
"description": "Promise based NEAR Contract and NEAR Wallet client for browser",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
9 changes: 8 additions & 1 deletion src/managers/contract-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ class ContractManager {
}

// Build Call Method Interface
private async buildCallInterface<R>({ method = '', args = {}, gas = THIRTY_TGAS, deposit = NO_DEPOSIT }) {
private async buildCallInterface<R>({
method = '',
args = {},
gas = THIRTY_TGAS,
deposit = NO_DEPOSIT,
callbackUrl = '',
}) {
if (!this.walletManager.walletSelector) {
await this.walletManager.initNear()
}
Expand All @@ -62,6 +68,7 @@ class ContractManager {
const outcome = await this.walletManager.wallet!.signAndSendTransaction({
signerId: accountId,
receiverId: this.walletManager.contractId,
callbackUrl,
actions: [
{
type: 'FunctionCall',
Expand Down
1 change: 1 addition & 0 deletions src/managers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type ChangeMethodArgs<A> = {
args: A
gas?: string
deposit?: string
callbackUrl?: string
}
export type Network = 'mainnet' | 'testnet' | 'localnet'
export type Config = {
Expand Down

0 comments on commit fb45e43

Please sign in to comment.