I have two functions that do the same thing:
public fun send_dummy_token(
user_nft: &mut NFT,
recipient_nft: address,
user_coin: Receiving<Coin<DUMMY>>,
ctx: &mut TxContext
) {
let self_coin = transfer::public_receive(&mut user_nft.id, user_coin);
transfer::public_transfer(self_coin, recipient_nft);
}
public fun send_dummy_tokens(
user_nft: &mut NFT,
recipient_nft: address,
user_coins: vector<Receiving<Coin<DUMMY>>>,
ctx: &mut TxContext
) {
let self_coin = transfer::public_receive(&mut user_nft.id, user_coin);
transfer::public_transfer(self_coin, recipient_nft);
Here, DUMMY
is a custom token, what I am trying to do I have some dummy token to my NFT I want to sent it to a another NFT.
I call from the frontend in the same way:
trx.moveCall({
target: `${PACKAGE_ADDRESS}::protocol::send_dummy_token`,
arguments: [
trx.object(NFTId + ""),
trx.pure(sentAddress, "address"), trx.object(allDummyCoins[0].coinObjectId)
});
trx.moveCall({
target: `${PACKAGE_ADDRESS}::protocol::send_dummy_tokens`,
arguments: [
trx.object(NFTId + ""),
trx.pure(sentAddress, "address"),
trx.makeMoveVec({objects: [allDummyCoins[0].coinObjectId]}),
});
The first call with send_dummy_token
is working but for the second call with send_dummy_tokens
is giving the error Error: Error checking transaction input objects: IncorrectUserSignature
…so should I use something other than makeMoveVec
?