Fireblocks Web3 Provider
Fireblocks EIP-1193 Compatible Ethereum JavaScript Provider
Installation
npm install @fireblocks/fireblocks-web3-provider
Setup
import { FireblocksWeb3Provider, ChainId, ApiBaseUrl } from "@fireblocks/fireblocks-web3-provider";
const eip1193Provider = new FireblocksWeb3Provider({
privateKey: process.env.FIREBLOCKS_API_PRIVATE_KEY_PATH,
apiKey: process.env.FIREBLOCKS_API_KEY,
vaultAccountIds: process.env.FIREBLOCKS_VAULT_ACCOUNT_IDS,
chainId: ChainId.GOERLI,
logTransactionStatusChanges: true,
})
Usage with ethers.js
npm install ethers@5
import * as ethers from "ethers"
const provider = new ethers.providers.Web3Provider(eip1193Provider);
Usage with web3.js
npm install web3
import Web3 from "web3";
const web3 = new Web3(eip1193Provider);
API Documentation
new FireblocksWeb3Provider(config)
This class is an EIP-1193 Compatible Ethereum JavaScript Provider powered by the Fireblocks API
FireblocksProviderConfig
type FireblocksProviderConfig = {
apiKey: string,
privateKey: string,
chainId?: ChainId,
rpcUrl?: string,
vaultAccountIds?: number | number[] | string | string[],
apiBaseUrl?: ApiBaseUrl | string,
fallbackFeeLevel?: FeeLevel,
note?: string,
pollingInterval?: number,
oneTimeAddressesEnabled?: boolean,
externalTxId?: (() => string) | string,
userAgent?: string,
assetId?: string,
logTransactionStatusChanges?: boolean,
logRequestsAndResponses?: boolean,
enhancedErrorHandling?: boolean,
proxyPath?: string
}