claimToken method

Future<String> claimToken(
  1. AptosAccount account,
  2. String sender,
  3. String creator,
  4. String collectionName,
  5. String name, {
  6. int? propertyVersion,
  7. BigInt? maxGasAmount,
  8. BigInt? gasUnitPrice,
  9. BigInt? expireTimestamp,
})

Claims a token on specified account and return the hash of the transaction submitted to the API.

Implementation

Future<String> claimToken(
  AptosAccount account,
  String sender,
  String creator,
  String collectionName,
  String name,
  {int? propertyVersion,
  BigInt? maxGasAmount,
  BigInt? gasUnitPrice,
  BigInt? expireTimestamp}
) async {
  final payload = transactionBuilder.buildTransactionPayload(
    "0x3::token_transfers::claim_script",
    [],
    [sender, creator, collectionName, name, propertyVersion ?? 0],
  );

  return aptosClient.generateSignSubmitTransaction(
    account,
    payload,
    maxGasAmount: maxGasAmount,
    gasUnitPrice: gasUnitPrice,
    expireTimestamp: expireTimestamp
  );
}