# Send transactions

## Sign and send a single transaction to a smart contract

Applications can call `signAndSendTransaction` API with the following API signature:

```javascript
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&#x20;

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:

```javascript
//example transaction
let txExecution = 
    await window.nearFiWallet
      .requestSignTransactions([
        {
          receiverId: "naistable.deganstable.testnet",
          actions: [
            {
              methodName: "storage_deposit",
              args: {},
              gas: parseNearAmount('0.02'),
              deposit: parseNearAmount('0.1')
            }
          ]
        },
        {
          receiverId: "wrap.testnet",
          actions: [
            {
              methodName: "storage_deposit",
              args: {},
              gas: parseNearAmount('0.05'),
              deposit: parseNearAmount('0.00125')
            }
          ]
        },
        {
          receiverId: "naistable.deganstable.testnet",
          actions: [
            {
              methodName: "borrow",
              args: {borrow_amount: "200000000000000000000"},
              gas: parseNearAmount('0.02'),
              deposit: parseNearAmount('10')
            }
          ]
        },
      ])
                              
```

NearFi wallet browser will show a popup to let users confirm the transaction.

![](/files/GaAsHjlSXCSbUR4HUS2c)

## Send NEAR

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

```javascript
//example transaction
let txExecution = 
    await window.nearFiWallet
      .sendMoney({
        receiverId: "nearfi.testnet",
        amount: parseNearAmount(20)
      })
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nearfi.finance/developer-guide/integrate-nearfi-dapp-browser-into-your-app/send-transactions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
