From 151f60fa1e6709a0902ea695e1b31770e9ed86c0 Mon Sep 17 00:00:00 2001 From: Arno Simon Date: Mon, 23 Sep 2024 15:29:22 +0200 Subject: [PATCH 1/3] fix build and ci --- .github/workflows/publish.yml | 12 ++++----- .github/workflows/sdk.yml | 2 ++ src/fireblocks.ts | 48 ++++++++++++++++++++--------------- src/kiln.ts | 2 +- 4 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fb3e22c..ac7ac19 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,13 +8,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: "16.x" - registry-url: "https://registry.npmjs.org" - - run: npm install - - run: npm run build + - uses: actions/checkout@v4 + - name: "setup:bun" + uses: oven-sh/setup-bun@v1 + - run: bun install + - run: bun run build - run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index ec353d0..dfa8bc1 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -25,3 +25,5 @@ jobs: run: bun install - name: "lint" run: bun run lint + - name: "build" + run: bun run build diff --git a/src/fireblocks.ts b/src/fireblocks.ts index 92cf0cf..b8da7e0 100644 --- a/src/fireblocks.ts +++ b/src/fireblocks.ts @@ -2,7 +2,15 @@ import { type AssetTypeResponse, FireblocksSDK, type PublicKeyResponse, SigningA import type { Client } from 'openapi-fetch'; import { FireblocksSigner } from './fireblocks_signer'; import type { components, paths } from './openapi/schema'; -import type { FireblocksIntegration, Integration } from './types/integrations'; + +type FireblocksIntegration = { + provider: "fireblocks"; + fireblocksApiKey: string; + fireblocksSecretKey: string; + vaultId: number; + name?: string; + fireblocksDestinationId?: string; +}; export class FireblocksService { client: Client; @@ -32,7 +40,7 @@ export class FireblocksService { * @param integration * @param assetId */ - async getPubkey(integration: Integration, assetId: string): Promise { + async getPubkey(integration: FireblocksIntegration, assetId: string): Promise { const fbSdk = this.getSdk(integration); const data = await fbSdk.getPublicKeyInfoForVaultAccount({ assetId: assetId, @@ -48,7 +56,7 @@ export class FireblocksService { * List Fireblocks supported assets * @param integration */ - async getAssets(integration: Integration): Promise { + async getAssets(integration: FireblocksIntegration): Promise { const fbSdk = this.getSdk(integration); return await fbSdk.getSupportedAssets(); } @@ -61,7 +69,7 @@ export class FireblocksService { * @param note */ async signSolTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['SOLStakeTx'], assetId: 'SOL_TEST' | 'SOL', note?: string, @@ -106,7 +114,7 @@ export class FireblocksService { * @param tx * @param note */ - async signAdaTx(integration: Integration, tx: components['schemas']['ADAUnsignedTx'], note?: string) { + async signAdaTx(integration: FireblocksIntegration, tx: components['schemas']['ADAUnsignedTx'], note?: string) { const payload = { rawMessageData: { messages: [ @@ -159,7 +167,7 @@ export class FireblocksService { * @param note */ async signAtomTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['ATOMUnsignedTx'] | components['schemas']['ATOMStakeUnsignedTx'], assetId: 'ATOM_COS' | 'ATOM_COS_TEST', note?: string, @@ -208,7 +216,7 @@ export class FireblocksService { * @param note */ async signDydxTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['DYDXUnsignedTx'] | components['schemas']['DYDXStakeUnsignedTx'], note?: string, ) { @@ -256,7 +264,7 @@ export class FireblocksService { * @param note */ async signFetTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['FETUnsignedTx'] | components['schemas']['FETStakeUnsignedTx'], note?: string, ) { @@ -306,7 +314,7 @@ export class FireblocksService { * @param note */ async signInjTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['INJUnsignedTx'] | components['schemas']['INJStakeUnsignedTx'], note?: string, ) { @@ -354,7 +362,7 @@ export class FireblocksService { * @param note */ async signKavaTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['KAVAUnsignedTx'] | components['schemas']['KAVAStakeUnsignedTx'], note?: string, ) { @@ -402,7 +410,7 @@ export class FireblocksService { * @param note */ async signOsmoTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['OSMOUnsignedTx'] | components['schemas']['OSMOStakeUnsignedTx'], note?: string, ) { @@ -450,7 +458,7 @@ export class FireblocksService { * @param note */ async signTiaTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['TIAUnsignedTx'] | components['schemas']['TIAStakeUnsignedTx'], note?: string, ) { @@ -498,7 +506,7 @@ export class FireblocksService { * @param note */ async signZetaTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['ZETAUnsignedTx'] | components['schemas']['ZETAStakeUnsignedTx'], note?: string, ) { @@ -547,7 +555,7 @@ export class FireblocksService { * @param tx * @param note */ - async signDotTx(integration: Integration, tx: components['schemas']['DOTUnsignedTx'], note?: string) { + async signDotTx(integration: FireblocksIntegration, tx: components['schemas']['DOTUnsignedTx'], note?: string) { const payload = { rawMessageData: { messages: [ @@ -582,7 +590,7 @@ export class FireblocksService { * @param tx * @param note */ - async signKsmTx(integration: Integration, tx: components['schemas']['KSMUnsignedTx'], note?: string) { + async signKsmTx(integration: FireblocksIntegration, tx: components['schemas']['KSMUnsignedTx'], note?: string) { const payload = { rawMessageData: { messages: [ @@ -619,7 +627,7 @@ export class FireblocksService { * @param note */ async signAndBroadcastEthTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['ETHUnsignedTx'], assetId: 'ETH_TEST6' | 'ETH', note?: string, @@ -644,7 +652,7 @@ export class FireblocksService { * @param note */ async signAndBroadcastPolTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['POLUnsignedTx'], assetId: 'ETH_TEST5' | 'ETH', note?: string, @@ -669,7 +677,7 @@ export class FireblocksService { * @param note */ async signTonTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['TONTx'], assetId: 'TON_TEST' | 'TON', note?: string, @@ -711,7 +719,7 @@ export class FireblocksService { * @param note */ async signXtzTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['XTZUnsignedTx'], assetId: 'XTZ_TEST' | 'XTZ', note?: string, @@ -756,7 +764,7 @@ export class FireblocksService { * @param note */ async signNearTx( - integration: Integration, + integration: FireblocksIntegration, tx: components['schemas']['NEARTx'], assetId: 'NEAR_TEST' | 'NEAR', note?: string, diff --git a/src/kiln.ts b/src/kiln.ts index e05fdc3..d3598d4 100644 --- a/src/kiln.ts +++ b/src/kiln.ts @@ -1,5 +1,5 @@ export * from './validators'; -export * from './openapi/schema.d.ts'; +export type * from './openapi/schema.d.ts'; export * from './utils'; import createClient, { type Client } from 'openapi-fetch'; import { FireblocksService } from './fireblocks'; From 7bcf20ba775b00a0191953e776e05b52e5ec8d58 Mon Sep 17 00:00:00 2001 From: Arno Simon Date: Mon, 23 Sep 2024 15:29:47 +0200 Subject: [PATCH 2/3] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 671e7d2..dbf3705 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kilnfi/sdk", - "version": "3.0.0", + "version": "3.0.1", "autor": "Kiln (https://kiln.fi)", "license": "BUSL-1.1", "description": "JavaScript sdk for Kiln API", From eac04d0ca4c6a95c046cbc2d802dcbef8995a6f0 Mon Sep 17 00:00:00 2001 From: Arno Simon Date: Mon, 23 Sep 2024 15:30:37 +0200 Subject: [PATCH 3/3] format --- src/fireblocks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fireblocks.ts b/src/fireblocks.ts index b8da7e0..fc5e049 100644 --- a/src/fireblocks.ts +++ b/src/fireblocks.ts @@ -4,7 +4,7 @@ import { FireblocksSigner } from './fireblocks_signer'; import type { components, paths } from './openapi/schema'; type FireblocksIntegration = { - provider: "fireblocks"; + provider: 'fireblocks'; fireblocksApiKey: string; fireblocksSecretKey: string; vaultId: number;