fireblocks-sdk-py
fireblocks-sdk-py copied to clipboard
Official Python SDK for Fireblocks API
The Official Python SDK for Fireblocks API
About
This repository contains the official Python SDK for Fireblocks API. For the complete API reference, go to the API reference.
Usage
Before You Begin
Make sure you have the credentials for Fireblocks API Services. Otherwise, please contact Fireblocks support for further instructions on how to obtain your API credentials.
Requirements
An officially supported version of Python, as per the official lifecycle: https://devguide.python.org/versions
Installation
pip3 install fireblocks-sdk
Importing Fireblocks SDK
from fireblocks_sdk import FireblocksSDK
fireblocks = FireblocksSDK(private_key, api_key)
You can also pass additional arguments:
fireblocks = FireblocksSDK(private_key, api_key, api_base_url="https://api.fireblocks.io", timeout=2.0, anonymous_platform=True)
Using Fireblocks Tokenization endpoints
from fireblocks_sdk import FireblocksSDK, FireblocksTokenization, \
ContractUploadRequest
fireblocks = FireblocksSDK(private_key, api_key)
# Get linked tokens
tokens=fireblocks.get_linked_tokens()
# Upload a private contract
contractTemplateRequest=ContractUploadRequest(
name='New Contract Template',
description='description',
longDescription='long description',
bytecode='0x12345',
sourcecode= 'sourcecode',
initializationPhase='ON_DEPLOYMENT',
abi=[]
)
template=fireblocks.upload_contract_template(contractTemplateRequest)
print(template['id'])