Skip to content

使用合约完成批量转账问题 #32

Answered by v1xingyue
v1xingyue asked this question in Q&A
Discussion options

You must be logged in to vote

类型传递错误,需要传递 object的时候,需要使用 tx.object(objectID) 来操作。 循环部分代码改为:

transferItems.forEach((item) => {
      tx.moveCall({
        target: CallTarget("coin_pool", "withdraw_to_address") as any,
        typeArguments: [coinType],
        arguments: [
          tx.pure(item.amount),
          tx.pure(item.address),
          tx.object(operatePool.id),  // 需要使用 tx.object 
        ],
      });
    });

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@v1xingyue
Comment options

v1xingyue Jun 19, 2023
Maintainer Author

Comment options

v1xingyue
Jun 20, 2023
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by v1xingyue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants