@iotexproject/kit 0.1.28 → 0.1.30
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 +132 -26
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4133,6 +4133,7 @@ declare class VerifyingProxyEntity {
|
|
|
4133
4133
|
export type ConfigContext = {
|
|
4134
4134
|
chainId: string;
|
|
4135
4135
|
appName: string;
|
|
4136
|
+
authData?: Record<string, any>;
|
|
4136
4137
|
};
|
|
4137
4138
|
declare class IoID {
|
|
4138
4139
|
verfiyerProxyList(args: {
|
|
@@ -4222,11 +4223,12 @@ declare class IoID {
|
|
|
4222
4223
|
chainId?: undefined;
|
|
4223
4224
|
}>;
|
|
4224
4225
|
setProjectMetadata(args: {
|
|
4226
|
+
key: string;
|
|
4225
4227
|
address: `0x${string}`;
|
|
4226
4228
|
metadata: ProjectMetadata;
|
|
4227
4229
|
}, ctx?: ConfigContext): Promise<{
|
|
4228
4230
|
address: `0x${string}`;
|
|
4229
|
-
data:
|
|
4231
|
+
data: any;
|
|
4230
4232
|
chainId: string;
|
|
4231
4233
|
error?: undefined;
|
|
4232
4234
|
} | {
|
|
@@ -8432,6 +8434,23 @@ export interface Candidate {
|
|
|
8432
8434
|
export interface CandidateV3 extends Candidate {
|
|
8433
8435
|
id: string;
|
|
8434
8436
|
}
|
|
8437
|
+
export interface CompositeBucket {
|
|
8438
|
+
index: bigint;
|
|
8439
|
+
candidateAddress: string;
|
|
8440
|
+
stakedAmount: bigint;
|
|
8441
|
+
stakedDuration: number;
|
|
8442
|
+
createTime: bigint;
|
|
8443
|
+
stakeStartTime: bigint;
|
|
8444
|
+
unstakeStartTime: bigint;
|
|
8445
|
+
autoStake: boolean;
|
|
8446
|
+
owner: string;
|
|
8447
|
+
contractAddress: string;
|
|
8448
|
+
stakedDurationBlockNumber: bigint;
|
|
8449
|
+
createBlockHeight: bigint;
|
|
8450
|
+
stakeStartBlockHeight: bigint;
|
|
8451
|
+
unstakeStartBlockHeight: bigint;
|
|
8452
|
+
endorsementExpireBlockHeight: bigint;
|
|
8453
|
+
}
|
|
8435
8454
|
export interface Bucket {
|
|
8436
8455
|
index: bigint;
|
|
8437
8456
|
candidateAddress: string;
|
|
@@ -8570,13 +8589,16 @@ declare class Staking {
|
|
|
8570
8589
|
}): Promise<any>;
|
|
8571
8590
|
getEndorseBucketsByDelegate(args: {
|
|
8572
8591
|
ownerAddress: `0x${string}` | `io${string}`;
|
|
8573
|
-
}): Promise<
|
|
8592
|
+
}): Promise<CompositeBucket[]>;
|
|
8574
8593
|
candidateTransferOwnership({ newOwner }: {
|
|
8575
8594
|
newOwner: `0x${string}`;
|
|
8576
8595
|
}): Promise<any>;
|
|
8577
8596
|
candidateActivate({ bucketIndex }: {
|
|
8578
8597
|
bucketIndex: string;
|
|
8579
8598
|
}): Promise<any>;
|
|
8599
|
+
getSelfStakeBucketByDelegate(args: {
|
|
8600
|
+
ownerAddress: `0x${string}` | `io${string}`;
|
|
8601
|
+
}): Promise<CompositeBucket | null>;
|
|
8580
8602
|
}
|
|
8581
8603
|
declare class utils {
|
|
8582
8604
|
erc20(args: {
|
|
@@ -8859,29 +8881,74 @@ declare class Analysis extends BaseDBModule {
|
|
|
8859
8881
|
api_key: string;
|
|
8860
8882
|
};
|
|
8861
8883
|
}>;
|
|
8862
|
-
|
|
8863
|
-
|
|
8884
|
+
upload_event({ user_id, event_type, event_id, event }: {
|
|
8885
|
+
event_type: string;
|
|
8886
|
+
user_id: string;
|
|
8887
|
+
event_id: string;
|
|
8888
|
+
event: Record<string, any>;
|
|
8889
|
+
}, ctx?: {
|
|
8890
|
+
authData?: {
|
|
8891
|
+
app_id: string;
|
|
8892
|
+
api_key: string;
|
|
8893
|
+
};
|
|
8894
|
+
}): Promise<{
|
|
8895
|
+
ok: boolean;
|
|
8896
|
+
msg: any;
|
|
8897
|
+
}>;
|
|
8898
|
+
generate_referral_code({ refer_id, }: {
|
|
8864
8899
|
refer_id: string;
|
|
8900
|
+
}, ctx?: {
|
|
8901
|
+
authData?: {
|
|
8902
|
+
app_id: string;
|
|
8903
|
+
api_key: string;
|
|
8904
|
+
};
|
|
8905
|
+
}): Promise<{
|
|
8906
|
+
ok: boolean;
|
|
8907
|
+
referral_code: any;
|
|
8908
|
+
msg: string;
|
|
8909
|
+
} | {
|
|
8910
|
+
ok: boolean;
|
|
8911
|
+
msg: any;
|
|
8912
|
+
referral_code?: undefined;
|
|
8913
|
+
}>;
|
|
8914
|
+
fetch_referral_code({ user_id, }: {
|
|
8865
8915
|
user_id: string;
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8916
|
+
}, ctx?: {
|
|
8917
|
+
authData?: {
|
|
8918
|
+
app_id: string;
|
|
8919
|
+
api_key: string;
|
|
8920
|
+
};
|
|
8870
8921
|
}): Promise<{
|
|
8922
|
+
ok: boolean;
|
|
8923
|
+
referral_code: any;
|
|
8924
|
+
msg?: undefined;
|
|
8925
|
+
} | {
|
|
8871
8926
|
ok: boolean;
|
|
8872
8927
|
msg: any;
|
|
8928
|
+
referral_code?: undefined;
|
|
8873
8929
|
}>;
|
|
8874
|
-
|
|
8875
|
-
|
|
8930
|
+
create_refer({ refer_id, user_id, device_id, data, }: {
|
|
8931
|
+
refer_id: string;
|
|
8876
8932
|
user_id: string;
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8933
|
+
device_id: string;
|
|
8934
|
+
data?: Record<string, any>;
|
|
8935
|
+
}, ctx?: {
|
|
8936
|
+
authData?: {
|
|
8937
|
+
app_id: string;
|
|
8938
|
+
api_key: string;
|
|
8939
|
+
};
|
|
8881
8940
|
}): Promise<{
|
|
8882
8941
|
ok: boolean;
|
|
8883
8942
|
msg: any;
|
|
8884
8943
|
}>;
|
|
8944
|
+
fetch_event({ event_id, }: {
|
|
8945
|
+
event_id: string;
|
|
8946
|
+
}, ctx?: {
|
|
8947
|
+
authData?: {
|
|
8948
|
+
app_id: string;
|
|
8949
|
+
api_key: string;
|
|
8950
|
+
};
|
|
8951
|
+
}): Promise<Record<string, any>>;
|
|
8885
8952
|
}
|
|
8886
8953
|
declare class Analyzer extends BaseDBModule {
|
|
8887
8954
|
tvl(): Promise<any>;
|
|
@@ -8911,10 +8978,18 @@ declare class Analyzer extends BaseDBModule {
|
|
|
8911
8978
|
start_date?: string;
|
|
8912
8979
|
end_date?: string;
|
|
8913
8980
|
}): Promise<any>;
|
|
8981
|
+
sumGasFeeIotx({ start_date, end_date }?: {
|
|
8982
|
+
start_date?: string;
|
|
8983
|
+
end_date?: string;
|
|
8984
|
+
}): Promise<any>;
|
|
8914
8985
|
avgGasFee({ start_date, end_date }?: {
|
|
8915
8986
|
start_date?: string;
|
|
8916
8987
|
end_date?: string;
|
|
8917
8988
|
}): Promise<any>;
|
|
8989
|
+
avgGasFeeIotx({ start_date, end_date }?: {
|
|
8990
|
+
start_date?: string;
|
|
8991
|
+
end_date?: string;
|
|
8992
|
+
}): Promise<any>;
|
|
8918
8993
|
nodesCount(): Promise<any>;
|
|
8919
8994
|
dappsCount(): Promise<any>;
|
|
8920
8995
|
totalCrossChainTxCount(): Promise<number>;
|
|
@@ -9046,7 +9121,7 @@ declare class Staking$1 extends BaseDBModule {
|
|
|
9046
9121
|
data?: undefined;
|
|
9047
9122
|
}>;
|
|
9048
9123
|
}
|
|
9049
|
-
export type ComponentType = "banner-latest" | "
|
|
9124
|
+
export type ComponentType = "banner-latest" | "token-2049";
|
|
9050
9125
|
export interface ComponentData {
|
|
9051
9126
|
id: ComponentType;
|
|
9052
9127
|
html: string;
|
|
@@ -9057,6 +9132,9 @@ declare class Resource {
|
|
|
9057
9132
|
id: ComponentType;
|
|
9058
9133
|
}): Promise<ComponentData>;
|
|
9059
9134
|
}
|
|
9135
|
+
declare class IoPay extends BaseDBModule {
|
|
9136
|
+
get_point_task(): Promise<import("postgres").RowList<import("postgres").Row[]>>;
|
|
9137
|
+
}
|
|
9060
9138
|
declare const modules$1: {
|
|
9061
9139
|
account: Account;
|
|
9062
9140
|
analyzer: Analyzer;
|
|
@@ -9067,10 +9145,12 @@ declare const modules$1: {
|
|
|
9067
9145
|
analysis: Analysis;
|
|
9068
9146
|
contract: Contract;
|
|
9069
9147
|
resource: Resource;
|
|
9148
|
+
iopay: IoPay;
|
|
9070
9149
|
};
|
|
9071
9150
|
export type DBModuleType = typeof modules$1;
|
|
9072
9151
|
export interface ConfigOptions {
|
|
9073
9152
|
ttl: number;
|
|
9153
|
+
checkAuth?: boolean;
|
|
9074
9154
|
}
|
|
9075
9155
|
export type KitModuleFunction<I extends z.AnyZodObject = z.AnyZodObject, O extends z.ZodType | undefined = undefined, R = any> = {
|
|
9076
9156
|
input?: I;
|
|
@@ -10116,18 +10196,44 @@ declare class Point {
|
|
|
10116
10196
|
sub: string | undefined;
|
|
10117
10197
|
};
|
|
10118
10198
|
}>;
|
|
10119
|
-
upload_event(
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
}
|
|
10124
|
-
|
|
10199
|
+
upload_event({ action_id, }: {
|
|
10200
|
+
action_id: number;
|
|
10201
|
+
device_id?: string;
|
|
10202
|
+
refer_id?: string;
|
|
10203
|
+
}, ctx?: {
|
|
10204
|
+
authData?: {
|
|
10205
|
+
sub: string;
|
|
10206
|
+
};
|
|
10125
10207
|
}): Promise<any>;
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10208
|
+
generate_referral_code(args?: any, ctx?: {
|
|
10209
|
+
authData?: {
|
|
10210
|
+
sub: string;
|
|
10211
|
+
};
|
|
10212
|
+
}): Promise<any>;
|
|
10213
|
+
fetch_referral_code(args?: any, ctx?: {
|
|
10214
|
+
authData?: {
|
|
10215
|
+
sub: string;
|
|
10216
|
+
};
|
|
10217
|
+
}): Promise<any>;
|
|
10218
|
+
create_refer({ referral_code, device_id, }: {
|
|
10219
|
+
referral_code: string;
|
|
10220
|
+
device_id: string;
|
|
10221
|
+
}, ctx?: {
|
|
10222
|
+
authData?: {
|
|
10223
|
+
sub: string;
|
|
10224
|
+
};
|
|
10225
|
+
}): Promise<any>;
|
|
10226
|
+
fetch_event({ event_id }: {
|
|
10227
|
+
event_id: string;
|
|
10228
|
+
}, ctx?: {
|
|
10229
|
+
authData?: {
|
|
10230
|
+
sub: string;
|
|
10231
|
+
};
|
|
10232
|
+
}): Promise<any>;
|
|
10233
|
+
my_point_tasks(args?: any, ctx?: {
|
|
10234
|
+
authData?: {
|
|
10235
|
+
sub: string;
|
|
10236
|
+
};
|
|
10131
10237
|
}): Promise<any>;
|
|
10132
10238
|
}
|
|
10133
10239
|
declare const modules$4: {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var L=({url:A="http://localhost:9527",ctx:B}={})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{for(let E in T){if(typeof T[E]==="object")T[E]=JSON.stringify(T[E],(J,H)=>typeof H==="bigint"?H.toString():H);if(T[E]==null)delete T[E]}const w=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;let b;if(B)b=await fetch(w,{headers:{...B}});else b=await fetch(w);return b.json()}}})}}),K=async({args:A={},prop:B,method:G,url:C,fetchRequestInit:j})=>{if(!j?.method||j?.method==="GET"){for(let T in A){if(typeof A[T]==="object")A[T]=JSON.stringify(A[T],(w,b)=>typeof b==="bigint"?b.toString():b);if(A[T]==null)delete A[T]}const z=`${C}/${String(B)}/${String(G)}?${new URLSearchParams(A).toString()}`;return(await fetch(z,{...j})).json()}if(j?.method==="POST"){const z=`${C}/${String(B)}/${String(G)}`;return(await fetch(z,{...j,body:JSON.stringify(A)})).json()}},N=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{return K({args:T,prop:C,method:D,url:A,fetchRequestInit:B})}}})}}),Q=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{return K({args:T,prop:C,method:D,url:A,fetchRequestInit:B})}}})}}),S=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{const w=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;return(await fetch(w,{method:"GET",...B})).json()}}})}}),U=({url:A="http://localhost:9527",ctx:B}={})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{let w=!1;for(let H in T){if(typeof T[H]==="object")w=!0;if(T[H]==null)delete T[H]}let b,E,J={};if(w)b=`${A}/${String(C)}/${String(D)}`;else b=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;if(B)J.headers={...B};if(w)J.method="POST",J.body=JSON.stringify(T);return E=await fetch(b,J),E.json()}}})}});export{S as createIotexscanClient,U as createIoidClient,Q as createClientWithIoPayServer,N as createClientWithDBServer,L as createClient};
|