offerToken method

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

Transfers specified amount of tokens from account to receiver and return the hash of the transaction submitted to the API.

Implementation

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

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