Skip to content

Sending an SPL token Example doesn't work #376

Closed
@n0n3mi1y

Description

I tried using an example of sending a token. However, I got an error saying that 4 arguments are needed. How do I create a fourth argument?

My code:
`static void TestSendingUSDC()
{

        var wallet1 = new Solnet.Wallet.Wallet("pudding border fetch text reward text cat jacket fetch cat correct amount");


        var client = ClientFactory.GetClient(Cluster.MainNet);
        var tokens = new TokenMintResolver();
        var wallet = TokenWallet.Load(client, tokens, wallet1.Account.PublicKey);

      
        var source = wallet.TokenAccounts().ForToken(WellKnownTokens.USDC).FirstOrDefault();
        

        
        var sig = wallet.Send(source, (decimal)1.0D, "332DjJ3TSuZeafhYPsnN8xaNDiBF6Q2oxcCKsWtQRPN5", wallet1.Account.PublicKey);
        //wallet.Send(sig);
        
    }`

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions