From a1175572a1c40ae02d9bb09a1842e2d82460971b Mon Sep 17 00:00:00 2001 From: Martin Saldinger <51637671+LeTamanoir@users.noreply.github.com> Date: Fri, 22 Nov 2024 09:39:31 +0100 Subject: [PATCH] export FireblocksAssetId (#160) * export FireblocksAssetId * add comment * bump version --- package.json | 2 +- src/fireblocks_signer.ts | 10 +++++++--- src/kiln.ts | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a09049f..13d2aac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kilnfi/sdk", - "version": "3.1.18", + "version": "3.1.19", "autor": "Kiln (https://kiln.fi)", "license": "BUSL-1.1", "description": "JavaScript sdk for Kiln API", diff --git a/src/fireblocks_signer.ts b/src/fireblocks_signer.ts index e18f5e2..200cfbe 100644 --- a/src/fireblocks_signer.ts +++ b/src/fireblocks_signer.ts @@ -11,7 +11,11 @@ import { import { formatEther, formatUnits } from 'viem'; import type { components } from './openapi/schema.js'; -export type AssetId = +/** + * Fireblocks asset id + * ref: https://github.com/fireblocks/fireblocks-web3-provider/blob/main/src/constants.ts + */ +export type FireblocksAssetId = | 'SOL_TEST' | 'SOL' | 'ETH_TEST5' @@ -81,7 +85,7 @@ export class FireblocksSigner { * @param assetId fireblocks asset id * @param note optional fireblocks custom note */ - public async sign(payloadToSign: object, assetId?: AssetId, note = ''): Promise { + public async sign(payloadToSign: object, assetId?: FireblocksAssetId, note = ''): Promise { try { const assetArgs = assetId ? { @@ -155,7 +159,7 @@ export class FireblocksSigner { */ public async signAndBroadcastWith( payloadToSign: object, - assetId: AssetId, + assetId: FireblocksAssetId, tx: components['schemas']['ETHUnsignedTx'] | components['schemas']['POLUnsignedTx'], destinationId: string, sendAmount = true, diff --git a/src/kiln.ts b/src/kiln.ts index cc3079a..bfc7de3 100644 --- a/src/kiln.ts +++ b/src/kiln.ts @@ -6,6 +6,7 @@ export * from './validators.js'; export * from './openapi/schema.js'; export * from './utils.js'; export type { FireblocksIntegration } from './fireblocks.js'; +export type { FireblocksAssetId } from './fireblocks_signer.js'; type Config = { baseUrl: string;