erc1155SafeTransferFrom static method

Future<String> erc1155SafeTransferFrom(
  1. String contractAddress,
  2. String sender,
  3. String to,
  4. String tokenId,
  5. String amount,
  6. String data,
)

Request data when send erc1155 nft.

contractAddress is nft contract address.

sender is sender public address.

to is receiver public address.

tokenId is nft token id.

amount is nft amount that you want to send, for example send 10 nft, pass "10"

data can pass "0x"

Implementation

static Future<String> erc1155SafeTransferFrom(
    String contractAddress,
    String sender,
    String to,
    String tokenId,
    String amount,
    String data) async {
  var list2 = [sender, to, tokenId, amount, data];
  var list1 = [contractAddress, "erc1155_safeTransferFrom", list2];

  const method = "particle_abi_encodeFunctionCall";
  final params = list1;
  return await EvmService.rpc(method, params);
}