@iotexproject/kit 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +518 -0
  2. package/package.json +9 -2
package/dist/index.d.ts CHANGED
@@ -18,9 +18,516 @@ declare class IoID {
18
18
  data?: undefined;
19
19
  }>;
20
20
  }
21
+ declare class GaugeEntity {
22
+ address: `0x${string}`;
23
+ chainId: string;
24
+ static abi: readonly [
25
+ {
26
+ readonly inputs: readonly [
27
+ {
28
+ readonly internalType: "address";
29
+ readonly name: "_forwarder";
30
+ readonly type: "address";
31
+ },
32
+ {
33
+ readonly internalType: "address";
34
+ readonly name: "_stakingToken";
35
+ readonly type: "address";
36
+ },
37
+ {
38
+ readonly internalType: "address";
39
+ readonly name: "_voter";
40
+ readonly type: "address";
41
+ }
42
+ ];
43
+ readonly stateMutability: "nonpayable";
44
+ readonly type: "constructor";
45
+ },
46
+ {
47
+ readonly inputs: readonly [
48
+ ];
49
+ readonly name: "NotAlive";
50
+ readonly type: "error";
51
+ },
52
+ {
53
+ readonly inputs: readonly [
54
+ ];
55
+ readonly name: "NotAuthorized";
56
+ readonly type: "error";
57
+ },
58
+ {
59
+ readonly inputs: readonly [
60
+ ];
61
+ readonly name: "NotTeam";
62
+ readonly type: "error";
63
+ },
64
+ {
65
+ readonly inputs: readonly [
66
+ ];
67
+ readonly name: "NotVoter";
68
+ readonly type: "error";
69
+ },
70
+ {
71
+ readonly inputs: readonly [
72
+ ];
73
+ readonly name: "RewardRateTooHigh";
74
+ readonly type: "error";
75
+ },
76
+ {
77
+ readonly inputs: readonly [
78
+ ];
79
+ readonly name: "ZeroAmount";
80
+ readonly type: "error";
81
+ },
82
+ {
83
+ readonly inputs: readonly [
84
+ ];
85
+ readonly name: "ZeroRewardRate";
86
+ readonly type: "error";
87
+ },
88
+ {
89
+ readonly anonymous: false;
90
+ readonly inputs: readonly [
91
+ {
92
+ readonly indexed: true;
93
+ readonly internalType: "address";
94
+ readonly name: "from";
95
+ readonly type: "address";
96
+ },
97
+ {
98
+ readonly indexed: false;
99
+ readonly internalType: "uint256";
100
+ readonly name: "amount";
101
+ readonly type: "uint256";
102
+ }
103
+ ];
104
+ readonly name: "ClaimRewards";
105
+ readonly type: "event";
106
+ },
107
+ {
108
+ readonly anonymous: false;
109
+ readonly inputs: readonly [
110
+ {
111
+ readonly indexed: true;
112
+ readonly internalType: "address";
113
+ readonly name: "from";
114
+ readonly type: "address";
115
+ },
116
+ {
117
+ readonly indexed: true;
118
+ readonly internalType: "address";
119
+ readonly name: "to";
120
+ readonly type: "address";
121
+ },
122
+ {
123
+ readonly indexed: false;
124
+ readonly internalType: "uint256";
125
+ readonly name: "amount";
126
+ readonly type: "uint256";
127
+ }
128
+ ];
129
+ readonly name: "Deposit";
130
+ readonly type: "event";
131
+ },
132
+ {
133
+ readonly anonymous: false;
134
+ readonly inputs: readonly [
135
+ {
136
+ readonly indexed: true;
137
+ readonly internalType: "address";
138
+ readonly name: "from";
139
+ readonly type: "address";
140
+ },
141
+ {
142
+ readonly indexed: false;
143
+ readonly internalType: "uint256";
144
+ readonly name: "amount";
145
+ readonly type: "uint256";
146
+ }
147
+ ];
148
+ readonly name: "NotifyReward";
149
+ readonly type: "event";
150
+ },
151
+ {
152
+ readonly anonymous: false;
153
+ readonly inputs: readonly [
154
+ {
155
+ readonly indexed: true;
156
+ readonly internalType: "address";
157
+ readonly name: "from";
158
+ readonly type: "address";
159
+ },
160
+ {
161
+ readonly indexed: false;
162
+ readonly internalType: "uint256";
163
+ readonly name: "amount";
164
+ readonly type: "uint256";
165
+ }
166
+ ];
167
+ readonly name: "Withdraw";
168
+ readonly type: "event";
169
+ },
170
+ {
171
+ readonly inputs: readonly [
172
+ {
173
+ readonly internalType: "address";
174
+ readonly name: "";
175
+ readonly type: "address";
176
+ }
177
+ ];
178
+ readonly name: "balanceOf";
179
+ readonly outputs: readonly [
180
+ {
181
+ readonly internalType: "uint256";
182
+ readonly name: "";
183
+ readonly type: "uint256";
184
+ }
185
+ ];
186
+ readonly stateMutability: "view";
187
+ readonly type: "function";
188
+ },
189
+ {
190
+ readonly inputs: readonly [
191
+ {
192
+ readonly internalType: "uint256";
193
+ readonly name: "_amount";
194
+ readonly type: "uint256";
195
+ },
196
+ {
197
+ readonly internalType: "address";
198
+ readonly name: "_recipient";
199
+ readonly type: "address";
200
+ }
201
+ ];
202
+ readonly name: "deposit";
203
+ readonly outputs: readonly [
204
+ ];
205
+ readonly stateMutability: "nonpayable";
206
+ readonly type: "function";
207
+ },
208
+ {
209
+ readonly inputs: readonly [
210
+ {
211
+ readonly internalType: "uint256";
212
+ readonly name: "_amount";
213
+ readonly type: "uint256";
214
+ }
215
+ ];
216
+ readonly name: "deposit";
217
+ readonly outputs: readonly [
218
+ ];
219
+ readonly stateMutability: "nonpayable";
220
+ readonly type: "function";
221
+ },
222
+ {
223
+ readonly inputs: readonly [
224
+ {
225
+ readonly internalType: "address";
226
+ readonly name: "_account";
227
+ readonly type: "address";
228
+ }
229
+ ];
230
+ readonly name: "earned";
231
+ readonly outputs: readonly [
232
+ {
233
+ readonly internalType: "uint256";
234
+ readonly name: "";
235
+ readonly type: "uint256";
236
+ }
237
+ ];
238
+ readonly stateMutability: "view";
239
+ readonly type: "function";
240
+ },
241
+ {
242
+ readonly inputs: readonly [
243
+ {
244
+ readonly internalType: "address";
245
+ readonly name: "_account";
246
+ readonly type: "address";
247
+ }
248
+ ];
249
+ readonly name: "getReward";
250
+ readonly outputs: readonly [
251
+ ];
252
+ readonly stateMutability: "nonpayable";
253
+ readonly type: "function";
254
+ },
255
+ {
256
+ readonly inputs: readonly [
257
+ {
258
+ readonly internalType: "address";
259
+ readonly name: "forwarder";
260
+ readonly type: "address";
261
+ }
262
+ ];
263
+ readonly name: "isTrustedForwarder";
264
+ readonly outputs: readonly [
265
+ {
266
+ readonly internalType: "bool";
267
+ readonly name: "";
268
+ readonly type: "bool";
269
+ }
270
+ ];
271
+ readonly stateMutability: "view";
272
+ readonly type: "function";
273
+ },
274
+ {
275
+ readonly inputs: readonly [
276
+ ];
277
+ readonly name: "lastTimeRewardApplicable";
278
+ readonly outputs: readonly [
279
+ {
280
+ readonly internalType: "uint256";
281
+ readonly name: "";
282
+ readonly type: "uint256";
283
+ }
284
+ ];
285
+ readonly stateMutability: "view";
286
+ readonly type: "function";
287
+ },
288
+ {
289
+ readonly inputs: readonly [
290
+ ];
291
+ readonly name: "lastUpdateTime";
292
+ readonly outputs: readonly [
293
+ {
294
+ readonly internalType: "uint256";
295
+ readonly name: "";
296
+ readonly type: "uint256";
297
+ }
298
+ ];
299
+ readonly stateMutability: "view";
300
+ readonly type: "function";
301
+ },
302
+ {
303
+ readonly inputs: readonly [
304
+ ];
305
+ readonly name: "left";
306
+ readonly outputs: readonly [
307
+ {
308
+ readonly internalType: "uint256";
309
+ readonly name: "";
310
+ readonly type: "uint256";
311
+ }
312
+ ];
313
+ readonly stateMutability: "view";
314
+ readonly type: "function";
315
+ },
316
+ {
317
+ readonly inputs: readonly [
318
+ ];
319
+ readonly name: "notifyRewardAmount";
320
+ readonly outputs: readonly [
321
+ ];
322
+ readonly stateMutability: "payable";
323
+ readonly type: "function";
324
+ },
325
+ {
326
+ readonly inputs: readonly [
327
+ ];
328
+ readonly name: "notifyRewardWithoutClaim";
329
+ readonly outputs: readonly [
330
+ ];
331
+ readonly stateMutability: "payable";
332
+ readonly type: "function";
333
+ },
334
+ {
335
+ readonly inputs: readonly [
336
+ ];
337
+ readonly name: "periodFinish";
338
+ readonly outputs: readonly [
339
+ {
340
+ readonly internalType: "uint256";
341
+ readonly name: "";
342
+ readonly type: "uint256";
343
+ }
344
+ ];
345
+ readonly stateMutability: "view";
346
+ readonly type: "function";
347
+ },
348
+ {
349
+ readonly inputs: readonly [
350
+ ];
351
+ readonly name: "rewardPerToken";
352
+ readonly outputs: readonly [
353
+ {
354
+ readonly internalType: "uint256";
355
+ readonly name: "";
356
+ readonly type: "uint256";
357
+ }
358
+ ];
359
+ readonly stateMutability: "view";
360
+ readonly type: "function";
361
+ },
362
+ {
363
+ readonly inputs: readonly [
364
+ ];
365
+ readonly name: "rewardPerTokenStored";
366
+ readonly outputs: readonly [
367
+ {
368
+ readonly internalType: "uint256";
369
+ readonly name: "";
370
+ readonly type: "uint256";
371
+ }
372
+ ];
373
+ readonly stateMutability: "view";
374
+ readonly type: "function";
375
+ },
376
+ {
377
+ readonly inputs: readonly [
378
+ ];
379
+ readonly name: "rewardRate";
380
+ readonly outputs: readonly [
381
+ {
382
+ readonly internalType: "uint256";
383
+ readonly name: "";
384
+ readonly type: "uint256";
385
+ }
386
+ ];
387
+ readonly stateMutability: "view";
388
+ readonly type: "function";
389
+ },
390
+ {
391
+ readonly inputs: readonly [
392
+ {
393
+ readonly internalType: "uint256";
394
+ readonly name: "";
395
+ readonly type: "uint256";
396
+ }
397
+ ];
398
+ readonly name: "rewardRateByEpoch";
399
+ readonly outputs: readonly [
400
+ {
401
+ readonly internalType: "uint256";
402
+ readonly name: "";
403
+ readonly type: "uint256";
404
+ }
405
+ ];
406
+ readonly stateMutability: "view";
407
+ readonly type: "function";
408
+ },
409
+ {
410
+ readonly inputs: readonly [
411
+ {
412
+ readonly internalType: "address";
413
+ readonly name: "";
414
+ readonly type: "address";
415
+ }
416
+ ];
417
+ readonly name: "rewards";
418
+ readonly outputs: readonly [
419
+ {
420
+ readonly internalType: "uint256";
421
+ readonly name: "";
422
+ readonly type: "uint256";
423
+ }
424
+ ];
425
+ readonly stateMutability: "view";
426
+ readonly type: "function";
427
+ },
428
+ {
429
+ readonly inputs: readonly [
430
+ ];
431
+ readonly name: "stakingToken";
432
+ readonly outputs: readonly [
433
+ {
434
+ readonly internalType: "address";
435
+ readonly name: "";
436
+ readonly type: "address";
437
+ }
438
+ ];
439
+ readonly stateMutability: "view";
440
+ readonly type: "function";
441
+ },
442
+ {
443
+ readonly inputs: readonly [
444
+ ];
445
+ readonly name: "totalSupply";
446
+ readonly outputs: readonly [
447
+ {
448
+ readonly internalType: "uint256";
449
+ readonly name: "";
450
+ readonly type: "uint256";
451
+ }
452
+ ];
453
+ readonly stateMutability: "view";
454
+ readonly type: "function";
455
+ },
456
+ {
457
+ readonly inputs: readonly [
458
+ {
459
+ readonly internalType: "address";
460
+ readonly name: "";
461
+ readonly type: "address";
462
+ }
463
+ ];
464
+ readonly name: "userRewardPerTokenPaid";
465
+ readonly outputs: readonly [
466
+ {
467
+ readonly internalType: "uint256";
468
+ readonly name: "";
469
+ readonly type: "uint256";
470
+ }
471
+ ];
472
+ readonly stateMutability: "view";
473
+ readonly type: "function";
474
+ },
475
+ {
476
+ readonly inputs: readonly [
477
+ ];
478
+ readonly name: "voter";
479
+ readonly outputs: readonly [
480
+ {
481
+ readonly internalType: "address";
482
+ readonly name: "";
483
+ readonly type: "address";
484
+ }
485
+ ];
486
+ readonly stateMutability: "view";
487
+ readonly type: "function";
488
+ },
489
+ {
490
+ readonly inputs: readonly [
491
+ {
492
+ readonly internalType: "uint256";
493
+ readonly name: "_amount";
494
+ readonly type: "uint256";
495
+ }
496
+ ];
497
+ readonly name: "withdraw";
498
+ readonly outputs: readonly [
499
+ ];
500
+ readonly stateMutability: "nonpayable";
501
+ readonly type: "function";
502
+ }
503
+ ];
504
+ left: () => Promise<any>;
505
+ voter: () => Promise<any>;
506
+ earned: (_account: `0x${string}`) => Promise<any>;
507
+ rewardRate: () => Promise<any>;
508
+ totalSupply: () => Promise<any>;
509
+ periodFinish: () => Promise<any>;
510
+ stakingToken: () => Promise<any>;
511
+ lastUpdateTime: () => Promise<any>;
512
+ rewardPerToken: () => Promise<any>;
513
+ isTrustedForwarder: (forwarder: `0x${string}`) => Promise<any>;
514
+ rewardPerTokenStored: () => Promise<any>;
515
+ lastTimeRewardApplicable: () => Promise<any>;
516
+ deposit: (_amount: string, _recipient: `0x${string}`) => Promise<any>;
517
+ withdraw: (_amount: string) => Promise<any>;
518
+ getReward: (_account: `0x${string}`) => Promise<any>;
519
+ notifyRewardAmount: () => Promise<any>;
520
+ notifyRewardWithoutClaim: () => Promise<any>;
521
+ }
522
+ declare class MarshallDao {
523
+ gaugeList(): Promise<import("@dappworks/kit/aiem").QueryReturnType<GaugeEntity, {
524
+ left: true;
525
+ }>>;
526
+ }
21
527
  declare class ERC20Entity {
22
528
  address: `0x${string}`;
23
529
  chainId: "1";
530
+ get isEther(): boolean;
24
531
  abi: readonly [
25
532
  {
26
533
  readonly inputs: readonly [
@@ -357,6 +864,10 @@ declare class ERC20Entity {
357
864
  }
358
865
  ];
359
866
  totalSupply: number;
867
+ symbol: string;
868
+ decimals: number;
869
+ priceUSD(): Promise<any>;
870
+ tokenUrl(): any;
360
871
  }
361
872
  declare class UniswapV2LPEntity {
362
873
  address: `0x${string}`;
@@ -1158,10 +1669,17 @@ declare class Staking {
1158
1669
  voterAddress: `0x${string}`;
1159
1670
  bucketIndex: string;
1160
1671
  }): Promise<any>;
1672
+ getNFTV2BucketsByIndexes(args: {
1673
+ token_ids: string[];
1674
+ }): Promise<any[]>;
1675
+ getNFTV2BucketByIndex(args: {
1676
+ token_id: string;
1677
+ }): Promise<any>;
1161
1678
  }
1162
1679
  declare const modules: {
1163
1680
  mimo: Mimo;
1164
1681
  staking: Staking;
1682
+ marshalldao: MarshallDao;
1165
1683
  ioid: IoID;
1166
1684
  };
1167
1685
  export type ModuleType = typeof modules;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iotexproject/kit",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "v0.0.8",
5
+ "version": "v0.0.10",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -15,7 +15,14 @@
15
15
  ],
16
16
  "peerDependencies": {},
17
17
  "dependencies": {
18
+ "@iotexproject/iotex-address-ts": "^1.0.4",
19
+ "axios": "^1.7.2",
20
+ "bech32": "^2.0.0",
18
21
  "bentocache": "^1.0.0-beta.9",
22
+ "bignumber.js": "^9.1.2",
23
+ "dataloader": "^2.2.2",
24
+ "dayjs": "^1.11.12",
25
+ "lru-cache": "^11.0.0",
19
26
  "reflect-metadata": "^0.2.2",
20
27
  "viem": "^2.17.5"
21
28
  },
@@ -24,7 +31,7 @@
24
31
  "@types/bun": "latest",
25
32
  "bun-plugin-dts": "^0.2.3",
26
33
  "hono": "^4.4.11",
27
- "typescript": "^5.0.0"
34
+ "typescript": "^5.5.4"
28
35
  },
29
36
  "publishConfig": {
30
37
  "access": "public",