Skip to content

Commit

Permalink
Merge pull request #223 from near/SQAC-103/ad-hoc-smart-contract-calls
Browse files Browse the repository at this point in the history
feat: [SQAC-103] Support for Ad Hoc Smart Contract Calls
  • Loading branch information
lewis-sqa authored Mar 30, 2022
2 parents d1e2297 + 11b6aad commit eef488e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/near-wallet-selector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Action>`)
- `type` (`string`): Action type. See below for available values.
- `params` (`object?`): Parameters for the Action (if applicable).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { NetworkConfiguration, resolveNetwork } from "../network";

interface SignAndSendTransactionParams {
signerId?: string;
receiverId?: string;
actions: Array<Action>;
}

Expand Down Expand Up @@ -107,6 +108,7 @@ export default class NearWalletSelector {

async signAndSendTransaction({
signerId,
receiverId,
actions,
}: SignAndSendTransactionParams) {
const wallet = this.controller.getSelectedWallet();
Expand All @@ -126,7 +128,7 @@ export default class NearWalletSelector {

return wallet.signAndSendTransaction({
signerId: signerId || accounts[0].accountId,
receiverId: this.getContractId(),
receiverId: receiverId || this.getContractId(),
actions,
});
}
Expand Down

0 comments on commit eef488e

Please sign in to comment.