Understanding token creation and balance retrieval within the OmniSafe API.
Creating a Token and Minting Initial Supply
POST /v1/tokens
endpoint.POST /v1/tokens
- Create Token and Mint API ReferenceTokenMintDto
schema (defined in the OpenAPI specification). It typically includes:symbol
: The token’s symbol (e.g., “MYTOKEN”).name
: The token’s name (e.g., “My Token”).decimals
: The number of decimal places for the token (e.g., 18).initialQuantity
: The initial quantity of tokens to mint.ownerAddress
: The wallet address to receive the initial supply of tokens.201 Created
: Returns the created token address (as plain text). Example: "0x1234567890abcdef..."
ownerAddress
must be a valid wallet address within the OmniSafe system.Getting Token Balance
GET /v1/tokens/{token-address}/{owner}
endpoint.GET /v1/tokens/{token-address}/{owner}
- Get Balance API Referencetoken-address
(path parameter, required): The address of the token, obtained from the POST /v1/tokens
response.owner
(path parameter, required): The address of the wallet for which you want to retrieve the balance.200 OK
: Returns the wallet balance (as a number). Example: 1000
token-address
must be a valid token address that was previously created through the POST /v1/tokens
endpoint.owner
address must be a valid wallet address within the OmniSafe system.