# Transfer ERC20 Tokens

```typescript
import { BigNumber } from 'ethers';
import 'dotenv/config';
import { NetworkNames, initializeSdkGateway } from '@kanalabs/mirai';

const tokenAddress = '0xc2132D05D31c914a87C6611C10748AEb04B58e8F'; // Sender address
const receiverAddress = '0x97a57d9CE2889E2E8DFb6019f8Eb51F5d119Bde3'; // Receiver address

(async () => {

    // initializating sdk...
    const sdk = await initializeSdkGateway(
        { privateKey: process.env.PRIVATE_KEY as string },
        {
          networks: [NetworkNames.Mumbai],
          bundlerApiKey: process.env.BUNDLER_API_KEY
        },
      );

    // set mumbai as default current instance
    const networkInstance = sdk.setCurrentInstance(NetworkNames.Mumbai);

    //initialize erc20 sdk instance
    const erc20 = sdk.erc20(tokenAddress, NetworkNames.Mumbai);

    const native = await sdk.getNativeBalance();
    console.log('native: ', native);

    // clear any previous transactions in batch
    await networkInstance.clearUserOpsFromBatch();

    // add erc20 transfer function to the batch
    await erc20.transfer(receiverAddress, 1000000 as unknown as BigNumber);

    // estimate transactions added to the batch and get the fee data for the UserOp
    const op = await networkInstance.estimate();
    console.log('op: ', op);

    //sign the UserOp and sending to the bundler...
    const uoHash = await networkInstance.send(op);

    // log the uoHash
    console.log(`UserOpHash: ${uoHash}`);
})()
```


---

# 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.kanalabs.io/smart-wallet-sdk/mirai-sdk-the-evm-smart-wallet-and-paymaster/examples/transfer-erc20-tokens.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.
