Skip to content

Commit ca395aa

Browse files
committed
Merge branch 'main' into fetch-ai
2 parents 0de4dd7 + 01a4dc0 commit ca395aa

40 files changed

+3369
-3448
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
"indent": ["warn", 2],
66
"semi": ["warn", "always"]
77
}
8-
}
8+
}

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: '16.x'
15-
registry-url: 'https://registry.npmjs.org'
14+
node-version: "16.x"
15+
registry-url: "https://registry.npmjs.org"
1616
- run: npm install
1717
- run: npm run build
1818
- run: npm publish --access public

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printWidth": 120
3+
}

README.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ It provides a simple way of crafting staking transactions as well getting real t
77
Check 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+
2426
The 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+
3538
In order to use this sdk, you will need a kiln api token.
3639
Please contact [email protected] to get one.
3740

@@ -40,69 +43,65 @@ import { Kiln } from "../src/kiln";
4043

4144
const 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
4953
import { Kiln } from "@kilnfi/sdk";
5054
import { 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

5559
const k = new Kiln({
5660
testnet: true,
57-
apiToken: 'kiln_xxx',
61+
apiToken: "kiln_xxx",
5862
});
5963

6064
const 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

6771
try {
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
8888
try {
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).

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './src/kiln';
1+
export * from "./src/kiln";

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kilnfi/sdk",
3-
"version": "2.11.3",
3+
"version": "2.11.4",
44
"autor": "Kiln <[email protected]> (https://kiln.fi)",
55
"license": "BUSL-1.1",
66
"description": "JavaScript sdk for Kiln API",
@@ -27,13 +27,13 @@
2727
},
2828
"homepage": "https://github.com/kilnfi/sdk-js#readme",
2929
"dependencies": {
30-
"@blockfrost/blockfrost-js": "^5.0.0",
30+
"@blockfrost/blockfrost-js": "^5.5.0",
3131
"@cosmjs/proto-signing": "^0.30.1",
3232
"@cosmjs/stargate": "^0.30.0",
3333
"@emurgo/cardano-serialization-lib-nodejs": "^11.5.0",
34-
"@solana/web3.js": "^1.47.3",
35-
"@substrate/txwrapper-polkadot": "^7.0.1",
36-
"@taquito/local-forging": "^17.4.0",
34+
"@solana/web3.js": "^1.91.3",
35+
"@substrate/txwrapper-polkadot": "^7.3.0",
36+
"@taquito/local-forging": "^17.5.2",
3737
"@taquito/rpc": "^16.0.1",
3838
"@types/bn.js": "^5.1.5",
3939
"axios": "^0.23.0",
@@ -42,19 +42,19 @@
4242
"fireblocks-sdk": "^4.0.0",
4343
"js-sha256": "^0.9.0",
4444
"near-api-js": "^2.1.4",
45-
"protobufjs": "^7.2.5",
46-
"viem": "^1.19.9",
47-
"web3-core": "^1.10.0"
45+
"protobufjs": "^7.2.6",
46+
"viem": "^1.21.4"
4847
},
4948
"devDependencies": {
5049
"@types/axios": "^0.14.0",
51-
"@types/node-fetch": "^2.6.2",
50+
"@types/node-fetch": "^2.6.11",
5251
"@typescript-eslint/eslint-plugin": "^5.0.0",
5352
"@typescript-eslint/parser": "^5.0.0",
5453
"eslint": "^7.32.0",
5554
"eslint-config-airbnb-base": "^14.2.1",
5655
"eslint-config-next": "^12.2.3",
57-
"eslint-plugin-import": "^2.25.2",
58-
"typescript": "^5.3.2"
56+
"eslint-plugin-import": "^2.29.1",
57+
"prettier": "^3.2.5",
58+
"typescript": "^5.4.3"
5959
}
6060
}

0 commit comments

Comments
 (0)