Send transactions
Applications can request to send NEAR, sign and send a single transaction, or a batch of transactions
Sign and send a single transaction to a smart contract
Applications can call signAndSendTransaction API with the following API signature:
signAndSendTransaction: ( params: SignAndSendTransactionParams )
=> Promise<SignAndSendTransactionResponse>
export interface Action {
methodName: string;
args: object;
gas: string;
deposit: string;
}
export interface SignAndSendTransactionParams {
receiverId: string;
actions: Array<Action>;
}
//example transaction
let txExecution =
await window.nearFiWallet
.signAndSendTransaction({
receiverId: "usdc.fakes.testnet",
actions: [
{
methodName: "storage_deposit",
args: {accountId: "nearfi.testnet"},
gas: parseNearAmount('0.02'),
deposit: parseNearAmount('0.00125')
}
]
})
NearFi wallet browser will show a popup to let users confirm the transaction.
A transaction can consist of multiple actions that call methods of the receiverId contract.
Sign and send a batch of transactions
Similar to the signAndSendTransaction API, applications can call requestSignTransactions API to send a batch of transactions each of which could call functions of different contracts:
NearFi wallet browser will show a popup to let users confirm the transaction.

Send NEAR
Applications can also request to send NEAR to an accountId or a contract using sendMoney API.
Last updated