@@ -7,6 +7,7 @@ It provides a simple way of crafting staking transactions as well getting real t
77Check out the [ full documentation] ( https://docs.kiln.fi/v1/connect/overview ) .
88
99## Supported protocols
10+
1011- ADA
1112- ATOM
1213- DOT
@@ -21,6 +22,7 @@ Check out the [full documentation](https://docs.kiln.fi/v1/connect/overview).
2122- More protocol to come, don't hesitate to contact us (
[email protected] )
2223
2324### ⚠️️WARNING:
25+
2426The transaction crafting and reporting are done on mainnet networks on OSMO / TIA / DYDX even in testnet mode.
2527
2628## Installation
@@ -32,6 +34,7 @@ npm install --save @kilnfi/sdk
3234```
3335
3436## Setup
37+
3538In order to use this sdk, you will need a kiln api token.
3639Please contact
[email protected] to get one.
3740
@@ -40,69 +43,65 @@ import { Kiln } from "../src/kiln";
4043
4144const k = new Kiln ({
4245 testnet: true ,
43- apiToken: ' kiln_xxx' ,
46+ apiToken: " kiln_xxx" ,
4447});
4548```
4649
4750## Craft 32 ETH staking transaction, sign it with fireblocks and broadcast it
51+
4852``` typescript
4953import { Kiln } from " @kilnfi/sdk" ;
5054import { Integration } from " @kilnfi/sdk/lib/types/integrations" ;
51- const fs = require (' fs ' );
55+ const fs = require (" fs " );
5256
53- const apiSecret = fs .readFileSync (__dirname + ' /path_to_fireblocks_secret' , ' utf8' );
57+ const apiSecret = fs .readFileSync (__dirname + " /path_to_fireblocks_secret" , " utf8" );
5458
5559const k = new Kiln ({
5660 testnet: true ,
57- apiToken: ' kiln_xxx' ,
61+ apiToken: " kiln_xxx" ,
5862});
5963
6064const vault: Integration = {
61- provider: ' fireblocks' ,
62- fireblocksApiKey: ' YOUR_API_USER_KEY' , // your fireblocks API user key
65+ provider: " fireblocks" ,
66+ fireblocksApiKey: " YOUR_API_USER_KEY" , // your fireblocks API user key
6367 fireblocksSecretKey: apiSecret , // your fireblocks private key (generated with your CSR file and your API user)
64- vaultId: 7 // your fireblocks vault id
68+ vaultId: 7 , // your fireblocks vault id
6569};
6670
6771try {
6872 // Craft 32 ETH staking transaction
69- const tx = await k .eth .craftStakeTx (
70- ' kiln_account_id' ,
71- ' withdrawal_address' ,
72- 32
73- );
73+ const tx = await k .eth .craftStakeTx (" kiln_account_id" , " withdrawal_address" , 32 );
7474
7575 // Sign it with your fireblock vault
7676 const txSigned = await k .eth .sign (vault , tx );
7777
7878 // Broadcast it
7979 const hash = await k .eth .broadcast (txSigned );
80-
8180} catch (err ) {
8281 // handle errors
8382}
8483```
8584
8685## Fetch ETH stakes and network stats
86+
8787``` typescript
8888try {
89- // Get stakes by accounts
90- const stakes = await k .eth .getAccountsRewards ([' kiln-account-id' ]);
89+ // Get stakes by accounts
90+ const stakes = await k .eth .getAccountsRewards ([" kiln-account-id" ]);
9191
92- // Get stakes by wallets
93- const stakesByWallet = await k .eth .getWalletRewards ([' wallet-address' ]);
92+ // Get stakes by wallets
93+ const stakesByWallet = await k .eth .getWalletRewards ([" wallet-address" ]);
9494
95- // Get stakes by validators
96- const stakesByValidator = await k .eth .getStakesRewards ([' validator-address' ]);
95+ // Get stakes by validators
96+ const stakesByValidator = await k .eth .getStakesRewards ([" validator-address" ]);
9797
98- // Get network stats
99- const stats = await k .eth .getNetworkStats ();
100-
101- } catch (err ) {
102- // handle errors
103- }
98+ // Get network stats
99+ const stats = await k .eth .getNetworkStats ();
100+ } catch (err ) {
101+ // handle errors
102+ }
104103```
105104
106105## License
107- This package is open-sourced software licensed under the [ BUSL-1.1 license] ( https://github.com/kilnfi/sdk-js/blob/main/LICENSE ) .
108106
107+ This package is open-sourced software licensed under the [ BUSL-1.1 license] ( https://github.com/kilnfi/sdk-js/blob/main/LICENSE ) .
0 commit comments