How to send USDC from solana-cli command line

I am trying to send USDC from the solana-cli command line but I can't find any example in the documentation. Everything is references to how to do it in javascript importing these 2 libraries.

import * as web3 from "@solana/web3.js"; import * as splToken from "@solana/spl-token";

The first to transfer SOL coin and the second for the rest of the TOKENS. Can be done? does anyone know the command?

Upvotes: 0

Views: 2006

Answers (1)

Jon C
Jon C

Reputation: 8462

The SPL docs contain CLI examples for every possible action with spl-token. To perform a transfer, you can do:

$ spl-token transfer EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v <AMOUNT> <RECEIVER>

Here, we specify the USDC mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v, which means that the CLI will attempt to send from the default user's associated token account for USDC.

You can see all of the examples for tranfers at https://spl.solana.com/token#example-transferring-tokens-to-another-user

Upvotes: 1

Related Questions