Rest Documentation

Wallet

This section describes all actions related to wallets.

Create wallet Arkane API

Create a whitelabel wallet

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "pincode" : "1234",
  "alias" : "alias",
  "description" : "description",
  "identifier" : "identifier",
  "secretType" : "ETHEREUM",
  "walletType" : "WHITE_LABEL"
}'

Example Http Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 596

{
  "id" : "1",
  "address" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "walletType" : "WHITE_LABEL",
  "secretType" : "ETHEREUM",
  "createdAt" : [ 2019, 10, 15, 12, 50, 0, 470611000 ],
  "archived" : false,
  "alias" : "aliasEth",
  "description" : "descriptionEth",
  "primary" : false,
  "hasCustomPin" : false,
  "balance" : {
    "available" : false,
    "secretType" : "ETHEREUM",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : null,
    "gasSymbol" : null,
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  }
}

Response Fields

Path Type Description

id

String

id of the wallet

hasCustomPin

Boolean

Whether the wallet has a custom pincode or not

address

String

address of the wallet

walletType

String

type of the wallet

secretType

String

type of the secret (possible values: AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO)

createdAt

Array

date and time the secret was created or imported

archived

Boolean

is the wallet archived or not

primary

Boolean

is the wallet the primary wallet for the secrettype?

alias

String

alias of the wallet

description

String

description of the wallet

balance

Object

The native token balance of the wallet

List wallets Arkane API

Returns all the wallets for the client

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets' -i -X GET

Example Http Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1215

[ {
  "id" : "1",
  "address" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "ETHEREUM",
  "createdAt" : [ 2019, 10, 15, 12, 50, 0, 60649000 ],
  "archived" : false,
  "alias" : "aliasEth",
  "description" : "descriptionEth",
  "primary" : false,
  "hasCustomPin" : false,
  "balance" : {
    "available" : false,
    "secretType" : "ETHEREUM",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : "ETH",
    "gasSymbol" : "ETH",
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  }
}, {
  "id" : "3",
  "address" : "0xae52b72db54e137a65a42434ab2543d31f8454c3",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "VECHAIN",
  "createdAt" : [ 2019, 10, 15, 12, 50, 0, 60702000 ],
  "archived" : false,
  "alias" : "aliasVechain",
  "description" : "descriptionVechain",
  "primary" : false,
  "hasCustomPin" : false,
  "balance" : {
    "available" : false,
    "secretType" : "VECHAIN",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : "VET",
    "gasSymbol" : "VTHO",
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  }
} ]

Response Fields

Path Type Description

.[]

Array

An array of wallets of the user

It’s also possible to filter based on secret type

Request Parameters

Parameter Description

secretType

Type of the secret (ETHEREUM, VECHAIN)

Get wallet Arkane API

Returns the details for a specific wallet (native balance is also included)

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets/1' -i -X GET

Path Parameters

Table 1. /api/wallets/{id}
Parameter Description

id

the id of the wallet

Example Http Response

HTTP/1.1 200 OK
Content-Length: 600
Content-Type: application/json;charset=UTF-8

{
  "id" : "1",
  "address" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "ETHEREUM",
  "createdAt" : [ 2019, 10, 15, 12, 50, 0, 837753000 ],
  "archived" : false,
  "alias" : "aliasEth",
  "description" : "descriptionEth",
  "primary" : false,
  "hasCustomPin" : false,
  "balance" : {
    "available" : false,
    "secretType" : "ETHEREUM",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : null,
    "gasSymbol" : null,
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  }
}

Response Fields

Path Type Description

id

String

id of the wallet

hasCustomPin

Boolean

Whether the wallet has a custom pincode or not

address

String

address of the wallet

walletType

String

type of the wallet

secretType

String

type of the secret (possible values: AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO)

createdAt

Array

date and time the secret was created or imported

archived

Boolean

is the wallet archived or not

primary

Boolean

is the wallet the primary wallet for the secrettype?

alias

String

alias of the wallet

description

String

description of the wallet

balance

Object

The native token balance of the wallet

Native balance Arkane API

Returns the "native" balance for a wallet. This is the balance of the native token used by the chain. Ex. ETH for Ethereum.

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets/1/balance' -i -X GET

Path Parameters

Table 2. /api/wallets/{id}/balance
Parameter Description

id

id of the wallet

Example Http Response

HTTP/1.1 200 OK
Content-Length: 240
Content-Type: application/json;charset=UTF-8

{
  "available" : false,
  "secretType" : "ETHEREUM",
  "balance" : 1.0,
  "gasBalance" : 1.0,
  "symbol" : "ETH",
  "gasSymbol" : "ETH",
  "rawBalance" : "1000000000000000000",
  "rawGasBalance" : "1000000000000000000",
  "decimals" : 18
}

Response Fields

Path Type Description

balance

Number

Normalized balance of the native coin

secretType

String

Type of the secret

symbol

String

The symbol of the native coin

gasSymbol

String

The symbol of the gas coin

gasBalance

Number

Normalized balance of the gas coin (same as balance when the coin for paying gas/fees is the same native coin)

rawBalance

String

Raw balance of the native coin

rawGasBalance

String

Raw balance of the gas coin (same as balance when the coin for paying gas/fees is the same native coin)

decimals

Number

Decimals of the native coin

available

Boolean

Whether the balance service is currently available or not

Token balances Arkane API

Returns the balance of all tokens currently supported by Arkane. The list of supported tokens can be found on Github.

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets/1/balance/tokens' -i -X GET

Example Http Response

HTTP/1.1 200 OK
Content-Length: 1163
Content-Type: application/json;charset=UTF-8

[ {
  "tokenAddress" : "0x4df47b4969b2911c966506e3592c41389493953b",
  "rawBalance" : "10000000283000000000000",
  "balance" : 10000.000283,
  "decimals" : 18,
  "symbol" : "FND",
  "logo" : "https://raw.githubusercontent.com/ArkaneNetwork/content-management/master/tokens/ethereum/mainnet/logos/0x4df47b4969b2911c966506e3592c41389493953b.png",
  "type" : "ERC20",
  "transferable" : true
}, {
  "tokenAddress" : "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359",
  "rawBalance" : "10000000283000000000000",
  "balance" : 10000.000283,
  "decimals" : 18,
  "symbol" : "DAI",
  "logo" : "https://raw.githubusercontent.com/ArkaneNetwork/content-management/master/tokens/ethereum/mainnet/logos/0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359.png",
  "type" : "ERC20",
  "transferable" : true
}, {
  "tokenAddress" : "0xE41d2489571d322189246DaFA5ebDe1F4699F498",
  "rawBalance" : "655000000000000000000",
  "balance" : 655.0,
  "decimals" : 18,
  "symbol" : "ZRX",
  "logo" : "https://raw.githubusercontent.com/ArkaneNetwork/content-management/master/tokens/ethereum/mainnet/logos/0xe41d2489571d322189246dafa5ebde1f4699f498.png",
  "type" : "ERC20",
  "transferable" : true
} ]

Response Fields

Path Type Description

[].tokenAddress

String

Address of the token

[].rawBalance

String

Raw token balance of the wallet

[].balance

Number

Normalized token balance of the wallet

[].type

String

The type of token, which depends on the specific blockchain

[].transferable

Boolean

Indicates whether or not the token can be transferred

[].symbol

String

The symbol of the token

[].logo

String

Logo of the token (url)

[].decimals

Number

Decimals of the token

Specific token balance Arkane API

Returns the token balance for a specified token (this can be any token).

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets/1/balance/tokens/0x4df47b4969b2911c966506e3592c41389493953b' -i -X GET

Path Parameters

Table 3. /api/wallets/{id}/balance/tokens/{token}
Parameter Description

id

id of the wallet

token

Token to get the balance for

Example Http Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 388

{
  "tokenAddress" : "0x4df47b4969b2911c966506e3592c41389493953b",
  "rawBalance" : "10000000283000000000000",
  "balance" : 10000.000283,
  "decimals" : 18,
  "symbol" : "FND",
  "logo" : "https://raw.githubusercontent.com/ArkaneNetwork/content-management/master/tokens/ethereum/mainnet/logos/0x4df47b4969b2911c966506e3592c41389493953b.png",
  "type" : "ERC20",
  "transferable" : true
}

Response Fields

Path Type Description

tokenAddress

String

Address of the token

rawBalance

String

Raw token balance of the wallet

balance

Number

Normalized token balance of the wallet

type

String

The type of token, which depends on the specific blockchain

transferable

Boolean

Indicates whether or not the token can be transferred

symbol

String

The symbol of the token

logo

String

Logo of the token (url)

decimals

Number

Decimals of the token

List Non Fungible Tokens (NFT’s) Arkane API

Currently this functionallity is only supported for Ethereum wallets (ERC-721), other chains will follow

Returns the list of NFT’s owned by a wallet

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets/89dbcffc-1e83-4d04-be8c-8cb705053570/nonfungibles?contract-addresses=0x6ebeaf8e8e946f0716e6533a6f2cefc83f60e8ab&contract-addresses=0xfac7bea255a6990f749363002136af6556b31e04' -i -X GET

Path Parameters

Table 4. /api/wallets/{walletId}/nonfungibles
Parameter Description

walletId

The ID of the wallet to list the non fungible tokens for

Request Parameters

Parameter Description

contract-addresses

(Optional) When set, the result will only contain tokens of these NFT contract addresses. Multiple values can be set.

Example Http Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2093

[ {
  "id" : "7664",
  "tokenId" : "7664",
  "owner" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "name" : "Pixielock",
  "description" : "At the end of your turn, summon a 1/1 Nimble Pixie.",
  "url" : "https://godsunchained.com/card/359127",
  "backgroundColor" : "f3f3f3",
  "imageUrl" : "https://images.godsunchained.com/cards/250/143.png",
  "imagePreviewUrl" : null,
  "imageThumbnailUrl" : null,
  "contract" : {
    "name" : "Gods Unchained",
    "description" : "Gods Unchained is a free-to-play, turn-based competitive tradingcard game. The goal of the game is to reduce your opponent's life to zero. Players use their collection to build decks of cards, and select a God to play with at the start of each match. Decks contain exactly 30 cards.",
    "address" : "0x6ebeaf8e8e946f0716e6533a6f2cefc83f60e8ab",
    "symbol" : "GODS",
    "url" : "https://godsunchained.com/",
    "imageUrl" : "https://storage.opensea.io/0x6ebeaf8e8e946f0716e6533a6f2cefc83f60e8ab-featured-1556588688.png",
    "type" : "ERC_721"
  }
}, {
  "id" : "106965784547830847323236430761121909501263774393788267967702982783333772235688",
  "tokenId" : "106965784547830847323236430761121909501263774393788267967702982783333772235688",
  "owner" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "name" : "phonenumber.eth",
  "description" : "This is the ENS name for phonenumber.eth",
  "url" : "https://manager.ens.domains/name/phonenumber.eth",
  "backgroundColor" : null,
  "imageUrl" : "https://storage.googleapis.com/opensea-static/ENS-4.png",
  "imagePreviewUrl" : null,
  "imageThumbnailUrl" : null,
  "contract" : {
    "name" : "ENS",
    "description" : "ENS offers a secure & decentralized way to address resources both on and off the blockchain using simple, human-readable names. OpenSea provides a secondary marketplace for ENS names.",
    "address" : "0xfac7bea255a6990f749363002136af6556b31e04",
    "symbol" : "ENS",
    "url" : "https://ens.domains/",
    "imageUrl" : "https://storage.opensea.io/0xfac7bea255a6990f749363002136af6556b31e04-1557985746.png",
    "type" : "ERC_721"
  }
} ]

Response Fields

Path Type Description

[].id

String

The token ID of this non fungible token

[].tokenId

String

The token ID of this non fungible token

[].owner

String

The wallet address owning the item

[].name

String

Name of this item

[].description

String

Description of the item

[].url

String

Link to the detail page of this item

[].backgroundColor

String

Background color to use when displaying this item

[].imageUrl

String

URL to an image of this item (original size)

[].imagePreviewUrl

Null

URL to an image of this item (size 512px)

[].imageThumbnailUrl

Null

URL to an image of this item (size 128px)

[].contract

Object

The contract that manages this item

[].contract.name

String

Name of the contract

[].contract.description

String

Description of the contract

[].contract.address

String

Address of the contract

[].contract.symbol

String

Symbol of the contract (e.g. GODS, CKITTY, STRK)

[].contract.url

String

Link to the website/application that issued this contract

[].contract.imageUrl

String

Link to an image (logo) of this contract

[].contract.type

String

The type of the contract (ex. ERC721)

Error codes

Error Code Meaning

wallet.archived

The wallet that is used appears to be archived

wallet.forbidden

Wallet to update was not found or does not belong to the correct user

wallet.balance.not.supported.yet

Getting the balance for chain is not supported yet

wallet.encrypt.internal-error

Problem while trying to encrypt user secret

wallet.decrypt.internal-error

A problem occurred while trying to access your wallet. Please contact support

wallet.secret.not-found

The specified secret was not found in our vault

wallet.secret.internal-error

An unknown error occurred when trying to fetch the secret. Please contact support.

Transactions

Transfer

Request Fields

Table 5. Data parameters
Path Type Description Constraints

walletId

String

The id of the wallet one wants to sign with.

Mandatory

to

String

The destination address of the transaction.

Mandatory, a valid address for the specified chain or the email address of the person you want to send tokens to

type

String

Type of transaction request

Mandatory, possible values: [TRANSFER, GAS_TRANSFER, TOKEN_TRANSFER, NFT_TRANSFER, CONTRACT_EXECUTION]

value

Number

[1] The value transferred for the transaction in the token value

Mandatory, must be >= 0

secretType

String

Which chain you want to do a transaction for

Mandatory. Must be one of: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO]

network

Object

[2] The network to submit the transaction to

Optional. Currently supported chains: [ETHEREUM]

network.name

String

The display name of the network to submit the transaction to (e.g.: "Rinkeby"). This will be shown to the user when signing the transaction

Required. Free text

data

String

The data you want to send with this transaction. This field will be ignored when building a token transaction request

Optional

network.nodeUrl

String

The URL of the node to submit the transaction to (e.g.: "https://rinkeby.infura.io")

Required

[3] (Only for Ethereum) The node to which the transaction will be send can be set manually. This can be done using the network parameter.
This feature enables you to submit a transaction to any mainnet node of your choosing, a testnet node (e.g. Kovan, Rinkeby, …​) or a different (private) network altogether.

Example Curl Request

Data example
$ curl 'https://api.arkane.network/api/transactions/build' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "type" : "TRANSFER",
  "walletId" : "cdc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "alias" : null,
  "secretType" : "VECHAIN",
  "network" : {
    "name" : "Rinkeby",
    "nodeUrl" : "https://rinkeby.infura.io",
    "chainId" : null
  },
  "data" : "0x",
  "value" : 1.15
}'
Table 6. Result parameters
Path Type Description

transactionHash

String

The transaction hash

Result example
{
  "transactionHash" : "0x621f692e386a8bc0c53d36aa793864893106e10f54f63fa9c063e24ad975d907"
}

Token Transfer

Request Fields

Table 7. Data parameters
Path Type Description Constraints

walletId

String

The id of the wallet one wants to sign with.

Mandatory

to

String

The destination address of the transaction.

Mandatory, a valid address for the specified chain or the email address of the person you want to send tokens to

type

String

Type of transaction request

Mandatory, possible values: [TRANSFER, GAS_TRANSFER, TOKEN_TRANSFER, NFT_TRANSFER, CONTRACT_EXECUTION]

value

Number

[1] The value transferred for the transaction in the token value

Mandatory, must be >= 0

secretType

String

Which chain you want to do a transaction for

Mandatory. Must be one of: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO]

tokenId

Null

The id of the non fungible token or ERC20 token inside ERC1155

Mandatory

tokenAddress

String

The address of the token to be used in this transaction

Optional

network

Object

[2] The network to submit the transaction to

Optional. Currently supported chains: [ETHEREUM]

network.name

String

The display name of the network to submit the transaction to (e.g.: "Rinkeby"). This will be shown to the user when signing the transaction

Required. Free text

network.nodeUrl

String

The URL of the node to submit the transaction to (e.g.: "https://rinkeby.infura.io")

Required

Example Curl Request

Data example
$ curl 'https://api.arkane.network/api/transactions/build' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "type" : "TOKEN_TRANSFER",
  "walletId" : "edc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "alias" : null,
  "secretType" : "VECHAIN",
  "network" : {
    "name" : "Rinkeby",
    "nodeUrl" : "https://rinkeby.infura.io",
    "chainId" : null
  },
  "tokenAddress" : "0x4df47b4969b2911c966506e3592c41389493953b",
  "value" : 1.15,
  "tokenId" : null
}'

Response Body

Result example
{
  "walletId" : "edc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "pincode" : null,
  "blockRef" : null,
  "chainTag" : null,
  "expiration" : 0,
  "gas" : 23000,
  "gasPriceCoef" : 0,
  "nonce" : "0xd6c88ad6c6751c60",
  "clauses" : [ {
    "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
    "amount" : 10000000000,
    "tokenAddress" : "0x0000000000000000000000000000456E65726779"
  } ],
  "type" : "VECHAIN_VIP180_TRANSACTION"
}

NFT Transfer

Request Fields

Table 8. Data parameters
Path Type Description Constraints

walletId

String

The id of the wallet one wants to sign with.

Mandatory

to

String

The destination address of the transaction.

Mandatory, a valid address for the specified chain or the email address of the person you want to send tokens to

type

String

Type of transaction request

Mandatory, possible values: [TRANSFER, GAS_TRANSFER, TOKEN_TRANSFER, NFT_TRANSFER, CONTRACT_EXECUTION]

secretType

String

Which chain you want to do a transaction for

Mandatory. Must be one of: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO]

tokenAddress

String

The address of the token to be used in this transaction

Optional

network

Object

[1] The network to submit the transaction to

Optional. Currently supported chains: [ETHEREUM]

network.name

String

The display name of the network to submit the transaction to (e.g.: "Rinkeby"). This will be shown to the user when signing the transaction

Required. Free text

from

String

The wallet containing the non fungible token. By default this will be the current wallet

Mandatory

tokenId

Number

The id of the non fungible token or ERC20 token inside ERC1155

Mandatory

tokenAddress

String

The address of the token to be used in this transaction

Mandatory

network.nodeUrl

String

The URL of the node to submit the transaction to (e.g.: "https://rinkeby.infura.io")

Required

Example Curl Request

Data example
$ curl 'https://api.arkane.network/api/transactions/build' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "type" : "NFT_TRANSFER",
  "walletId" : "adc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "alias" : null,
  "secretType" : "VECHAIN",
  "network" : {
    "name" : "Rinkeby",
    "nodeUrl" : "https://rinkeby.infura.io",
    "chainId" : null
  },
  "tokenAddress" : "0x4df47b4969b2911c966506e3592c41389493953b",
  "from" : "0x89e01cEC55D718fA1Bf6B00fF21e6707cd9A3067",
  "tokenId" : 1
}'

Response Body

Result example
{
  "walletId" : "adc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "pincode" : "549644",
  "gasPrice" : 300000000000000,
  "gas" : 23000,
  "nonce" : 0,
  "value" : 10000000000,
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "network" : {
    "name" : "Rinkeby",
    "nodeUrl" : "https://rinkeby.infura.io",
    "chainId" : null
  },
  "data" : "0x",
  "type" : "ETH_TRANSACTION"
}

Gas Transfer

Request Fields

Table 9. Data parameters
Path Type Description Constraints

walletId

String

The id of the wallet one wants to sign with.

Mandatory

to

String

The destination address of the transaction.

Mandatory, a valid address for the specified chain or the email address of the person you want to send tokens to

type

String

Type of transaction request

Mandatory, possible values: [TRANSFER, GAS_TRANSFER, TOKEN_TRANSFER, NFT_TRANSFER, CONTRACT_EXECUTION]

value

Number

[1] The value transferred for the transaction in the token value

Mandatory, must be >= 0

secretType

String

Which chain you want to do a transaction for

Mandatory. Must be one of: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO]

network

Object

[2] The network to submit the transaction to

Optional. Currently supported chains: [ETHEREUM]

network.name

String

The display name of the network to submit the transaction to (e.g.: "Rinkeby"). This will be shown to the user when signing the transaction

Required. Free text

network.nodeUrl

String

The URL of the node to submit the transaction to (e.g.: "https://rinkeby.infura.io")

Required

Example Curl Request

Data example
$ curl 'https://api.arkane.network/api/transactions/build' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "type" : "GAS_TRANSFER",
  "walletId" : "ddc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "alias" : null,
  "secretType" : "VECHAIN",
  "network" : {
    "name" : "Rinkeby",
    "nodeUrl" : "https://rinkeby.infura.io",
    "chainId" : null
  },
  "value" : 1.15
}'

Response Body

Result example
{
  "walletId" : "ddc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "pincode" : null,
  "blockRef" : null,
  "chainTag" : null,
  "expiration" : 0,
  "gas" : 23000,
  "gasPriceCoef" : 0,
  "nonce" : "0xd6c88ad6c6751c60",
  "clauses" : [ {
    "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
    "amount" : 10000000000
  } ],
  "type" : "VTHO_TRANSACTION"
}

Contract Execution

Request Fields

Table 10. Data parameters
Path Type Description Constraints

walletId

String

The id of the wallet one wants to sign with.

Mandatory

to

String

The destination address of the transaction.

Mandatory, a valid address for the specified chain or the email address of the person you want to send tokens to

value

Number

The amount that will be sent with the contract execution. Value will be passed as-is. This means that for example in Etheruem the value is in WEI

Optional, default = 0, must be >= 0

secretType

String

Which chain you want to do a transaction for

Mandatory. Must be one of: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO]

type

String

Type of transaction request

Mandatory, possible values: [TRANSFER, GAS_TRANSFER, TOKEN_TRANSFER, NFT_TRANSFER, CONTRACT_EXECUTION]

network

Object

The network to submit the transaction to

Optional

functionName

String

Name of the function on the contract that needs to be executed

Mandatory

inputs[]

Array

Array of inputs needed to execute the function

Mandatory

inputs[].type

String

The type of the input parameter (ex. uint256)

Mandatory

inputs[].value

String

The value of the input parameter. This needs to be passed as a string value, will be parsed by Arkane

Mandatory

chainSpecificFields

Object

Field that contains chain specific values. For possible values, please see chain specific fields documentation.

Mandatory

network

Object

[1] The network to submit the transaction to

Optional. Currently supported chains: [ETHEREUM]

network.name

String

The display name of the network to submit the transaction to (e.g.: "Rinkeby"). This will be shown to the user when signing the transaction

Required. Free text

network.nodeUrl

String

The URL of the node to submit the transaction to (e.g.: "https://rinkeby.infura.io")

Required

Example Curl Request

Data example
$ curl 'https://api.arkane.network/api/transactions/build' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -d '{
  "type" : "GAS_TRANSFER",
  "walletId" : "ddc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "alias" : null,
  "secretType" : "VECHAIN",
  "network" : {
    "name" : "Rinkeby",
    "nodeUrl" : "https://rinkeby.infura.io",
    "chainId" : null
  },
  "value" : 1.15
}'

Response Body

Result example
{
  "walletId" : "ddc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "pincode" : null,
  "blockRef" : null,
  "chainTag" : null,
  "expiration" : 0,
  "gas" : 23000,
  "gasPriceCoef" : 0,
  "nonce" : "0xd6c88ad6c6751c60",
  "clauses" : [ {
    "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
    "amount" : 10000000000
  } ],
  "type" : "VTHO_TRANSACTION"
}

Swap

This section describes how to use the swapping functionality within Arkane. It allows you to swap/exchange a (native) token to (native) token.

Trading pairs Arkane API

Returns the list of possible trading pairs for a given wallet.

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets/e5bcf403-20f3-4e7d-8772-ebb981885c5a/swaps/pairs' -i -X GET \
    -H 'Content-Type: application/json'

Path Parameters

Table 11. /api/wallets/{id}/swaps/pairs
Parameter Description

id

The id of the wallet

Example Http Response

HTTP/1.1 200 OK
Content-Length: 468
Content-Type: application/json;charset=UTF-8

[ {
  "from" : {
    "secretType" : "VECHAIN",
    "symbol" : "VET",
    "tokenAddress" : ""
  },
  "to" : {
    "secretType" : "VECHAIN",
    "symbol" : "VTHO",
    "tokenAddress" : "0x0000000000000000000000000000456e65726779"
  }
}, {
  "from" : {
    "secretType" : "VECHAIN",
    "symbol" : "VTHO",
    "tokenAddress" : "0x0000000000000000000000000000456e65726779"
  },
  "to" : {
    "secretType" : "VECHAIN",
    "symbol" : "VET",
    "tokenAddress" : ""
  }
} ]

Response Fields

Path Type Description

[]

Array

The available trading pairs for this wallet

[].from.secretType

String

Source secret type

[].from.symbol

String

Source token symbol (native token symbol will also be present (ex. VET)

[].from.tokenAddress

String

Optional token address, when empty it represents the native token (ex. VET)

[].to.secretType

String

Destination secret type

[].to.symbol

String

Destination token symbol (native token symbol will also be present (ex. VET)

[].to.tokenAddress

String

Destination token address, when empty it represents the native token (VET)

Exchange rate Arkane API

Returns the exchange rates for a specified swap.

Example Curl Request

$ curl 'https://api.arkane.network/api/swaps/rates?fromSecretType=VECHAIN&toSecretType=VECHAIN&fromToken=&toToken=0x0000000000000000000000000000456e65726779&amount=100&orderType=SELL&fromToken=' -i -X GET \
    -H 'Content-Type: application/json'

Request Parameters

Parameter Description

fromSecretType

The input secret type (Possible values: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO])

toSecretType

The output secret type (Possible values: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN, NEO])

fromToken

The type of token as input

toToken

The type of token as output

amount

The amount to swap

orderType

The order type (SELL or BUY). For sell orders (exact input), the amount bought (output) is calculated. For buy orders (exact output), the cost (input) is calculated

Example Http Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 345

{
  "exchangeRates" : [ {
    "exchange" : "VEXCHANGE",
    "orderType" : "SELL",
    "inputAmount" : 100,
    "outputAmount" : 485,
    "slippage" : 0.025,
    "fee" : 1
  } ],
  "bestRate" : {
    "exchange" : "VEXCHANGE",
    "orderType" : "SELL",
    "inputAmount" : 100,
    "outputAmount" : 485,
    "slippage" : 0.025,
    "fee" : 1
  }
}

Response Fields

Path Type Description

exchangeRates

Array

The exchange rates

exchangeRates[].orderType

String

The order type (SELL or BUY)

exchangeRates[].inputAmount

Number

The input amount

exchangeRates[].outputAmount

Number

The output amount (rate = outputAmount / inputAmount)

exchangeRates[].slippage

Number

The slippage (in %) that is allowed for the swap

exchangeRates[].fee

Number

The fee (percentage) that is included in the exchange rate

bestRate

Object

The best exchange rate (included in the exchangeRates list)

bestRate.orderType

String

The order type (SELL or BUY)

bestRate.inputAmount

Number

The input amount

bestRate.outputAmount

Number

The output amount (rate = outputAmount / inputAmount)

bestRate.slippage

Number

The slippage (in %) that is allowed for the swap

bestRate.fee

Number

The fee (percentage) that is included in the exchange rate

Create swap Arkane API

Creates the transaction requests that are needed to execute the swap. With this result (the transaction requests), you will need to call the native transactions endpoint to execute the swap. Ex. for VeChain, use the output from this call to the input of: Execute VET transaction

Example Curl Request

$ curl 'https://api.arkane.network/api/wallets/e30a6a01-8d9a-412e-b0c8-eb04d86d1daa/swaps' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "walletId" : "id",
  "destinationWalletId" : "id",
  "fromSecretType" : "VECHAIN",
  "toSecretType" : "VECHAIN",
  "fromToken" : "",
  "toToken" : "0x0000000000000000000000000000456e65726779",
  "inputAmount" : 100,
  "outputAmount" : 1305,
  "orderType" : "SELL",
  "exchange" : "VEXCHANGE"
}'

Path Parameters

Table 12. /api/wallets/{id}/swaps
Parameter Description

id

The id of the wallet

Example Http Response

HTTP/1.1 200 OK
Content-Length: 571
Content-Type: application/json;charset=UTF-8

[ {
  "walletId" : "e30a6a01-8d9a-412e-b0c8-eb04d86d1daa",
  "pincode" : null,
  "blockRef" : null,
  "chainTag" : null,
  "expiration" : 0,
  "gas" : null,
  "gasPriceCoef" : null,
  "nonce" : null,
  "clauses" : [ {
    "to" : "0xB74C4EBd95F70Dd9794d8c49053a297689950b63",
    "amount" : 1305000000000000000000,
    "data" : "0xad65d76d000000000000000000000000000000000000000000000044f9c0112b17a58000000000000000000000000000000000000000000000000000000000005c5452f200000000000000000000000033e2f608129ffca67c9fdc56cd9d2354a79d2919"
  } ],
  "type" : "VET_TRANSACTION"
} ]

Response Fields

Path Type Description

[]

Array

An array of transaction requests that need to be offered to the native transactions endpoint in order to execute the swap

Swap Error Tokens

Error Code Meaning

swap.no-exchange-found

No SwapService found for SwapExchange

swap.uniswap.get-price.failed

Unable to get the price of a token on uniswap

swap.uniswap.allowance-error

Unable to get allowance for token on uniswap

swap.uniswap.exchange-not-found

An exchange contract for a token on uniswap could not be found

^