Releases: bitcart/bitcart-sdk
Version 0.4.0
Version 0.4.0
Full fee control and easy lightning.
Fee control:
Now you can pass fee parameter to pay_to function to specify manual fee, or
callback function like
def fee_calc(size):
return size/4
btc.pay_to(address, amount, fee=fee_calc)
Getting size as argument and returning fee, it can be any function of your choice.
Another parameter, broadcast, was added. By default transaction is submitted to network, but if you set broadcast to False raw transaction will be returned. See API reference in docs for details.
Easy lightning:
Now lightning is part of btc daemon and BTC coin class, just launch the same daemon and use all lightning functions!
After upgrade, try for example, this:
>>> btc.node_id
'030ff29580149a366bdddf148713fa808f0f4b934dccd5f7820f3d613e03c86e55'
Lightning is enabled in your daemon by default, disable it with BTC_LIGTNING=false environment variable.
If lightning is disabled, bitcart.errors.LightningDisabledError
is raised.
Version 0.3.1 Asyncio
Version 0.3.1 Asyncio:
support for async with context managers.
It is a breaking change.
You must close the underlying aiohttp client connections in either of two ways, via context manager:
async with btc:
print(await btc.balance())
Or, if you don't use context managers, close it manually:
print(await btc.balance())
await btc.close()
Version 0.3.0 Asyncio
Version 0.3.0 Asyncio:
This version adds new events-based API to get updates.
To register a callback function, use add_event_handler(events, func)
function or @on
decorator
Example:
@btc.on("new_transaction")
async def handler(event, tx):
print(event)
print(tx)
print(await btc.get_tx(tx))
btc.poll_updates()
The following code would print
new_transaction
some_tx_hash
dict of tx hash data
On each transaction in your wallet.
btc.on or add_event_handler can also accept a list of events, for example:
async def handler(event, **kwargs):
print(event, kwargs)
Getting updates is the same, via btc.poll_updates().
There are two kinds of events for now:
new_block which gets emitted on every new block, passing height
argument to callback function
new_transaction which gets emitted on every new transaction passing tx
argument as tx_hash of new transaction to callback_function.
Callback function, as with old notify api can be either sync or async.
Old @btc.notify
api is removed.
Version 0.3.0
Version 0.3.0:
This version adds new events-based API to get updates.
To register a callback function, use add_event_handler(events, func)
function or @on
decorator
Example:
@btc.on("new_transaction")
def handler(event, tx):
print(event)
print(tx)
print(btc.get_tx(tx))
btc.poll_updates()
The following code would print
new_transaction
some_tx_hash
dict of tx hash data
On each transaction in your wallet.
btc.on or add_event_handler can also accept a list of events, for example:
def handler(event, **kwargs):
print(event, kwargs)
Getting updates is the same, via btc.poll_updates().
There are two kinds of events for now:
new_block which gets emitted on every new block, passing height
argument to callback function
new_transaction which gets emitted on every new transaction passing tx
argument as tx_hash of new transaction to callback_function.
Old @btc.notify
api is removed.
Version 0.2.7 Asyncio
Version 0.2.7 Asyncio
Fixes deprecated parameter from aiohttp
Now decimal sending works
Version 0.2.6 Asyncio
Version 0.2.6 Asyncio
Fix warning raising(no stacklevel passed)
Now usable in uvloop - del method now works and doesn't raise SystemError
Version 0.2.5
Version 0.2.5
Fix warning raising(no stacklevel)
Version 0.2.5 Asyncio
Thi is a hotfix for del method, now it uses create_task.
Version 0.2.4 Async
This is the first release of bitcart sdk asyncio version.
All APIs remained the same, just use async/await. For more details check the readme.
Version 0.2.4
Version 0.2.4: Add ability to get fiat price in most currencies
Now rate() method accepts optional currency argument to get it in currency other than USD.
New method: list_fiat() to get list of all supported fiat currencies.