Appearance
Tokens
Methods for creating and managing tokens.
Quick Reference
| Method | Description |
|---|---|
| createToken | Create a new Token in the system which can then be transferred between wallets |
| findTokens | Search for Tokens using either a simple filter or queryBuilder |
| getToken | Get information about token |
| updateToken | Update a Token |
createToken
Create a new Token in the system which can then be transferred between wallets
ts
await client.createToken(
{
foreign: 'EURO',
divisor: 10,
limit: 10,
public: true,
metadata: {
customMetadata: true,
},
// belongs_to: 'EURO-wallet'
},
{
// GENERALOPTIONS
},
);ts
{
wallet: {
id: 5,
foreign: 'EURO',
name: 'EURO',
metadata: null,
type: 'token',
default_allow_negative: true,
default_allow_positive: false,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
status: 'active',
default_dtw_to: '000',
default_dtw_from: '000'
},
token: {
id: 5,
foreign: 'EURO',
public: true,
belongs_to: 5,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
metadata: {
customMetadata: true
},
divisor: 10,
limit: 10,
type: 'value',
status: 'active'
}
};createTokenFnInput
Input for createToken
| Attribute | Type | Required | Description |
|---|---|---|---|
foreign | string | ✓ | Name of the token, used for name based token transfers. Must be unique |
public | boolean | Boolean indicating if token can be traded with outside seed wallet | |
metadata | | Key/value object describing the token | |
divisor | number | Minimum amount of token that can be transferred | |
limit | number | Maximum amount of token that can be issued | |
belongs_to | string | number | Id of the wallet this token belongs_to | |
options | {} | Optional flags for input |
createTokenFnOutput
Output of createToken
| Attribute | Type | Always | Description |
|---|---|---|---|
token | {} | ✓ | Units of value which can be transferred in this system |
wallet | {} | ✓ | Wallet|Entities who can make transfers in this system |
findTokens
Search for Tokens using either a simple filter or queryBuilder
ts
await client
.findTokens()
.where({
metadata: {
even: true,
example: 'test',
},
})
.orWhere({
foreign: 'token-example1',
})
.limit(5)
.offset(0)
.orderBy(['foreign', { column: 'id', order: 'desc' }])
.options({
tracking_id: 'hello',
return_metadata_total: true,
include_balance: true,
});ts
{
tokens: [
{
id: 15,
foreign: 'token-example0',
public: true,
belongs_to: 4,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
metadata: {
cool: true,
even: true,
example: 'test'
},
divisor: null,
limit: null,
type: 'value',
status: 'active',
belongs_to_foreign: 'VALID0',
balance_transfer_id: null,
balance_pending_amount: null,
balance_pending_amount_from: null,
balance_pending_amount_to: null,
balance_available_balance: null,
balance_finished_amount: null,
balance_latest_control_hash: null,
balance_amount: null,
balance_updated_at: null
},
{
id: 16,
foreign: 'token-example1',
public: true,
belongs_to: 5,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
metadata: {
cool: true,
even: false,
example: 'test'
},
divisor: null,
limit: null,
type: 'value',
status: 'active',
belongs_to_foreign: 'VALID1',
balance_transfer_id: 4,
balance_pending_amount: 0,
balance_pending_amount_from: 0,
balance_pending_amount_to: 0,
balance_available_balance: -999,
balance_finished_amount: -999,
balance_latest_control_hash: null,
balance_amount: -999,
balance_updated_at: '2026-01-01T10:00:00.000Z'
},
{
id: 17,
foreign: 'token-example2',
public: true,
belongs_to: 6,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
metadata: {
cool: true,
even: true,
example: 'test'
},
divisor: null,
limit: null,
type: 'value',
status: 'active',
belongs_to_foreign: 'VALID2',
balance_transfer_id: null,
balance_pending_amount: null,
balance_pending_amount_from: null,
balance_pending_amount_to: null,
balance_available_balance: null,
balance_finished_amount: null,
balance_latest_control_hash: null,
balance_amount: null,
balance_updated_at: null
},
{
id: 19,
foreign: 'token-example4',
public: true,
belongs_to: 8,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
metadata: {
cool: true,
even: true,
example: 'test'
},
divisor: null,
limit: null,
type: 'value',
status: 'active',
belongs_to_foreign: 'VALID4',
balance_transfer_id: null,
balance_pending_amount: null,
balance_pending_amount_from: null,
balance_pending_amount_to: null,
balance_available_balance: null,
balance_finished_amount: null,
balance_latest_control_hash: null,
balance_amount: null,
balance_updated_at: null
},
{
id: 21,
foreign: 'token-example6',
public: true,
belongs_to: 10,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
metadata: {
cool: true,
even: true,
example: 'test'
},
divisor: null,
limit: null,
type: 'value',
status: 'active',
belongs_to_foreign: 'VALID6',
balance_transfer_id: null,
balance_pending_amount: null,
balance_pending_amount_from: null,
balance_pending_amount_to: null,
balance_available_balance: null,
balance_finished_amount: null,
balance_latest_control_hash: null,
balance_amount: null,
balance_updated_at: null
}
],
metadata: {
limit: 5,
offset: 0,
total: 6,
more_rows: true,
order: [
{
field: 'foreign',
direction: 'asc'
},
{
field: 'id',
direction: 'desc'
}
]
}
};findTokensFnInput
Input for findTokens
| Attribute | Type | Required | Description |
|---|---|---|---|
foreign | string | number | Foreign of the token | |
type | | Type of the token | |
belongs_to | string | number | Foreign of the wallet connected to token | |
metadata | | Metadata filter for custom properties | |
options | {} | Optional flags for input |
findTokensFnOutput
Output of findTokens
| Attribute | Type | Always | Description |
|---|---|---|---|
tokens | ({})[] | ✓ | Found tokens |
metadata | {} | ✓ | Metadata about the search |
getToken
Get information about token
ts
await client.getToken(
{
token: 'EURO',
},
{
create_if_not_exists: true,
// return_only_id: true, // for example purposes we want more than id
ignore_cache: true,
include_balance: true,
// GENERALOPTIONS
},
);ts
{
token: {
balance_transfer_id: null,
balance_pending_amount: null,
balance_pending_amount_from: null,
balance_pending_amount_to: null,
balance_available_balance: null,
balance_finished_amount: null,
balance_latest_control_hash: null,
balance_amount: null,
balance_updated_at: null,
id: 2,
foreign: 'EURO',
public: true,
belongs_to: 2,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
metadata: null,
divisor: null,
limit: null,
type: 'value',
status: 'active',
belongs_to_foreign: null
}
};getTokenFnInput
Input for getToken
| Attribute | Type | Required | Description |
|---|---|---|---|
foreign | string | number | Foreign of the token | |
token | string | number | Foreign of the token | |
options | {} | Optional flags for input |
getTokenFnOutput
Output of getToken
| Attribute | Type | Always | Description |
|---|---|---|---|
token | {} |
updateToken
Update a Token
ts
await client.updateToken(
{
token: TEST.INFO.TOKENS.EUR.foreign,
public: false,
metadata: {
metadata_field: 2,
},
status: 'disabled',
},
{
return_when_not_updated: true,
// GENERALOPTIONS
},
);ts
{
token: {
id: 1,
foreign: 'EUR',
public: false,
belongs_to: 1,
created_at: '2026-01-01T10:00:00.000Z',
updated_at: '2026-01-01T10:00:00.000Z',
metadata: {
metadata_field: 2
},
divisor: null,
limit: null,
type: 'value',
status: 'disabled'
},
updated: true
};updateTokenFnInput
Input for updateToken
| Attribute | Type | Required | Description |
|---|---|---|---|
token | string | number | ✓ | Token foreign |
metadata | | Key/value object describing the token | |
public | boolean | Boolean indicating if token can be traded with outside seed wallet | |
status | | Current status for the token | |
options | {} | Optional flags for input |
updateTokenFnOutput
Output of updateToken
| Attribute | Type | Always | Description |
|---|---|---|---|
token | {} | Units of value which can be transferred in this system | |
updated | boolean | Boolean showing if the token was updated |