Skip to content

Commit 140c3d0

Browse files
kiln-botLeTamanoir
andauthored
Update OpenAPI schema (#170)
* Update OpenAPI schema * breaking change to create a v4 * update examples * fix erros * fix version --------- Co-authored-by: Kiln Bot <[email protected]> Co-authored-by: Martin Saldinger <[email protected]>
1 parent 0ddb8a3 commit 140c3d0

File tree

10 files changed

+716
-348
lines changed

10 files changed

+716
-348
lines changed

examples/eth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const vault: Integration = {
2222
try {
2323
console.log('crafting...');
2424
const tx = await k.client.POST(
25-
'/v1/eth/transaction/stake',
25+
'/eth/transaction/stake',
2626
{
2727
body: {
2828
account_id: process.env.KILN_ACCOUNT_ID,
@@ -40,7 +40,7 @@ try {
4040
console.log('signing...');
4141
const signResponse = await k.fireblocks.signEthTx(vault, tx.data.data, "ETH_TEST6");
4242
console.log('broadcasting...');
43-
const broadcastedTx = await k.client.POST("/v1/eth/transaction/broadcast", {
43+
const broadcastedTx = await k.client.POST("/eth/transaction/broadcast", {
4444
body: {
4545
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
4646
}

examples/kava.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const vault: FireblocksIntegration = {
2121
try {
2222
console.log('crafting...');
2323
const tx = await k.client.POST(
24-
'/v1/kava/transaction/stake',
24+
'/kava/transaction/stake',
2525
{
2626
body: {
2727
account_id: process.env.KILN_ACCOUNT_ID as string,
@@ -36,7 +36,7 @@ try {
3636
const signResponse = await k.fireblocks.signKavaTx(vault, tx.data.data);
3737
console.log('broadcasting...');
3838
if(!signResponse.signed_tx?.data?.signed_tx_serialized) throw new Error('No signed_tx in response');
39-
const broadcastedTx = await k.client.POST("/v1/kava/transaction/broadcast", {
39+
const broadcastedTx = await k.client.POST("/kava/transaction/broadcast", {
4040
body: {
4141
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
4242
}

examples/near.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Kiln } from "../src/kiln";
2-
import type { Integration } from "../lib/types/integrations";
2+
import type { FireblocksIntegration } from "../src/fireblocks";
33
import fs from "node:fs";
44
import 'dotenv/config'
55

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

14-
const vault: Integration = {
14+
const vault: FireblocksIntegration = {
1515
provider: 'fireblocks',
1616
fireblocksApiKey: process.env.FIREBLOCKS_API_KEY,
1717
fireblocksSecretKey: apiSecret,
@@ -21,7 +21,7 @@ const vault: Integration = {
2121
try {
2222
console.log('crafting...');
2323
const tx = await k.client.POST(
24-
'/v1/near/transaction/stake',
24+
'/near/transaction/stake',
2525
{
2626
body: {
2727
account_id: 'd3f1b917-72b1-4982-a4dd-93fce579a708',
@@ -34,7 +34,7 @@ try {
3434
console.log('signing...');
3535
const signResponse = await k.fireblocks.signNearTx(vault, tx.data.data, "NEAR_TEST");
3636
console.log('broadcasting...');
37-
const broadcastedTx = await k.client.POST("/v1/near/transaction/broadcast", {
37+
const broadcastedTx = await k.client.POST("/near/transaction/broadcast", {
3838
body: {
3939
signed_tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
4040
}

examples/noble.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ try {
3030
// });
3131
// console.log(getCosmosAddress('02d92b48d3e9ef34f2016eac7857a02768c88e30aea7a2366bc5ba032a22eceb8b', 'noble'));
3232
const tx = await k.client.POST(
33-
'/v1/noble/transaction/burn-usdc',
33+
'/noble/transaction/burn-usdc',
3434
{
3535
body: {
3636
pubkey: '02d92b48d3e9ef34f2016eac7857a02768c88e30aea7a2366bc5ba032a22eceb8b',
@@ -44,7 +44,7 @@ try {
4444
const signResponse = await k.fireblocks.signNobleTx(vault, tx.data.data);
4545
console.log('broadcasting...');
4646
if(!signResponse.signed_tx?.data?.signed_tx_serialized) throw new Error('No signed_tx in response');
47-
const broadcastedTx = await k.client.POST("/v1/noble/transaction/broadcast", {
47+
const broadcastedTx = await k.client.POST("/noble/transaction/broadcast", {
4848
body: {
4949
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
5050
}

examples/sol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const vault: FireblocksIntegration = {
2121
try {
2222
console.log('crafting...');
2323
const tx = await k.client.POST(
24-
'/v1/sol/transaction/stake',
24+
'/sol/transaction/stake',
2525
{
2626
body: {
2727
account_id: 'd3f1b917-72b1-4982-a4dd-93fce579a708',
@@ -36,7 +36,7 @@ try {
3636
const signResponse = await k.fireblocks.signSolTx(vault, tx.data.data, "SOL_TEST");
3737
if(!signResponse.signed_tx?.data.signed_tx_serialized) throw new Error('No signed_tx in response');
3838
console.log('broadcasting...');
39-
const broadcastedTx = await k.client.POST("/v1/sol/transaction/broadcast", {
39+
const broadcastedTx = await k.client.POST("/sol/transaction/broadcast", {
4040
body: {
4141
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized
4242
}

examples/ton.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const vault: FireblocksIntegration = {
2121
try {
2222
console.log('crafting...');
2323
const tx = await k.client.POST(
24-
'/v1/ton/transaction/stake-ton-whales-pool',
24+
'/ton/transaction/stake-ton-whales-pool',
2525
{
2626
body: {
2727
account_id: process.env.KILN_ACCOUNT_ID as string,
@@ -48,7 +48,7 @@ try {
4848
const signResponse = await k.fireblocks.signTonTx(vault, tx.data.data, "TON");
4949
console.log('broadcasting...');
5050
if(!signResponse.signed_tx?.data?.signed_tx_serialized) throw new Error('No signed_tx in response');
51-
const broadcastedTx = await k.client.POST("/v1/ton/transaction/broadcast", {
51+
const broadcastedTx = await k.client.POST("/ton/transaction/broadcast", {
5252
body: {
5353
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
5454
}

examples/xtz.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const vault: FireblocksIntegration = {
2121
try {
2222
console.log('crafting...');
2323
const tx = await k.client.POST(
24-
'/v1/xtz/transaction/delegate',
24+
'/xtz/transaction/delegate',
2525
{
2626
body: {
2727
account_id: 'd3f1b917-72b1-4982-a4dd-93fce579a708',
@@ -35,7 +35,7 @@ try {
3535
const signResponse = await k.fireblocks.signXtzTx(vault, tx.data.data, "XTZ_TEST");
3636
if(!signResponse.signed_tx?.data.signed_tx_serialized) throw new Error('No signed_tx in response');
3737
console.log('broadcasting...');
38-
const broadcastedTx = await k.client.POST("/v1/xtz/transaction/broadcast", {
38+
const broadcastedTx = await k.client.POST("/xtz/transaction/broadcast", {
3939
body: {
4040
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized
4141
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kilnfi/sdk",
3-
"version": "3.1.24",
3+
"version": "4.0.0",
44
"autor": "Kiln <[email protected]> (https://kiln.fi)",
55
"license": "BUSL-1.1",
66
"description": "JavaScript sdk for Kiln API",

src/fireblocks.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class FireblocksService {
107107
throw new Error('Fireblocks signature is missing');
108108
}
109109

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1038-
const preparedTx = await this.client.POST('/v1/near/transaction/prepare', {
1038+
const preparedTx = await this.client.POST('/near/transaction/prepare', {
10391039
body: {
10401040
unsigned_tx_serialized: tx.unsigned_tx_serialized,
10411041
signature: signature,

0 commit comments

Comments
 (0)