@iotexproject/kit 0.1.29 → 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 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: `0x${string}`;
4231
+ data: any;
4230
4232
  chainId: string;
4231
4233
  error?: undefined;
4232
4234
  } | {
@@ -8879,29 +8881,74 @@ declare class Analysis extends BaseDBModule {
8879
8881
  api_key: string;
8880
8882
  };
8881
8883
  }>;
8882
- create_ref({ device_id, refer_id, user_id, point }: {
8883
- device_id: string;
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, }: {
8884
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, }: {
8885
8915
  user_id: string;
8886
- point?: number;
8887
- }, authData?: {
8888
- app_id: string;
8889
- api_key: string;
8916
+ }, ctx?: {
8917
+ authData?: {
8918
+ app_id: string;
8919
+ api_key: string;
8920
+ };
8890
8921
  }): Promise<{
8922
+ ok: boolean;
8923
+ referral_code: any;
8924
+ msg?: undefined;
8925
+ } | {
8891
8926
  ok: boolean;
8892
8927
  msg: any;
8928
+ referral_code?: undefined;
8893
8929
  }>;
8894
- upload_event({ user_id, type, event }: {
8895
- type: string;
8930
+ create_refer({ refer_id, user_id, device_id, data, }: {
8931
+ refer_id: string;
8896
8932
  user_id: string;
8897
- event: Record<string, any>;
8898
- }, authData?: {
8899
- app_id: string;
8900
- api_key: string;
8933
+ device_id: string;
8934
+ data?: Record<string, any>;
8935
+ }, ctx?: {
8936
+ authData?: {
8937
+ app_id: string;
8938
+ api_key: string;
8939
+ };
8901
8940
  }): Promise<{
8902
8941
  ok: boolean;
8903
8942
  msg: any;
8904
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>>;
8905
8952
  }
8906
8953
  declare class Analyzer extends BaseDBModule {
8907
8954
  tvl(): Promise<any>;
@@ -9074,7 +9121,7 @@ declare class Staking$1 extends BaseDBModule {
9074
9121
  data?: undefined;
9075
9122
  }>;
9076
9123
  }
9077
- export type ComponentType = "banner-latest" | "iotex-2.0";
9124
+ export type ComponentType = "banner-latest" | "token-2049";
9078
9125
  export interface ComponentData {
9079
9126
  id: ComponentType;
9080
9127
  html: string;
@@ -9103,6 +9150,7 @@ declare const modules$1: {
9103
9150
  export type DBModuleType = typeof modules$1;
9104
9151
  export interface ConfigOptions {
9105
9152
  ttl: number;
9153
+ checkAuth?: boolean;
9106
9154
  }
9107
9155
  export type KitModuleFunction<I extends z.AnyZodObject = z.AnyZodObject, O extends z.ZodType | undefined = undefined, R = any> = {
9108
9156
  input?: I;
@@ -10148,17 +10196,44 @@ declare class Point {
10148
10196
  sub: string | undefined;
10149
10197
  };
10150
10198
  }>;
10151
- upload_event({ action_type, }: {
10152
- action_type: string;
10153
- }, authData?: {
10154
- sub: string;
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
+ };
10155
10207
  }): Promise<any>;
10156
- create_ref({ refer_id, device_id, user_id, }: {
10157
- refer_id: string;
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;
10158
10220
  device_id: string;
10159
- user_id: string;
10160
- }, authData?: {
10161
- sub: 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
+ };
10162
10237
  }): Promise<any>;
10163
10238
  }
10164
10239
  declare const modules$4: {
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 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};
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.29",
5
+ "version": "v0.1.30",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {