Signing with Fireblocks
The FireblocksSigner in the Chorus One SDK is a specialized implementation of the Signer interface that integrates with the Fireblocks platform.
Fireblocks is known for its advanced security features, including multi-party computation (MPC) and secure wallet infrastructure, making it an ideal choice for enterprises requiring robust security and compliance.
Obtaining Fireblocks Credentials
Before initializing the FireblocksSigner, you will need to acquire the necessary credentials from Fireblocks.
This includes the
apiSecretKey,apiKey,vaultName, andassetId.
Let's explain a bit more about what those are below:
apiSecretKey: Fireblocks API Secret key. Generate this by creating an RSA key file as described in the Fireblocks Quickstart Guide.
apiKey: Fireblocks API Key. Obtain this from the Fireblocks platform as detailed in the Fireblocks Quickstart Guide.
vaultName: The name of the Fireblocks vault where the assets are stored.
assetId: The identifier for the asset you intend to manage. You can get this from the Fireblocks platform.
addressDerivationFn: A function that derives the address from the public key, implementing the
AddressDerivationFntype and provided by Staker classes as static methods, e.g.SolanaStaker.getAddressDerivationFn,NearStaker.getAddressDerivationFn, etc.
type AddressDerivationFn = (publicKey: Uint8Array, hdPath: string) => Array<string>Setting Up the FireblocksSigner
With your credentials ready, you can now configure and initialize the FireblocksSigner:
import { SolanaStaker } from '@chorus-one/solana'
import { FireblocksSigner } from '@chorus-one/signer-fireblocks'
const signer = new FireblocksSigner({
apiSecretKey: 'your-api-secret-key',
apiKey: 'your-api-key',
vaultName: 'your-vault-name',
assetId: 'SOL',
addressDerivationFn: SolanaStaker.getAddressDerivationFn()
})
await signer.init()Ethereum Contract Call Signing
The contractCall method on FireblocksSigner enables secure Ethereum smart contract interactions via Fireblocks, supporting both native and pooled staking flows.
How contractCall Works
contractCall WorkscontractCall submits your contract call as a Fireblocks transaction and manages the signing and execution process end-to-end:
Under the Hood
Creates Fireblocks Transaction: Builds a transaction with
CONTRACT_CALLoperation, placing your contract call data inextraParameters.contractCallData.Polls for Status: Continuously checks Fireblocks for transaction completion or failure.
Returns Status: Responds with:
status: 'success' or 'failure'receipt: Full Fireblocks transaction detailsreason: Error description if failed
Error States
Possible failure statuses include:
BLOCKED: Blocked by Fireblocks policyFAILED: Execution failedCANCELLED: Transaction cancelledREJECTED: Rejected by policyTIMEOUT: Transaction exceeded allowed time (configurable viatimeoutparameter)
Further Reading
Last updated
Was this helpful?