Document

With this system, you can create addresses on the BNB network and deposit and withdraw BNB and token.


Getting Started

First, you will need api_key and secret_key. These API keys located in your account. You are required it when you want to use API key for interact with service.
Also you required to restrict API access to your own secure IP addresses. If you do not know your server's IPaddress, you can run this command on your server.

curl 'https://bnb-wallet.reza.biz/api/'


API Key Setup

First, get API key and secret key from panel and choose method's that you need.
Never share your API key/secret key to ANYONE.
API key and secret key will be something like this:

API Key: 4f3c12fa0a1d1ac8b026298b980f16b2
SECRET KEY: f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6
For each request you must send two params in header, one of this is api_key and another is api_sign you must create api_sign by hmac_hash sha256 on params that you will be sent!
for example: you want to send par1=value1 and par2=value2 to API
at the first you must create api_sign string by secret_key .

PHP:

$post_encode = http_build_query([
             'par1'=>'value1',
             'par2'=>'value2'
        ]);
$s = hash_hmac('sha256', $post_encode, 'f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6', true);
echo base64_encode($s); //g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=
    


Node.js:
var crypto = require('crypto');
var hash = crypto.createHmac('SHA256', "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6").update("par1=value1&par2=value2").digest('base64');
    



Python:
import hashlib
import hmac
import base64

dataToBeSigned= bytes("par1=value1&par2=value2").encode('utf-8')
portalKey = bytes("f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6").encode('utf-8')

signature = base64.b64encode(hmac.new(portalKey, dataToBeSigned, digestmod=hashlib.sha256).digest())
    


Ruby:
require 'openssl'
require "base64"

hash  = OpenSSL::HMAC.digest('sha256', "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6", "par1=value1&par2=value2")
token = Base64.encode64(hash)
token.delete("\n")
    


Java:
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;

public class ApiSecurityExample {
  public static void main(String[] args) {
    String portalKey = "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6";
    String dataToBeSigned= "par1=value1&par2=value2";

    Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
    SecretKeySpec secret_key = new SecretKeySpec(portalKey.getBytes(), "HmacSHA256");
    sha256_HMAC.init(secret_key);

    String hash = Base64.encodeBase64String(sha256_HMAC.doFinal(dataToBeSigned.getBytes()));
  }
}
    


Send request

At this level , you must have api_key and api_sign and params that you want to send par1=value1&par2=value2
send params via post method to API and set api_key and api_sign in header .

CURL

curl -H "api_key:4f3c12fa0a1d1ac8b026298b980f16b2" -H "api_sign:g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=" --data "par1=value1&par2=value2" https://bnb-wallet.reza.biz/api/example

PHP
$_headers = [
	'api_key:4f3c12fa0a1d1ac8b026298b980f16b2',
	'api_sign:g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $_headers);
curl_setopt($ch, CURLOPT_URL, 'https://bnb-wallet.reza.biz/api/example');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'par1=value1&par2=value2');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
        


Response

All response is json format .

Success Sample:

{
	...
	"success": true,
	"status": 200
}
    
success will be true if everything is fine and status is same as a http status code.

Failed Sample:
{
	"errors": {
		"auth": "INVALID_API_SIGN"
	},
	"success": false,
	"status": 403
}
    


Generate address

POST https://bnb-wallet.reza.biz/api/generate-address

Name Type Mandatory Description
label string no set label for new assigned address like Hotwallet5


Response:
{
	"address_id": 1781,
	"address": "0xf44c246708ead8226d3b9a003e45e505e6330bfe	",
	"label": "Hotwallet5",
	"success": true,
	"status": 200
}
    


Withdraw

POST https://bnb-wallet.reza.biz/api/withdraw

Name Type Mandatory Description
address_id integer yes
coin string yes BNB , TRX, USDT
to_address string yes Receiver Address
amount float yes Please check have enough BNB for fee


Response:
{
	"txid": "0x3e22038f5294c4540fa6f7667c37bc549de84699b7b4039766fde31616d2cf1c",
	"success": true,
	"status": 200
}
    


Get Address info By ID

POST https://bnb-wallet.reza.biz/api/get-address-by-id

Name Type Mandatory Description
address_id integer yes address_id is unique that returned in generate address API


Response:
{
	"id": 1406,
	"address": "0xf44c246708ead8226d3b9a003e45e505e6330bfe",
	"label": "Hotwallet6",
	"address_id": 1406,
	"date": "2021-07-21T09:46:27+0200",
	"db_balance": {
		"BNB": "0.1",
		"TRX": "0.03",
		"USDT": 0
	},
	"success": true,
	"status": 200
}
    

Get Address info by address

POST https://bnb-wallet.reza.biz/api/get-address

Name Type Mandatory Description
address string yes BNB address 0xf44c246708ead8226d3b9a003e45e505e6330bfe


Response:
{
	"id": 1406,
	"address": "0xf44c246708ead8226d3b9a003e45e505e6330bfe",
	"label": "Hotwallet6",
	"address_id": 1406,
	"date": "2021-07-21T09:46:27+0200",
	"db_balance": {
		"BNB": "0.1",
		"TRX": "0.03",
		"USDT": 0
	},
	"success": true,
	"status": 200
}
    

Get Address List By Label

POST https://bnb-wallet.reza.biz/api/get-address-list-by-label

Name Type Mandatory Description
label string yes


Response:
{
    "items": [
        {
            "id": 2,
            "address": "0xf44c246708ead8226d3b9a003e45e505e6330bfe",
            "label": "Hotwallet-1",
            "address_id": 2,
            "date": "2021-09-10T14:28:29+0000",
            "db_balance": {
               "BNB": "0.1",
		        "TRX": "0.02",
		        "USDT": 0
            }
        },
        {
            "id": 3,
            "address": "0x2e2428758b5cb41b626fce9cbd30e4db99a04d6a",
            "label": "Hotwallet-1",
            "address_id": 3,
            "date": "2021-09-10T14:29:15+0000",
            "db_balance": {
                "BNB": "0.1",
		        "TRX": "0.03",
		        "USDT": "256"
            }
        },
        {
            "id": 4,
            "address": "0x4c5bb3c441950a993a80cd2d5d0cad35df2cf99d",
            "label": "Hotwallet-1",
            "address_id": 4,
            "date": "2021-09-10T14:29:19+0000",
            "db_balance": {
                "BNB": "2",
		        "TRX": 0,
		        "USDT": 0
            }
        }
    ],
    "success": true,
    "status": 200
}
    

Address List

POST https://bnb-wallet.reza.biz/api/address-list

Name Type Mandatory Description
page integer yes
limit integer yes min 1 , max 100


Response:
{
	"items": [
		{
			"id": 1405,
			"address": "0x4c5bb3c441950a993a80cd2d5d0cad35df2cf99d",
			"label": "1",
			"address_id": 1405,
			"date": "2021-07-21T09:46:27+0200",
			"db_balance": {
				"BNB": "2",
		        "TRX": 0,
		        "USDT": 0
			}
		},
		{
			"id": 1406,
			"address": "0xf44c246708ead8226d3b9a003e45e505e6330bfe",
			"label": "1",
			"address_id": 1406,
			"date": "2021-07-21T09:46:27+0200",
			"db_balance": {
				"BNB": "3",
		        "TRX": "0.02",
		        "USDT": 0
			}
		},
		{
			"id": 1746,
			"address": "0x2e2428758b5cb41b626fce9cbd30e4db99a04d6a",
			"label": "",
			"address_id": 1746,
			"date": "2021-07-22T13:32:57+0200",
			"db_balance": {
				"BNB": "2",
		        "TRX": 0,
		        "USDT": 0
			}
		},
		{
			"id": 1747,
			"address": "0x0f0e57df6224ac19b28cb7a868fbe6f1915241c4",
			"label": "",
			"address_id": 1747,
			"date": "2021-07-22T13:33:07+0200",
			"db_balance": {
				"BNB": "2",
		        "TRX": 0,
		        "USDT": "256"
			}
		}
	],
	"total": 24,
	"limit": 4,
	"page": 1,
	"success": true,
	"status": 200
}
    

Transaction List

POST https://bnb-wallet.reza.biz/api/transaction-list

Name Type Mandatory Description
page integer yes
limit integer yes
address_id integer no address_id is unique that returned in generate address API
type string no deposit or withdraw
txid string no Network txid
coin string no BNB , TRX, USDT
status string no Network status Success Fail


Response:
{
    "items": [
        {
            "id": 1,
            "txid": "0x3e22038f5294c4540fa6f7667c37bc549de84699b7b4039766fde31616d2cf1c",
            "blockchain_time": 1631221317,
            "blockchain_date": "2021-09-09T21:01:57+0000",
            "fee": "0",
            "fee_coin": "BNB",
            "status": "Success",
            "owner_address": "0xf44c246708ead8226d3b9a003e45e505e6330bfe",
            "amount": "2",
            "to_address": "0x2e2428758b5cb41b626fce9cbd30e4db99a04d6a",
            "coin": "BNB",
            "address_id": 1,
            "address_label": "init",
            "type": "deposit",
            "block_id": 33569657,
            "time": 1631221383,
            "date": "2021-09-09T21:03:03+0000"
        },
        {
            "id": 2,
            "txid": "0x209cf32191e1799898e526dd528a44060941ab509c178942f10a11b71e0d4aac",
            "blockchain_time": 1631221458,
            "blockchain_date": "2021-09-09T21:04:18+0000",
            "fee": "0",
            "fee_coin": "BNB",
            "status": "Success",
            "owner_address": "0x2e2428758b5cb41b626fce9cbd30e4db99a04d6a",
            "amount": "1",
            "to_address": "0xf44c246708ead8226d3b9a003e45e505e6330bfe",
            "coin": "BNB",
            "address_id": 1,
            "address_label": "init",
            "type": "withdraw",
            "block_id": 33569704,
            "time": 1631221562,
            "date": "2021-09-09T21:06:02+0000"
        },
        {
            "id": 3,
            "txid": "0x209cf32191e1799898e526dd528a44060941ab509c178942f10a11b71e0d4aad",
            "blockchain_time": 1631221533,
            "blockchain_date": "2021-09-09T21:05:33+0000",
            "fee": "0",
            "fee_coin": "BNB",
            "status": "Success",
            "owner_address": "0xf44c246708ead8226d3b9a003e45e505e6330bfe",
            "amount": "1",
            "to_address": "0x2e2428758b5cb41b626fce9cbd30e4db99a04d6a",
            "coin": "BNB",
            "address_id": 1,
            "address_label": "init",
            "type": "withdraw",
            "block_id": 33569729,
            "time": 1631221622,
            "date": "2021-09-09T21:07:02+0000"
        }
    ],
    "total": 7,
    "limit": 3,
    "page": 1,
    "success": true,
    "status": 200
}
    


Webhook Params

After each withdraw and deposit on wallet , system send details with post to your webhook URL .
There is a list of params that will be send!

Name Type Sample Description
id integer 1 Transaction Id in wallet db
txid string 0x209cf32191e1799898e526dd528a44060941ab509c178942f10a11b71e0d4aac network txid
blockchain_time integer 1631221680 UNIX timestamp
blockchain_date string 2021-09-09T21:08:00+0000 date format in ISO8601
fee float 0 Fee used for withdraw
fee_coin string BNB
status string Success Success is means everything is fine!
owner_address string 0xf44c246708ead8226d3b9a003e45e505e6330bfe Sender Account
amount float 2.1
coin string BNB BNB , TRX , USDT
to_address string 0x2e2428758b5cb41b626fce9cbd30e4db99a04d6a receiver address
address_id integer 2 related address
address_label string hotwallet6
type string withdraw deposit,withdraw
block_id integer 33569778 block id on the network
time integer 1631221690 UNIX timestamp
date string 2021-09-09T21:08:10+0000 date format in ISO8601


Any question?

[email protected]


SDK

PHP SDK