Reference documentation

Wallet

This section describes all actions related to wallets.

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.

This allows users to link his existing wallets with your application. The difference with Manage wallets:

  • A user can only link wallets, it is not possible to create or import a wallet

  • A list of all wallets is returned for any chain (it is possible to filter this).

An example use case could be a portfolio app where a user wants to quickly link all his wallets to get an overview of his complete portfolio.

To link wallets, use the connect building block with:

Data

No data needed

Manage wallets Arkane Connect

As an application, it is possible to have a user manage his wallets for a specific chain. During this action, the user can link existing wallets or import a wallet. When the user returns to the app, a wallet will be linked to your application for the given chain. When a user does not have any wallets yet, a user can indicate to create a new wallet.

To manage wallets, use the connect building block with:

Table 1. Data parameters

Name

Description

Example

chain

The chain for which you want to manage wallets.

ethereum

Data example
{
  "chain": "ethereum"
}

List wallets Arkane API

Returns all the wallets for the specified user (bearer token)

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: 1269
[ {
  "id" : "1",
  "address" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "ETHEREUM",
  "createdAt" : [ 2019, 4, 1, 8, 42, 10, 253545000 ],
  "archived" : false,
  "alias" : "aliasEth",
  "description" : "descriptionEth",
  "primary" : false,
  "balance" : {
    "available" : false,
    "secretType" : "ETHEREUM",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : "ETH",
    "gasSymbol" : "ETH",
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  },
  "hasCustomPin" : false,
  "status" : "UNAVAILABLE"
}, {
  "id" : "3",
  "address" : "0xae52b72db54e137a65a42434ab2543d31f8454c3",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "VECHAIN",
  "createdAt" : [ 2019, 4, 1, 8, 42, 10, 253565000 ],
  "archived" : false,
  "alias" : "aliasVechain",
  "description" : "descriptionVechain",
  "primary" : false,
  "balance" : {
    "available" : false,
    "secretType" : "VECHAIN",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : "VET",
    "gasSymbol" : "VTHO",
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  },
  "hasCustomPin" : false,
  "status" : "UNAVAILABLE"
} ]

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 2. /api/wallets/{id}

Parameter

Description

id

the id of the wallet

Example Http Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 626
{
  "id" : "1",
  "address" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "ETHEREUM",
  "createdAt" : [ 2019, 4, 1, 8, 42, 10, 820342000 ],
  "archived" : false,
  "alias" : "aliasEth",
  "description" : "descriptionEth",
  "primary" : false,
  "balance" : {
    "available" : false,
    "secretType" : "ETHEREUM",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : null,
    "gasSymbol" : null,
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  },
  "hasCustomPin" : false,
  "status" : "UNAVAILABLE"
}

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 (ex: ETHEREUM)

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

status

String

status 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 3. /api/wallets/{id}/balance

Parameter

Description

id

id of the wallet

Example Http Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 240
{
  "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

Request Fields

Unresolved directive in <stdin> - include::./snippets/get-token-balances/request-fields.adoc[]

Example Http Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1163
[ {
  "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 4. /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

Transactions

Transaction Error Codes

Error Code Meaning

transaction.sign.internal-error

A problem occurred trying to submit the sign the request

transaction.insufficient-funds

The account that initiated the transfer does not have enough energy

transaction.sign.gas-error

Unable to fetch default gas prices

transaction.submit.internal-error

A problem occurred trying to submit the sign the request

transaction.submit.not-supported-yet

Submitting a request to this network is not possible yet

Transfer Arkane Connect

This can be used to transfer (native) tokens from a wallet to another wallet. To start a transfer you need to:

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

value

Number

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]

tokenAddress

String

The address of the token to be used in this transaction

Optional

data

Null

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

Optional

Request Body

Data example
{
  "walletId" : "edc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "alias" : null,
  "value" : 1.15,
  "secretType" : "VECHAIN",
  "tokenAddress" : "0x0000000000000000000000000000456E65726779",
  "data" : null
}
Table 6. Result parameters
Path Type Description

transactionHash

String

The transaction hash

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

If you want to perform a token transfer, add the field "tokenAddress". For "native" transfers, simply omit the field "tokenAddress".

For the value, we expect the "decimal value". If a token has 18 decimals and you want to transfer 1 of the specific token, provide the value 1. Arkane will translate this to the correct non decimal value being: 1 * 10e18. Using this, you don’t have to take the different number of decimals for different tokens into account.

Ethereum

Error Codes

Error Code Meaning

transaction.submit.ethereum-error

Something went wrong while trying to submit the ethereum transaction

web3.internal-error

Something went wrong with the underlying web3 connection.

web3.estimate.gas.internal-error

A problem occurred trying to estimate the gas.

web3.nonce.internal-error

A problem occurred trying to get the next nonce

web3.transaction.submit.internal-error

A problem occurred trying to submit the transaction to the Ethereum network

Execute ETH transaction Arkane Connect

To execute an Ethereum transaction, use the connect building block with:

Request Fields
Table 7. Data parameters

Path

Type

Description

Constraints

type

String

The type of the transaction

Mandatory, value for ether transaction: ETH_TRANSACTION

walletId

String

The id of the wallet one wants to sign with.

Mandatory

gasPrice

Number

The gas price of the transaction

Optional (default gas price is used otherwise), must be > 0

gas

Number

The amount of gas to use for the transaction (unused gas is refunded)

Optional (by default calculated), must be >= 0

value

Number

The value transferred for the transaction in Wei, also the endowment if it’s a contract-creation transaction

Mandatory, must be >= 0

data

String

Either a byte string containing the associated data of the message, or in the case of a contract-creation transaction, the initialisation code

Optional

nonce

Number

Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

Optional (next nonce will be used by defaut), must be >= 0

to

String

The destination address of the transaction.

Mandatory, a valid ethereum address

Request Body
Data example
{
  "type" : "ETH_TRANSACTION",
  "walletId" : "adc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "gasPrice" : 300000000000000,
  "gas" : 23000,
  "nonce" : 0,
  "value" : 10000000000,
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "data" : "0x"
}
Response Fields
Table 8. Result parameters

Path

Type

Description

transactionHash

String

The transaction hash

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

Execute ERC20 transfer Arkane Connect

To execute an ERC20 transaction transfer, use the connect building block with:

Request Fields
Table 9. Data parameters

Path

Type

Description

Constraints

type

String

The type of the transaction

Mandatory

walletId

String

The id of the wallet one wants to sign with.

Mandatory

gasPrice

Number

The gas price of the transaction

Optional (default gas price is used otherwise), must be > 0

gas

Number

The amount of gas to use for the transaction (unused gas is refunded)

Optional (by default calculated), must be >= 0

value

Number

The value transferred for the transaction in Wei, also the endowment if it’s a contract-creation transaction

Mandatory, must be >= 0

tokenAddress

String

The address of the ERC20 token to be used in this transaction

Mandatory, valid ethereum contract address

nonce

Number

Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

Optional (next nonce will be used by defaut), must be >= 0

to

String

The destination address of the transaction.

Mandatory, a valid ethereum address

Request Body
Data example
{
  "type" : "ETHEREUM_ERC20_TRANSACTION",
  "walletId" : "bdc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "gasPrice" : 300000000000000,
  "gas" : 200000,
  "nonce" : 0,
  "value" : 10000000000,
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "tokenAddress" : "0x4df47b4969b2911c966506e3592c41389493953b"
}
Response Fields
Table 10. Result parameters

Path

Type

Description

transactionHash

String

The transaction hash

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

Sign Arkane Connect

Signs arbitrary data. This data is before UTF-8 HEX decoded and enveloped as followed:

"\x19Ethereum Signed Message:\n" + message.length + message.

To sign data, use the connect building block with:

Request Fields
Table 11. Data parameters

Path

Type

Description

Constraints

type

String

type of the signature request

Mandatory, possible values: ETHEREUM_TRANSACTION, ETHEREUM_RAW, VECHAIN_TRANSACTION, GOCHAIN_TRANSACTION, GOCHAIN_RAW

walletId

String

The id of the wallet one wants to sign with.

Mandatory

data

String

The arbitrary to sign

Mandatory, hex-encoded

prefix

Boolean

Whether or not to prefix the data with the “\x19Ethereum Signed Message:\n”-prefix.

Optional, Default true

hash

Boolean

Whether or not to to hash the given data prior to creating the signature.

Default true. Ignored if prefix = true

Request Body
Data example
{
  "type" : "ETHEREUM_RAW",
  "walletId" : "1",
  "data" : "Some data",
  "hash" : true,
  "prefix" : true
}
Response Fields
Table 12. Result parameters

Path

Type

Description

success

Boolean

See if the response contains a result

result.r

String

The R value of the signature

result.s

String

The S value of the signature

result.v

String

The V value of the signature

result.signature

String

The value of the signature

Response Body
Result example
{
  "success" : true,
  "result" : {
    "r" : "0xb91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd",
    "s" : "0x6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a029",
    "v" : "0x1c",
    "signature" : "0xb91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a0291c"
  }
}

Gochain

Error Codes

Error Code Meaning

transaction.submit.gochain-error

Something went wrong while trying to submit the Gochain transaction

Execute GO transaction Arkane Connect

To execute an Gochain transaction, use the connect building block with:

Request Fields
Table 13. Data parameters

Path

Type

Description

Constraints

type

String

The type of the transaction

Mandatory, value for ether transaction: GO_TRANSACTION

walletId

String

The id of the wallet one wants to sign with.

Mandatory

gasPrice

Number

The gas price of the transaction

Optional (default gas price is used otherwise), must be > 0

gas

Number

The amount of gas to use for the transaction (unused gas is refunded)

Optional (by default calculated), must be >= 0

value

Number

The value transferred for the transaction in Wei, also the endowment if it’s a contract-creation transaction

Mandatory, must be >= 0

data

String

Either a byte string containing the associated data of the message, or in the case of a contract-creation transaction, the initialisation code

Optional

nonce

Number

Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

Optional (next nonce will be used by defaut), must be >= 0

to

String

The destination address of the transaction.

Mandatory, a valid ethereum address

Request Body
Data example
{
  "type" : "GO_TRANSACTION",
  "walletId" : "adc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "gasPrice" : 300000000000000,
  "gas" : 23000,
  "nonce" : 0,
  "value" : 10000000000,
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "data" : "0x"
}
Response Fields
Table 14. Result parameters

Path

Type

Description

transactionHash

String

The transaction hash

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

Execute GO20 transfer Arkane Connect

To execute an GO20 transaction transfer, use the connect building block with:

Request Fields
Table 15. Data parameters

Path

Type

Description

Constraints

type

String

The type of the transaction

Mandatory

walletId

String

The id of the wallet one wants to sign with.

Mandatory

gasPrice

Number

The gas price of the transaction

Optional (default gas price is used otherwise), must be > 0

gas

Number

The amount of gas to use for the transaction (unused gas is refunded)

Optional (by default calculated), must be >= 0

value

Number

The value transferred for the transaction in Wei, also the endowment if it’s a contract-creation transaction

Mandatory, must be >= 0

tokenAddress

String

The address of the GO20 token to be used in this transaction

Mandatory, valid gochain contract address

nonce

Number

Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

Optional (next nonce will be used by defaut), must be >= 0

to

String

The destination address of the transaction.

Mandatory, a valid ethereum address

Request Body
Data example
{
  "type" : "GOCHAIN_GO20_TRANSACTION",
  "walletId" : "bdc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "gasPrice" : 300000000000000,
  "gas" : 200000,
  "nonce" : 0,
  "value" : 10000000000,
  "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
  "tokenAddress" : "0x4df47b4969b2911c966506e3592c41389493953b"
}
Response Fields
Table 16. Result parameters

Path

Type

Description

transactionHash

String

The transaction hash

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

Sign Arkane Connect

Signs arbitrary data. This data is before UTF-8 HEX decoded and enveloped as followed:

"\x19Ethereum Signed Message:\n" + message.length + message.

To sign data, use the connect building block with:

Request Fields
Table 17. Data parameters

Path

Type

Description

Constraints

type

String

type of the signature request

Mandatory, possible values: ETHEREUM_TRANSACTION, ETHEREUM_RAW, VECHAIN_TRANSACTION, GOCHAIN_TRANSACTION, GOCHAIN_RAW

walletId

String

The id of the wallet one wants to sign with.

Mandatory

data

String

The arbitrary to sign

Mandatory, hex-encoded

prefix

Boolean

Whether or not to prefix the data with the “\x19Ethereum Signed Message:\n”-prefix.

Optional, Default true

hash

Boolean

Whether or not to to hash the given data prior to creating the signature.

Default true. Ignored if prefix = true

Request Body
Data example
{
  "type" : "ETHEREUM_RAW",
  "walletId" : "1",
  "data" : "Some data",
  "hash" : true,
  "prefix" : true
}
Response Fields
Table 18. Result parameters

Path

Type

Description

success

Boolean

See if the response contains a result

result.r

String

The R value of the signature

result.s

String

The S value of the signature

result.v

String

The V value of the signature

result.signature

String

The value of the signature

Response Body
Result example
{
  "success" : true,
  "result" : {
    "r" : "0xb91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd",
    "s" : "0x6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a029",
    "v" : "0x1c",
    "signature" : "0xb91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a0291c"
  }
}

Vechain

Error Codes

Error Code Meaning

thorify.internal-error

Something went wrong with the underlying vechain connection

thorify.transaction.submit.internal-error

A problem occurred trying to submit the transaction to the vechain network

|Path|Type|Description|Constraints |type |String |The type of the transaction |Mandatory, value for vet transaction: VET_TRANSACTION |walletId |String |The id of the wallet one wants to sign with. |Mandatory |blockRef |Null | BlockRef is the reference to a specific block. When the BlockRef is a block ID in the future, it enables users to configure the transactions to be executed as a specific block height; |Optional |chainTag |Null |chaintag |Optional |expiration |Number |The number of blocks that can be used to specify when the transaction expires |Optional, must be >= 0 |gas |Number |the maximum amount of VeThor the sender is willing to pay to execute all the clauses in the transaction |Optional, must be > 0 |gasPriceCoef |Number |Users can modify the Gas Price Coefficient to increase the amount of VeThor they are willing to commit in the predefined range as to prioritize the transaction |Optional, must be >= 0 |nonce |String |TxNonce is a random number in the transaction. Users are able to change the nonce to generate unique TxID as part of the “in-transaction proof of work” feature |Optional |clauses |Array |Each transaction may contain multiple clauses, and each clause contains the “To”, “Value”, and “Data” fields that can be used to commence different tasks such as payment or smart contracts |At least 1 must be present |clauses[].to |String |address of the to clause |Mandatory, valid vechain address |clauses[].amount |Number |amount of the to clause |Mandatory, must be >= 0 |clauses[].data |String |data of the to clause |Optional

.Data example [.sect-request-body] ===== Request Body

[source,options="nowrap"] ---- { "type" : "VET_TRANSACTION", "walletId" : "cdc4c08a-b8fa-4e4c-z5a2-92c87b80f174", "blockRef" : null, "chainTag" : null, "expiration" : 3, "gas" : 23000, "gasPriceCoef" : 46576, "nonce" : "a213f871-3c2b-4d91-baae-76c2cd145679", "clauses" : [ { "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9", "amount" : 10000000000, "data" : "0x0000" } ] } ----

.Result parameters [.sect-response-fields] ===== Response Fields

|Path|Type|Description |transactionHash |String |The transaction hash

.Result example [.sect-response-body] ===== Response Body

[source,options="nowrap"] ---- { "transactionHash" : "0x6f6cd9b6038d5546e408c777bd3aab6d277bf24bc7d9f7445815b2a097e705fb" } ----

==== Execute VTHO transfer Arkane Connect To execute a VTHO transfer, use the connect building block with:

.URL https://connect-staging.arkane.network/transaction/execute/vtho_transaction

.Data parameters [.sect-request-fields] ===== Request Fields

|Path|Type|Description|Constraints |type |String |The type of the transaction, e.g.: VTHO_TRANSACTION |Mandatory, value for vtho transaction: VTHO_TRANSACTION |walletId |String |The id of the wallet one wants to sign with. |Mandatory |blockRef |Null | BlockRef is the reference to a specific block. When the BlockRef is a block ID in the future, it enables users to configure the transactions to be executed as a specific block height; |Optional |chainTag |Null |chaintag |Optional |expiration |Number |The number of blocks that can be used to specify when the transaction expires |Optional, must be >= 0 |gas |Number |the maximum amount of VeThor the sender is willing to pay to execute all the clauses in the transaction |Optional, must be > 0 |gasPriceCoef |Number |Users can modify the Gas Price Coefficient to increase the amount of VeThor they are willing to commit in the predefined range as to prioritize the transaction |Optional, must be >= 0 |nonce |String |TxNonce is a random number in the transaction. Users are able to change the nonce to generate unique TxID as part of the “in-transaction proof of work” feature |Optional |clauses |Array |Each transaction may contain multiple clauses, and each clause contains the “To”, “Value”, and “Data” fields that can be used to commence different tasks such as payment or smart contracts |At least 1 must be present |clauses[].to |String |address of the to clause |Mandatory, valid vechain address |clauses[].amount |Number |amount of the to clause |Mandatory, must be >= 0

.Data example [.sect-request-body] ===== Request Body

[source,options="nowrap"] ---- { "type" : "VTHO_TRANSACTION", "walletId" : "ddc4c08a-b8fa-4e4c-z5a2-92c87b80f174", "blockRef" : null, "chainTag" : null, "expiration" : 3, "gas" : 23000, "gasPriceCoef" : 46576, "nonce" : "5d7c46bd-dd70-438a-858c-e11ad1a6f085", "clauses" : [ { "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9", "amount" : 10000000000 } ] } ----

.Result parameters [.sect-response-fields] ===== Response Fields

|Path|Type|Description |transactionHash |String |The transaction hash

.Result example [.sect-response-body] ===== Response Body

[source,options="nowrap"] ---- { "transactionHash" : "0x6f6cd9b6038d5546e408c777bd3aab6d277bf24bc7d9f7445815b2a097e705fb" } ----

.Result parameters

|Path|Type|Description

|transactionHash |String |The transaction hash

.Result example

[source,json] ---- { "transactionHash" : "0x621f692e386a8bc0c53d36aa793864893106e10f54f63fa9c063e24ad975d907" } ----

==== Execute VIP180 transfer Arkane Connect

To execute an VIP180 transaction transfer, use the connect building block with:

.URL https://connect-staging.arkane.network/transaction/execute/vechain_vip180_transaction

.Data parameters [.sect-request-fields] ===== Request Fields

|Path|Type|Description|Constraints |type |String |The type of the transaction |Mandatory, value for vet transaction: VECHAIN_VIP180_TRANSACTION |walletId |String |The id of the wallet one wants to sign with. |Mandatory |blockRef |Null | BlockRef is the reference to a specific block. When the BlockRef is a block ID in the future, it enables users to configure the transactions to be executed as a specific block height; |Optional |chainTag |Null |chaintag |Optional |expiration |Number |The number of blocks that can be used to specify when the transaction expires |Optional, must be >= 0 |gas |Number |the maximum amount of VeThor the sender is willing to pay to execute all the clauses in the transaction |Optional, must be > 0 |gasPriceCoef |Number |Users can modify the Gas Price Coefficient to increase the amount of VeThor they are willing to commit in the predefined range as to prioritize the transaction |Optional, must be >= 0 |nonce |String |TxNonce is a random number in the transaction. Users are able to change the nonce to generate unique TxID as part of the “in-transaction proof of work” feature |Optional |clauses |Array |Each transaction may contain multiple clauses, and each clause contains the “To”, “Value”, and “Data” fields that can be used to commence different tasks such as payment or smart contracts |At least 1 must be present |clauses[].to |String |address of the to clause |Mandatory, valid vechain address |clauses[].tokenAddress |String |The address of the token to be used in this application |Mandatory, valid vechain ERC20 token address |clauses[].amount |Number |amount of the to clause |Mandatory, must be >= 0

.Data example [.sect-request-body] ===== Request Body

[source,options="nowrap"] ---- { "type" : "VECHAIN_VIP180_TRANSACTION", "walletId" : "edc4c08a-b8fa-4e4c-z5a2-92c87b80f174", "blockRef" : null, "chainTag" : null, "expiration" : 3, "gas" : 23000, "gasPriceCoef" : 46576, "nonce" : "642d29e5-a724-4f11-9977-fe7591c1367c", "clauses" : [ { "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9", "amount" : 10000000000, "tokenAddress" : "0x0000000000000000000000000000456E65726779" } ] } ----

.Result parameters [.sect-response-fields] ===== Response Fields

|Path|Type|Description |transactionHash |String |The transaction hash

.Result example [.sect-response-body] ===== Response Body

[source,options="nowrap"] ---- { "transactionHash" : "0x6f6cd9b6038d5546e408c777bd3aab6d277bf24bc7d9f7445815b2a097e705fb" } ----

=== Bitcoin

==== Error Codes

Error Code

Meaning

|bitcoin.address-wrong-network |Something went wrong with the address of this bitcoin wallet on this specific network.

|bitcoin.creation-error |An error occurred trying to create the Bitcoin transaction.

|bitcoin.transaction-inputs |The account you’re trying to use as origin in the transaction doesn’t have valid inputs to send

|bitcoin.not-enough-funds |Not enough funds to create the transaction

|bitcoin.signing-error |An error occurred trying to sign the bitcoin transaction.

==== Execute Bitcoin transaction Arkane Connect To execute an Bitcoin transaction, use the connect building block with:

.URL https://connect-staging.arkane.network/transaction/execute/btc_transaction

.Data parameters [.sect-request-fields] ===== Request Fields

|Path|Type|Description|Constraints |type |String |The type of the transaction |Mandatory, value for bitcoin transaction: BTC_TRANSACTION |walletId |String |The id of the wallet one wants to sign with. |Mandatory |value |Number |value in satoshi |must be >= 0 |to |String |The destination address of the transaction. |Mandatory, a valid bitcoin address |feePerByte |Number |The fee per byte for the transaction (satoshi value) |Optional |pincode |String |The pincode of the specified wallet |Mandatory, must be between 4-6 digits

.Data example [.sect-request-body] ===== Request Body

[source,options="nowrap"] ---- { "type" : "BTC_TRANSACTION", "walletId" : "1543", "value" : 10000000000, "feePerByte" : 6, "to" : "mpi2SkK5vKipCNE9h1HtRgDg6UM44AuN9S" } ----

.Result parameters [.sect-response-fields] ===== Response Fields

|Path|Type|Description |transactionHash |String |The transaction hash

.Result example [.sect-response-body] ===== Response Body

[source,options="nowrap"] ---- { "transactionHash" : "9c0278cd0ee9edf48e75c012142f26594684eef4f52ec59e2276fa83e3f29a18" } ----

=== Litecoin

==== Error Codes

|Error Code | Meaning

|litecoin.address-wrong-network |Something went wrong with the address of this litecoin wallet on this specific network.

|litecoin.creation-error |An error occurred trying to create the Litecoin transaction.

|litecoin.transaction-inputs |The account you’re trying to use as origin in the transaction doesn’t have valid inputs to send

|litecoin.not-enough-funds |Not enough funds to create the transaction

|litecoin.signing-error |An error occurred trying to sign the litecoin transaction

==== Execute Litecoin transaction Arkane Connect To execute an Litecoin transaction, use the connect building block with:

.URL https://connect-staging.arkane.network/transaction/execute/ltc_transaction

.Data parameters [.sect-request-fields] ===== Request Fields

|Path|Type|Description|Constraints |type |String |The type of the transaction |Mandatory, value for bitcoin transaction: LTC_TRANSACTION |walletId |String |The id of the wallet one wants to sign with. |Mandatory |value |Number |value in satoshi |must be >= 0 |to |String |The destination address of the transaction. |Mandatory, a valid litecoin address |feePerKiloByte |Number |The fee per kilobyte for the transaction (satoshi value) |Optional |pincode |String |The pincode of the specified wallet |Mandatory, must be between 4-6 digits

.Data example [.sect-request-body] ===== Request Body

[source,options="nowrap"] ---- { "type" : "LTC_TRANSACTION", "walletId" : "1543", "value" : 10000000000, "feePerKiloByte" : 6, "to" : "MTvnA4CN73ry7c65wEuTSaKzb2pNKHB4n1" } ----

.Result parameters [.sect-response-fields] ===== Response Fields

|Path|Type|Description |transactionHash |String |The transaction hash

.Result example [.sect-response-body] ===== Response Body

[source,options="nowrap"] ---- { "transactionHash" : "9c0278cd0ee9edf48e75c012142f26594684eef4f52ec59e2276fa83e3f29a18" } ----

=== Tron

==== Error Codes

|Error Code | Meaning

|tron.balance.bandwidth-error |Unable to fetch bandwidth

|tron.signature.error |An error occurred trying to create a tron signature

==== Execute a TRON transaction Arkane Connect To execute an TRON transaction, use the connect building block with:

.URL https://connect-staging.arkane.network/transaction/execute/trx_transaction

.Data parameters [.sect-request-fields] ===== Request Fields

|Path|Type|Description|Constraints

|type |String |The type of the transaction |Mandatory, value for tron transaction: TRX_TRANSACTION

|walletId |String |The id of the wallet one wants to sign with. |Mandatory

|value |Number |The value transferred for the transaction in "sun" |Mandatory, must be >= 0

|to |String |The destination address of the transaction. |Mandatory, a valid tron address

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

.Data example [.sect-request-body] ===== Request Body

[source,options="nowrap"] ---- { "type" : "TRX_TRANSACTION", "walletId" : "adc4c08a-b8fa-4e4c-z5a2-92c87b80f174", "pincode" : "549644", "value" : 10000000000, "to" : "TAGGUxf5VvuA7UJdzAtjoS3gJuJytLQiYo", "data" : "0x" } ----

.Result parameters [.sect-response-fields] ===== Response Fields

|Path|Type|Description

|transactionHash |String |The transaction hash

.Result example [.sect-response-body] ===== Response Body

[source,options="nowrap"] ---- { "transactionHash" : "e30c9a753d60b9312038cbe0a5dfe2891d1d25e46e37de514faa74febb5ccbb8" } ----

==== Execute TRC10 transfer Arkane Connect

To execute a TRC10 transaction transfer, use the connect building block with:

.URL https://connect-staging.arkane.network/transaction/execute/tron_trc10_transaction

.Data parameters [.sect-request-fields] ===== Request Fields

|Path|Type|Description|Constraints

|type |String |The type of the transaction |Mandatory, value for a trc10 transaction: TRC10_TRANSACTION

|walletId |String |The id of the wallet one wants to sign with. |Mandatory

|value |Number |The value transferred for the transaction in "sun" |Mandatory, must be >= 0

|to |String |The destination address of the transaction. |Mandatory, a valid tron address

|token |String |The address of the TRC10 token to be used in this transaction |Mandatory, valid ethereum contract address

.Data example [.sect-request-body] ===== Request Body

[source,options="nowrap"] ---- { "type" : "TRC10_TRANSACTION", "walletId" : "adc4c08a-b8fa-4e4c-z5a2-92c87b80f174", "pincode" : "549644", "value" : 10000000000, "to" : "TAGGUxf5VvuA7UJdzAtjoS3gJuJytLQiYo", "token" : "TCFXpuCNS77Ha6Nj9RU5Vr97TY7fG1YfzF" } ----

.Result parameters [.sect-response-fields] ===== Response Fields

|Path|Type|Description

|transactionHash |String |The transaction hash

.Result example [.sect-response-body] ===== Response Body

[source,options="nowrap"] ---- { "transactionHash" : "e30c9a753d60b9312038cbe0a5dfe2891d1d25e46e37de514faa74febb5ccbb8" } ----

== Profile === User profile Arkane API Returns more info about the connected user.

[.sect-http-request] ==== Example Http Request

[source,http,options="nowrap"] ---- GET /api/profile HTTP/1.1 Host: api.arkane.network ----

[.sect-http-response] ==== Example Http Response

[source,http,options="nowrap"] ---- HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: 130 { "userId" : "davy", "hasMasterPin" : true, "username" : null, "email" : null, "firstName" : null, "lastName" : null } ----

[.sect-response-fields] ==== Response Fields

|Path|Type|Description |userId |String |userId of the logged in user |hasMasterPin |Boolean |check if the user already set up his master pincode |username |Null |Username of the logged in user |email |Null |email of the logged in user |firstName |Null |first name of the logged in user |lastName |Null |last name of the logged in user

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

=== 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

=== Trading pairs Arkane API Returns the list of possible trading pairs for a given wallet.

[.sect-curl-request] ==== Example Curl Request

[source,bash] ---- $ curl 'https://api.arkane.network/api/wallets/8d3c0113-877d-4f2f-8f13-d9cea4c9a980/swaps/pairs' -i -X GET \ -H 'Content-Type: application/json' ----

[.sect-path-parameters] ==== Path Parameters

./api/wallets/{id}/swaps/pairs

|Parameter|Description |id |The id of the wallet

[.sect-http-response] ==== Example Http Response

[source,http,options="nowrap"] ---- HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: 468 [ { "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" : "" } } ] ----

[.sect-response-fields] ==== 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.

[.sect-curl-request] ==== Example Curl Request

[source,bash] ---- $ 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' ----

[.sect-request-parameters] ==== Request Parameters

|Parameter|Description |fromSecretType |The input secret type (Possible values: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN]) |toSecretType |The output secret type (Possible values: [AETERNITY, BITCOIN, ETHEREUM, GOCHAIN, LITECOIN, TRON, VECHAIN]) |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

[.sect-http-response] ==== Example Http Response

[source,http,options="nowrap"] ---- 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 } } ----

[.sect-response-fields] ==== 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

[.sect-curl-request] ==== Example Curl Request

[source,bash] ---- $ curl 'https://api.arkane.network/api/wallets/8eca0014-7238-4432-a244-0bfff9e53535/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" }' ----

[.sect-path-parameters] ==== Path Parameters

./api/wallets/{id}/swaps

|Parameter|Description |id |The id of the wallet

[.sect-http-response] ==== Example Http Response

[source,http,options="nowrap"] ---- HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: 568 [ { "type" : "VET_TRANSACTION", "walletId" : "8eca0014-7238-4432-a244-0bfff9e53535", "blockRef" : null, "chainTag" : null, "expiration" : 0, "gas" : 0, "gasPriceCoef" : null, "nonce" : null, "clauses" : [ { "to" : "0xB74C4EBd95F70Dd9794d8c49053a297689950b63", "amount" : 1305000000000000000000, "data" : "0xad65d76d000000000000000000000000000000000000000000000044f9c0112b17a58000000000000000000000000000000000000000000000000000000000005c5452f200000000000000000000000033e2f608129ffca67c9fdc56cd9d2354a79d2919" } ] } ] ----

[.sect-response-fields] ==== 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

^