Wallet API
We provide the following useful wrapper functions through our wallet endpoint:
get
- returns an object containing balances and tx countstx
- returns an object containing nonces and gas detailserc20factory
- returns a token object for a specific addresserc721factory
- returns an asset object for a specific addresserc20
- returns a token object for a specific contract and addresserc721
- returns an asset object for a specific contract and address
By default, each of these functions will check all available networks.
You may also add the chain
parameter in order to select a single network.
Required options should be set via GET params
and piped if using URLs - for example - ?params=option_one|option_two
More information on each of the available methods
can be seen below:
get
( address
)
A valid Ethereum address
is required.
The get
function is used to provide display details for multi-network wallets.
An example URL request:
Data returned should look similar to this:
"results":
{
"public":
{
"balances":
{
"hex": "0x0",
"wei": 0,
"eth": 0
},
"txs":
{
"hex": "0x0",
"int": 0
}
},
"private":
{
"balances":
{
"hex": "0x4de41a57cc26000",
"wei": 350790000000000000,
"eth": 0.35079
},
"txs":
{
"hex": "0xa",
"int": 10
}
}
}
It is also possible to fetch tokens
and assets
whilst getting wallet details by adding them as parameters, which in-turn invoke the erc20factory
and erc721factory
methods below.
An example URL request:
Data returned should look similar to this:
{
"code": "success",
"message": "Successfully fetched data",
"data":
{
"status": 200,
"results":
{
"public":
{
"balances":
{
"hex": "0x0",
"wei": 0,
"eth": 0
},
"txs":
{
"hex": "0x0",
"int": 0
},
"tokens": false,
"assets": false
},
"private":
{
"balances":
{
"hex": "0x37ae913adae1000",
"wei": 250769000000000000,
"eth": 0.250769
},
"txs":
{
"hex": "0xb",
"int": 11
},
"tokens":
{
"MYR":
{
"supply":
{
"int": 100011000,
"float": "1000110.00"
},
"balance":
{
"int": 11000,
"float": "110.00"
},
"type": "erc20",
"symbol": "MYR",
"name": "Digital Ringgit",
"decimals": 2
},
"USD":
{
"supply":
{
"int": 100001010,
"float": "1000010.10"
},
"balance":
{
"int": 1010,
"float": "10.10"
},
"type": "erc20",
"symbol": "USD",
"name": "Digital Dollar",
"decimals": 2
}
},
"assets":
{
"DOM":
{
"supply":
{
"int": 2,
"float": 2
},
"balance":
{
"int": 1,
"float": 1
},
"type": "erc721",
"symbol": "DOM",
"name": "Domains",
"decimals": 0,
"assets":
[{
"id": "28087381717255711585255468938901593077562726875988296656680607858942714165240",
"meta": "http://smalley.my"
}]
},
"NUM":
{
"supply":
{
"int": 1,
"float": 1
},
"balance":
{
"int": 1,
"float": 1
},
"type": "erc721",
"symbol": "NUM",
"name": "Numbers",
"decimals": 0,
"assets":
[{
"id": "95800812254398607618717869111870014631827986520762525906936918807176128071390",
"meta": "+60195444321"
}]
}
}
}
}
},
"_links":
{
"up":
[
{
"href": "http://bce.asia/api/cortex/v1"
}
],
"help":
[
{
"name": "toc",
"href": "http://bce.asia/documentation"
},
{
"name": "self",
"href": "http://bce.asia/documentation/wallet"
}
]
}
}
tx
( address
)
A valid Ethereum address
is required.
The tx
function is used to gather important information prior to creating a raw transaction.
An example URL request:
Data returned should look similar to this:
"results":
{
"public":
{
"gas":
{
"limit":
{
"hex": "0x7a1f1f",
"wei": 8003359,
"eth": "0.000000000008003359"
},
"price":
{
"hex": "0xb2d05e00",
"wei": 3000000000,
"eth": "0.000000003000000000"
}
},
"nonce":
{
"hex": "0x0",
"int": 0
}
},
"private":
{
"gas":
{
"limit":
{
"hex": "0x7a1200",
"wei": 8000000,
"eth": "0.000000000008000000"
},
"price":
{
"hex": "0x3b9aca00",
"wei": 1000000000,
"eth": "0.000000001000000000"
}
},
"nonce":
{
"hex": "0xa",
"int": 10
}
}
}
erc20factory
( contractAddress
, walletAddress
, supplySymbol
)
All three options are required.
Although both contractAddress
and walletAddress
utilize valid Ethereum addresses, the contractAddress
can also be replaced by specific reserved keywords such as bce
- which will then help to use our internal records to find the most up-to-date contract address associated with that particular keyword.
The supplySymbol
should be a valid symbol such as MYR
or USD
.
An example URL request:
Data returned should look similar to this:
"results":
{
"MYR":
{
"supply":
{
"int": 100011000,
"float": "1000110.00"
},
"balance":
{
"int": 11000,
"float": "110.00"
},
"type": "erc20",
"symbol": "MYR",
"name": "Digital Ringgit",
"decimals": 2
}
}
Multiple supplies can be fetched by providing a comma seperated list such as MYR,USD
.
An example URL request:
Data returned should look similar to this:
"results":
{
"MYR":
{
"supply":
{
"int": 100011000,
"float": "1000110.00"
},
"balance":
{
"int": 11000,
"float": "110.00"
},
"type": "erc20",
"symbol": "MYR",
"name": "Digital Ringgit",
"decimals": 2
},
"USD":
{
"supply":
{
"int": 100001010,
"float": "1000010.10"
},
"balance":
{
"int": 1010,
"float": "10.10"
},
"type": "erc20",
"symbol": "USD",
"name": "Digital Dollar",
"decimals": 2
}
}
erc721factory
( contractAddress
, walletAddress
, supplySymbol
)
All three options are required.
Although both contractAddress
and walletAddress
utilize valid Ethereum addresses, the contractAddress
can also be replaced by specific reserved keywords such as bce
- which will then help to use our internal records to find the most up-to-date contract address associated with that particular keyword.
The supplySymbol
should be a valid symbol such as DOM
or NUM
.
An example URL request:
Data returned should look similar to this:
"results":
{
"DOM":
{
"supply":
{
"int": 2,
"float": 2
},
"balance":
{
"int": 1,
"float": 1
},
"type": "erc721",
"symbol": "DOM",
"name": "Domains",
"decimals": 0,
"assets":
[{
"id": "28087381717255711585255468938901593077562726875988296656680607858942714165240",
"meta": "http://smalley.my"
}]
}
}
Multiple supplies can be fetched by providing a comma seperated list such as DOM,NUM
.
An example URL request:
Data returned should look similar to this:
"results":
{
"DOM":
{
"supply":
{
"int": 2,
"float": 2
},
"balance":
{
"int": 1,
"float": 1
},
"type": "erc721",
"symbol": "DOM",
"name": "Domains",
"decimals": 0,
"assets":
[{
"id": "28087381717255711585255468938901593077562726875988296656680607858942714165240",
"meta": "http://smalley.my"
}]
},
"NUM":
{
"supply":
{
"int": 1,
"float": 1
},
"balance":
{
"int": 1,
"float": 1
},
"type": "erc721",
"symbol": "NUM",
"name": "Numbers",
"decimals": 0,
"assets":
[{
"id": "95800812254398607618717869111870014631827986520762525906936918807176128071390",
"meta": "+60195444321"
}]
}
}
erc20
( contractAddress
, walletAddress
)
Both options are required.
Although both contractAddress
and walletAddress
utilize valid Ethereum addresses, the contractAddress
can also be replaced by specific reserved keywords such as myr
- which will then help to use our internal records to find the most up-to-date contract address associated with that particular keyword.
An example URL request:
Data returned should look similar to this:
"results":
{
"supply":
{
"int": 100011000,
"float": "1000110.00"
},
"balance":
{
"int": 11000,
"float": "110.00"
},
"type": "erc20",
"symbol": "MYR",
"contract": "0x064e925b536B3158ca0f7A232e3C1615Dda28aD7",
"name": "Digital Ringgit",
"decimals": 2
}
Providing a blank 0x0
wallet address will still allow for generic information about that supply, should it be valid.
An example URL request:
Data returned should look similar to this:
"results":
{
"supply":
{
"int": 100011000,
"float": "1000110.00"
},
"balance":
{
"int": 0
},
"type": "erc20",
"symbol": "MYR",
"contract": "0x064e925b536B3158ca0f7A232e3C1615Dda28aD7",
"name": "Digital Ringgit",
"decimals": 2
}
erc721
( contractAddress
, walletAddress
)
Both options are required.
Although both contractAddress
and walletAddress
utilize valid Ethereum addresses, the contractAddress
can also be replaced by specific reserved keywords such as dom
- which will then help to use our internal records to find the most up-to-date contract address associated with that particular keyword.
An example URL request:
Data returned should look similar to this:
"results":
{
"supply":
{
"int": 2,
"float": 2
},
"balance":
{
"int": 1,
"float": 1
},
"type": "erc721",
"symbol": "DOM",
"contract": "0xA57640b312e333DCFf97461411abfBC1B96FdBB7",
"name": "Domains",
"decimals": 0,
"assets":
[{
"id": "28087381717255711585255468938901593077562726875988296656680607858942714165240",
"meta": "http://smalley.my"
}]
}
Providing a blank 0x0
wallet address will still allow for generic information about that supply, should it be valid.
An example URL request:
Data returned should look similar to this:
"results":
{
"supply":
{
"int": 2,
"float": 2
},
"balance": {},
"type": "erc721",
"symbol": "DOM",
"contract": "0xA57640b312e333DCFf97461411abfBC1B96FdBB7",
"name": "Domains",
"decimals": 0,
"assets": false
}