Wallet

All of the wallet end points

get
Wallet Exists?

http://127.0.0.1:31567/wallet/exists
Check if wallet has already been created / imported. Used for building a rich wallet client UI.
Request
Response
Request
Response
200: OK
true

get
Public Address

http://127.0.0.1:31567/wallet/address
Fetch your public key
Request
Response
Request
Response
200: OK
"tp1q7n4l3dldcv69wfyqm32mpkwvf56q5kjdv7ma5p2668z05ljcv2gsq3ke4q"

get
Asset Balances

http://127.0.0.1:31567/wallet/balance
Request
Response
Request
Response
200: OK
[
{
"asset": "asset",
"balance": 2147483649
}
]

get
Received by address

http://127.0.0.1:31567/wallet/receivedbyaddress
Transaction received by address
Request
Response
Request
Response
200: OK

get
Address Output

http://127.0.0.1:31567/wallet/addressoutputs
Request
Response
Request
Body Parameters
address
required
string
Response
200: OK
List of address outputs
400: Bad Request
Error
address is missing

get
Address Balance

http://127.0.0.1:31567/wallet/addressbalance
Request
Response
Request
Path Parameters
address
required
string
Address you want to check the balance of
Response
200: OK

get
Remove Wallet

http://127.0.0.1:31567//wallet/remove
Remove wallet
Request
Response
Request
Body Parameters
password
required
string
wallet password
Response
200: OK

get
Zen Public Key (XPUB)

http://127.0.0.1:31567/wallet/zenpublickey
Return the Zen public key (XPUB)
Request
Response
Request
Response
200: OK

get
Resync

http://127.0.0.1:31567/wallet/resync
Request
Response
Request
Response
200: OK

get
Transaction Count

http://127.0.0.1:31567/wallet/transactioncount
Get transaction count (used for pagination)
Request
Response
Request
Path Parameters
optional
string
Response
200: OK
25

get
Transaction History

http://127.0.0.1:31567/wallet/transactions
Retreive the transaction history
Request
Response
Request
Body Parameters
take
required
number
skip
required
number
Response
200: OK
An array of tx objects, where each transaction can have a single or multiple tx deltas or incoming or outgoing assets.
[
{
"txHash": "txHash",
"asset": "00",
"amount": 0,
"confirmations": "someConfrimation"
}
]
400: Bad Request
Remember to add the parameters skip and take
Invalid input

post
Import Wallet

http://127.0.0.1:31567/wallet/import
Request
Response
Request
Path Parameters
words
required
array
A list of 12 or 24 bip39 compliant words
Body Parameters
password
required
string
A password to encrypt your mnemonic phrase
Response
200: OK
The account was imported correctly
400: Bad Request
Account already exist

post
Public Key

http://127.0.0.1:31567/wallet/publickey
Get the public key paired with the path
Request
Response
Request
Body Parameters
password
required
string
wallet password
path
required
string
bit44 derivative path
Response
200: OK

post
Send Transaction

http://127.0.0.1:31567/wallet/send
Send a transaction to another regular wallet address
Request
Response
Request
Body Parameters
output
required
string
compose of address, asset and amount
password
required
string
1234
Response
200: OK
Return the transaction hash of the send transaction
4f49f18a0575e701661d95cd221feb4399dc25e6f8230d37c4e2860cbd248fb9

post
Sign

http://127.0.0.1:31567/wallet/sign
Request
Response
Request
Path Parameters
password
required
string
wallet password
message
required
string
txhash
path
required
string
bit44 derivative path
Response
200: OK

post
Check Password

http://127.0.0.1:31567/wallet/checkpassword
Request
Response
Request
Path Parameters
password
required
string
wallet password
Response
200: OK
true

post
Retrive Mnemonic Phrase

http://127.0.0.1:31567/wallet/mnemonicphrase
Request
Response
Request
Path Parameters
password
required
string
wallet password
Response
200: OK

post
Create Hex Transaction

http://127.0.0.1:31567/wallet/createrawtransaction
Create a hex transaction
Request
Response
Request
Body Parameters
password
required
string
wallet password
output
required
array
composed of address asset and amount
Response
200: OK
Return the raw transaction
0000000001014f49f18a0575e701661d95cd221feb4399dc25e6f8230d37c4e2860cbd248fb901020220afea2e549bc52e05673396161e175ba8b5d9afca75c658ec3c4739fc4feeca020000370220ecc94205df8142d81f469eb7c62db9b65f58a3e186250908ec855a32c5d1b466007e0001740ca8163200010162010360c63d3a8228f6ba18f10b487bc1e2526479db65b866cd408c9c6f2fe1e423cb2c0e82ef5cf046ad5c814e5404ad7fe2b7edfd76d0cb359a484ddda8e7ca9fd1356150ef28a1d2fc59115510fd38c5125f17f12b80661b168bf342e181df4810

post
Create raw transaction

http://127.0.0.1:31567/wallet/rawtransaction/create
Create an unsigned raw transaction
Request
Response
Request
Path Parameters
outputs
optional
string
composed of address asset and amount
Response
200: OK
hex tx

post
Sign Raw Transaction

http://127.0.0.1:31567/wallet/rawtransaction/sign
Receive a raw transaction and sign it
Request
Response
Request
Body Parameters
password
required
string
wallet password
tx
required
string
tx transaction in hex format
Response
200: OK

post
Sign Raw Transaction

http://127.0.0.1:31567/wallet/rawtransaction/sign
Receive a raw transaction and sign it
Request
Response
Request
Body Parameters
password
required
string
wallet password
tx
required
string
tx transaction in hex format
Response
200: OK

post
Get Wallet Keys

http://127.0.0.1:31567/wallet/keys
Get imported public keys
Request
Response
Request
Path Parameters
password
optional
string
wallet password
Response
200: OK
[
{
"publicKey": string,
"path": "m/44'/258'/0'/1/0"
}
]

post
Publish Raw Transaction

http://127.0.0.1:31567/wallet/rawtransaction/publish
Parse a transaction from raw, verify that is fully signed and then publish the transaction
Request
Response
Request
Body Parameters
tx
required
string
signed tx in hex format
Response
200: OK

post
Import watchonly address

http://127.0.0.1:31567/wallet/importwatchonlyaddress
Request
Response
Request
Body Parameters
address
optional
string
Address to add as watchonly
Response
200: OK
added
400: Bad Request
Address already exist

post
Get new address

http://127.0.0.1:31567/wallet/getnewaddress
Get a new address
Request
Response
Request
Response
200: OK
return a new address

post
Restore new address

http://127.0.0.1:31567/wallet/restorenewaddresses
Request
Response
Request
Body Parameters
max
required
number
Response
200: OK

post
Import Zen Public Key

http://127.0.0.1:31567/wallet/importzenpublickey
Import Zen Public Key
Request
Response
Request
Body Parameters
publicKey
required
string
public key
Response
200: OK

post
Execute Contract

http://127.0.0.1:31567/wallet/contract/execute
Run a smart contract with parameters
Request
Response
Request
Body Parameters
sign
required
string
sign hash
password
required
string
wallet password
returnAddress
required
boolean
Execute the contract with some default arguments, such as: - returnAddress - allows the contract to automatically send funds back to in case it needs to. { "returnAddress" : true/false }
message
optional
string
send the contract some data
contractId
required
string
The contract address
command
required
string
Trigger one of the functions in the contract such as: "buy" / "redeem"
spends
required
array
an array of outputs
Response
200: OK

post
Activate Contract

http://127.0.0.1:31567/wallet/contract/activate
This how you activate a contract
Request
Response
Request
Body Parameters
rlimit
optional
string
zebra's rlimit for recording hints
password
required
string
wallet password
numberOfBlocks
required
number
The number of blocks you want to activate your contract for
code
required
string
Send valid fstar code, for example: let main _ _ _ _ _ _ _ _ = Zen.ResultT.failw \"This contract does nothing\"\nlet cf _ _ _ _ _ _ _ = Zen.Cost.ret (1 <: nat)
Response
200: OK
Cake successfully retrieved.
{
"address": "ctzn1qqqqqqqym4kfe8y5qg5tazkgjwn4qpesj05x6mqsvd5auwmzkhhs444fnkvwxhahr",
"contractId": "000000009bad939392804517d1591274ea00e6127d0dad820c6d3bc76c56bde15ad533b3"
}
400: Bad Request
Could not find a matching in the query.

post
Extend Contract

http://127.0.0.1:31567/wallet/contract/extend
This is to extend a contract
Request
Response
Request
Body Parameters
password
required
string
wallet password
numberOfBlocks
required
string
Number of block until when the contract will be active
contractId
required
string
ID of the contract
Response
200: OK

post
Execute CGP Contract

http://127.0.0.1:31567/wallet/contract/cgp
Execute the CGP contract at the payout block
Request
Response
Request
Body Parameters
password
optional
string
wallet password
Response
200: OK