Reference documentation

Table of Contents

Wallet

This section describes all actions related to wallets.

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: 1217
[ {
  "id" : "1",
  "address" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "ETHEREUM",
  "createdAt" : [ 2019, 1, 9, 16, 18, 25, 443325000 ],
  "archived" : false,
  "alias" : "aliasEth",
  "description" : "descriptionEth",
  "primary" : false,
  "balance" : {
    "secretType" : "ETHEREUM",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : "ETH",
    "gasSymbol" : "ETH",
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  },
  "hasCustomPin" : false,
  "status" : "AVAILABLE"
}, {
  "id" : "3",
  "address" : "0xae52b72db54e137a65a42434ab2543d31f8454c3",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "VECHAIN",
  "createdAt" : [ 2019, 1, 9, 16, 18, 25, 443373000 ],
  "archived" : false,
  "alias" : "aliasVechain",
  "description" : "descriptionVechain",
  "primary" : false,
  "balance" : {
    "secretType" : "VECHAIN",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : "VET",
    "gasSymbol" : "VTHO",
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  },
  "hasCustomPin" : false,
  "status" : "AVAILABLE"
} ]

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: 600
{
  "id" : "1",
  "address" : "0xdc72b72db54e227e65a45004ab2798d31e8934c2",
  "walletType" : "THREEWAY_SHARED",
  "secretType" : "ETHEREUM",
  "createdAt" : [ 2019, 1, 9, 16, 18, 26, 157049000 ],
  "archived" : false,
  "alias" : "aliasEth",
  "description" : "descriptionEth",
  "primary" : false,
  "balance" : {
    "secretType" : "ETHEREUM",
    "balance" : 1.0,
    "gasBalance" : 1.0,
    "symbol" : null,
    "gasSymbol" : null,
    "rawBalance" : "1000000000000000000",
    "rawGasBalance" : "1000000000000000000",
    "decimals" : 18
  },
  "hasCustomPin" : false,
  "status" : "AVAILABLE"
}

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: 217
{
  "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

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: 1028
[ {
  "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"
}, {
  "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"
}, {
  "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"
} ]

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

[].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: 343
{
  "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"
}

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

symbol

String

The symbol of the token

logo

String

Logo of the token (url)

decimals

Number

Decimals of the token

Transactions

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: [ETHEREUM, VECHAIN, BITCOIN]

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

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" : 10000000000,
  "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" : 10000000000,
  "gas" : 23000,
  "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

walletId

String

The id of the wallet one wants to sign with.

Mandatory

data

String

The arbitrary to sign

Mandatory

Request Body
Data example
{
  "type" : "ETHEREUM_RAW",
  "walletId" : "1",
  "pincode" : "31345",
  "data" : "Some data"
}
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" : "0x9955af11969a2d2a7f860cb00e6a00cfa7c581f5df2dbe8ea16700b33f4b4b9b",
    "s" : "0x69f945012f7ea7d3febf11eb1b78e1adc2d1c14c2cf48b25000938cc1860c83e",
    "v" : "0x1",
    "signature" : "0x9955af11969a2d2a7f860cb00e6a00cfa7c581f5df2dbe8ea16700b33f4b4b9b69f945012f7ea7d3febf11eb1b78e1adc2d1c14c2cf48b25000938cc1860c83e1"
  }
}

Vechain

Execute VET transaction Arkane Connect

To execute an VeChain 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 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

Request Body
Data example
{
  "type" : "VET_TRANSACTION",
  "walletId" : "cdc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "blockRef" : null,
  "chainTag" : null,
  "expiration" : 3,
  "gas" : 23000,
  "gasPriceCoef" : 46576,
  "nonce" : "d71939ac-a9db-4d4c-94b4-f388843599e1",
  "clauses" : [ {
    "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
    "amount" : 10000000000,
    "data" : "0x0000"
  } ]
}
Response Fields
Table 14. Result parameters

Path

Type

Description

transactionHash

String

The transaction hash

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

Execute VTHO transfer Arkane Connect

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

Request Fields
Table 15. Data parameters

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

Request Body
Data example
{
  "type" : "VTHO_TRANSACTION",
  "walletId" : "ddc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "blockRef" : null,
  "chainTag" : null,
  "expiration" : 3,
  "gas" : 23000,
  "gasPriceCoef" : 46576,
  "nonce" : "32740e58-7cff-47b6-ac09-1d4692ecfb45",
  "clauses" : [ {
    "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
    "amount" : 10000000000
  } ]
}
Response Fields
Table 16. Result parameters

Path

Type

Description

transactionHash

String

The transaction hash

Response Body
Result example
{
  "transactionHash" : "0x6f6cd9b6038d5546e408c777bd3aab6d277bf24bc7d9f7445815b2a097e705fb"
}
Table 17. Result parameters
Path Type Description

transactionHash

String

The transaction hash

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

Execute VIP180 transfer Arkane Connect

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

Request Fields
Table 18. Data parameters

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

Request Body
Data example
{
  "type" : "VECHAIN_VIP180_TRANSACTION",
  "walletId" : "edc4c08a-b8fa-4e4c-z5a2-92c87b80f174",
  "blockRef" : null,
  "chainTag" : null,
  "expiration" : 3,
  "gas" : 23000,
  "gasPriceCoef" : 46576,
  "nonce" : "2833b11e-4bf1-46ea-b613-d1f785f7a78a",
  "clauses" : [ {
    "to" : "0xdc71b72db51e227e65a45004ab2798d31e8934c9",
    "amount" : 10000000000,
    "tokenAddress" : "0x0000000000000000000000000000456E65726779"
  } ]
}
Response Fields
Table 19. Result parameters

Path

Type

Description

transactionHash

String

The transaction hash

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

Bitcoin

Execute Bitcoin transaction Arkane Connect

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

Request Fields
Table 20. Data parameters
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

Request Body
Data example
{
  "type" : "BTC_TRANSACTION",
  "walletId" : "1543",
  "pincode" : "549644",
  "value" : 10000000000,
  "feePerByte" : 6,
  "to" : "mpi2SkK5vKipCNE9h1HtRgDg6UM44AuN9S"
}
Response Fields
Table 21. Result parameters
Path Type Description

transactionHash

String

The transaction hash

Response Body
Result example
{
  "transactionHash" : "9c0278cd0ee9edf48e75c012142f26594684eef4f52ec59e2276fa83e3f29a18"
}

Profile

User profile Arkane API

Returns more info about the connected user.

Example Http Request

GET /api/profile HTTP/1.1
Host: api.arkane.network

Example Http Response

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
}

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.

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/47971bdc-7edb-4657-a79b-30a27921cedb/swaps/pairs' -i -X GET \
    -H 'Content-Type: application/json'

Path Parameters

Table 22. /api/wallets/{id}/swaps/pairs
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: 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" : ""
  }
} ]

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 rate 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: [ETHEREUM, VECHAIN, BITCOIN])

toSecretType

The output secret type (Possible values: [ETHEREUM, VECHAIN, BITCOIN])

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: 86

{
  "orderType" : "SELL",
  "inputAmount" : 100,
  "outputAmount" : 485,
  "fee" : 1
}

Response Fields

Path Type Description

orderType

String

The order type (SELL or BUY)

inputAmount

Number

The input amount

outputAmount

Number

The output amount (rate = outputAmount / inputAmount)

fee

Number

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

Create swap Arkane API

Creates the transaction request that is needed to execute the swap. With this result (the transaction request), 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/245f32e0-7495-4e96-819f-9096b24e6e43/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"
}'

Path Parameters

Table 23. /api/wallets/{id}/swaps
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: 564

{
  "type" : "VET_TRANSACTION",
  "walletId" : "245f32e0-7495-4e96-819f-9096b24e6e43",
  "pincode" : null,
  "blockRef" : null,
  "chainTag" : null,
  "expiration" : 0,
  "gas" : 0,
  "gasPriceCoef" : null,
  "nonce" : null,
  "clauses" : [ {
    "to" : "0xB74C4EBd95F70Dd9794d8c49053a297689950b63",
    "amount" : 1305000000000000000000,
    "data" : "0xad65d76d000000000000000000000000000000000000000000000044f9c0112b17a58000000000000000000000000000000000000000000000000000000000005c5452f200000000000000000000000033e2f608129ffca67c9fdc56cd9d2354a79d2919"
  } ]
}

Response Fields

Path Type Description

type

String

The type transaction result you need to send

walletId

String

The id of the wallet

clauses

Array

the clauses associated to this swap

clauses[].to

String

Destination address for the clause

clauses[].amount

Number

Amount for the clause

clauses[].data

String

Data for the clause

^