diff --git a/packages/near-wallet-selector/README.md b/packages/near-wallet-selector/README.md index 24d42022f..cf29a847b 100644 --- a/packages/near-wallet-selector/README.md +++ b/packages/near-wallet-selector/README.md @@ -289,6 +289,7 @@ console.log(contractId); // "guest-book.testnet" - `params` (`object`) - `signerId` (`string?`): Account ID used to sign the transaction. Defaults to the first account. + - `receiverId` (`string?`): Account ID to receive the transaction. Defaults to `contractId` defined in `.init`. - `actions` (`Array`) - `type` (`string`): Action type. See below for available values. - `params` (`object?`): Parameters for the Action (if applicable). diff --git a/packages/near-wallet-selector/src/core/NearWalletSelector.tsx b/packages/near-wallet-selector/src/core/NearWalletSelector.tsx index e5ea212a0..730a272e3 100644 --- a/packages/near-wallet-selector/src/core/NearWalletSelector.tsx +++ b/packages/near-wallet-selector/src/core/NearWalletSelector.tsx @@ -14,6 +14,7 @@ import { NetworkConfiguration, resolveNetwork } from "../network"; interface SignAndSendTransactionParams { signerId?: string; + receiverId?: string; actions: Array; } @@ -107,6 +108,7 @@ export default class NearWalletSelector { async signAndSendTransaction({ signerId, + receiverId, actions, }: SignAndSendTransactionParams) { const wallet = this.controller.getSelectedWallet(); @@ -126,7 +128,7 @@ export default class NearWalletSelector { return wallet.signAndSendTransaction({ signerId: signerId || accounts[0].accountId, - receiverId: this.getContractId(), + receiverId: receiverId || this.getContractId(), actions, }); }