Create new currency

Creates a new currency in Tetrium.


Call URL

/currencies

Type : POST


Call request header parameters

Field Type Required/Optional Description Accepted values
wallet-address string Required The sender's wallet address. Any valid wallet address
wallet-key string Required The key of the sender's wallet. Any valid wallet key that unlocks the sender's wallet

Call request body parameters

Field Type Required/Optional Description Accepted values
currencyName string Required A name for the new currency. Any string
currencySymbol string Required A symbol for the new currency. Any string, preferably 3 characters, eg: "SMC"
currencyDecimals number (in string) Required The number of decimals to be used for the new currency . Any string with an integer number, eg: "2". The maximum number of decimals allowed is "6".

Sample Call Request

https://api.tetrium.io/tokenize/currencies

Parameters:

{
   "currencyName":"SampleCurrency",
   "currencySymbol":"SMC",
   "currencyDecimals":"2"
}

Call responses

Success response

Field Type Description Respond Values
status string Status of the API call. "success"
message string Information about the status. "create-currency initiated"
transactionHash string The hash of the transaction. To be used to verify the transaction's sealing status. Any string

Error response

Field Type Description Respond Values
status string Status of the API call. "fail"
error string Information about the error. (See below)

Information contained in error:

Error Messages Description
"missing currencyName" currencyName was not provided as a parameter in the API call body.
"missing currencySymbol" currencySymbol was not provided as a parameter in the API call body.
"missing currencyDecimals" currencyDecimals was not provided as a parameter in the API call body.
"invalid currencyDecimals" currencyDecimals provided was not in the correct format.
"currencyDecimals exceeds maximum" currencyDecimals provided exceeds the allowed limit of 6.

For any other errors, please refer to List of Common Error Messages

Sample Call Response

{
   "status":"success",
   "message":"create-currency initiated",
   "transactionHash":"0x5ff710ede5f75f07002f6b3b4f3298159ae05bf6d6ce81d21af8c111e03f8c51"
}

Important!

To get the currency address of this created currency, run the check-transaction-status API using the transactionHash.

You will need a currency address to proceed with any further currency-related transactions. For more info, take a look at the "Transaction Status" section under How Tetrium works.

results matching ""

    No results matching ""