Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build and ci #123

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 2 additions & 0 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ jobs:
run: bun install
- name: "lint"
run: bun run lint
- name: "build"
run: bun run build
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kilnfi/sdk",
"version": "3.0.0",
"version": "3.0.1",
"autor": "Kiln <[email protected]> (https://kiln.fi)",
"license": "BUSL-1.1",
"description": "JavaScript sdk for Kiln API",
Expand Down
48 changes: 28 additions & 20 deletions src/fireblocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<paths>;
Expand Down Expand Up @@ -32,7 +40,7 @@ export class FireblocksService {
* @param integration
* @param assetId
*/
async getPubkey(integration: Integration, assetId: string): Promise<PublicKeyResponse> {
async getPubkey(integration: FireblocksIntegration, assetId: string): Promise<PublicKeyResponse> {
const fbSdk = this.getSdk(integration);
const data = await fbSdk.getPublicKeyInfoForVaultAccount({
assetId: assetId,
Expand All @@ -48,7 +56,7 @@ export class FireblocksService {
* List Fireblocks supported assets
* @param integration
*/
async getAssets(integration: Integration): Promise<AssetTypeResponse[]> {
async getAssets(integration: FireblocksIntegration): Promise<AssetTypeResponse[]> {
const fbSdk = this.getSdk(integration);
return await fbSdk.getSupportedAssets();
}
Expand All @@ -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,
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -208,7 +216,7 @@ export class FireblocksService {
* @param note
*/
async signDydxTx(
integration: Integration,
integration: FireblocksIntegration,
tx: components['schemas']['DYDXUnsignedTx'] | components['schemas']['DYDXStakeUnsignedTx'],
note?: string,
) {
Expand Down Expand Up @@ -256,7 +264,7 @@ export class FireblocksService {
* @param note
*/
async signFetTx(
integration: Integration,
integration: FireblocksIntegration,
tx: components['schemas']['FETUnsignedTx'] | components['schemas']['FETStakeUnsignedTx'],
note?: string,
) {
Expand Down Expand Up @@ -306,7 +314,7 @@ export class FireblocksService {
* @param note
*/
async signInjTx(
integration: Integration,
integration: FireblocksIntegration,
tx: components['schemas']['INJUnsignedTx'] | components['schemas']['INJStakeUnsignedTx'],
note?: string,
) {
Expand Down Expand Up @@ -354,7 +362,7 @@ export class FireblocksService {
* @param note
*/
async signKavaTx(
integration: Integration,
integration: FireblocksIntegration,
tx: components['schemas']['KAVAUnsignedTx'] | components['schemas']['KAVAStakeUnsignedTx'],
note?: string,
) {
Expand Down Expand Up @@ -402,7 +410,7 @@ export class FireblocksService {
* @param note
*/
async signOsmoTx(
integration: Integration,
integration: FireblocksIntegration,
tx: components['schemas']['OSMOUnsignedTx'] | components['schemas']['OSMOStakeUnsignedTx'],
note?: string,
) {
Expand Down Expand Up @@ -450,7 +458,7 @@ export class FireblocksService {
* @param note
*/
async signTiaTx(
integration: Integration,
integration: FireblocksIntegration,
tx: components['schemas']['TIAUnsignedTx'] | components['schemas']['TIAStakeUnsignedTx'],
note?: string,
) {
Expand Down Expand Up @@ -498,7 +506,7 @@ export class FireblocksService {
* @param note
*/
async signZetaTx(
integration: Integration,
integration: FireblocksIntegration,
tx: components['schemas']['ZETAUnsignedTx'] | components['schemas']['ZETAStakeUnsignedTx'],
note?: string,
) {
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/kiln.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down