wallet API

The world's first Google powered blockchain wallet.

The Hut34 Wallet's enterprise grade API binds tokenised value and a blockchain based settlement layer to data secured by Colossus encryption service.

Enable API Access in your account

Prior to using API calls, you need to enable API access in your account.

First, Sign in using your Google account credentials at:

https://wallet.hut34.io/

Next, click on your profile on the top right of your screen and click on API settings.

On the next page, click on "Enable API". It's done! You have successfully enabled API access to this account.

Wallet as a service API v.0.0.1

  • API based security applies to all URLs /api/v1/

  • Regular OAuth based security applies to all other URLs

  • we recommend using other providers such as infura, etherscan, or ethers.js in a client, to query balances and view transaction history.

Base URL

All endpoints are served at:

https://wallet.hut34.io/api/v1

Authentication

Note: The API tag displayed against an address in the browser window indicates that this address was created using the API.

To enable API access, first log in to your wallet, and select ‘API access’ from the top right hand corner of the screen. Record your API key, and ensure all requests contain an ‘Authorization’ request header as follows:

Authorization: Hut34 [APIKEY]

For example:

Authorization: Hut34 CKooV3KaDPg6K70H06aF9IgQi7zFCSkO

Note: This Authorization header must be included in all further API calls.

Endpoints

get
/addresses (GET)

https://wallet.hut34.io/api/v1/addresses
Returns the list of addresses for this user that can be managed via the API.
Request
Response
Headers
Authorization
required
string
"Hut34 [API_KEY]"
200: OK
[
{
"created": "2018-05-15T15:34:10.938+10:00",
"updated": "2018-05-15T15:34:10.938+10:00",
"address": "0x1a7ede45aac5ea993f5d3a5c1c966764d1313740"
},
{
"created": "2018-05-14T11:35:04.142+10:00",
"updated": "2018-05-14T11:35:04.142+10:00",
"address": "0xf7b024a32cE0183616ee62bBA00786a71e987390"
}
]

post
/addresses (POST)

https://wallet.hut34.io/api/v1/addresses
Allows the user to create a new address with the chosen password.
Request
Response
Headers
Authorization
required
string
"Hut34 [API_KEY]"
Body Parameters
password
required
string
"p4ssword"
200: OK
// RETURNS A NEWLY CREATED ADDRESS DETAILS
// NOTE: this creates a new address with the password you have chosen
{
"created": "2018-05-15T15:34:10.938+10:00",
"updated": "2018-05-15T15:34:10.938+10:00",
"address": "0x1a7ede45aac5ea993f5d3a5c1c966764d1313740"
}

post
/addresses/{source address}/send/eth

https://wallet.hut34.io/api/v1/addresses/{source address}/send/eth
Allows the user to send ETH to another address.
Request
Response
Headers
Authorization
required
string
"Hut34 [API_KEY]"
Body Parameters
password
required
string
"p4ssword"
to
required
string
"0xADDRESS"
value
required
string
"100000000", (note: value is in Wei, nonce is fetched automatically, gas limit is set to 21,000.
200: OK
// returns: Submitted tx hash
{
"transactionHash": "0x6382c86eeb550cfb32eda5bb466ec99208b48a72532b01d8a53d3d2a1fe990f6"
}

post
/addresses/{source address}/send/tokens

https://wallet.hut34.io/api/v1/addresses/{Source address}/send/tokens
Allows to send tokens (other than ETH) to an address.
Request
Response
Headers
Authorization
required
string
"Hut34 [API_KEY]"
Body Parameters
password
required
string
"p4ssword"
to
required
string
"0xADDRESS"
value
required
string
"10000000"
tokenAddress
required
string
"0xTOKENADDRESS"
200: OK
//Returning submitting tx hash
{
"password": "p455w0rd",
"to": "0xADDRESS",
"tokenAddress": "0xTOKENADDRESS",
"value": "100000000000000"

Redirecting

https://wallet.hut34.io/api/v1/?redirectAddressTo={redirect address}

After sign in, this will perform a redirect in the browser to the given address, with the parameter "walletAddress" set to the first address in the wallet.

For example:

https://wallet.hut34.io/api/v1?redirectAddressTo=https://hut34.io

will direct you to

https://hut34.io/?walletAddress=0xf7b024a32cE0183616ee62bBA00786a71e987390

Transaction

Your application can prepare a transaction for your user to approve. Prepare a JSON object which describes the transaction, as outlined below. Encode this JSON object in Base 64, and provide this information as a 'data' GET variable within a link to the user's wallet, as shown below;

get
Prepare for transfer (GET)

https://wallet.hut34.io/api/v1/?data={encodedJSON}
Using the JSON object below and after encoding it in base64, insert the text in a variable called data.
Request
Response
Headers
Authorization
required
string
"Hut34 [API_KEY]"
Body Parameters
toAddress
required
string
"0xADDRESS"
amount
required
string
"0.0001"
redirectOnSuccess
required
string
A string that contains the URL after a successful transaction
token
optional
object
{ "symbol": "ENTRP", "decimals":18, "address": "0x5BC7e5f0Ab8b2E10D2D0a3F21739FCe62459aeF3"}
200: OK

If no token is mentioned in the JSON object, it will automatically prepare to transfer ETH.

Example of transfer

{
"toAddress": "0x95c8c55bb34e9701a80507c83cf488d5b85166e2",
"amount": "1",
"redirectOnSuccess": "https://www.youtube.com/watch?v=SC4xMk98Pdc",
"token": {
"symbol": "ENTRP",
"decimals": 18,
"address": "0x5BC7e5f0Ab8b2E10D2D0a3F21739FCe62459aeF3"
}
}

After encoding the above JSON object in base64, we find the following link:

https://wallet.hut34.io/?data=ewogICJ0b0FkZHJlc3MiOiAiMHg5NWM4YzU1YmIzNGU5NzAxYTgwNTA3YzgzY2Y0ODhkNWI4NTE2NmUyIiwKICAiYW1vdW50IjogIjEiLAogICJyZWRpcmVjdE9uU3VjY2VzcyI6ICJodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PVNDNHhNazk4UGRjIiwKICAidG9rZW4iOiB7CiAgICAic3ltYm9sIjogIkVOVFJQIiwKICAgICJkZWNpbWFscyI6IDE4LAogICAgImFkZHJlc3MiOiAiMHg1QkM3ZTVmMEFiOGIyRTEwRDJEMGEzRjIxNzM5RkNlNjI0NTlhZUYzIgogIH0KfQ==

Do not forget to include the Authorization header containing your Hut34 API key.

post
Sign Order Hash

https://wallet.hut34.io/api/v1/signOrderHash
Signs a 0x order.WARNING: Signing does not mean that the 0x order is valid. It is merely a mathematical calculation.
Request
Response
Headers
Authorization
required
string
"Hut34 [API_KEY]"
Body Parameters
walletAddress
required
string
"0x1E1b924fb3f6A66c34731f2Bd62b2FAdb1c07eB1"
password
required
string
"password"
orderHash
required
string
"0xb299859b6025f2344d8ba704a4c63d362dbe0460076ca57d4d91968782735806"
200: OK
{
"result": "0x..................."
}

post
Fill 0x Order

https://wallet.hut34.io/api/v1/fillOrder
Fill the 0x order included in the body.The 0x object must be valid and signed.
Request
Response
Headers
Authorization
required
string
Hut34 [API_KEY]
Body Parameters
signedOrder
required
object
Valid 0x order
walletAddress
required
string
The address you want to fill the order with
password
required
string
password of your Hut34 address that you are using
200: OK
Returns the transaction hash that can be tracked on etherscan.
"result": "0x......"

post
Set Proxy Allowance

https://wallet.hu34.io/api/v1/setProxyAllowance
Approve the coin used for this address.
Request
Response
Headers
Authorization
required
string
Hut34 [API_KEY]
Body Parameters
walletAddress
optional
string
The address used to approve the coin
password
optional
string
The password of the address
tokenAddress
optional
string
The address of the approved coin
200: OK
Returns the transaction hash that can be tracked on etherscan.
"result": "0x......"

Disable API Access in your account

If you ever want to disable API calls for your account for any reason, complete the following steps:

First, Log In your Hut34 Wallet using your Google Account credentials.

Next, click on your profile, on the top right corner of the page.

Finally, click on "Disable API".

You have now disabled API access in your wallet.