Skip to content

Commit 2e2ca40

Browse files
authored
Merge pull request #40 from kilnfi/feat/dot
[SOF-1037] Feat/dot
2 parents 23f548c + 5f0d9d6 commit 2e2ca40

File tree

12 files changed

+1836
-34
lines changed

12 files changed

+1836
-34
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Check out the full documentation [here](https://docs.kiln.fi/kiln-connect/).
1010
- ATOM
1111
- ADA
1212
- NEAR
13+
- DOT
1314
- More protocol to come, don't hesitate to contact us ([email protected])
1415

1516
## Installation

examples/dot.ts

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { Kiln } from "../src/kiln";
2+
3+
const fs = require('fs');
4+
5+
const apiSecret = fs.readFileSync(__dirname + '/fireblocks_secret.key', 'utf8');
6+
7+
const f = async () => {
8+
const k = new Kiln({
9+
testnet: true,
10+
apiToken: 'kiln_dTkxUTFRdHBMZm9vNFFycFhDSTZCdlJsbjJZang5VnY6ejJoV3FCSTlyZlBtM2ZIM0RFRVVaM3NwTkZReHJXTDZWZUxJMWtWWlVrb3VNYUVzcE9Lakt4ZVplOG9vd1oyVw',
11+
integrations: [
12+
{
13+
name: 'vault1',
14+
provider: 'fireblocks',
15+
fireblocksApiKey: '53aee35e-04b7-9314-8f28-135a66c8af2c',
16+
fireblocksSecretKey: apiSecret,
17+
vaultAccountId: '7',
18+
},
19+
],
20+
});
21+
22+
try {
23+
// const tx = await k.dot.craftBondTx(
24+
// '376acfff-e35d-4b7c-90da-c6acb8ea7197',
25+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
26+
// 1,
27+
// );
28+
// const tx = await k.dot.craftRebondTx(
29+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
30+
// 1,
31+
// );
32+
33+
// const tx = await k.dot.craftNominateTx(
34+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
35+
// );
36+
37+
// const tx = await k.dot.craftUnbondTx(
38+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
39+
// 1,
40+
// );
41+
42+
// const tx = await k.dot.craftWithdrawUnbondedTx(
43+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
44+
// );
45+
46+
// const tx = await k.dot.craftChillTx(
47+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
48+
// );
49+
50+
// const tx = await k.dot.craftSetControllerTx(
51+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
52+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
53+
// );
54+
55+
// const tx = await k.dot.craftSetPayeeTx(
56+
// '5DK8ShqtyuVk2w4qrF9HwaBJoiZV1byQs5ARZ3df2Pt8V6Vj',
57+
// 'Staked',
58+
// );
59+
//
60+
// const signedTx = await k.dot.sign('vault1', tx);
61+
// const hash = await k.dot.broadcast(signedTx);
62+
// console.log(hash);
63+
64+
const status = await k.dot.getTxStatus(
65+
{
66+
blockHash: '0x62ea99ad580e8bfa9d4c79b61b9867838d7086e8c0c8c2ae70226ea37279fc47',
67+
hash: '0x6c6654109e448117ffb021fba07d38d1b41c6927da465ddc3de7af49760f0bae'
68+
},
69+
);
70+
71+
console.log(status);
72+
} catch (err) {
73+
console.log(err);
74+
}
75+
};
76+
77+
f();

examples/sol.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ const f = async () => {
1919
});
2020

2121
try {
22-
// const tx = await k.sol.craftStakeTx(
23-
// '771254de-ac5a-4911-afdf-1d5b7e802dc9',
24-
// '4icse2mPXNgyxxn11tVM7sTnSqDqwJSEzdnaCQnRzvA9',
25-
// 0.12
26-
// );
22+
const tx = await k.sol.craftMergeStakeAccountsTx(
23+
'H1JADXwA94AfMa6tbzhyALDHeawPcWShsvrV3uHGXEWc',
24+
'5dZHQaV1tHLs2z377Lsp6trQsJWe338scd1hYroxXRv3',
25+
'4icse2mPXNgyxxn11tVM7sTnSqDqwJSEzdnaCQnRzvA9',
26+
);
2727
// const tx = await k.sol.craftMergeStakeAccountsTx(
2828
// 'Atms8wevMwkrMy7Nb5uqftayQSzxLHP2zNXq9gBS7vWB',
2929
// '2ax6R5pHCS4hLC4q6xfrqToQ36hyy5PofUDodCGWkNtJ',
@@ -35,9 +35,9 @@ const f = async () => {
3535
// '4icse2mPXNgyxxn11tVM7sTnSqDqwJSEzdnaCQnRzvA9',
3636
// 0.1
3737
// );
38-
// const signedTx = await k.sol.sign('vault1', tx);
39-
// const hash = await k.sol.broadcast(signedTx);
40-
// console.log(hash);
38+
const signedTx = await k.sol.sign('vault1', tx);
39+
const hash = await k.sol.broadcast(signedTx);
40+
console.log(hash);
4141

4242
// const accounts = await k.sol.getAccountsRewards(['771254de-ac5a-4911-afdf-1d5b7e802dc9']);
4343
// console.log(accounts);

0 commit comments

Comments
 (0)