@iotexproject/kit 0.1.25 → 0.1.26

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
@@ -8960,6 +8960,49 @@ declare class Contract extends BaseDBModule {
8960
8960
  address: string;
8961
8961
  }): Promise<import("postgres").Row>;
8962
8962
  }
8963
+ export type ItemVote = {
8964
+ isNative: boolean;
8965
+ remainingDuration: string;
8966
+ voterIotexAddress: string;
8967
+ votes: string;
8968
+ weightedVotes: string;
8969
+ };
8970
+ export type DelegateVotes = {
8971
+ data: {
8972
+ bucketInfo: ItemVote[];
8973
+ count: number;
8974
+ epochNumber: number;
8975
+ };
8976
+ };
8977
+ declare class Staking$1 extends BaseDBModule {
8978
+ delegatesByHeight({ height }?: {
8979
+ height?: number;
8980
+ }): Promise<never[] | import("postgres").RowList<import("postgres").Row[]>>;
8981
+ bucketByHash({ hash }: {
8982
+ hash: string;
8983
+ }): Promise<import("postgres").Row | null>;
8984
+ delegate_votes(args: {
8985
+ delegateName: string;
8986
+ page: number;
8987
+ limit?: number;
8988
+ }): Promise<DelegateVotes | {
8989
+ error: any;
8990
+ }>;
8991
+ delegate_recent_blocks(args: {
8992
+ producerAddress: string;
8993
+ page: number;
8994
+ limit: number;
8995
+ }): Promise<{
8996
+ data: {
8997
+ blocks: import("postgres").Row[] & Iterable<import("postgres").Row> & import("postgres").ResultQueryMeta<number, string | number>;
8998
+ total: number;
8999
+ };
9000
+ error?: undefined;
9001
+ } | {
9002
+ error: unknown;
9003
+ data?: undefined;
9004
+ }>;
9005
+ }
8963
9006
  export type ComponentType = "banner-latest" | "iotex-2.0";
8964
9007
  export interface ComponentData {
8965
9008
  id: ComponentType;
@@ -8974,7 +9017,7 @@ declare class Resource {
8974
9017
  declare const modules$1: {
8975
9018
  account: Account;
8976
9019
  analyzer: Analyzer;
8977
- staking: Staking;
9020
+ staking: Staking$1;
8978
9021
  transaction: Transaction;
8979
9022
  nft: NFT;
8980
9023
  health: Health;
package/dist/index.js CHANGED
@@ -1 +1 @@
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};
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};
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.25",
5
+ "version": "v0.1.26",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {