fireblocks / fireblocks-defi-sdk-py Goto Github PK
View Code? Open in Web Editor NEWFireblocks DeFi Python SDK
License: MIT License
Fireblocks DeFi Python SDK
License: MIT License
from web3 import Web3
from web3_bridge import Web3Bridge
from chain import Chain
from fireblocks_sdk import FireblocksSDK, TransferPeerPath, TRANSACTION_STATUS_CONFIRMED, TRANSACTION_STATUS_CANCELLED, TRANSACTION_STATUS_REJECTED, TRANSACTION_STATUS_FAILED, VAULT_ACCOUNT,\
TRANSACTION_MINT, TRANSACTION_BURN, FireblocksApiException, DestinationTransferPeerPath, ONE_TIME_ADDRESS
these import from the examples can not work.
"chain" and "web3_bridge" are files within the fireblocks_defi_sdk_py package and have to be imported like this:
from fireblocks_defi_sdk_py.web3_bridge import Web3Bridge
from fireblocks_defi_sdk_py.chain import Chain
Because fo the way type hinting is used in this definition
def safe_batch_transfer_from(self, to_address: str, token_ids: list[int], values: list[int], from_address: str = "",
data: bytes = bytearray(), note: str = ""):
in file: fireblocks_defi_sdk_py/examples/basic_example.py
Python 3.9 or above is needed in order to run this code but the documentation indicates that python 3.6 is sufficient.
Without installing py-evm, running the examples raises an error:
"TypeError: MockBackend.estimate_gas() takes 2 positional arguments but 3 were given"
After installing via "pip install py-evm" the error is resolved
fireblocks-defi-sdk-py/fireblocks_defi_sdk_py/web3_bridge.py
Lines 91 to 110 in 70a98e3
These print statements make it extra difficult for output be properly logged. They should either be done with the logging package or just not at all, since this isn't a presentation layer. In particular, the \r
special character to make it look self-erasing ruins my log files.
I'm confused as to why the initial call to Why doesn't the initial POST return an HTTP 202 status to indicate that it wasn't completed, only accepted? Also, SUBMIT_TIMEOUT
is actually a retry loop, not a time in seconds, which is misleading. It will stop retrying after SUBMIT_TIMEOUT
number of loops, which is guaranteed to be significantly longer than SUBMIT_TIMEOUT*4
since the very minimum amount of time it will take is 4 seconds from the time.sleep(4)
statement.
Also this function returns str
and not dict
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.