@iotexproject/kit 0.1.26 → 0.1.28
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 +43 -0
- package/dist/index.js +1 -1
- package/package.json +7 -1
package/dist/index.d.ts
CHANGED
|
@@ -6734,6 +6734,15 @@ declare class Mimo {
|
|
|
6734
6734
|
chainId: string;
|
|
6735
6735
|
contractAddress: `0x${string}`;
|
|
6736
6736
|
}): Promise<unknown>;
|
|
6737
|
+
depositWETH({ chainId, contractAddress }: {
|
|
6738
|
+
chainId: string;
|
|
6739
|
+
contractAddress: `0x${string}`;
|
|
6740
|
+
}): Promise<unknown>;
|
|
6741
|
+
withdrawWETH({ amount, chainId, contractAddress }: {
|
|
6742
|
+
amount: string;
|
|
6743
|
+
chainId: string;
|
|
6744
|
+
contractAddress: `0x${string}`;
|
|
6745
|
+
}): Promise<unknown>;
|
|
6737
6746
|
}
|
|
6738
6747
|
declare class MockBucketEntity {
|
|
6739
6748
|
address: `0x${string}`;
|
|
@@ -8411,6 +8420,18 @@ declare class MSP {
|
|
|
8411
8420
|
chainId: string;
|
|
8412
8421
|
}[] | null>;
|
|
8413
8422
|
}
|
|
8423
|
+
export interface Candidate {
|
|
8424
|
+
ownerAddress: string;
|
|
8425
|
+
operatorAddress: string;
|
|
8426
|
+
rewardAddress: string;
|
|
8427
|
+
name: string;
|
|
8428
|
+
totalWeightedVotes: bigint;
|
|
8429
|
+
selfStakeBucketIdx: bigint;
|
|
8430
|
+
selfStakingTokens: bigint;
|
|
8431
|
+
}
|
|
8432
|
+
export interface CandidateV3 extends Candidate {
|
|
8433
|
+
id: string;
|
|
8434
|
+
}
|
|
8414
8435
|
export interface Bucket {
|
|
8415
8436
|
index: bigint;
|
|
8416
8437
|
candidateAddress: string;
|
|
@@ -8534,6 +8555,28 @@ declare class Staking {
|
|
|
8534
8555
|
error: unknown;
|
|
8535
8556
|
data?: undefined;
|
|
8536
8557
|
}>;
|
|
8558
|
+
getDelegateByAddress(args: {
|
|
8559
|
+
ownerAddress: `0x${string}` | `io${string}`;
|
|
8560
|
+
}): Promise<CandidateV3>;
|
|
8561
|
+
upsertRewardDistribution(args: {
|
|
8562
|
+
foundationRewardPortion: number;
|
|
8563
|
+
epochRewardPortion: number;
|
|
8564
|
+
blockRewardPortion: number;
|
|
8565
|
+
}): Promise<any>;
|
|
8566
|
+
candidateUpdate({ name, operatorAddress, rewardAddress }: {
|
|
8567
|
+
name: string;
|
|
8568
|
+
operatorAddress: `0x${string}`;
|
|
8569
|
+
rewardAddress: `0x${string}`;
|
|
8570
|
+
}): Promise<any>;
|
|
8571
|
+
getEndorseBucketsByDelegate(args: {
|
|
8572
|
+
ownerAddress: `0x${string}` | `io${string}`;
|
|
8573
|
+
}): Promise<never[] | undefined>;
|
|
8574
|
+
candidateTransferOwnership({ newOwner }: {
|
|
8575
|
+
newOwner: `0x${string}`;
|
|
8576
|
+
}): Promise<any>;
|
|
8577
|
+
candidateActivate({ bucketIndex }: {
|
|
8578
|
+
bucketIndex: string;
|
|
8579
|
+
}): Promise<any>;
|
|
8537
8580
|
}
|
|
8538
8581
|
declare class utils {
|
|
8539
8582
|
erc20(args: {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var U=({url:j="http://localhost:9527",ctx:z}={})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{for(let K in b){if(typeof b[K]==="object")b[K]=JSON.stringify(b[K],(Q,N)=>typeof N==="bigint"?N.toString():N);if(b[K]==null)delete b[K]}const H=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;let D;if(z)D=await fetch(H,{headers:{...z}});else D=await fetch(H);return D.json()}}})}}),S=async({args:j={},prop:z,method:L,url:B,fetchRequestInit:G})=>{if(!G?.method||G?.method==="GET"){for(let b in j){if(typeof j[b]==="object")j[b]=JSON.stringify(j[b],(H,D)=>typeof D==="bigint"?D.toString():D);if(j[b]==null)delete j[b]}const J=`${B}/${String(z)}/${String(L)}?${new URLSearchParams(j).toString()}`;return(await fetch(J)).json()}if(G?.method==="POST"){const J=`${B}/${String(z)}/${String(L)}`;return(await fetch(J,{...G,body:JSON.stringify(j)})).json()}},V=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{return S({args:b,prop:B,method:C,url:j,fetchRequestInit:z})}}})}}),W=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{return S({args:b,prop:B,method:C,url:j,fetchRequestInit:z})}}})}}),X=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{const H=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;return(await fetch(H,{method:"GET",...z})).json()}}})}}),Y=({url:j="http://localhost:9527",ctx:z}={})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{let H=!1;for(let N in b){if(typeof b[N]==="object")H=!0;if(b[N]==null)delete b[N]}let D,K,Q={};if(H)D=`${j}/${String(B)}/${String(C)}`;else D=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;if(z)Q.headers={...z};if(H)Q.method="POST",Q.body=JSON.stringify(b);return K=await fetch(D,Q),K.json()}}})}});export{X as createIotexscanClient,Y as createIoidClient,W as createClientWithIoPayServer,V as createClientWithDBServer,U 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.1.
|
|
5
|
+
"version": "v0.1.28",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"@iotexproject/iotex-address-ts": "^1.0.4",
|
|
27
27
|
"@noble/curves": "^1.6.0",
|
|
28
28
|
"@tryghost/content-api": "^1.11.21",
|
|
29
|
+
"@types/bn.js": "^5.1.6",
|
|
30
|
+
"@types/utf8": "^3.0.3",
|
|
29
31
|
"axios": "^1.7.2",
|
|
30
32
|
"bech32": "^2.0.0",
|
|
31
33
|
"bentocache": "^1.0.0-beta.9",
|
|
@@ -40,9 +42,12 @@
|
|
|
40
42
|
"jsonwebtoken": "^9.0.2",
|
|
41
43
|
"lodash": "^4.17.21",
|
|
42
44
|
"lru-cache": "^11.0.0",
|
|
45
|
+
"number-to-bn": "^1.7.0",
|
|
43
46
|
"postgres": "^3.4.4",
|
|
44
47
|
"reflect-metadata": "^0.2.2",
|
|
45
48
|
"strip-ansi-cjs": "^8.0.0",
|
|
49
|
+
"underscore": "^1.13.7",
|
|
50
|
+
"utf8": "^3.0.0",
|
|
46
51
|
"utility-types": "^3.11.0",
|
|
47
52
|
"viem": "^2.17.5",
|
|
48
53
|
"zod": "^3.23.8",
|
|
@@ -55,6 +60,7 @@
|
|
|
55
60
|
"@types/google-protobuf": "^3.15.12",
|
|
56
61
|
"@types/jsonwebtoken": "^9.0.7",
|
|
57
62
|
"@types/tryghost__content-api": "^1.3.16",
|
|
63
|
+
"@types/underscore": "^1.11.15",
|
|
58
64
|
"bun-plugin-dts": "^0.2.3",
|
|
59
65
|
"grpc-tools": "^1.12.4",
|
|
60
66
|
"grpc_tools_node_protoc_ts": "^5.3.3",
|