Skip to content

Commit b8f0295

Browse files
kiln-botEllzer
andcommitted
Update OpenAPI schema (#187)
* Update OpenAPI schema * update trx * bump version * update signTrxTx return type --------- Co-authored-by: Kiln Bot <[email protected]> Co-authored-by: Elliott Denis <[email protected]>
1 parent 7bc4a73 commit b8f0295

File tree

4 files changed

+109
-30
lines changed

4 files changed

+109
-30
lines changed

examples/trx.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ try {
2121
console.log('crafting...');
2222
const tx = await k.client.POST('/trx/transaction/stake', {
2323
body: {
24-
account_id: '',
24+
account_id: '9d7b0e32-203d-4b1d-9ff1-99ccae420c7f',
2525
owner_address: 'TAERHY5gyzDRmAaeqqa6C4Fuyc9HLnnHx7',
26-
amount_sun: trxToSun('1').toString(),
26+
amount_sun: Number(trxToSun('1')),
2727
resource: 'BANDWIDTH',
2828
},
2929
});
@@ -36,7 +36,7 @@ try {
3636
console.log('broadcasting...');
3737
const broadcastedTx = await k.client.POST('/trx/transaction/broadcast', {
3838
body: {
39-
signed_tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
39+
tx_serialized: signResponse.signed_tx.data.signed_tx_serialized,
4040
},
4141
});
4242
console.log(broadcastedTx);

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": "4.1.0",
3+
"version": "4.1.1",
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ export class FireblocksService {
11111111
tx: components['schemas']['TRXUnsignedTx'],
11121112
note?: string,
11131113
): Promise<{
1114-
signed_tx: { data: components['schemas']['TRXSignedTx'] };
1114+
signed_tx: { data: components['schemas']['TRXPreparedTx'] };
11151115
fireblocks_tx: TransactionResponse;
11161116
}> {
11171117
const payload = {

src/openapi/schema.ts

Lines changed: 104 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6975,6 +6975,26 @@ export interface paths {
69756975
patch?: never;
69766976
trace?: never;
69776977
};
6978+
"/trx/transaction/cancel-unstake": {
6979+
parameters: {
6980+
query?: never;
6981+
header?: never;
6982+
path?: never;
6983+
cookie?: never;
6984+
};
6985+
get?: never;
6986+
put?: never;
6987+
/**
6988+
* Unstake transaction
6989+
* @description Craft an cancel unstake transaction to Cancel unstakings, all unstaked funds still in the waiting period will be re-staked, or withdrawn if the passed the lockup period.
6990+
*/
6991+
post: operations["postTrxCancelUnstakeTx"];
6992+
delete?: never;
6993+
options?: never;
6994+
head?: never;
6995+
patch?: never;
6996+
trace?: never;
6997+
};
69786998
"/trx/transaction/withdraw-unstaked": {
69796999
parameters: {
69807000
query?: never;
@@ -12748,7 +12768,7 @@ export interface components {
1274812768
*/
1274912769
restake_rewards: boolean;
1275012770
/**
12751-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
12771+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
1275212772
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
1275312773
*/
1275412774
grantee_address?: string;
@@ -12765,7 +12785,7 @@ export interface components {
1276512785
*/
1276612786
validator_address: string;
1276712787
/**
12768-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
12788+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
1276912789
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
1277012790
*/
1277112791
grantee_address: string;
@@ -14455,7 +14475,7 @@ export interface components {
1445514475
*/
1445614476
restake_rewards: boolean;
1445714477
/**
14458-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
14478+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
1445914479
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
1446014480
*/
1446114481
grantee_address?: string;
@@ -14472,7 +14492,7 @@ export interface components {
1447214492
*/
1447314493
validator_address: string;
1447414494
/**
14475-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
14495+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
1447614496
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
1447714497
*/
1447814498
grantee_address: string;
@@ -16162,7 +16182,7 @@ export interface components {
1616216182
*/
1616316183
restake_rewards: boolean;
1616416184
/**
16165-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
16185+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
1616616186
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
1616716187
*/
1616816188
grantee_address?: string;
@@ -16179,7 +16199,7 @@ export interface components {
1617916199
*/
1618016200
validator_address: string;
1618116201
/**
16182-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
16202+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
1618316203
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
1618416204
*/
1618516205
grantee_address: string;
@@ -20904,7 +20924,7 @@ export interface components {
2090420924
*/
2090520925
restake_rewards: boolean;
2090620926
/**
20907-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
20927+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
2090820928
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
2090920929
*/
2091020930
grantee_address?: string;
@@ -20921,7 +20941,7 @@ export interface components {
2092120941
*/
2092220942
validator_address: string;
2092320943
/**
20924-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
20944+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
2092520945
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
2092620946
*/
2092720947
grantee_address: string;
@@ -24005,7 +24025,7 @@ export interface components {
2400524025
*/
2400624026
validator_address: string;
2400724027
/**
24008-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
24028+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
2400924029
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
2401024030
*/
2401124031
grantee_address: string;
@@ -25729,7 +25749,7 @@ export interface components {
2572925749
*/
2573025750
restake_rewards: boolean;
2573125751
/**
25732-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
25752+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
2573325753
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
2573425754
*/
2573525755
grantee_address?: string;
@@ -25746,7 +25766,7 @@ export interface components {
2574625766
*/
2574725767
validator_address: string;
2574825768
/**
25749-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
25769+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
2575025770
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
2575125771
*/
2575225772
grantee_address: string;
@@ -27434,7 +27454,7 @@ export interface components {
2743427454
*/
2743527455
validator_address: string;
2743627456
/**
27437-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
27457+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
2743827458
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
2743927459
*/
2744027460
grantee_address: string;
@@ -29134,7 +29154,7 @@ export interface components {
2913429154
*/
2913529155
validator_address: string;
2913629156
/**
29137-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
29157+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
2913829158
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
2913929159
*/
2914029160
grantee_address: string;
@@ -30836,7 +30856,7 @@ export interface components {
3083630856
*/
3083730857
restake_rewards: boolean;
3083830858
/**
30839-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
30859+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
3084030860
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
3084130861
*/
3084230862
grantee_address?: string;
@@ -30853,7 +30873,7 @@ export interface components {
3085330873
*/
3085430874
validator_address: string;
3085530875
/**
30856-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
30876+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
3085730877
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
3085830878
*/
3085930879
grantee_address: string;
@@ -32553,7 +32573,7 @@ export interface components {
3255332573
*/
3255432574
validator_address: string;
3255532575
/**
32556-
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/Interop/chains.json
32576+
* @description Grantee address, this address is specific to each validator. Kiln grantee addresses are found here: https://github.com/eco-stake/validator-registry/blob/master/Kiln/chains.json https://github.com/eco-stake/validator-registry/blob/master/interop/chains.json
3255732577
* @example cosmos1u4whe0pwlgt7q7ph37qxalq2wfq4pkcdze5fmd
3255832578
*/
3255932579
grantee_address: string;
@@ -33839,7 +33859,7 @@ export interface components {
3383933859
*/
3384033860
unsigned_tx_serialized: string;
3384133861
};
33842-
TRXSignedTx: {
33862+
TRXPreparedTx: {
3384333863
/**
3384433864
* @description Signed serialized transaction
3384533865
* @example 0a750a02238e2208b63bcc4a1991f66a40d0c1989cbf325a57083612530a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e7472616374121b0a154102e07e61860efd34e1bdedcb5b485da75407d8f110c0843d70f08fb99abf321241f19adddba846d1fae9233d872048b04a7b003b7757816b5f601d2a08b00f99901b25ec8e6b906a46165a25ece7f8b9e138b755a9d5aca2c880ba8dbaaf8f8a8400
@@ -33867,9 +33887,9 @@ export interface components {
3386733887
owner_address: string;
3386833888
/**
3386933889
* @description Amount of TRX to stake in sun
33870-
* @example 10000
33890+
* @example 100000
3387133891
*/
33872-
amount_sun: string;
33892+
amount_sun: number;
3387333893
/**
3387433894
* @description Resource to obtain
3387533895
* @example BANDWIDTH
@@ -33885,16 +33905,23 @@ export interface components {
3388533905
owner_address: string;
3388633906
/**
3388733907
* @description Amount of TRX to unstake in sun
33888-
* @example 10000
33908+
* @example 100000
3388933909
*/
33890-
amount_sun: string;
33910+
amount_sun: number;
3389133911
/**
3389233912
* @description Resource to release
3389333913
* @example BANDWIDTH
3389433914
* @enum {string}
3389533915
*/
3389633916
resource: "BANDWIDTH" | "ENERGY";
3389733917
};
33918+
TRXCraftCancelUnstakeTxPayload: {
33919+
/**
33920+
* @description Wallet address of the owner
33921+
* @example TAERHY5gyzDRmAaeqqa6C4Fuyc9HLnnHx7
33922+
*/
33923+
owner_address: string;
33924+
};
3389833925
TRXCraftWithdrawUnstakedTxPayload: {
3389933926
/**
3390033927
* @description Wallet address of the owner
@@ -33910,9 +33937,13 @@ export interface components {
3391033937
owner_address: string;
3391133938
/**
3391233939
* @description Number of votes to cast
33913-
* @example 1
33940+
* @example {
33941+
* "TQzd66b9EFVHJfZK5AmiVhBjtJvXGeSPPZ": 1
33942+
* }
3391433943
*/
33915-
votes?: string;
33944+
votes?: {
33945+
[key: string]: number;
33946+
};
3391633947
};
3391733948
TRXCraftWithdrawRewardsTxPayload: {
3391833949
/**
@@ -33938,7 +33969,7 @@ export interface components {
3393833969
* @description Signed serialized transaction
3393933970
* @example 0a026554220847c22aa98d1f46a94090ee9ba0be325a6a080412660a30747970652e676f6f676c65617069732e636f6d2f70726f6f746f636f6c2e566f74655769746e7373616c6c656454787061796c6f616412320a154102e07e61860efd34e1bdedcb5b485da75407d8f112190a1541a4ce68cfcdd27884bde52cec653354048e0aa989100170b0e1fef6bd32
3394033971
*/
33941-
signed_tx_serialized: string;
33972+
tx_serialized: string;
3394233973
};
3394333974
TRXStake: {
3394433975
/**
@@ -52209,6 +52240,54 @@ export interface operations {
5220952240
};
5221052241
};
5221152242
};
52243+
postTrxCancelUnstakeTx: {
52244+
parameters: {
52245+
query?: never;
52246+
header?: never;
52247+
path?: never;
52248+
cookie?: never;
52249+
};
52250+
/** @description Transaction to craft */
52251+
requestBody: {
52252+
content: {
52253+
"application/json; charset=utf-8": components["schemas"]["TRXCraftCancelUnstakeTxPayload"];
52254+
};
52255+
};
52256+
responses: {
52257+
/** @description Successful operation */
52258+
200: {
52259+
headers: {
52260+
[name: string]: unknown;
52261+
};
52262+
content: {
52263+
"application/json; charset=utf-8": {
52264+
data: components["schemas"]["TRXUnsignedTx"];
52265+
};
52266+
};
52267+
};
52268+
/** @description Invalid parameters */
52269+
400: {
52270+
headers: {
52271+
[name: string]: unknown;
52272+
};
52273+
content?: never;
52274+
};
52275+
/** @description Unauthorized */
52276+
401: {
52277+
headers: {
52278+
[name: string]: unknown;
52279+
};
52280+
content?: never;
52281+
};
52282+
/** @description Internal server error */
52283+
500: {
52284+
headers: {
52285+
[name: string]: unknown;
52286+
};
52287+
content?: never;
52288+
};
52289+
};
52290+
};
5221252291
postTrxWithdrawUnstakedTx: {
5221352292
parameters: {
5221452293
query?: never;
@@ -52374,7 +52453,7 @@ export interface operations {
5237452453
};
5237552454
content: {
5237652455
"application/json; charset=utf-8": {
52377-
data: components["schemas"]["TRXSignedTx"];
52456+
data: components["schemas"]["TRXPreparedTx"];
5237852457
};
5237952458
};
5238052459
};

0 commit comments

Comments
 (0)