UNPKG

@kilnfi/sdk

Version:

JavaScript sdk for Kiln API

406 lines 18.8 kB
import { type AssetTypeResponse, type ConfigurationOptions, Fireblocks, type PublicKeyInformation, type TransactionResponse } from '@fireblocks/ts-sdk'; import type { Client } from 'openapi-fetch'; import { type FireblocksAssetId, FireblocksSigner } from './fireblocks_signer.js'; import type { components, paths } from './openapi/schema.js'; export type FireblocksIntegration = ({ config?: never; instance: Fireblocks; } | { config: ConfigurationOptions; instance?: never; }) & { vaultId: `${number}`; }; export declare class FireblocksService { client: Client<paths>; constructor(client: Client<paths>); /** * Retrieve a fireblocks SDK from a Fireblocks integration */ getSdk(integration: FireblocksIntegration): Fireblocks; /** * Retrieve a fireblocks signer from a Fireblocks integration */ getSigner(integration: FireblocksIntegration): FireblocksSigner; /** * Get fireblocks wallet pubkey compressed */ getPubkey(integration: FireblocksIntegration, assetId: (string & {}) | FireblocksAssetId): Promise<PublicKeyInformation>; /** * List Fireblocks supported assets */ getAssets(integration: FireblocksIntegration): Promise<AssetTypeResponse[]>; /** * Sign a Solana transaction on Fireblocks */ signSolTx(integration: FireblocksIntegration, tx: components['schemas']['SOLStakeTx'], assetId: 'SOL_TEST' | 'SOL', note?: string): Promise<{ signed_tx: { data: components['schemas']['SOLPreparedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Create a Cardano transaction in Fireblocks without waiting for completion * * The payload must not contain an inputsSelection: it is only meaningful for * Fireblocks-built transfers (not RAW signing, where the tx is already built) * and the Fireblocks API rejects ADA RAW transactions carrying it with * HTTP 500 {"message":"Unexpected error","code":1404}. */ createAdaTx(integration: FireblocksIntegration, tx: components['schemas']['ADAUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a Cardano transaction to complete and prepare it for broadcast */ waitForAdaTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['ADAUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['ADASignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a Cardano transaction on Fireblocks */ signAdaTx(integration: FireblocksIntegration, tx: components['schemas']['ADAUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['ADASignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Create an ATOM transaction in Fireblocks without waiting for completion */ createAtomTx(integration: FireblocksIntegration, tx: components['schemas']['ATOMUnsignedTx'] | components['schemas']['ATOMStakeUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for an ATOM transaction to complete and prepare it for broadcast */ waitForAtomTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['ATOMUnsignedTx'] | components['schemas']['ATOMStakeUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['ATOMSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign an ATOM transaction on Fireblocks (combines createAtomTx and waitForAtomTxCompletion) */ signAtomTx(integration: FireblocksIntegration, tx: components['schemas']['ATOMUnsignedTx'] | components['schemas']['ATOMStakeUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['ATOMSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a DYDX transaction on Fireblocks */ /** * Create a DYDX transaction in Fireblocks without waiting for completion */ createDydxTx(integration: FireblocksIntegration, tx: components['schemas']['DYDXUnsignedTx'] | components['schemas']['DYDXStakeUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a DYDX transaction to complete and prepare it for broadcast */ waitForDydxTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['DYDXUnsignedTx'] | components['schemas']['DYDXStakeUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['DYDXSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a DYDX transaction on Fireblocks (combines createDydxTx and waitForDydxTxCompletion) */ signDydxTx(integration: FireblocksIntegration, tx: components['schemas']['DYDXUnsignedTx'] | components['schemas']['DYDXStakeUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['DYDXSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a FET transaction on Fireblocks */ /** * Create a FET transaction in Fireblocks without waiting for completion */ createFetTx(integration: FireblocksIntegration, tx: components['schemas']['FETUnsignedTx'] | components['schemas']['FETStakeUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a FET transaction to complete and prepare it for broadcast */ waitForFetTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['FETUnsignedTx'] | components['schemas']['FETStakeUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['FETSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a FET transaction on Fireblocks (combines createFetTx and waitForFetTxCompletion) */ signFetTx(integration: FireblocksIntegration, tx: components['schemas']['FETUnsignedTx'] | components['schemas']['FETStakeUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['FETSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a INJ transaction on Fireblocks */ /** * Create a INJ transaction in Fireblocks without waiting for completion */ createInjTx(integration: FireblocksIntegration, tx: components['schemas']['INJUnsignedTx'] | components['schemas']['INJStakeUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a INJ transaction to complete and prepare it for broadcast */ waitForInjTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['INJUnsignedTx'] | components['schemas']['INJStakeUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['INJSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a INJ transaction on Fireblocks (combines createInjTx and waitForInjTxCompletion) */ signInjTx(integration: FireblocksIntegration, tx: components['schemas']['INJUnsignedTx'] | components['schemas']['INJStakeUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['INJSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a CRO transaction on Fireblocks */ /** * Create a CRO transaction in Fireblocks without waiting for completion */ createCroTx(integration: FireblocksIntegration, tx: components['schemas']['CROUnsignedTx'] | components['schemas']['CROStakeUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a CRO transaction to complete and prepare it for broadcast */ waitForCroTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['CROUnsignedTx'] | components['schemas']['CROStakeUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['CROSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a CRO transaction on Fireblocks (combines createCroTx and waitForCroTxCompletion) */ signCroTx(integration: FireblocksIntegration, tx: components['schemas']['CROUnsignedTx'] | components['schemas']['CROStakeUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['CROSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a NOBLE transaction on Fireblocks */ /** * Create a NOBLE transaction in Fireblocks without waiting for completion */ createNobleTx(integration: FireblocksIntegration, tx: components['schemas']['DYDXUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a NOBLE transaction to complete and prepare it for broadcast */ waitForNobleTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['DYDXUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['DYDXSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a NOBLE transaction on Fireblocks (combines createNobleTx and waitForNobleTxCompletion) */ signNobleTx(integration: FireblocksIntegration, tx: components['schemas']['DYDXUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['DYDXSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a OSMO transaction on Fireblocks */ /** * Create a OSMO transaction in Fireblocks without waiting for completion */ createOsmoTx(integration: FireblocksIntegration, tx: components['schemas']['OSMOUnsignedTx'] | components['schemas']['OSMOStakeUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a OSMO transaction to complete and prepare it for broadcast */ waitForOsmoTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['OSMOUnsignedTx'] | components['schemas']['OSMOStakeUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['OSMOSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a OSMO transaction on Fireblocks (combines createOsmoTx and waitForOsmoTxCompletion) */ signOsmoTx(integration: FireblocksIntegration, tx: components['schemas']['OSMOUnsignedTx'] | components['schemas']['OSMOStakeUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['OSMOSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a TIA transaction on Fireblocks */ /** * Create a TIA transaction in Fireblocks without waiting for completion */ createTiaTx(integration: FireblocksIntegration, tx: components['schemas']['TIAUnsignedTx'] | components['schemas']['TIAStakeUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a TIA transaction to complete and prepare it for broadcast */ waitForTiaTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['TIAUnsignedTx'] | components['schemas']['TIAStakeUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['TIASignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a TIA transaction on Fireblocks (combines createTiaTx and waitForTiaTxCompletion) */ signTiaTx(integration: FireblocksIntegration, tx: components['schemas']['TIAUnsignedTx'] | components['schemas']['TIAStakeUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['TIASignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign an ETH transaction with given integration using Fireblocks raw signing */ signEthTx(integration: FireblocksIntegration, tx: components['schemas']['ETHUnsignedTx'], assetId: 'ETH_TEST_HOODI' | 'ETH', note?: string): Promise<{ signed_tx: { data: components['schemas']['ETHSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign and broadcast an ETH transaction with given integration using Fireblocks contract call feature */ signAndBroadcastEthTx(integration: FireblocksIntegration, tx: components['schemas']['ETHUnsignedTx'], assetId: 'ETH_TEST_HOODI' | 'ETH', fireblocksDestinationId: string, note?: string): Promise<TransactionResponse>; /** * Sign a POL transaction with given integration using Fireblocks raw signing */ signPolTx(integration: FireblocksIntegration, tx: components['schemas']['POLUnsignedTx'], assetId: 'ETH_TEST5' | 'ETH', note?: string): Promise<{ signed_tx: { data: components['schemas']['POLSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign and broadcast a POL transaction with given integration using Fireblocks contract call feature */ signAndBroadcastPolTx(integration: FireblocksIntegration, tx: components['schemas']['POLUnsignedTx'], assetId: 'ETH_TEST5' | 'ETH', fireblocksDestinationId: string, note?: string): Promise<TransactionResponse>; /** * Create a TON transaction in Fireblocks without waiting for completion */ createTonTx(integration: FireblocksIntegration, tx: components['schemas']['TONTx'], assetId: 'TON_TEST' | 'TON', note?: string): Promise<TransactionResponse>; /** * Wait for a TON transaction to complete and prepare it for broadcast */ waitForTonTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['TONTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['TONPreparedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a TON transaction on Fireblocks */ signTonTx(integration: FireblocksIntegration, tx: components['schemas']['TONTx'], assetId: 'TON_TEST' | 'TON', note?: string): Promise<{ signed_tx: { data: components['schemas']['TONPreparedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Create a XTZ transaction in Fireblocks without waiting for completion */ createXtzTx(integration: FireblocksIntegration, tx: components['schemas']['XTZUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a XTZ transaction to complete and prepare it for broadcast */ waitForXtzTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['XTZUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['XTZSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a XTZ transaction on Fireblocks (combines createXtzTx and waitForXtzTxCompletion) */ signXtzTx(integration: FireblocksIntegration, tx: components['schemas']['XTZUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['XTZSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Create a NEAR transaction in Fireblocks without waiting for completion */ createNearTx(integration: FireblocksIntegration, tx: components['schemas']['NEARTx'], assetId: 'NEAR_TEST' | 'NEAR', note?: string): Promise<TransactionResponse>; /** * Wait for a NEAR transaction to complete and prepare it for broadcast */ waitForNearTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['NEARTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['NEARSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a NEAR transaction on Fireblocks (combines createNearTx and waitForNearTxCompletion) */ signNearTx(integration: FireblocksIntegration, tx: components['schemas']['NEARTx'], assetId: 'NEAR_TEST' | 'NEAR', note?: string): Promise<{ signed_tx: { data: components['schemas']['NEARSignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a Trx transaction on Fireblocks */ createTrxTx(integration: FireblocksIntegration, tx: components['schemas']['TRXUnsignedTx'], note?: string): Promise<TransactionResponse>; waitForTrxTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['TRXUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['TRXPreparedTx']; }; fireblocks_tx: TransactionResponse; }>; signTrxTx(integration: FireblocksIntegration, tx: components['schemas']['TRXUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['TRXPreparedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a SEI transaction on Fireblocks */ /** * Create a SEI transaction in Fireblocks without waiting for completion */ createSeiTx(integration: FireblocksIntegration, tx: components['schemas']['SEIUnsignedTx'] | components['schemas']['SEIStakeUnsignedTx'], note?: string): Promise<TransactionResponse>; /** * Wait for a SEI transaction to complete and prepare it for broadcast */ waitForSeiTxCompletion(integration: FireblocksIntegration, tx: components['schemas']['SEIUnsignedTx'] | components['schemas']['SEIStakeUnsignedTx'], fbTx: TransactionResponse): Promise<{ signed_tx: { data: components['schemas']['SEISignedTx']; }; fireblocks_tx: TransactionResponse; }>; /** * Sign a SEI transaction on Fireblocks (combines createSeiTx and waitForSeiTxCompletion) */ signSeiTx(integration: FireblocksIntegration, tx: components['schemas']['SEIUnsignedTx'] | components['schemas']['SEIStakeUnsignedTx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['SEISignedTx']; }; fireblocks_tx: TransactionResponse; }>; signSuiTx(integration: FireblocksIntegration, tx: components['schemas']['SUITx'], note?: string): Promise<{ signed_tx: { data: components['schemas']['SUIBroadcastTxPayload']; }; fireblocks_tx: TransactionResponse; }>; } //# sourceMappingURL=fireblocks.d.ts.map