Nexera-Fi SDK Usage Guide
This section provides a step-by-step guide for initializing the Nexera-Fi SDK and covers fundamental configurations needed for TypeScript and Python projects.
Typescript SDK Usage
In TypeScript projects, start by configuring your Ethers.js Provider and Signer instances. Afterward, proceed to create an instance of the NexeraFiSDK class.
General Methods
getAdapters
Returns a collection of Nexera-Fi Adapters. The collection provides a structured way to access each Adapter's following data:
- Adapter's address (for the blockchain specified by
chainId
) - Adapter's set of basic operations (if available)
- Adapter's set of extra operations (if available)
- ABI encoded data necessary for initializing the Adapter (example)
getOrchestrator
To interact with your Orchestrator instance, ensure proper configuration of getOrchestrator
by specifying:
- The address of the target Orchestrator contract.
- Either an Ethers.js Provider for read-only operations or a Signer for both read and transactional operations.
deployOrchestrator
Provides a function to seamlessly deploy your Orchestrator on-chain.
For a detailed example of how to use this function, see here.
executeInMicroservice
Returns a function for executing a set of on-chain actions through an Orchestrator instance in a single transaction, with transaction delegation to an external microservice.
For a detailed example of how to use this function, see here.
getSubgraph
- Subgraph Client
To access the Nexera-Fi Subgraphs API, ensure proper configuration of getSubgraph
by specifying:
- The chain ID of the target blockchain.
You can now consume the Subgraph API through the client-side queries to access on-chain data and event-driven entities.
Python SDK Usage
For Python projects, start by importing the NexeraFi_SDK package and configuring your Web3.py HTTP Provider.
General Methods
get_adapter_names
Returns a list of strings containing the names of the supported Adapters.
get_supported_chain_ids
Returns a list of integers representing the supported chain IDs.
get_operations
Returns an enumeration of Orchestrator base operations.
get_base_operations_for_adapters
Returns an enumeration of base operations specific to each supported Adapter.
get_extra_operations_for_adapters
Returns an enumeration of extra operations specific to each supported Adapter
get_adapter_initialize_data
Returns Adapters' ABI encoded initialize data for a given chain ID.
get_adapter_addresses
Returns Adapters' addresses for a given chain ID.
get_orchestrator
Returns a Web3 contract instance of the Orchestrator configured at the provided address.
get_orchestrator_factory
Returns a Web3 contract instance of the OrchestratorFactory configured at the address linked to the provided chain ID.