Overview
Connectors provide the interface between the Fusion SDK and blockchain providers. They handle signing typed data and making contract calls.BlockchainProviderConnector
Interface that all blockchain provider connectors must implement.Methods
Sign EIP-712 typed dataParameters:
walletAddress(string): The wallet address to sign withtypedData(EIP712TypedData): The typed data to sign
Execute an eth_call to read contract stateParameters:
contractAddress(string): The contract address to callcallData(string): The encoded call data
PrivateKeyProviderConnector
A blockchain provider connector that uses a private key for signing.Constructor
The private key to use for signing (with or without 0x prefix)
A Web3-like provider for making contract calls
Example
Methods
Parameters:
walletAddress(string): Not used, signature is created from private keytypedData(EIP712TypedData): The typed data to sign
Parameters:
contractAddress(string): The contract address to callcallData(string): The encoded call data
Web3ProviderConnector
A blockchain provider connector that uses a Web3 provider’s signing capabilities.Constructor
A Web3-like provider for signing and making contract calls
Example
Methods
Uses eth_signTypedData_v4 RPC methodParameters:
walletAddress(string): The wallet address to sign withtypedData(EIP712TypedData): The typed data to sign
Parameters:
contractAddress(string): The contract address to callcallData(string): The encoded call data
Web3Like Interface
A minimal Web3 provider interface compatible with Web3.js.Execute an eth_call to read contract stateParameters:
transactionConfig(TransactionConfig): Transaction configuration withtoanddatafields
Extend the Web3 instance with custom methodsParameters:
extension(unknown): Extension configuration
TransactionConfig
The encoded call data
The contract address to call
Provider Compatibility
TheWeb3Like interface is compatible with:
- Web3.js (v1.x and v4.x)
- Ethers.js providers (wrapped)
- MetaMask and other browser wallets
- Custom RPC providers