Create Token
Once an application is connected to Martian wallet via connect method, an app can request the user to create a token using
window.martian.createToken()
and it will return a Promise 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.
createToken()
// Create a token
const txnHash = await window.martian.createToken("ColName123", "TokenName", "TokenDescription", 1, "https://aptos.dev/img/nyan.jpeg", 1)
Last modified 1yr ago