Wallet API Wallet API creates a wallet, and gets the wallet information and its balance.
Create wallet Creates a public key - private key pair (or a mnemonic phrase) and a wallet address.
Request URL Responses Request sample curl -X 'POST'
'https://sandbox-bc-api.qpyou.cn/core/v0/wallet'
-H 'accept: */*'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJp...'
-H 'x-network: polygon'
-d ''
Response sample // Polygon
{
"code" : 0 ,
"message" : "success" ,
"data" : {
"address" : "0x413a1bF6584fF29d663f6CE5cf3F1Fce2064cf4d" ,
"privateKey" : "0x250748507c8d83cc71fb4178d0b989062dc8e02ea050f9078ae0d8fbfda4d845"
}
}
// Xpla
{
"code" : 0 ,
"message" : "success" ,
"data" : {
"address" : "xpla1xckvhyu48uqlhduqgd79y45tpfhqlnrqhr87nt" ,
"publicKey" : "AvNhefa+7fhS7RH/VryEtz1yWzXKGS1+jnheotpOMuSV" ,
"privateKey" : "pledge outdoor ginger assault key luxury appear roast immense march burden charge season sea raw suspect tenant fossil portion easily onion fragile castle spoil"
}
}
Gets the information about the account status, like nonce (sequence), account number, and etc. Gets the account status including the nonce (sequence) and the account number. If the wallet is a multi-sig wallet , the API returns the thresholds required for sending a transaction from this wallet and the information about the signers.
Request URL Path parameters Responses Request sample curl -X 'GET'
'https://sandbox-bc-api.qpyou.cn/core/v1/wallet/0x9428e6eF51FEb2201676deEc11B7E36F7c1F0765'
-H 'accept: */*'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJp...'
-H 'x-network: polygon'
Response sample // Polygon (SINGLE)
{
"code" : 0 ,
"message" : "success" ,
"data" : {
"nonce" : 185 ,
"type" : "SINGLE"
}
}
// Xpla (SINGLE)
{
"code" : 0 ,
"message" : "success" ,
"data" : {
"nonce" : 52 ,
"accountNumber" : 4658 ,
"publicKey" : "xplapub1qtet7gjzyt6h3rm79ragfanses4xwgx6hjtjzh2juvtklxhup5gpgepz4yz" ,
"type" : "SINGLE"
}
}
// Polygon (MULTI)
{
"code" : 0 ,
"message" : "success" ,
"data" : {
"nonce" : 185 ,
"type" : "MULTI" ,
"signers" : [ "xpla1c49ehdl8dcd3wv0vj52h25gfxkxkr7sfpvqrhw" , "xpla1gzq6a8t4dt9lpth6ufzlnnvll9cdsdfgmrhk73" , "xpla16xhh685u829vrm407sq8rf82wt4gjudslzgtm7 " ] ,
"threshold" : 2
}
}
// Xpla (MULTI)
{
"code" : 0 ,
"message" : "success" ,
"data" : {
"nonce" : 52 ,
"accountNumber" : 4658 ,
"publicKey" : "xplapub1qtet7gjzyt6h3rm79ragfanses4xwgx6hjtjzh2juvtklxhup5gpgepz4yz" ,
"type" : "MULTI" ,
"signers" : [ "0xD6e69da7f1be111394dfef4C48eaC9b52ddf2Fd0" , "0xA10078576Ca6f63dc6f78ff9a8ed8bd05B51f463" , "0xa245824a24daf3b312d3f59c7debf162c4993e8b" ] ,
"threshold" : 2
}
}
Get wallet balance Gets the balance (Polygon: matic, XPLA: xpla) of the wallet.
Request URL Path parameters Responses Request sample curl -X 'GET'
'https://sandbox-bc-api.qpyou.cn/core/v1/wallet/0x9428e6eF51FEb2201676deEc11B7E36F7c1F0765/balance'
-H 'accept: */*'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJp...'
-H 'x-network: polygon'
Response sample {
"code" : 0 ,
"message" : "success" ,
"data" : {
"balance" : "0.198284931197886585" ,
"rawBalance" : "198284931197886585" ,
"decimals" : 18
}
}