createCollection method

Future<String> createCollection(
  1. AptosAccount account,
  2. String name,
  3. String description,
  4. String uri, {
  5. BigInt? maxAmount,
  6. BigInt? maxGasAmount,
  7. BigInt? gasUnitPrice,
  8. BigInt? expireTimestamp,
})

Creates a new NFT collection within the specified account and return the hash of the transaction submitted to the API.

Implementation

Future<String> createCollection(
  AptosAccount account,
  String name,
  String description,
  String uri,
  {BigInt? maxAmount,
  BigInt? maxGasAmount,
  BigInt? gasUnitPrice,
  BigInt? expireTimestamp}
) async {
  final payload = transactionBuilder.buildTransactionPayload(
    "0x3::token::create_collection_script",
    [],
    [name, description, uri, maxAmount ?? MAX_U64_BIG_INT, [false, false, false]],
  );

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