@iotexproject/kit 0.0.103 → 0.1.0
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.
- package/dist/index.d.ts +38 -27
- package/dist/index.js +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -345,7 +345,7 @@ declare class ERC20Entity {
|
|
|
345
345
|
totalSupply: number;
|
|
346
346
|
name: string;
|
|
347
347
|
symbol: string;
|
|
348
|
-
decimals(): Promise<number>;
|
|
348
|
+
decimals(): Promise<number | undefined>;
|
|
349
349
|
balanceOf(account?: `0x${string}`): Promise<{
|
|
350
350
|
value: string;
|
|
351
351
|
format: string;
|
|
@@ -2517,11 +2517,11 @@ declare class LPTokenEntity {
|
|
|
2517
2517
|
}>;
|
|
2518
2518
|
approve(spender: `0x${string}`, amount: string, owner: `0x${string}`): Promise<`0x${string}` | null>;
|
|
2519
2519
|
kLast: () => Promise<any>;
|
|
2520
|
-
name(): Promise<string>;
|
|
2521
|
-
symbol(): Promise<string>;
|
|
2522
|
-
token0(): Promise
|
|
2523
|
-
token1(): Promise
|
|
2524
|
-
tokenUrl(): Promise<any[]>;
|
|
2520
|
+
name(): Promise<string | undefined>;
|
|
2521
|
+
symbol(): Promise<string | undefined>;
|
|
2522
|
+
token0(): Promise<"" | `0x${string}` | undefined>;
|
|
2523
|
+
token1(): Promise<"" | `0x${string}` | undefined>;
|
|
2524
|
+
tokenUrl(): Promise<any[] | undefined>;
|
|
2525
2525
|
factory: () => Promise<any>;
|
|
2526
2526
|
decimals: () => Promise<any>;
|
|
2527
2527
|
allowance: (owner: string, spender: string) => Promise<any>;
|
|
@@ -3421,7 +3421,7 @@ declare class GaugeEntity {
|
|
|
3421
3421
|
name?: string | undefined;
|
|
3422
3422
|
totalIoID?: string | undefined;
|
|
3423
3423
|
totalAppliedIoID?: string | undefined;
|
|
3424
|
-
}
|
|
3424
|
+
}>;
|
|
3425
3425
|
stakingTokenInfo(account?: `0x${string}`): Promise<import("@dappworks/kit/aiem").QueryReturnType<ERC20Entity, {
|
|
3426
3426
|
name: true;
|
|
3427
3427
|
symbol: true;
|
|
@@ -3511,6 +3511,9 @@ declare class GaugeEntity {
|
|
|
3511
3511
|
isZero: boolean;
|
|
3512
3512
|
};
|
|
3513
3513
|
rewardsUSD: string;
|
|
3514
|
+
} | {
|
|
3515
|
+
rewards: string;
|
|
3516
|
+
rewardsUSD: string;
|
|
3514
3517
|
}>;
|
|
3515
3518
|
gaugeDailyRewards(): Promise<{
|
|
3516
3519
|
rewards: {
|
|
@@ -3521,6 +3524,9 @@ declare class GaugeEntity {
|
|
|
3521
3524
|
isZero: boolean;
|
|
3522
3525
|
};
|
|
3523
3526
|
rewardsUSD: string;
|
|
3527
|
+
} | {
|
|
3528
|
+
rewards: string;
|
|
3529
|
+
rewardsUSD: string;
|
|
3524
3530
|
}>;
|
|
3525
3531
|
votes(account: `0x${string}`): Promise<{
|
|
3526
3532
|
votes: string;
|
|
@@ -4126,10 +4132,14 @@ declare class VerifyingProxyEntity {
|
|
|
4126
4132
|
applyIoIDs: (_amount: string) => Promise<any>;
|
|
4127
4133
|
incrementMinterAllowance: (_amount: string) => Promise<any>;
|
|
4128
4134
|
}
|
|
4135
|
+
export type ConfigContext = {
|
|
4136
|
+
chainId: string;
|
|
4137
|
+
appName: string;
|
|
4138
|
+
};
|
|
4129
4139
|
declare class IoID {
|
|
4130
4140
|
verfiyerProxyList(args: {
|
|
4131
4141
|
addresses: `0x${string}`[];
|
|
4132
|
-
}): Promise<import("@dappworks/kit/aiem").QueryReturnType<VerifyingProxyEntity, {
|
|
4142
|
+
}, ctx?: ConfigContext): Promise<import("@dappworks/kit/aiem").QueryReturnType<VerifyingProxyEntity, {
|
|
4133
4143
|
address: true;
|
|
4134
4144
|
chainId: true;
|
|
4135
4145
|
projectId: true;
|
|
@@ -4156,8 +4166,8 @@ declare class IoID {
|
|
|
4156
4166
|
_name: string;
|
|
4157
4167
|
_symbol: string;
|
|
4158
4168
|
_amount: string;
|
|
4159
|
-
}): Promise<{
|
|
4160
|
-
address: string
|
|
4169
|
+
}, ctx?: ConfigContext): Promise<{
|
|
4170
|
+
address: `0x${string}`;
|
|
4161
4171
|
value: string;
|
|
4162
4172
|
data: any;
|
|
4163
4173
|
chainId: string;
|
|
@@ -4172,7 +4182,7 @@ declare class IoID {
|
|
|
4172
4182
|
setGauge(args: {
|
|
4173
4183
|
address: `0x${string}`;
|
|
4174
4184
|
gauge: `0x${string}`;
|
|
4175
|
-
}): Promise<{
|
|
4185
|
+
}, ctx?: ConfigContext): Promise<{
|
|
4176
4186
|
address: `0x${string}`;
|
|
4177
4187
|
data: any;
|
|
4178
4188
|
chainId: string;
|
|
@@ -4186,7 +4196,7 @@ declare class IoID {
|
|
|
4186
4196
|
incrementMinterAllowance(args: {
|
|
4187
4197
|
amount: string;
|
|
4188
4198
|
address: `0x${string}`;
|
|
4189
|
-
}): Promise<{
|
|
4199
|
+
}, ctx?: ConfigContext): Promise<{
|
|
4190
4200
|
address: `0x${string}`;
|
|
4191
4201
|
data: any;
|
|
4192
4202
|
chainId: string;
|
|
@@ -4200,7 +4210,7 @@ declare class IoID {
|
|
|
4200
4210
|
applyIoIDs(args: {
|
|
4201
4211
|
address: `0x${string}`;
|
|
4202
4212
|
amount: number;
|
|
4203
|
-
}): Promise<{
|
|
4213
|
+
}, ctx?: ConfigContext): Promise<{
|
|
4204
4214
|
value: string;
|
|
4205
4215
|
address: `0x${string}`;
|
|
4206
4216
|
data: any;
|
|
@@ -4216,7 +4226,7 @@ declare class IoID {
|
|
|
4216
4226
|
setProjectMetadata(args: {
|
|
4217
4227
|
address: `0x${string}`;
|
|
4218
4228
|
metadata: ProjectMetadata;
|
|
4219
|
-
}): Promise<{
|
|
4229
|
+
}, ctx?: ConfigContext): Promise<{
|
|
4220
4230
|
address: `0x${string}`;
|
|
4221
4231
|
data: `0x${string}`;
|
|
4222
4232
|
chainId: string;
|
|
@@ -4229,7 +4239,7 @@ declare class IoID {
|
|
|
4229
4239
|
}>;
|
|
4230
4240
|
registedDevices(args: {
|
|
4231
4241
|
address: `0x${string}`;
|
|
4232
|
-
}): Promise<IoIDDevice[] | {
|
|
4242
|
+
}, ctx?: ConfigContext): Promise<IoIDDevice[] | {
|
|
4233
4243
|
error: unknown;
|
|
4234
4244
|
}>;
|
|
4235
4245
|
}
|
|
@@ -5432,7 +5442,7 @@ declare class VoterEntity {
|
|
|
5432
5442
|
declare class MarshallDao {
|
|
5433
5443
|
gaugeList(args: {
|
|
5434
5444
|
account?: `0x${string}`;
|
|
5435
|
-
}): Promise<import("@dappworks/kit/aiem").QueryReturnType<GaugeEntity, {
|
|
5445
|
+
}, ctx?: ConfigContext): Promise<import("@dappworks/kit/aiem").QueryReturnType<GaugeEntity, {
|
|
5436
5446
|
address: true;
|
|
5437
5447
|
chainId: true;
|
|
5438
5448
|
gaugeType: true;
|
|
@@ -5468,7 +5478,7 @@ declare class MarshallDao {
|
|
|
5468
5478
|
}>[] | null>;
|
|
5469
5479
|
totalGaugeRewards(args: {
|
|
5470
5480
|
account?: `0x${string}`;
|
|
5471
|
-
}): Promise<{
|
|
5481
|
+
}, ctx?: ConfigContext): Promise<{
|
|
5472
5482
|
rewards: number | undefined;
|
|
5473
5483
|
rewardsUSD: number | undefined;
|
|
5474
5484
|
} | {
|
|
@@ -5477,7 +5487,7 @@ declare class MarshallDao {
|
|
|
5477
5487
|
} | null | undefined>;
|
|
5478
5488
|
voterInfo(args: {
|
|
5479
5489
|
account?: `0x${string}`;
|
|
5480
|
-
}): Promise<import("@dappworks/kit/aiem").QueryReturnType<VoterEntity, {
|
|
5490
|
+
}, ctx?: ConfigContext): Promise<import("@dappworks/kit/aiem").QueryReturnType<VoterEntity, {
|
|
5481
5491
|
epochVoteEndTime: true;
|
|
5482
5492
|
myVote: false | [
|
|
5483
5493
|
`0x${string}`
|
|
@@ -5491,9 +5501,9 @@ declare class MarshallDao {
|
|
|
5491
5501
|
voteToGauge(args: {
|
|
5492
5502
|
stakingTokens: `0x${string}`[];
|
|
5493
5503
|
weights: number[];
|
|
5494
|
-
}): Promise<{
|
|
5504
|
+
}, ctx?: ConfigContext): Promise<{
|
|
5495
5505
|
data: any;
|
|
5496
|
-
address: string
|
|
5506
|
+
address: `0x${string}`;
|
|
5497
5507
|
chainId: string;
|
|
5498
5508
|
error?: undefined;
|
|
5499
5509
|
} | {
|
|
@@ -5506,7 +5516,7 @@ declare class MarshallDao {
|
|
|
5506
5516
|
gagueAddress: `0x${string}`;
|
|
5507
5517
|
amountOrTokenId: string;
|
|
5508
5518
|
account: `0x${string}`;
|
|
5509
|
-
}): Promise<{
|
|
5519
|
+
}, ctx?: ConfigContext): Promise<{
|
|
5510
5520
|
data: any;
|
|
5511
5521
|
approve: `0x${string}` | null | undefined;
|
|
5512
5522
|
approveAddress: `0x${string}`;
|
|
@@ -5524,7 +5534,7 @@ declare class MarshallDao {
|
|
|
5524
5534
|
withdrawFromGauge(args: {
|
|
5525
5535
|
gagueAddress: string;
|
|
5526
5536
|
amount: string;
|
|
5527
|
-
}): Promise<{
|
|
5537
|
+
}, ctx?: ConfigContext): Promise<{
|
|
5528
5538
|
data: any;
|
|
5529
5539
|
address: string;
|
|
5530
5540
|
chainId: string;
|
|
@@ -5532,11 +5542,11 @@ declare class MarshallDao {
|
|
|
5532
5542
|
getRewardFromGauge(args: {
|
|
5533
5543
|
gaugeAddress: string;
|
|
5534
5544
|
account: `0x${string}`;
|
|
5535
|
-
}): Promise<any>;
|
|
5545
|
+
}, ctx?: ConfigContext): Promise<any>;
|
|
5536
5546
|
batchGetRewardFromGauge(args: {
|
|
5537
5547
|
gaugeAddress: any[];
|
|
5538
5548
|
account: `0x${string}`;
|
|
5539
|
-
}): Promise<{
|
|
5549
|
+
}, ctx?: ConfigContext): Promise<{
|
|
5540
5550
|
data: any;
|
|
5541
5551
|
address: `0x${string}`;
|
|
5542
5552
|
title: string;
|
|
@@ -5544,7 +5554,7 @@ declare class MarshallDao {
|
|
|
5544
5554
|
}[]>;
|
|
5545
5555
|
claimIncentiveRewards(args: {
|
|
5546
5556
|
gaugeAddress: string;
|
|
5547
|
-
}): Promise<{
|
|
5557
|
+
}, ctx?: ConfigContext): Promise<{
|
|
5548
5558
|
data: any;
|
|
5549
5559
|
address: `0x${string}`;
|
|
5550
5560
|
chainId: string;
|
|
@@ -5552,7 +5562,7 @@ declare class MarshallDao {
|
|
|
5552
5562
|
withDrawTaxReward(args: {
|
|
5553
5563
|
gaugeAddress: `0x${string}`;
|
|
5554
5564
|
taxer: `0x${string}`;
|
|
5555
|
-
}): Promise<{
|
|
5565
|
+
}, ctx?: ConfigContext): Promise<{
|
|
5556
5566
|
data: any;
|
|
5557
5567
|
gaugeAddress: `0x${string}`;
|
|
5558
5568
|
chainId: string;
|
|
@@ -8492,8 +8502,9 @@ declare const modules$1: {
|
|
|
8492
8502
|
resource: Resource;
|
|
8493
8503
|
};
|
|
8494
8504
|
export type DBModuleType = typeof modules$1;
|
|
8495
|
-
export declare const createClient: ({ url }?: {
|
|
8505
|
+
export declare const createClient: ({ url, ctx }?: {
|
|
8496
8506
|
url?: string;
|
|
8507
|
+
ctx?: ConfigContext;
|
|
8497
8508
|
}) => ModuleType;
|
|
8498
8509
|
export declare const createClientWithDBServer: ({ url }?: {
|
|
8499
8510
|
url?: string;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var N=({url:C="http://localhost:9527",ctx:D}={})=>new Proxy({},{get(J,G,M){return new Proxy({},{get(K,b){return async(j)=>{for(let B in j){if(typeof j[B]==="object")j[B]=JSON.stringify(j[B],(H,L)=>typeof L==="bigint"?L.toString():L);if(j[B]==null)delete j[B]}const F=`${C}/${String(G)}/${String(b)}?${new URLSearchParams(j).toString()}`;let z;if(D)z=await fetch(F,{headers:{...D}});else z=await fetch(F);return z.json()}}})}}),O=({url:C="http://localhost:9527"}={})=>new Proxy({},{get(D,J,G){return new Proxy({},{get(M,K){return async(b)=>{for(let z in b){if(typeof b[z]==="object")b[z]=JSON.stringify(b[z],(B,H)=>typeof H==="bigint"?H.toString():H);if(b[z]==null)delete b[z]}const j=`${C}/${String(J)}/${String(K)}?${new URLSearchParams(b).toString()}`;return(await fetch(j)).json()}}})}}),P=({url:C="http://localhost:9527",fetchRequestInit:D})=>new Proxy({},{get(J,G,M){return new Proxy({},{get(K,b){return async(j)=>{const F=`${C}/${String(G)}/${String(b)}`;return(await fetch(F,{method:"POST",...D,body:JSON.stringify(j)})).json()}}})}});export{P as createClientWithWriteDBServer,O as createClientWithDBServer,N as createClient};
|
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
|
|
5
|
+
"version": "v0.1.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
@@ -31,10 +31,11 @@
|
|
|
31
31
|
"lru-cache": "^11.0.0",
|
|
32
32
|
"postgres": "^3.4.4",
|
|
33
33
|
"reflect-metadata": "^0.2.2",
|
|
34
|
+
"strip-ansi-cjs": "^8.0.0",
|
|
34
35
|
"viem": "^2.17.5"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@dappworks/kit": "0.4.
|
|
38
|
+
"@dappworks/kit": "0.4.197",
|
|
38
39
|
"@types/bun": "latest",
|
|
39
40
|
"@types/tryghost__content-api": "^1.3.16",
|
|
40
41
|
"bun-plugin-dts": "^0.2.3",
|