API Reference for the Token Factory Service (1.0)

Download OpenAPI specification:Download

Token Factory service makes it trivial to generate and deploy token smart contracts for token specifications ERC20 (for fungible tokens) and ERC721 (for non-fungible tokens). Token Contracts manage the total supply, ownership, transfers, delegate spenders, as well as minting and burning tokens.

tokenfactory

Authentication

app_creds

Kaleido API for marketplace services are authenticated using application credentials. The username and password must be created in the environment containing the service instance as "Application Credentials". For more details see the documentation on App Credentials.

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Contracts

Get the Token Contracts

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create / update a Token Contract

Authorizations:
Request Body schema: application/json
name
required
string

User defined name for the token contract

symbol
required
string

User defined ticker symbol for the token contract

type
required
string

The type of token contract to create (erc20 or erc721)

supply
string

The initial supply of tokens (erc20 only)

burnable
boolean
mintable
boolean
deploy
boolean

Set to true to deploy the contract to the chain

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "symbol": "string",
  • "type": "string",
  • "supply": "string",
  • "burnable": true,
  • "mintable": true,
  • "deploy": true
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "symbol": "string",
  • "type": "string",
  • "supply": "string",
  • "burnable": true,
  • "mintable": true,
  • "deploy": true,
  • "_id": "string",
  • "address": "string",
  • "from": "string",
  • "created_at": "string",
  • "updated_at": "string"
}

Get the Token Contract by address or id

Authorizations:
path Parameters
contract_address_or_id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get the ERC20 Token Contract's total supply

Authorizations:
path Parameters
contract_address
required
string

Responses

Response samples

Content type
application/json
{
  • "totalSupply": "string"
}

Get the Token Contract's name

Authorizations:
path Parameters
contract_address
required
string

Responses

Response samples

Content type
application/json
{
  • "name": "string"
}

Get the Token Contract's symbol

Authorizations:
path Parameters
contract_address
required
string

Responses

Response samples

Content type
application/json
{
  • "symbol": "string"
}

Get the balance of an account for a given Token Contract

Authorizations:
path Parameters
contract_address
required
string
account_address
required
string

Responses

Response samples

Content type
application/json
{
  • "balance": "string"
}

Get the account owner of a token_id (ERC721 only)

Authorizations:
path Parameters
contract_address
required
string
token_id
required
string

Responses

Response samples

Content type
application/json
{
  • "address": "string"
}

Transfer tokens to an account

Authorizations:
path Parameters
contract_address
required
string
Request Body schema: application/json
toAddress
required
string

The address to transfer to

amount
string

The amount of tokens to transfer (erc20 only)

tokenId
string

The tokenId to transfer (erc721 only)

from
string

The address used to sign the transfer transaction

fromAddress
required
string

The address to transfer from

Responses

Request samples

Content type
application/json
{
  • "toAddress": "string",
  • "amount": "string",
  • "tokenId": "string",
  • "from": "string",
  • "fromAddress": "string"
}

Response samples