@iotexproject/kit 0.1.26 → 0.1.27

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 CHANGED
@@ -8411,6 +8411,18 @@ declare class MSP {
8411
8411
  chainId: string;
8412
8412
  }[] | null>;
8413
8413
  }
8414
+ export interface Candidate {
8415
+ ownerAddress: string;
8416
+ operatorAddress: string;
8417
+ rewardAddress: string;
8418
+ name: string;
8419
+ totalWeightedVotes: bigint;
8420
+ selfStakeBucketIdx: bigint;
8421
+ selfStakingTokens: bigint;
8422
+ }
8423
+ export interface CandidateV3 extends Candidate {
8424
+ id: string;
8425
+ }
8414
8426
  export interface Bucket {
8415
8427
  index: bigint;
8416
8428
  candidateAddress: string;
@@ -8534,6 +8546,28 @@ declare class Staking {
8534
8546
  error: unknown;
8535
8547
  data?: undefined;
8536
8548
  }>;
8549
+ getDelegateByAddress(args: {
8550
+ ownerAddress: `0x${string}` | `io${string}`;
8551
+ }): Promise<CandidateV3>;
8552
+ upsertRewardDistribution(args: {
8553
+ foundationRewardPortion: number;
8554
+ epochRewardPortion: number;
8555
+ blockRewardPortion: number;
8556
+ }): Promise<any>;
8557
+ candidateUpdate({ name, operatorAddress, rewardAddress }: {
8558
+ name: string;
8559
+ operatorAddress: `0x${string}`;
8560
+ rewardAddress: `0x${string}`;
8561
+ }): Promise<any>;
8562
+ getEndorseBucketsByDelegate(args: {
8563
+ ownerAddress: `0x${string}` | `io${string}`;
8564
+ }): Promise<never[] | undefined>;
8565
+ candidateTransferOwnership({ newOwner }: {
8566
+ newOwner: `0x${string}`;
8567
+ }): Promise<any>;
8568
+ candidateActivate({ bucketIndex }: {
8569
+ bucketIndex: string;
8570
+ }): Promise<any>;
8537
8571
  }
8538
8572
  declare class utils {
8539
8573
  erc20(args: {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var K=({url:w="http://localhost:9527",ctx:A}={})=>new Proxy({},{get(B,C,T){return new Proxy({},{get(b,E){return async(j)=>{for(let z in j){if(typeof j[z]==="object")j[z]=JSON.stringify(j[z],(G,D)=>typeof D==="bigint"?D.toString():D);if(j[z]==null)delete j[z]}const $=`${w}/${String(C)}/${String(E)}?${new URLSearchParams(j).toString()}`;let J;if(A)J=await fetch($,{headers:{...A}});else J=await fetch($);return J.json()}}})}}),H=async({args:w={},prop:A,method:B,url:C,fetchRequestInit:T})=>{if(!T?.method||T?.method==="GET"){for(let j in w){if(typeof w[j]==="object")w[j]=JSON.stringify(w[j],($,J)=>typeof J==="bigint"?J.toString():J);if(w[j]==null)delete w[j]}const b=`${C}/${String(A)}/${String(B)}?${new URLSearchParams(w).toString()}`;return(await fetch(b)).json()}if(T?.method==="POST"){const b=`${C}/${String(A)}/${String(B)}`;return(await fetch(b,{...T,body:JSON.stringify(w)})).json()}},L=({url:w="http://localhost:9527",fetchRequestInit:A})=>new Proxy({},{get(B,C,T){return new Proxy({},{get(b,E){return async(j)=>{return H({args:j,prop:C,method:E,url:w,fetchRequestInit:A})}}})}}),N=({url:w="http://localhost:9527",fetchRequestInit:A})=>new Proxy({},{get(B,C,T){return new Proxy({},{get(b,E){return async(j)=>{return H({args:j,prop:C,method:E,url:w,fetchRequestInit:A})}}})}}),Q=({url:w="http://localhost:9527",fetchRequestInit:A})=>new Proxy({},{get(B,C,T){return new Proxy({},{get(b,E){return async(j)=>{const $=`${w}/${String(C)}/${String(E)}?${new URLSearchParams(j).toString()}`;return(await fetch($,{method:"GET",...A})).json()}}})}}),S=({url:w="http://localhost:9527",ctx:A}={})=>new Proxy({},{get(B,C,T){return new Proxy({},{get(b,E){return async(j)=>{let $=!1;for(let D in j){if(typeof j[D]==="object")$=!0;if(j[D]==null)delete j[D]}let J,z,G={};if($)J=`${w}/${String(C)}/${String(E)}`;else J=`${w}/${String(C)}/${String(E)}?${new URLSearchParams(j).toString()}`;if(A)G.headers={...A};if($)G.method="POST",G.body=JSON.stringify(j);return z=await fetch(J,G),z.json()}}})}});export{Q as createIotexscanClient,S as createIoidClient,N as createClientWithIoPayServer,L as createClientWithDBServer,K as createClient};
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.26",
5
+ "version": "v0.1.27",
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",