-
Originally asked on stack overflow. Please help me. How to send several different coins at once using a smart contract to Aptos in one transaction if initially the number of coins and their types are unknown and will be indicated only by arguments? I realized that I should use vectors in the function arguments, but I can’t figure it out further. I've tried to use vectors like in code below but i got errors. public entry fun multisend(sender: &signer, receiver: address, types: vector<coin::Coin<T>>, amounts: vector<u64>) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is not currently possible because: to transfer |
Beta Was this translation helpful? Give feedback.
This is not currently possible because:
to transfer
Coin
, you must passCoinType: coin::transfer<CoinType>(sender, receiver, amount);
however, passing an unknown amount of
CoinType
as type arguments is impossible. The best you can do ismultisend<CoinType1, CoinType2, ..., CoinTypeN>
but N is a bounded number.