Function pairedFaMetadataAddress

  • Calculates the paired FA metadata address for a given coin type. This function is tolerant of various address formats in the coin type string, including complex nested types.

    Parameters

    • coinType: `0x${string}::${string}::${string}`

      The coin type string in any of these formats:

      • Short form address: "0x1::aptos_coin::AptosCoin"
      • Long form address: "0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin"
      • With leading zeros: "0x00001::aptos_coin::AptosCoin"
      • With nested types: "0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>"

    Returns AccountAddress

    The calculated metadata address as an AccountAddress instance

    // All these formats are valid and will produce the same result:
    pairedFaMetadataAddress("0x1::aptos_coin::AptosCoin") // simple form
    pairedFaMetadataAddress("0x0000000000000000000000000000000000000000000000000000000000000001::aptos_coin::AptosCoin") // long form
    pairedFaMetadataAddress("0x00001::aptos_coin::AptosCoin") // with leading zeros
    pairedFaMetadataAddress("0x1::coin::Coin<0x1412::a::struct<0x0001::aptos_coin::AptosCoin>>") // nested type parameters
MMNEPVFCICPMFPCPTTAAATR