Skip to content

Commit 72c40ba

Browse files
authored
add osmo-ibc-transfer noble tx (#95)
* add osmo-ibc-transfer noble tx * nits * format code
1 parent 2808c74 commit 72c40ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3051
-3155
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"eslint-config-airbnb-base": "^14.2.1",
5555
"eslint-config-next": "^12.2.3",
5656
"eslint-plugin-import": "^2.29.1",
57+
"prettier": "^3.2.5",
5758
"typescript": "^5.4.3"
5859
}
5960
}

0 commit comments

Comments
 (0)