Simple API for Eurabit Wallet users to send and receive bitcoin payments.
The Eurabit Wallet API provides a simple interface Merchants can use to programmatically interact with their wallet.
To use this API, you will need to run small local service which be responsible for managing your Eurabit Wallet. Your application interacts with this service locally via HTTP API calls Click here for complete setup instructions on GitHub.
Send bitcoin from your wallet to another bitcoin address. All transactions include a 0.0001 BTC miners fee. All bitcoin values are in Satoshi i.e. divide by 100000000 to get the amount in BTC. The Base URL for all requests: https://eurabit.info/merchant/$guid/. $guid should be replaced with your Eurabit Wallet identifier (found on the login page). http://localhost:88000/merchant/$guid/payment?password=$main_password&second_password=$second_password&to=$address&amount=$amount&from=$from&fee=$fee
Response: 200 OK, application/json
{
"message": "Response Message",
"tx_hash": "Transaction Hash",
"notice": "Additional Message"
}
{
"message": "Sent 0.1 BTC to 1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq",
"tx_hash": "f322d01ad784e5deeb25464a5781c3b20971c1863679ca506e702e3e33c18e9c",
"notice": "Some funds are pending confirmation and cannot be spent yet (Value 0.001 BTC)"
}
Create eurabit wallets programmatically The create_wallet method can be used to create a new eurabit.info bitcoin wallet.
Response: 200 OK, application/json
{
"guid": "4b8cd8e9-9480-44cc-b7f2-527e98ee3287",
"address": "12AaMuRnzw6vW6s2KPRAGeX53meTf8JbZS",
"label": "Main address"
}
Send a transaction to multiple recipients in the same transaction.
http://localhost:88000/merchant/$guid/sendmany?password=$main_password&second_password=$second_password&recipients=$recipients&fee=$fee
Response: 200 OK, application/json
{
"1JzSZFs2DQke2B3S4pBxaNaMzzVZaG4Cqh": 100000000,
"12Cf6nCcRtKERh9cQm3Z29c9MWvQuFSxvT": 1500000000,
"1dice6YgEVBf88erBFra9BHf6ZMoyvG88": 200000000
}
The above example would send 1 BTC to 1JzSZFs2DQke2hgrr6BxaNaMzzVZaG4Cqh, 15 BTC to 12Cf6nCcRtKERh9cQm3Z29c9MWvQuFSxvT and 2 BTC to 1dice6YgEVBf88hynBFra9BHf6ZMoyvG88 in the same transaction.
Response: 200 OK, application/json
{
"message": "Response Message",
"tx_hash": "Transaction Hash"
}
{
"message": "Sent To Multiple Recipients",
"tx_hash": "f322d01ad784e5deeb25464a5781c3b20971c1863679ca506e702e3e33c18e9c"
}
$guid="GUID_HERE";
$firstpassword="PASSWORD_HERE";
$secondpassword="PASSWORD_HERE";
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode('{
"'.$addressa.'": '.$amounta.',
"'.$addressb.'": '.$amountb.'
$json_url =
"http://localhost:88000/merchant/$guid/sendmany?password=$firstpassword&second_password=$secondpassword&recipients=$recipients";
$json_data = file_get_contents($json_url);
$json_feed = json_decode($json_data);
$message = $json_feed-{'>'}message;
$txid = $json_feed-{'>'}tx_hash;
Fetch the balance of a wallet. This should be used as an estimate only and will include unconfirmed transactions and possibly double spends.http://localhost:88000/merchant/$guid/balance?password=$main_password
Response: 200 OK, application/json
{
"balance": "Wallet Balance in Satoshi"
}
{
"balance": 1000
}
List all active addresses in a wallet. Also includes a 0 confirmation balance which should be used as an estimate only and will include unconfirmed transactions and possibly double spends.
http://localhost:88000/merchant/$guid/list?password=$main_password
Response: 200 OK, application/json
{
"addresses": [
{
"balance": 1400938800,
"address": "1Q1AtvCyKhtveGm3187mgNRh5YcukUWjQC",
"label": "SMS Deposits",
"total_received": 5954572400
},
{
"balance": 79434360,
"address": "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq",
"label": "My Wallet",
"total_received": 4538800048335
},
{
"balance": 0,
"address": "17p49XUC2fw4Fn53WjZqYAm4APKqhNPEkY",
"total_received": 0
}
]
}
Retrieve the balance of a bitcoin address. Querying the balance of an address by label is depreciated. http://localhost:88000/merchant/$guid/address_balance?password=$main_password&address=$address
Response: 200 OK, application/json
{
"address": "The Bitcoin Address Generated",
"label": "The Address Label"
}
{
"address": "18fyqiZzndTxdVg569ouRogB4uFj86JJiy",
"label": "Order No : 1234"
}
http://localhost:88000/merchant/$guid/new_address?password=$main_password&second_password=$second_password&label=$label
Response: 200 OK, application/json
{
"address": "The Bitcoin Address Generated",
"label": "The Address Label"
}
{
"address": "18fyqiZzndTxdVo7g9ouRogB4uFj86JJiy",
"label": "Order No : 1234"
}
To improve wallet performance addresses which have not been used recently should be moved to an archived state. They will still be held in the wallet but will no longer be included in the "list" or "list-transactions" calls.
For example if an invoice is generated for a user once that invoice is paid the address should be archived.
Or if a unique bitcoin address is generated for each user, users who have not logged in recently (~30 days) their addresses should be archived. http://localhost:88000/merchant/$guid/archive_address?password=$main_password&second_password=$second_password&address=$address
Response: 200 OK, application/json
{
"archived": "18fyqiZzndTxdVo7g9ouRogB4uFj86JJiy"
}
Unarchive an address. Will also restore consolidated addresses (see below). http://localhost:8800/merchant/$guid/unarchive_address?password=$main_password&second_password=$second_password&address=$address
Response: 200 OK, application/json
{
"active": "18fyqiZzndTxdVjhtg9ouRogB4uFj86JJiy"
}
Low-latency streaming socket channel providing data on new blocks and transactions. Subscribe for notifications on blocks, transactions, or addresses, and receive JSON objects describing a transaction block when an event occurs.
Simple plain text API for querying eurabit data like hashrate, difficulty, block height and more.