Martian Wallet Dev Docs
HomeChrome web store
  • Introduction
  • 🏗️Integration
    • Detecting the Provider
    • Establishing a Connection
    • Displaying Your App
  • ⚙️methods
    • Aptos
      • Generate Transaction
      • Sign Transaction
      • Submit Transaction
      • Sign and Submit Transaction
      • Sign Generic Transaction
      • Generate Sign and Submit Transaction
      • Create Collection
      • Create Token
      • Add Network
      • Change Network
      • Get Networks
      • Get Transaction
      • Get Transactions
      • Get Account Transactions
      • Get Account Resources
      • Get Account
      • Get Chain Id
      • Get Ledger Info
    • Sui
      • Sign Transaction Block
      • Sign and Execute Transaction
      • Get Public Key
      • Get Old Address
      • Get Accounts
    • Sign Message
    • Get Network
    • Get Current Blockchain
    • Cancel Submitted Transactions
    • Network Change Event
    • Account Change Event
Powered by GitBook
On this page
  1. methods
  2. Aptos

Create Token

PreviousCreate CollectionNextAdd Network

Last updated 2 years ago

Once an application is connected to Martian wallet via method, an app can request the user to create a token using window.martian.createToken()and it will return a that resolves when the user accepts the request and reject (throw when awaited) when the user declines the request or request is not valid/fails. It takes twelve parameters listed below

  • Collection name = Name of the collection

  • Token name = Name of the token

  • Token description = Token description

  • Token supply = Total supply of the token

  • Token url = URL of the token

  • Royalty payee address? = The royalty_payee_address is address that royalty is paid to. Default is creator's address

  • Royalty points denominator? = The quantity royalty_points_numerator / royalty_points_denominator is the percentage of sale price (Royalty) should be paid to the payee address. It can be a single owner's account address or an address of a shared account owned by a group of creators. Default is 0

  • Royalty points numerator? = The quantity royalty_points_numerator / royalty_points_denominator is the percentage of sale price (Royalty) should be paid to the payee address. It can be a single owner's account address or an address of a shared account owned by a group of creators. Default is 0

  • Property keys? = The property_keys are the property key value pairs that can be stored, read and write on-chain. Default is []

  • Property values? = The property_values are the property key value pairs that can be stored, read and write on-chain. Default is []

  • Property types? = The property_types are the property key value pairs that can be stored, read and write on-chain. Default is []

  • max? = The maxium of tokens can be minted from this token. Default is 9007199254740991

Below is an example code describing the way to create a token.

// Create a token
const txnHash = await window.martian.createToken("ColName123", "TokenName", "TokenDescription", 1, "https://aptos.dev/img/nyan.jpeg", 1)
⚙️
Promise
connect