Skip to content

Update OpenAPI schema #170

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

Merged
merged 5 commits into from
Dec 6, 2024
Merged
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
4 changes: 2 additions & 2 deletions examples/eth.ts
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ const vault: Integration = {
try {
console.log('crafting...');
const tx = await k.client.POST(
'/v1/eth/transaction/stake',
'/eth/transaction/stake',
{
body: {
account_id: process.env.KILN_ACCOUNT_ID,
@@ -40,7 +40,7 @@ try {
console.log('signing...');
const signResponse = await k.fireblocks.signEthTx(vault, tx.data.data, "ETH_TEST6");
console.log('broadcasting...');
const broadcastedTx = await k.client.POST("/v1/eth/transaction/broadcast", {
const broadcastedTx = await k.client.POST("/eth/transaction/broadcast", {
body: {
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
}
4 changes: 2 additions & 2 deletions examples/kava.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ const vault: FireblocksIntegration = {
try {
console.log('crafting...');
const tx = await k.client.POST(
'/v1/kava/transaction/stake',
'/kava/transaction/stake',
{
body: {
account_id: process.env.KILN_ACCOUNT_ID as string,
@@ -36,7 +36,7 @@ try {
const signResponse = await k.fireblocks.signKavaTx(vault, tx.data.data);
console.log('broadcasting...');
if(!signResponse.signed_tx?.data?.signed_tx_serialized) throw new Error('No signed_tx in response');
const broadcastedTx = await k.client.POST("/v1/kava/transaction/broadcast", {
const broadcastedTx = await k.client.POST("/kava/transaction/broadcast", {
body: {
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
}
8 changes: 4 additions & 4 deletions examples/near.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Kiln } from "../src/kiln";
import type { Integration } from "../lib/types/integrations";
import type { FireblocksIntegration } from "../src/fireblocks";
import fs from "node:fs";
import 'dotenv/config'

@@ -11,7 +11,7 @@ const k = new Kiln({
apiToken: process.env.KILN_API_KEY,
});

const vault: Integration = {
const vault: FireblocksIntegration = {
provider: 'fireblocks',
fireblocksApiKey: process.env.FIREBLOCKS_API_KEY,
fireblocksSecretKey: apiSecret,
@@ -21,7 +21,7 @@ const vault: Integration = {
try {
console.log('crafting...');
const tx = await k.client.POST(
'/v1/near/transaction/stake',
'/near/transaction/stake',
{
body: {
account_id: 'd3f1b917-72b1-4982-a4dd-93fce579a708',
@@ -34,7 +34,7 @@ try {
console.log('signing...');
const signResponse = await k.fireblocks.signNearTx(vault, tx.data.data, "NEAR_TEST");
console.log('broadcasting...');
const broadcastedTx = await k.client.POST("/v1/near/transaction/broadcast", {
const broadcastedTx = await k.client.POST("/near/transaction/broadcast", {
body: {
signed_tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
}
4 changes: 2 additions & 2 deletions examples/noble.ts
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ try {
// });
// console.log(getCosmosAddress('02d92b48d3e9ef34f2016eac7857a02768c88e30aea7a2366bc5ba032a22eceb8b', 'noble'));
const tx = await k.client.POST(
'/v1/noble/transaction/burn-usdc',
'/noble/transaction/burn-usdc',
{
body: {
pubkey: '02d92b48d3e9ef34f2016eac7857a02768c88e30aea7a2366bc5ba032a22eceb8b',
@@ -44,7 +44,7 @@ try {
const signResponse = await k.fireblocks.signNobleTx(vault, tx.data.data);
console.log('broadcasting...');
if(!signResponse.signed_tx?.data?.signed_tx_serialized) throw new Error('No signed_tx in response');
const broadcastedTx = await k.client.POST("/v1/noble/transaction/broadcast", {
const broadcastedTx = await k.client.POST("/noble/transaction/broadcast", {
body: {
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
}
4 changes: 2 additions & 2 deletions examples/sol.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ const vault: FireblocksIntegration = {
try {
console.log('crafting...');
const tx = await k.client.POST(
'/v1/sol/transaction/stake',
'/sol/transaction/stake',
{
body: {
account_id: 'd3f1b917-72b1-4982-a4dd-93fce579a708',
@@ -36,7 +36,7 @@ try {
const signResponse = await k.fireblocks.signSolTx(vault, tx.data.data, "SOL_TEST");
if(!signResponse.signed_tx?.data.signed_tx_serialized) throw new Error('No signed_tx in response');
console.log('broadcasting...');
const broadcastedTx = await k.client.POST("/v1/sol/transaction/broadcast", {
const broadcastedTx = await k.client.POST("/sol/transaction/broadcast", {
body: {
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized
}
4 changes: 2 additions & 2 deletions examples/ton.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ const vault: FireblocksIntegration = {
try {
console.log('crafting...');
const tx = await k.client.POST(
'/v1/ton/transaction/stake-ton-whales-pool',
'/ton/transaction/stake-ton-whales-pool',
{
body: {
account_id: process.env.KILN_ACCOUNT_ID as string,
@@ -48,7 +48,7 @@ try {
const signResponse = await k.fireblocks.signTonTx(vault, tx.data.data, "TON");
console.log('broadcasting...');
if(!signResponse.signed_tx?.data?.signed_tx_serialized) throw new Error('No signed_tx in response');
const broadcastedTx = await k.client.POST("/v1/ton/transaction/broadcast", {
const broadcastedTx = await k.client.POST("/ton/transaction/broadcast", {
body: {
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
}
4 changes: 2 additions & 2 deletions examples/xtz.ts
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ const vault: FireblocksIntegration = {
try {
console.log('crafting...');
const tx = await k.client.POST(
'/v1/xtz/transaction/delegate',
'/xtz/transaction/delegate',
{
body: {
account_id: 'd3f1b917-72b1-4982-a4dd-93fce579a708',
@@ -35,7 +35,7 @@ try {
const signResponse = await k.fireblocks.signXtzTx(vault, tx.data.data, "XTZ_TEST");
if(!signResponse.signed_tx?.data.signed_tx_serialized) throw new Error('No signed_tx in response');
console.log('broadcasting...');
const broadcastedTx = await k.client.POST("/v1/xtz/transaction/broadcast", {
const broadcastedTx = await k.client.POST("/xtz/transaction/broadcast", {
body: {
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized
}
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.1.24",
"version": "4.0.0",
"autor": "Kiln <support@kiln.fi> (https://kiln.fi)",
"license": "BUSL-1.1",
"description": "JavaScript sdk for Kiln API",
36 changes: 18 additions & 18 deletions src/fireblocks.ts
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/sol/transaction/prepare', {
const preparedTx = await this.client.POST('/sol/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
signatures: signatures,
@@ -166,7 +166,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/ada/transaction/prepare', {
const preparedTx = await this.client.POST('/ada/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
signed_messages: signedMessages,
@@ -218,7 +218,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/atom/transaction/prepare', {
const preparedTx = await this.client.POST('/atom/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -271,7 +271,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/dydx/transaction/prepare', {
const preparedTx = await this.client.POST('/dydx/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -326,7 +326,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/fet/transaction/prepare', {
const preparedTx = await this.client.POST('/fet/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -379,7 +379,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/inj/transaction/prepare', {
const preparedTx = await this.client.POST('/inj/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -434,7 +434,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/kava/transaction/prepare', {
const preparedTx = await this.client.POST('/kava/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -489,7 +489,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/noble/transaction/prepare', {
const preparedTx = await this.client.POST('/noble/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -542,7 +542,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/osmo/transaction/prepare', {
const preparedTx = await this.client.POST('/osmo/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -595,7 +595,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/tia/transaction/prepare', {
const preparedTx = await this.client.POST('/tia/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -650,7 +650,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/zeta/transaction/prepare', {
const preparedTx = await this.client.POST('/zeta/transaction/prepare', {
body: {
pubkey: tx.pubkey,
tx_body: tx.tx_body,
@@ -695,7 +695,7 @@ export class FireblocksService {
const fbTx = await fbSigner.sign(payload, 'DOT', fbNote);
const signature = `0x00${fbTx.signedMessages?.[0]?.signature.fullSig}`;

const preparedTx = await this.client.POST('/v1/dot/transaction/prepare', {
const preparedTx = await this.client.POST('/dot/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
signature: signature,
@@ -738,7 +738,7 @@ export class FireblocksService {
const fbTx = await fbSigner.sign(payload, 'KSM', fbNote);
const signature = `0x00${fbTx.signedMessages?.[0]?.signature.fullSig}`;

const preparedTx = await this.client.POST('/v1/ksm/transaction/prepare', {
const preparedTx = await this.client.POST('/ksm/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
signature: signature,
@@ -791,7 +791,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/eth/transaction/prepare', {
const preparedTx = await this.client.POST('/eth/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
r: `0x${signature.r}`,
@@ -867,7 +867,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/pol/transaction/prepare', {
const preparedTx = await this.client.POST('/pol/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
r: `0x${signature.r}`,
@@ -938,7 +938,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/ton/transaction/prepare', {
const preparedTx = await this.client.POST('/ton/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
signature: signature,
@@ -987,7 +987,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/xtz/transaction/prepare', {
const preparedTx = await this.client.POST('/xtz/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
signature: signature,
@@ -1035,7 +1035,7 @@ export class FireblocksService {
throw new Error('Fireblocks signature is missing');
}

const preparedTx = await this.client.POST('/v1/near/transaction/prepare', {
const preparedTx = await this.client.POST('/near/transaction/prepare', {
body: {
unsigned_tx_serialized: tx.unsigned_tx_serialized,
signature: signature,
994 changes: 681 additions & 313 deletions src/openapi/schema.ts

Large diffs are not rendered by default.