API Miner (1.2.2)

This document describes the specification for the API Miner public API.

Download OpenAPI 3.0 Specification

Download Postman Collection

Quickstart and other documentation

This document has the specification, the main documentation can be found on the official Blockwell Docs website:

Blockwell Docs

Rate limiting

All users are limited to 10 requests per second and 3600 requests per hour.

Contact us if you need higher limits.

Contact

Contact us at:

General Blockwell chat: Blockwell Telegram

Changelog

Authentication

AccessToken

Access Token (aka. API Key) must be given as a Bearer token:

Authorization: Bearer <token>
Security Scheme Type HTTP
HTTP Authorization Scheme bearer

Generic responses

This describes the generic responses that are not specific to an endpoint.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    • "error": "bad_query",
    • "message": "Invalid query format"
    }
}

tokens

List tokens

List Token contracts belonging to the current user.

Authorizations:
query Parameters
network
string

Optional. Filter by network, see Ethereum networks.

name
string

Optional. Filter by Token name.

symbol
string

Optional. Filter by Token symbol.

Responses

Response Schema: application/json
Array of objects (Token contract)

Response samples

Content type
application/json
{
  • "data": [
    • {
      }
    ]
}

Token by ID

Get a specific token by its unique identifier.

Authorizations:
path Parameters
contractId
required
string

ID of the token

Responses

Response Schema: application/json
object (Token contract)

Response samples

Content type
application/json
{
  • "data": {
    • "id": "6ab34922-0561-48b7-9e11-ce1581e100f2",
    • "name": "API Miner Coin",
    • "network": "rinkeby",
    • "address": "0x418f8020b48731ffd2a99afe0aa5e7d66ca263d8",
    • "type": "erc20",
    • "parameters": {
      }
    }
}

Default account balance

Get the specified token balance for the current user's default account.

Authorizations:
path Parameters
contractId
required
string

ID of the token.

Responses

Response Schema: application/json
data
string

Token balance of the address in the smallest unit.

Response samples

Content type
application/json
{
  • "data": "1000000000000000000"
}

Token balance

Get the specified token balance for a specific account.

Authorizations:
path Parameters
contractId
required
string

ID of the token.

address
required
string

Address to get balance for.

Responses

Response Schema: application/json
data
string

Token balance of the address in the smallest unit.

Response samples

Content type
application/json
{
  • "data": "1000000000000000000"
}

Token transfer history

Gets the transfer history for the specified token.

Authorizations:
query Parameters
from
string

Filter transfers by the from address.

to
string

Filter transfers by the to address.

address
string

Filter transfers where this address is either the sender or recipient.

Responses

Response Schema: application/json
Array of objects (Token transfer)

Response samples

Content type
application/json
{
  • "data": [
    • {
      },
    • {
      }
    ]
}

Transfer tokens

Submit a Token transfer to the blockchain.!!

Success means the transfer was accepted for processing, but there are no guarantees as to when the processing will be done. Processing happens on first-come-first-served basis.

A successful response contains a unique ID for the transaction, which can then be used to query its status.

Passing the optional callbacks parameter in the body will add a web callback that gets called once the transaction completes.

The callback payload is {"transaction": Transaction}, with the same formatting as with getting a transaction.

Authorizations:
path Parameters
contractId
required
string

ID of the token.

Request Body schema: application/json

Token transfer request body.

to
required
string

Ethereum address to send Tokens to.

value
required
string^[0-9]$

Amount of Tokens to transfer, in the Token's smallest unit.

from
string

Address to send from, as either an Ethereum address, or an account ID.

If not specified, the current user's default account will be used.

callbacks
Array of strings

Callback URL(s) to be notified when the Token transfer completes.

See Callbacks for more details.

callbackData
object

An object holding data that the callbacks will contain.

waitForAsset
string

The address of an asset to wait for to be deposited before this transaction should be processed. This can be an ERC-20 token address, or 0x0 for Ether.

The maximum time the transaction can wait is one hour, after which it will fail.

If specified, waitForValue is also required.

waitForValue
string

When waitForAsset is specified, the user's balance must greater than or equal to this value before the transaction is processed.

If specified, waitForAsset is also required.

Responses

Response Schema: application/json
object (Transaction)

Request samples

Content type
application/json
{
  • "to": "0x98c4A022C1492Cc8a59F75295FBCf4a9F1Bc7cE8",
  • "value": "1000000000000000000"
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": "9969d904-fa6c-4bd5-91ce-f07002a3ee27",
    • "type": "contract-method",
    • "contractId": "6ab34922-0561-48b7-9e11-ce1581e100f2",
    • "from": "0x418F8020b48731FfD2a99Afe0Aa5E7d66Ca263d8",
    • "method": "transfer",
    • "parameters": [
      ],
    • "status": "new",
    • "created": "2018-06-12T22:20:42.804Z",
    • "network": "rinkeby"
    }
}

Token information

Get information for a token by network and address.

Authorizations:
path Parameters
required
string or number
Example: rinkeby

The network to use, see Ethereum networks.

address
required
string
Example: 0x4CfC7bF1e8eB43d27DE0a4e648D9Cf3b6198D0EC

Address of the contract to call.

Responses

Response Schema: application/json
address
string

Address of the token contract.

name
string

Name of the token.

symbol
string

Token symbol.

decimals
number

Number of decimals the token uses.

totalSupply
string

Total supply of the token, in smallest units.

Response samples

Content type
application/json
{
  • "address": "0x4CfC7bF1e8eB43d27DE0a4e648D9Cf3b6198D0EC",
  • "name": "Pump Token",
  • "symbol": "PUMP",
  • "decimals": 18,
  • "totalSupply": "1000000000000000000000000"
}

Token circulating supply

Get a token's circulating supply.

The supply is calculated by excluding accounts holding a certain ERC-721 token.

Authorizations:
path Parameters
required
string or number
Example: rinkeby

The network to use, see Ethereum networks.

address
required
string
Example: 0x4CfC7bF1e8eB43d27DE0a4e648D9Cf3b6198D0EC

Address of the contract to call.

Responses

Response Schema: application/json
data
string

Total circulating supply, in the token's smallest unit.

Response samples

Content type
application/json
{
  • "data": "1000000000000000000"
}

Token total supply

Get a token's total supply of tokens.

Typically this is equivalent to calling totalSupply on the token contract.

Authorizations:
path Parameters
required
string or number
Example: rinkeby

The network to use, see Ethereum networks.

address
required
string
Example: 0x4CfC7bF1e8eB43d27DE0a4e648D9Cf3b6198D0EC

Address of the contract to call.

Responses

Response Schema: application/json
data
string

Total supply, in the token's smallest unit.

Response samples

Content type
application/json
{
  • "data": "1000000000000000000"
}

contracts

Find Contracts

Search for smart contracts.

Authorizations:
query Parameters
network
string

Filter by network, see Ethereum networks.

name
string

Filter by Contract name.

symbol
string

Filter by Contract symbol.

address
string

Find contracts with a specific address. Note that the result may still include multiple networks if not filtered.

source
boolean

Pass true to have the server also return the source code of the contract, if it's available.

text
string

Perform a non-exact text search. Finds partial matches in symbol, contract name, and address.

name, symbol and address are ignored if text is present, but network can be used to limit the search to a specific network.

Note that text search does not include ABI or source code in the results.

id
string

Retrieve multiple contracts by their IDs.

id should be a list of contract IDs separated by commas. Note that the presence of id in the query overrides all other parts of the query.

An alternative ID format is also supported, with <network>/<address>. For example rinkeby/0xe8340FdfE79851e9E117b3033E147a654dbDb0Ae.

Unlike with text queries, using id does give you the ABI as well.

Responses

Response Schema: application/json
Array of objects (Smart contract)

Response samples

Content type
application/json
{
  • "data": [
    • {
      }
    ]
}

Deploy contract

Deploy a new smart contract.

This endpoint allows you to create a new deployment of a smart contract "template" in the system.

Success means the deployment was accepted for processing, but there are no guarantees as to when the processing will be done. Processing happens on first-come-first-served basis.

Contract deployments are basically just like regular Ethereum transactions, so a successful response will contain a transaction ID. That ID can then be used to query its status.

Passing the optional callbacks parameter in the body will add a web callback that gets called once the transaction completes. See Callbacks for more details.

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

Full name for the Contract.

network
required
string

The network the contract should be deployed on, see Ethereum networks.

type
string

Type of contract to deploy.

bwtype
string

Blockwell contract type to deploy.

bwver
number

Version of the Blockwell contract to deploy.

account
string

ID of the account to deploy under. If not specified, the user's default account will be used.

parameters
object

Parameters to be used when creating the contract.

callbacks
Array of strings

Callback URL(s) to be notified when the deployment completes. See Callbacks for more details.

callbackData
object

An object holding data that the callbacks will contain.

Responses

Response Schema: application/json
object (Transaction)

Request samples

Content type
application/json
{
  • "name": "API Miner Coin",
  • "network": "rinkeby",
  • "type": "erc20",
  • "parameters": {
    • "symbol": "APIMC",
    • "decimals": 18,
    • "supply": "100000000000000000000000000",
    • "holder": "0x418F8020b48731FfD2a99Afe0Aa5E7d66Ca263d8"
    }
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": "9969d904-fa6c-4bd5-91ce-f07002a3ee27",
    • "type": "contract-deploy",
    • "contractId": "6ab34922-0561-48b7-9e11-ce1581e100f2",
    • "from": "0x418F8020b48731FfD2a99Afe0Aa5E7d66Ca263d8",
    • "status": "new",
    • "created": "2018-06-12T22:20:42.804Z",
    • "network": "rinkeby"
    }
}

Add an existing contract

Add an existing contract to the system.

The contract must already be deployed using other means, and an ABI must be provided in the body. The API will then respond with an API Miner ID for the contract and it can be interacted with like any other contract in API Miner.

Note that you must provide either type or abi. Use type to map the contract to an existing contract type, or abi to use an arbitrary ABI.

Authorizations:
Request Body schema: application/json
name
string

Full name for the Contract.

network
required
string

The network the contract should be deployed on, see Ethereum networks.

address
required
string

The Ethereum address of the contract in the network.

abi
Array of any

The ABI JSON array for the contract. Must provide either this or type.

type
string

The contract type. Must provide either this or abi.

fromBlock
any

Block number for when this contract was deployed. If specified, this is used to make lookups faster.

Responses

Response Schema: application/json
object (Smart contract)

Request samples

Content type
application/json
{
  • "name": "API Miner Coin",
  • "network": "rinkeby",
  • "address": "0x418F8020b48731FfD2a99Afe0Aa5E7d66Ca263d8",
  • "abi": [
    • {
      },
    • {
      }
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": "6ab34922-0561-48b7-9e11-ce1581e100f2",
    • "name": "API Miner Coin",
    • "network": "rinkeby",
    • "address": "0x418f8020b48731ffd2a99afe0aa5e7d66ca263d8",
    • "type": "erc20",
    • "parameters": {
      },
    • "abi": [
      ]
    }
}

Contract by ID

Get a specific Contract by its unique identifier.

Authorizations:
path Parameters
contractId
required
string

ID of the Contract

Responses

Response Schema: application/json
object (Smart contract)

Response samples

Content type
application/json
{
  • "data": {
    • "id": "6ab34922-0561-48b7-9e11-ce1581e100f2",
    • "name": "API Miner Coin",
    • "network": "rinkeby",
    • "address": "0x418f8020b48731ffd2a99afe0aa5e7d66ca263d8",
    • "type": "erc20",
    • "parameters": {
      },
    • "abi": [
      ]
    }
}

Contract view call

Make a view-only Contract call that isn't a transaction.

As an example, an ERC-20 token's balanceOf method is view-only.

path Parameters
contractId
required
string

ID of the Contract.

method
required
string

Contract method to call.

query Parameters
arg
Array of any

Method arguments.

The server expects the 'arg' query string variable to repeat for multiple array elements, eg. arg=argument1&arg=argument2

Responses

Response Schema: application/json
data
any

Return value of the Contract call.

Response samples

Content type
application/json
{
  • "data": "1000000000000000000"
}

Batch contract view call

Make a batch of Contract and JSON-RPC calls that are view-only.

As an example, an ERC-20 token's balanceOf method is view-only.

Request Body schema: application/json
Array of objects

Array of calls. Response is guaranteed to be in the same order.

Responses

Response Schema: application/json
Array of objects or objects

Request samples

Content type
application/json
{
  • "calls": [
    • {
      },
    • {
      }
    ]
}

Response samples

Content type
application/json
{
  • "data": [
    • {
      },
    • {
      },
    • {
      }
    ]
}

Contract send call

Submit a Contract method transaction to the blockchain.

This is required for making smart Contract method calls that change state, such as the ERC-20 token's transfer method.

Success means the transaction was accepted for processing, but there are no guarantees as to when the processing will be done. Processing happens on first-come-first-served basis.

A successful response contains a unique ID for the transaction, which can then be used to query its status.

Passing the optional callbacks parameter in the body will add a web callback that gets called once the transaction completes.

The callback payload is {"transaction": Transaction}, with the same formatting as with getting a transaction.

Authorizations:
path Parameters
contractId
required
string

ID of the Contract.

method
required
string

Contract method to call.

Request Body schema: application/json
from
string

Address to send from, as either an Ethereum address, or an account ID.

If not specified, the current user's default account will be used.

arg
Array of any

Array of arguments to pass to the contract method call.

callbacks
Array of strings

Callback URL(s) to be notified when the Token transfer completes. See Callbacks for more details.

callbackData
object

An object holding data that the callbacks will contain.

dependency
string

The ID of a transaction this new transaction depends on.

This new transaction won't be sent until the dependency has resolved successfully.

waitForAsset
string

The address of an asset to wait for to be deposited before this transaction should be processed. This can be an ERC-20 token address, or 0x0 for Ether.

The maximum time the transaction can wait is one hour, after which it will fail.

If specified, waitForValue is also required.

waitForValue
string

When waitForAsset is specified, the user's balance must greater than or equal to this value before the transaction is processed.

If specified, waitForAsset is also required.

Responses

Response Schema: application/json
object (Transaction)

Request samples

Content type
application/json
{
  • "arg": [
    • "0x98c4A022C1492Cc8a59F75295FBCf4a9F1Bc7cE8",
    • "1000000000000000000"
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": "9969d904-fa6c-4bd5-91ce-f07002a3ee27",
    • "type": "contract-method",
    • "contractId": "6ab34922-0561-48b7-9e11-ce1581e100f2",
    • "from": "0x418F8020b48731FfD2a99Afe0Aa5E7d66Ca263d8",
    • "method": "transfer",
    • "parameters": [
      ],
    • "status": "new",
    • "created": "2018-06-12T22:20:42.804Z",
    • "network": "rinkeby"
    }
}

Contract all events history

Gets the log history for a all events for a specific Contract.

All query parameters will be passed as filters to event parameters. This lets you filter on indexed event parameters. For example, to get all token transfer events from a particular address, you could use:

?from=0x9A83706D363e2Fd14103f587EA4bb27B2b2f3Ae6

Multiple entries of a parameter will be added as an OR to the filter, for example to get all transfers from two different addresses:

?from=0x9A83706D363e2Fd14103f587EA4bb27B2b2f3Ae6&from=0x418F8020b48731FfD2a99Afe0Aa5E7d66Ca263d8

One special query parameter is accepted, fromBlock, which will limit the search to starting from a specific block number.

Authorizations:
path Parameters
contractId
required
string

ID of the Contract.

query Parameters
fromBlock
number

The block number to start the search from.

toBlock
string

The block number to end the search at. Also accepts earliest, latest and pending. Defaults to latest.

Responses

Response Schema: application/json
Array of objects (Smart Contract event)

Response samples

Content type
application/json
{
  • "data": [
    • {
      }
    ]
}

Contract event history

Gets the log history for a specific event for a specific Contract.

All query parameters will be passed as filters to event parameters. This lets you filter on indexed event parameters. For example, to get all token transfer events from a particular address, you could use:

?from=0x9A83706D363e2Fd14103f587EA4bb27B2b2f3Ae6

Multiple entries of a parameter will be added as an OR to the filter, for example to get all transfers from two different addresses:

?from=0x9A83706D363e2Fd14103f587EA4bb27B2b2f3Ae6&from=0x418F8020b48731FfD2a99Afe0Aa5E7d66Ca263d8

One special query parameter is accepted, fromBlock, which will limit the search to starting from a specific block number.

Authorizations:
path Parameters
contractId
required
string

ID of the Contract.

event
required
string

Name of the event.

query Parameters
fromBlock
number

The block number to start the search from.

toBlock
string

The block number to end the search at. Also accepts earliest, latest and pending. Defaults to latest.

Responses

Response Schema: application/json
Array of objects (Smart Contract event)

Response samples

Content type
application/json
{
  • "data": [
    • {
      }
    ]
}

Direct contract view call

Make a view-only Contract call to an arbitrary contract address without needing to add the contract to API Miner.

A contract type must be provided so an ABI can be determined for the contract.

path Parameters
required
string or number
Example: rinkeby

The network to use, see Ethereum networks.

address
required
string
Example: 0x98c4A022C1492Cc8a59F75295FBCf4a9F1Bc7cE8

Address of the contract to call.

method
required
string

Contract method to call.

query Parameters
type
required
string

Type of the contract to use for determining its ABI.

arg
Array of strings

Method arguments.

The server expects the 'arg' query string variable to repeat for multiple array elements, eg. arg=argument1&arg=argument2

Responses

Response Schema: application/json
data
any

Return value of the Contract call.

Response samples

Content type
application/json
{
  • "data": "1000000000000000000"
}

Direct contract send call

Submit a method transaction to the blockchain directly to a contract without needing to add it to API Miner first.

A contract type must be provided so an ABI can be determined for the contract.

Success means the transaction was accepted for processing, but there are no guarantees as to when the processing will be done. Processing happens on first-come-first-served basis.

A successful response contains a unique ID for the transaction, which can then be used to query its status.

Authorizations:
path Parameters
required
string or number
Example: rinkeby

The network to use, see Ethereum networks.

address
required
string
Example: 0x98c4A022C1492Cc8a59F75295FBCf4a9F1Bc7cE8

Address of the contract to send to.

method
required
string

Contract method to send.

Request Body schema: application/json
type
required
string

A contract type for determining an ABI for the contract.

from
string

Address to send from, as either an Ethereum address, or an account ID.

If not specified, the current user's default account will be used.

arg
Array of any

Array of arguments to pass to the contract method call.

dependency
string

The ID of a transaction this new transaction depends on.

This new transaction won't be sent until the dependency has resolved successfully.

waitForAsset
string

The address of an asset to wait for to be deposited before this transaction should be processed. This can be an ERC-20 token address, or 0x0 for Ether.

The maximum time the transaction can wait is one hour, after which it will fail.

If specified, waitForValue is also required.

waitForValue
string

When waitForAsset is specified, the user's balance must greater than or equal to this value before the transaction is processed.

If specified, waitForAsset is also required.

Responses

Response Schema: application/json
object (Transaction)

Request samples

Content type
application/json
{
  • "type": "erc20",
  • "arg": [
    • "0x98c4A022C1492Cc8a59F75295FBCf4a9F1Bc7cE8",
    • "1000000000000000000"
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": "9969d904-fa6c-4bd5-91ce-f07002a3ee27",
    • "type": "contract-method",
    • "from": "0x418F8020b48731FfD2a99Afe0Aa5E7d66Ca263d8",
    • "method": "transfer",
    • "parameters": [
      ],
    • "status": "new",
    • "created": "2018-06-12T22:20:42.804Z",
    • "network": "rinkeby"
    }
}

network

Get latest block

Retrieve the latest block from the network specified in the parameters.

path Parameters
required
string or number
Example: rinkeby

The network to read, see Ethereum networks.

query Parameters
transactions
string
Example: transactions=true

Whether to include transaction data with the block

Responses

Response Schema: application/json
object

Response samples

Content type
application/json
{
  • "data": {
    • "number": 3,
    • "hash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46",
    • "parentHash": "0x2302e1c0b972d00932deb5dab9eb2982f570597d9d42504c05d9c2147eaf9c88",
    • "nonce": "0xfb6e1a62d119228b",
    • "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    • "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    • "transactionsRoot": "0x3a1b03875115b79539e5bd33fb00d8f7b7cd61929d5a3c574f507b8acf415bee",
    • "stateRoot": "0xf1133199d44695dfa8fd1bcfe424d82854b5cebef75bddd7e40ea94cda515bcb",
    • "miner": "0x8888f1f195afa192cfee860698584c030f4c9db1",
    • "difficulty": "21345678965432",
    • "totalDifficulty": "324567845321",
    • "size": 616,
    • "extraData": "0x",
    • "gasLimit": 3141592,
    • "gasUsed": 21662,
    • "timestamp": 1429287689,
    • "transactions": [
      ],
    • "uncles": [ ]
    }
}

Get block

Retrieve a specific block from the given network.

path Parameters
required
string or number
Example: rinkeby

The network to read, see Ethereum networks.

number
required
number
Example: 3

Block number.

query Parameters
transactions
string
Example: transactions=true

Whether to include transaction data with the block

Responses

Response Schema: application/json
object

Response samples

Content type
application/json
{
  • "data": {
    • "number": 3,
    • "hash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46",
    • "parentHash": "0x2302e1c0b972d00932deb5dab9eb2982f570597d9d42504c05d9c2147eaf9c88",
    • "nonce": "0xfb6e1a62d119228b",
    • "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    • "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    • "transactionsRoot": "0x3a1b03875115b79539e5bd33fb00d8f7b7cd61929d5a3c574f507b8acf415bee",
    • "stateRoot": "0xf1133199d44695dfa8fd1bcfe424d82854b5cebef75bddd7e40ea94cda515bcb",
    • "miner": "0x8888f1f195afa192cfee860698584c030f4c9db1",
    • "difficulty": "21345678965432",
    • "totalDifficulty": "324567845321",
    • "size": 616,
    • "extraData": "0x",
    • "gasLimit": 3141592,
    • "gasUsed": 21662,
    • "timestamp": 1429287689,
    • "transactions": [
      ],
    • "uncles": [ ]
    }
}

Get gas price

Retrieve the gas price for a network. The gas price is in wei.

path Parameters
required
string or number
Example: rinkeby

The network to get gas price for, see Ethereum networks.

Responses

Response Schema: application/json
object

Response samples

Content type
application/json
{
  • "data": "1000000000"
}

transactions

Get a transaction

Get the status of a pending transaction.

Authorizations:
path Parameters
id
required
string

Transaction ID.

Responses

Response Schema: application/json
object (Transaction)

Response samples

Content type
application/json
{
  • "data": {
    • "id": "8c9a4558-93cb-4d6a-821c-77ea1ca9adad",
    • "status": "completed",
    • "created": "2018-06-08T19:04:14.216Z",
    • "submitted": "2018-06-08T19:04:14.980Z",
    • "ended": "2018-06-08T19:04:29.050Z",
    • "transactionHash": "0xe1eabd59aea1857bc5eb52d42415b76cfe539e9d650903d85accd3cd9c3d36c0"
    }
}

Transaction history

Get the current user's transaction history.

Authorizations:
query Parameters
contractId
string

Filter by contract ID.

from
string

Filter by 'from'. Can be either the account ID, or Ethereum address.

method
string

Filter by contract method used.

status
string

Filter by transaction status.

contractAddress
string

Filter by contract address.

text
string

Text search.

sort
string
Example: sort=status -created

Sort by fields. Can sort by multiple fields with space separated field names, and descending sort by using a - in front of the field name.

pageSize
integer

Maximum size of results page. Defaults to 50.

page
integer

Number of the page to retrieve.

Responses

Response Schema: application/json
Array of objects (Transaction)

Response samples

Content type
application/json
{
  • "data": [
    • {
      }
    ]
}

Submit a new transaction

Submit a new Ether transaction to the specified network.

Success means the transaction was accepted for processing, but there are no guarantees as to when the processing will be done. Processing happens on first-come-first-served basis.

A successful response contains a unique ID for the transaction, which can then be used to query its status.

Authorizations:
Request Body schema: application/json
required
string or number

The network to use, see Ethereum networks.

to
required
string

Ethereum address to send Ether to.

value
required
string^[0-9]$

Amount of Ether to transfer, in wei.

from
string

Address to send from, as either an Ethereum address, or an account ID.

If not specified, the current user's default account will be used.

callbacks
Array of strings

Callback URL(s) to be notified when the Token transfer completes.

See Callbacks for more details.

callbackData
object

An object holding data that the callbacks will contain.

waitForAsset
string

The address of an asset to wait for to be deposited before this transaction should be processed. This can be an ERC-20 token address, or 0x0 for Ether.

The maximum time the transaction can wait is one hour, after which it will fail.

If specified, waitForValue is also required.

waitForValue
string

When waitForAsset is specified, the user's balance must greater than or equal to this value before the transaction is processed.

If specified, waitForAsset is also required.

Responses

Response Schema: application/json
object (Transaction)

Request samples

Content type
application/json
{
  • "network": "rinkeby",
  • "to": "0x98c4A022C1492Cc8a59F75295FBCf4a9F1Bc7cE8",
  • "value": "1000000000000000000"
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": "9969d904-fa6c-4bd5-91ce-f07002a3ee27",
    • "status": "new",
    • "created": "2018-06-12T22:20:42.804Z"
    }
}

Get a public key

Get a public key used for web callback request signing.

The ID can be given as default, in which case the current default key is used.

Responses always contain the Key-Id header for identifying public keys. See Callbacks for more details.

Authorizations:
path Parameters
id
required
string

Public key ID.

Responses

Response Headers
Key-Id
string

Public key ID.

Response Schema: text/plain
string <binary>

Response samples

Content type
text/plain
-----BEGIN PUBLIC KEY-----
MIICIjAN...
-----END PUBLIC KEY-----

accounts

List accounts

List Accounts belonging to the current user.

Authorizations:

Responses

Response Schema: application/json
Array of objects (Account)

Response samples

Content type
application/json
{
  • "data": [
    • {
      },
    • {
      }
    ]
}

Create account

Generates a new Ethereum account.

If an owner ID is specified, the account will be created for that user. Otherwise, the account will belong to the authenticated user.

Authorizations:
Request Body schema: application/json
owner
string

User ID for the owner of the new account.

If not specified, the current user will be used instead.

default
boolean

If this is set to true, the account will be made the user's default account.

Responses

Response Schema: application/json
object (Account)

Request samples

Content type
application/json
{
  • "default": false
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": "bf15bdb2-0574-5982-a199-08fab9ac59f1",
    • "address": "0xa46b6126a261cf6bdca70216742b09ca2c31f73b",
    • "owner": "4b17b28b-2409-54b6-bf43-f36fe8bced4e",
    • "defaultAccount": false
    }
}

Account by ID

Get a specific Account by its ID.

Authorizations:
path Parameters
accountId
required
string

ID of the Account

Responses

Response Schema: application/json
object (Account)

Response samples

Content type
application/json
{
  • "data": {
    • "id": "bf15bdb2-0574-5982-a199-08fab9ac59f1",
    • "address": "0xa46b6126a261cf6bdca70216742b09ca2c31f73b",
    • "owner": "4b17b28b-2409-54b6-bf43-f36fe8bced4e",
    • "defaultAccount": true
    }
}

Default account

Get the current user's default account.

Authorizations:

Responses

Response Schema: application/json
object (Account)

Response samples

Content type
application/json
{
  • "data": {
    • "id": "bf15bdb2-0574-5982-a199-08fab9ac59f1",
    • "address": "0xa46b6126a261cf6bdca70216742b09ca2c31f73b",
    • "owner": "4b17b28b-2409-54b6-bf43-f36fe8bced4e",
    • "defaultAccount": true
    }
}

Sign message, default

Sign a personal or EIP-191 message with the current user's default account.

Authorizations:
Request Body schema: application/json
One of
message
required
string

Responses

Response Schema: application/json
string or object (Signature response)

Signature data for message signing.

Request samples

Content type
application/json
Example
{
  • "message": "This is a message!"
}

Response samples

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

Sign message

Sign a personal or EIP-191 message with the specified account.

Authorizations:
path Parameters
accountId
required
string

ID of the Account

Request Body schema: application/json
One of
message
required
string

Responses

Response Schema: application/json
string or object (Signature response)

Signature data for message signing.

Request samples

Content type
application/json
Example
{
  • "message": "This is a message!"
}

Response samples

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

Account ETH balance

Get the Ether balance of an account.

Authorizations:
path Parameters
account
required
string

ID of the account, address of the account, or default.

network
required
string

The Ethereum network to read.

Responses

Response Schema: application/json
data
string

Ether balance of the address in Wei.

Response samples

Content type
application/json
{
  • "data": "1500000000000000000"
}

users

Find users

Search for users based on parameters.

If an external ID is specified, the name parameter is ignored.

If no parameters are supplied, the endpoint returns all users the current user has created.

Authorizations:
query Parameters
externalId
string

User external ID.

name
string

User name.

Responses

Response Schema: application/json
Array of objects (User)

Response samples

Content type
application/json
{
  • "data": [
    • {
      }
    ]
}

Create user

Creates a new user.

If an owner ID is specified, the account will be created for that user. Otherwise, the account will belong to the authenticated user.

Authorizations:
Request Body schema: application/json
name
string

A name for the user.

This does not have to be unique, it's simply for informational purposes.

externalId
string

An arbitrary identifier for external use.

Typically you would set this to an ID used in your application for the user.

externalData
object

Arbitrary data associated with this user.

There are certain restrictions on this data to avoid security issues. The restrictions are the same as for callback data.

auth
boolean

If set to true, a new authentication token for the user will be returned as well.

account
boolean

If set to true, a default Ethereum account will also be created for the user.

ownerless
boolean

If set to true, the user will be created without an owner.

In practice, not having an owner means the previous user cannot access the new user, or create auth tokens for the user.

Responses

Response Schema: application/json
object (User)
auth
string

User auth token, if requested.

object (Account)

Request samples

Content type
application/json
{
  • "auth": true,
  • "account": true
}

Response samples

Content type
application/json
{
  • "data": {
    • "id": "4b17b28b-2409-54b6-bf43-f36fe8bced4e"
    }
}

User by ID

Get a user by its ID.

Authorizations:
path Parameters
userId
required
string

User ID.

Responses

Response Schema: application/json
object (User)

Response samples

Content type
application/json
{
  • "data": {
    • "id": "string",
    • "name": "string",
    • "groups": [
      ],
    • "externalId": "string",
    • "externalData": { },
    • "created": "string"
    }
}

Update user

Update data associated with the user.

Note that this endpoint does allow you to change the user's externalId, even though that should rarely be needed.

If a field is not present in the request body, its value is left unchanged. To clear the value of an existing field, use null.

Authorizations:
path Parameters
userId
required
string

User ID.

Request Body schema: application/json
name
string

A name for the user.

This does not have to be unique, it's simply for informational purposes.

externalId
string

An arbitrary identifier for external use.

Typically you would set this to an ID used in your application for the user.

externalData
object

Arbitrary data associated with this user.

There are certain restrictions on this data to avoid security issues. The restrictions are the same as for callback data.

Responses

Request samples

Content type
application/json
{
  • "name": "New User"
}

New access token

Generates a new access token for the current user.

Authorizations:
Request Body schema: application/json
revoke
boolean

If specified as true, all old access tokens will be revoked.

Responses

Response Schema: application/json
data
string

New access token

Request samples

Content type
application/json
{
  • "revoke": false
}

Response samples

Content type
application/json
{
  • "data": "abcd1234"
}

User access token

Generates a new access token for the given user.

Note that you can only authenticate users you have ownership over.

Authorizations:
path Parameters
userId
required
string

User ID.

Request Body schema: application/json
revoke
boolean

If specified as true, all old access tokens will be revoked.

Responses

Response Schema: application/json
data
string

New access token

Request samples

Content type
application/json
{
  • "revoke": false
}

Response samples

Content type
application/json
{
  • "data": "abcd1234"
}