@iotexproject/kit 0.1.8 → 0.1.11

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
@@ -4230,37 +4230,6 @@ declare class IoID {
4230
4230
  }, ctx?: ConfigContext): Promise<IoIDDevice[] | {
4231
4231
  error: unknown;
4232
4232
  }>;
4233
- register(args: {
4234
- verifyingProxyAddress: `0x${string}`;
4235
- verifySignature: string;
4236
- didhash: string;
4237
- didurl: string;
4238
- owner: `0x${string}`;
4239
- device: `0x${string}`;
4240
- v: string;
4241
- r: string;
4242
- s: string;
4243
- }, ctx?: ConfigContext): Promise<{
4244
- address: `0x${string}`;
4245
- data: any;
4246
- chainId: string;
4247
- error?: undefined;
4248
- } | {
4249
- error: unknown;
4250
- address?: undefined;
4251
- data?: undefined;
4252
- chainId?: undefined;
4253
- }>;
4254
- did_hex(args: {
4255
- did: `0x${string}`;
4256
- owner: `0x${string}`;
4257
- }, ctx?: ConfigContext): Promise<{
4258
- hex: string;
4259
- error?: undefined;
4260
- } | {
4261
- error: unknown;
4262
- hex?: undefined;
4263
- }>;
4264
4233
  }
4265
4234
  declare class VoterEntity {
4266
4235
  address: `0x${string}`;
@@ -8621,6 +8590,51 @@ declare const modules$2: {
8621
8590
  };
8622
8591
  };
8623
8592
  export type IotexscanModulesType = typeof modules$2;
8593
+ declare class Ioid {
8594
+ register(args: {
8595
+ projectName: string;
8596
+ deviceSignature: `0x${string}`;
8597
+ did: string;
8598
+ didurl: string;
8599
+ owner: `0x${string}`;
8600
+ device: `0x${string}`;
8601
+ v: string;
8602
+ r: string;
8603
+ s: string;
8604
+ }, ctx?: ConfigContext): Promise<{
8605
+ error: any;
8606
+ ok?: undefined;
8607
+ hash?: undefined;
8608
+ } | {
8609
+ ok: boolean;
8610
+ hash: `0x${string}`;
8611
+ error?: undefined;
8612
+ }>;
8613
+ verifier(args: {
8614
+ owner: string;
8615
+ device: string;
8616
+ }, ctx?: ConfigContext): Promise<{
8617
+ verifySignature: string;
8618
+ error?: undefined;
8619
+ } | {
8620
+ error: any;
8621
+ verifySignature?: undefined;
8622
+ }>;
8623
+ did_hex(args: {
8624
+ did: `0x${string}`;
8625
+ owner: `0x${string}`;
8626
+ }, ctx?: ConfigContext): Promise<{
8627
+ hex: string;
8628
+ error?: undefined;
8629
+ } | {
8630
+ error: unknown;
8631
+ hex?: undefined;
8632
+ }>;
8633
+ }
8634
+ declare const modules$3: {
8635
+ ioid: Ioid;
8636
+ };
8637
+ export type IoIDModuleType = typeof modules$3;
8624
8638
  export type IotexscanAdapterType<T extends Record<string, Record<string, any>>> = {
8625
8639
  [key in keyof T]: {
8626
8640
  [key1 in keyof T[key]]: (arg: Parameters<T[key][key1]>[0] & {
@@ -8644,5 +8658,9 @@ export declare const createIotexscanClient: ({ url, fetchRequestInit }: {
8644
8658
  url?: string;
8645
8659
  fetchRequestInit?: FetchRequestInit;
8646
8660
  }) => IotexscanAdapterType<IotexscanModulesType>;
8661
+ export declare const createIoidClient: ({ url, ctx }?: {
8662
+ url?: string;
8663
+ ctx?: ConfigContext;
8664
+ }) => IoIDModuleType;
8647
8665
 
8648
8666
  export {};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var N=({url:B="http://localhost:9527",ctx:C}={})=>new Proxy({},{get(H,F,L){return new Proxy({},{get(J,b){return async(j)=>{for(let G in j){if(typeof j[G]==="object")j[G]=JSON.stringify(j[G],(K,M)=>typeof M==="bigint"?M.toString():M);if(j[G]==null)delete j[G]}const D=`${B}/${String(F)}/${String(b)}?${new URLSearchParams(j).toString()}`;let z;if(C)z=await fetch(D,{headers:{...C}});else z=await fetch(D);return z.json()}}})}}),O=({url:B="http://localhost:9527"}={})=>new Proxy({},{get(C,H,F){return new Proxy({},{get(L,J){return async(b)=>{for(let z in b){if(typeof b[z]==="object")b[z]=JSON.stringify(b[z],(G,K)=>typeof K==="bigint"?K.toString():K);if(b[z]==null)delete b[z]}const j=`${B}/${String(H)}/${String(J)}?${new URLSearchParams(b).toString()}`;return(await fetch(j)).json()}}})}}),P=({url:B="http://localhost:9527",fetchRequestInit:C})=>new Proxy({},{get(H,F,L){return new Proxy({},{get(J,b){return async(j)=>{const D=`${B}/${String(F)}/${String(b)}`;return(await fetch(D,{method:"POST",...C,body:JSON.stringify(j)})).json()}}})}}),Q=({url:B="http://localhost:9527",fetchRequestInit:C})=>new Proxy({},{get(H,F,L){return new Proxy({},{get(J,b){return async(j)=>{const D=`${B}/${String(F)}/${String(b)}?${new URLSearchParams(j).toString()}`;return(await fetch(D,{method:"GET",...C})).json()}}})}});export{Q as createIotexscanClient,P as createClientWithWriteDBServer,O as createClientWithDBServer,N as createClient};
1
+ var F=({url:w="http://localhost:9527",ctx:b}={})=>new Proxy({},{get(B,z,E){return new Proxy({},{get(C,$){return async(T)=>{for(let O in T){if(typeof T[O]==="object")T[O]=JSON.stringify(T[O],(D,A)=>typeof A==="bigint"?A.toString():A);if(T[O]==null)delete T[O]}const j=`${w}/${String(z)}/${String($)}?${new URLSearchParams(T).toString()}`;let N;if(b)N=await fetch(j,{headers:{...b}});else N=await fetch(j);return N.json()}}})}}),G=({url:w="http://localhost:9527"}={})=>new Proxy({},{get(b,B,z){return new Proxy({},{get(E,C){return async($)=>{for(let N in $){if(typeof $[N]==="object")$[N]=JSON.stringify($[N],(O,D)=>typeof D==="bigint"?D.toString():D);if($[N]==null)delete $[N]}const T=`${w}/${String(B)}/${String(C)}?${new URLSearchParams($).toString()}`;return(await fetch(T)).json()}}})}}),H=({url:w="http://localhost:9527",fetchRequestInit:b})=>new Proxy({},{get(B,z,E){return new Proxy({},{get(C,$){return async(T)=>{const j=`${w}/${String(z)}/${String($)}`;return(await fetch(j,{method:"POST",...b,body:JSON.stringify(T)})).json()}}})}}),J=({url:w="http://localhost:9527",fetchRequestInit:b})=>new Proxy({},{get(B,z,E){return new Proxy({},{get(C,$){return async(T)=>{const j=`${w}/${String(z)}/${String($)}?${new URLSearchParams(T).toString()}`;return(await fetch(j,{method:"GET",...b})).json()}}})}}),K=({url:w="http://localhost:9527",ctx:b}={})=>new Proxy({},{get(B,z,E){return new Proxy({},{get(C,$){return async(T)=>{for(let O in T){if(typeof T[O]==="object")T[O]=JSON.stringify(T[O],(D,A)=>typeof A==="bigint"?A.toString():A);if(T[O]==null)delete T[O]}const j=`${w}/${String(z)}/${String($)}?${new URLSearchParams(T).toString()}`;let N;if(b)N=await fetch(j,{headers:{...b}});else N=await fetch(j);return N.json()}}})}});export{J as createIotexscanClient,K as createIoidClient,H as createClientWithWriteDBServer,G as createClientWithDBServer,F as createClient};
package/package.json CHANGED
@@ -2,14 +2,14 @@
2
2
  "name": "@iotexproject/kit",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "v0.1.8",
5
+ "version": "v0.1.11",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
9
9
  "dev": "bun run build && bun run --watch server-kit.ts",
10
10
  "dev-db": "bun server-db.ts",
11
11
  "dev-iotexscan": "bun server-iotexscan.ts",
12
- "dev-pebble": "bun run build && bun run --watch server-pebble.ts",
12
+ "dev-ioid": "bun run build && bun run --watch server-ioid.ts",
13
13
  "test": "bun --hot run tests/test-marshalldao.ts",
14
14
  "build": "bun run build.mjs",
15
15
  "prepublishOnly": "bun run build",
@@ -23,6 +23,7 @@
23
23
  "@grpc/grpc-js": "^1.11.1",
24
24
  "@grpc/proto-loader": "^0.7.13",
25
25
  "@iotexproject/iotex-address-ts": "^1.0.4",
26
+ "@noble/curves": "^1.6.0",
26
27
  "@tryghost/content-api": "^1.11.21",
27
28
  "axios": "^1.7.2",
28
29
  "bech32": "^2.0.0",