@iotexproject/kit 0.1.18 → 0.1.20

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
@@ -352,6 +352,12 @@ declare class ERC20Entity {
352
352
  originFormat: string;
353
353
  decimals: string;
354
354
  }>;
355
+ balanceUSD(account?: `0x${string}`): Promise<string | {
356
+ value: string;
357
+ format: string;
358
+ originFormat: string;
359
+ decimals: string;
360
+ }>;
355
361
  allowance: (owner: string, spender: string) => Promise<any>;
356
362
  approve(spender: `0x${string}`, amount: string, owner: `0x${string}`): Promise<`0x${string}` | null>;
357
363
  priceUSD(): Promise<any>;
@@ -2559,11 +2565,12 @@ export interface IoIDDevice {
2559
2565
  } | null;
2560
2566
  }
2561
2567
  export type ProjectMetadata = {
2562
- logo: string;
2568
+ logo?: string;
2563
2569
  twitter?: string;
2564
2570
  website?: string;
2565
2571
  desc?: string;
2566
2572
  github?: string;
2573
+ metadata?: any;
2567
2574
  };
2568
2575
  declare class GaugeEntity {
2569
2576
  address: `0x${string}`;
@@ -6303,6 +6310,366 @@ declare class UniswapV2LPEntity {
6303
6310
  balanceOf(address: string): Promise<bigint>;
6304
6311
  totalSupplyUSD(): Promise<number>;
6305
6312
  }
6313
+ declare class ERC20Entity$1 {
6314
+ address: `0x${string}`;
6315
+ chainId: string;
6316
+ static abi: readonly [
6317
+ {
6318
+ readonly inputs: readonly [
6319
+ {
6320
+ readonly internalType: "string";
6321
+ readonly name: "name";
6322
+ readonly type: "string";
6323
+ },
6324
+ {
6325
+ readonly internalType: "string";
6326
+ readonly name: "symbol";
6327
+ readonly type: "string";
6328
+ },
6329
+ {
6330
+ readonly internalType: "uint256";
6331
+ readonly name: "initialSupply";
6332
+ readonly type: "uint256";
6333
+ },
6334
+ {
6335
+ readonly internalType: "address";
6336
+ readonly name: "owner";
6337
+ readonly type: "address";
6338
+ }
6339
+ ];
6340
+ readonly stateMutability: "nonpayable";
6341
+ readonly type: "constructor";
6342
+ },
6343
+ {
6344
+ readonly anonymous: false;
6345
+ readonly inputs: readonly [
6346
+ {
6347
+ readonly indexed: true;
6348
+ readonly internalType: "address";
6349
+ readonly name: "owner";
6350
+ readonly type: "address";
6351
+ },
6352
+ {
6353
+ readonly indexed: true;
6354
+ readonly internalType: "address";
6355
+ readonly name: "spender";
6356
+ readonly type: "address";
6357
+ },
6358
+ {
6359
+ readonly indexed: false;
6360
+ readonly internalType: "uint256";
6361
+ readonly name: "value";
6362
+ readonly type: "uint256";
6363
+ }
6364
+ ];
6365
+ readonly name: "Approval";
6366
+ readonly type: "event";
6367
+ },
6368
+ {
6369
+ readonly anonymous: false;
6370
+ readonly inputs: readonly [
6371
+ {
6372
+ readonly indexed: true;
6373
+ readonly internalType: "address";
6374
+ readonly name: "from";
6375
+ readonly type: "address";
6376
+ },
6377
+ {
6378
+ readonly indexed: true;
6379
+ readonly internalType: "address";
6380
+ readonly name: "to";
6381
+ readonly type: "address";
6382
+ },
6383
+ {
6384
+ readonly indexed: false;
6385
+ readonly internalType: "uint256";
6386
+ readonly name: "value";
6387
+ readonly type: "uint256";
6388
+ }
6389
+ ];
6390
+ readonly name: "Transfer";
6391
+ readonly type: "event";
6392
+ },
6393
+ {
6394
+ readonly inputs: readonly [
6395
+ {
6396
+ readonly internalType: "address";
6397
+ readonly name: "owner";
6398
+ readonly type: "address";
6399
+ },
6400
+ {
6401
+ readonly internalType: "address";
6402
+ readonly name: "spender";
6403
+ readonly type: "address";
6404
+ }
6405
+ ];
6406
+ readonly name: "allowance";
6407
+ readonly outputs: readonly [
6408
+ {
6409
+ readonly internalType: "uint256";
6410
+ readonly name: "";
6411
+ readonly type: "uint256";
6412
+ }
6413
+ ];
6414
+ readonly stateMutability: "view";
6415
+ readonly type: "function";
6416
+ },
6417
+ {
6418
+ readonly inputs: readonly [
6419
+ {
6420
+ readonly internalType: "address";
6421
+ readonly name: "spender";
6422
+ readonly type: "address";
6423
+ },
6424
+ {
6425
+ readonly internalType: "uint256";
6426
+ readonly name: "amount";
6427
+ readonly type: "uint256";
6428
+ }
6429
+ ];
6430
+ readonly name: "approve";
6431
+ readonly outputs: readonly [
6432
+ {
6433
+ readonly internalType: "bool";
6434
+ readonly name: "";
6435
+ readonly type: "bool";
6436
+ }
6437
+ ];
6438
+ readonly stateMutability: "nonpayable";
6439
+ readonly type: "function";
6440
+ },
6441
+ {
6442
+ readonly inputs: readonly [
6443
+ {
6444
+ readonly internalType: "address";
6445
+ readonly name: "account";
6446
+ readonly type: "address";
6447
+ }
6448
+ ];
6449
+ readonly name: "balanceOf";
6450
+ readonly outputs: readonly [
6451
+ {
6452
+ readonly internalType: "uint256";
6453
+ readonly name: "";
6454
+ readonly type: "uint256";
6455
+ }
6456
+ ];
6457
+ readonly stateMutability: "view";
6458
+ readonly type: "function";
6459
+ },
6460
+ {
6461
+ readonly inputs: readonly [
6462
+ {
6463
+ readonly internalType: "uint256";
6464
+ readonly name: "amount";
6465
+ readonly type: "uint256";
6466
+ }
6467
+ ];
6468
+ readonly name: "burn";
6469
+ readonly outputs: readonly [
6470
+ ];
6471
+ readonly stateMutability: "nonpayable";
6472
+ readonly type: "function";
6473
+ },
6474
+ {
6475
+ readonly inputs: readonly [
6476
+ {
6477
+ readonly internalType: "address";
6478
+ readonly name: "account";
6479
+ readonly type: "address";
6480
+ },
6481
+ {
6482
+ readonly internalType: "uint256";
6483
+ readonly name: "amount";
6484
+ readonly type: "uint256";
6485
+ }
6486
+ ];
6487
+ readonly name: "burnFrom";
6488
+ readonly outputs: readonly [
6489
+ ];
6490
+ readonly stateMutability: "nonpayable";
6491
+ readonly type: "function";
6492
+ },
6493
+ {
6494
+ readonly inputs: readonly [
6495
+ ];
6496
+ readonly name: "decimals";
6497
+ readonly outputs: readonly [
6498
+ {
6499
+ readonly internalType: "uint8";
6500
+ readonly name: "";
6501
+ readonly type: "uint8";
6502
+ }
6503
+ ];
6504
+ readonly stateMutability: "view";
6505
+ readonly type: "function";
6506
+ },
6507
+ {
6508
+ readonly inputs: readonly [
6509
+ {
6510
+ readonly internalType: "address";
6511
+ readonly name: "spender";
6512
+ readonly type: "address";
6513
+ },
6514
+ {
6515
+ readonly internalType: "uint256";
6516
+ readonly name: "subtractedValue";
6517
+ readonly type: "uint256";
6518
+ }
6519
+ ];
6520
+ readonly name: "decreaseAllowance";
6521
+ readonly outputs: readonly [
6522
+ {
6523
+ readonly internalType: "bool";
6524
+ readonly name: "";
6525
+ readonly type: "bool";
6526
+ }
6527
+ ];
6528
+ readonly stateMutability: "nonpayable";
6529
+ readonly type: "function";
6530
+ },
6531
+ {
6532
+ readonly inputs: readonly [
6533
+ {
6534
+ readonly internalType: "address";
6535
+ readonly name: "spender";
6536
+ readonly type: "address";
6537
+ },
6538
+ {
6539
+ readonly internalType: "uint256";
6540
+ readonly name: "addedValue";
6541
+ readonly type: "uint256";
6542
+ }
6543
+ ];
6544
+ readonly name: "increaseAllowance";
6545
+ readonly outputs: readonly [
6546
+ {
6547
+ readonly internalType: "bool";
6548
+ readonly name: "";
6549
+ readonly type: "bool";
6550
+ }
6551
+ ];
6552
+ readonly stateMutability: "nonpayable";
6553
+ readonly type: "function";
6554
+ },
6555
+ {
6556
+ readonly inputs: readonly [
6557
+ ];
6558
+ readonly name: "name";
6559
+ readonly outputs: readonly [
6560
+ {
6561
+ readonly internalType: "string";
6562
+ readonly name: "";
6563
+ readonly type: "string";
6564
+ }
6565
+ ];
6566
+ readonly stateMutability: "view";
6567
+ readonly type: "function";
6568
+ },
6569
+ {
6570
+ readonly inputs: readonly [
6571
+ ];
6572
+ readonly name: "symbol";
6573
+ readonly outputs: readonly [
6574
+ {
6575
+ readonly internalType: "string";
6576
+ readonly name: "";
6577
+ readonly type: "string";
6578
+ }
6579
+ ];
6580
+ readonly stateMutability: "view";
6581
+ readonly type: "function";
6582
+ },
6583
+ {
6584
+ readonly inputs: readonly [
6585
+ ];
6586
+ readonly name: "totalSupply";
6587
+ readonly outputs: readonly [
6588
+ {
6589
+ readonly internalType: "uint256";
6590
+ readonly name: "";
6591
+ readonly type: "uint256";
6592
+ }
6593
+ ];
6594
+ readonly stateMutability: "view";
6595
+ readonly type: "function";
6596
+ },
6597
+ {
6598
+ readonly inputs: readonly [
6599
+ {
6600
+ readonly internalType: "address";
6601
+ readonly name: "recipient";
6602
+ readonly type: "address";
6603
+ },
6604
+ {
6605
+ readonly internalType: "uint256";
6606
+ readonly name: "amount";
6607
+ readonly type: "uint256";
6608
+ }
6609
+ ];
6610
+ readonly name: "transfer";
6611
+ readonly outputs: readonly [
6612
+ {
6613
+ readonly internalType: "bool";
6614
+ readonly name: "";
6615
+ readonly type: "bool";
6616
+ }
6617
+ ];
6618
+ readonly stateMutability: "nonpayable";
6619
+ readonly type: "function";
6620
+ },
6621
+ {
6622
+ readonly inputs: readonly [
6623
+ {
6624
+ readonly internalType: "address";
6625
+ readonly name: "sender";
6626
+ readonly type: "address";
6627
+ },
6628
+ {
6629
+ readonly internalType: "address";
6630
+ readonly name: "recipient";
6631
+ readonly type: "address";
6632
+ },
6633
+ {
6634
+ readonly internalType: "uint256";
6635
+ readonly name: "amount";
6636
+ readonly type: "uint256";
6637
+ }
6638
+ ];
6639
+ readonly name: "transferFrom";
6640
+ readonly outputs: readonly [
6641
+ {
6642
+ readonly internalType: "bool";
6643
+ readonly name: "";
6644
+ readonly type: "bool";
6645
+ }
6646
+ ];
6647
+ readonly stateMutability: "nonpayable";
6648
+ readonly type: "function";
6649
+ }
6650
+ ];
6651
+ get isEther(): boolean;
6652
+ type(): Promise<string>;
6653
+ name: string;
6654
+ symbol: string;
6655
+ decimals(): Promise<number | undefined>;
6656
+ balanceOf(account?: `0x${string}`): Promise<{
6657
+ value: string;
6658
+ format: string;
6659
+ originFormat: string;
6660
+ decimals: string;
6661
+ }>;
6662
+ balanceUSD(account?: `0x${string}`): Promise<string | {
6663
+ value: string;
6664
+ format: string;
6665
+ originFormat: string;
6666
+ decimals: string;
6667
+ }>;
6668
+ allowance: (owner: string, spender: string) => Promise<any>;
6669
+ approve(spender: `0x${string}`, amount: string, owner: `0x${string}`): Promise<`0x${string}` | null>;
6670
+ priceUSD(): Promise<any>;
6671
+ tokenUrl(): Promise<any>;
6672
+ }
6306
6673
  declare class Mimo {
6307
6674
  getLpList(args: {
6308
6675
  address: string;
@@ -6335,6 +6702,24 @@ declare class Mimo {
6335
6702
  getToken({ address }: {
6336
6703
  address: string;
6337
6704
  }): Promise<any>;
6705
+ getTokenDetail({ account, tokenAddress }: {
6706
+ account: `0x${string}`;
6707
+ tokenAddress: `0x${string}`;
6708
+ }): Promise<import("@dappworks/kit/aiem").QueryReturnType<ERC20Entity$1, {
6709
+ name: true;
6710
+ symbol: true;
6711
+ priceUSD: true;
6712
+ tokenUrl: true;
6713
+ balanceOf: false | [
6714
+ `0x${string}`
6715
+ ];
6716
+ balanceUSD: false | [
6717
+ `0x${string}`
6718
+ ];
6719
+ }>>;
6720
+ getAllTokens({ account }: {
6721
+ account: `0x${string}`;
6722
+ }): Promise<any>;
6338
6723
  }
6339
6724
  declare class MockBucketEntity {
6340
6725
  address: `0x${string}`;
@@ -8301,6 +8686,38 @@ declare class Health {
8301
8686
  message: string;
8302
8687
  };
8303
8688
  }
8689
+ declare class PointsPlatform {
8690
+ userPoints(args: {
8691
+ user: string;
8692
+ }): Promise<{
8693
+ selfPoints: any;
8694
+ selfRank: any;
8695
+ dailyPoints: any;
8696
+ error?: undefined;
8697
+ } | {
8698
+ error: unknown;
8699
+ selfPoints?: undefined;
8700
+ selfRank?: undefined;
8701
+ dailyPoints?: undefined;
8702
+ }>;
8703
+ usersRank(args: {
8704
+ page: number;
8705
+ limit: number;
8706
+ }): Promise<{
8707
+ data: any;
8708
+ error?: undefined;
8709
+ } | {
8710
+ error: unknown;
8711
+ data?: undefined;
8712
+ }>;
8713
+ protocolsRank(): Promise<{
8714
+ data: any;
8715
+ error?: undefined;
8716
+ } | {
8717
+ error: unknown;
8718
+ data?: undefined;
8719
+ }>;
8720
+ }
8304
8721
  declare const modules: {
8305
8722
  mimo: Mimo;
8306
8723
  staking: Staking;
@@ -8310,6 +8727,7 @@ declare const modules: {
8310
8727
  utils: utils;
8311
8728
  hub: UseHub;
8312
8729
  health: Health;
8730
+ points: PointsPlatform;
8313
8731
  };
8314
8732
  export type ModuleType = typeof modules;
8315
8733
  declare class ClickHouseSDK {
@@ -8360,7 +8778,7 @@ declare class Analysis extends BaseDBModule {
8360
8778
  ok: boolean;
8361
8779
  message: string;
8362
8780
  }>;
8363
- createRef({ device_id, refer_id, user_id }: {
8781
+ create_ref({ device_id, refer_id, user_id }: {
8364
8782
  device_id: string;
8365
8783
  refer_id: string;
8366
8784
  user_id: string;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var G=({url:b="http://localhost:9527",ctx:j}={})=>new Proxy({},{get(C,w,F){return new Proxy({},{get(E,D){return async(T)=>{for(let z in T){if(typeof T[z]==="object")T[z]=JSON.stringify(T[z],(A,B)=>typeof B==="bigint"?B.toString():B);if(T[z]==null)delete T[z]}const $=`${b}/${String(w)}/${String(D)}?${new URLSearchParams(T).toString()}`;let N;if(j)N=await fetch($,{headers:{...j}});else N=await fetch($);return N.json()}}})}}),H=({url:b="http://localhost:9527"}={})=>new Proxy({},{get(j,C,w){return new Proxy({},{get(F,E){return async(D)=>{for(let N in D){if(typeof D[N]==="object")D[N]=JSON.stringify(D[N],(z,A)=>typeof A==="bigint"?A.toString():A);if(D[N]==null)delete D[N]}const T=`${b}/${String(C)}/${String(E)}?${new URLSearchParams(D).toString()}`;return(await fetch(T)).json()}}})}}),J=({url:b="http://localhost:9527",fetchRequestInit:j})=>new Proxy({},{get(C,w,F){return new Proxy({},{get(E,D){return async(T)=>{const $=`${b}/${String(w)}/${String(D)}`;return(await fetch($,{method:"POST",...j,body:JSON.stringify(T)})).json()}}})}}),K=({url:b="http://localhost:9527",fetchRequestInit:j})=>new Proxy({},{get(C,w,F){return new Proxy({},{get(E,D){return async(T)=>{const $=`${b}/${String(w)}/${String(D)}?${new URLSearchParams(T).toString()}`;return(await fetch($,{method:"GET",...j})).json()}}})}}),L=({url:b="http://localhost:9527",ctx:j}={})=>new Proxy({},{get(C,w,F){return new Proxy({},{get(E,D){return async(T)=>{let $=!1;for(let B in T){if(typeof T[B]==="object")$=!0;if(T[B]==null)delete T[B]}let N,z,A={};if($)N=`${b}/${String(w)}/${String(D)}`;else N=`${b}/${String(w)}/${String(D)}?${new URLSearchParams(T).toString()}`;if(j)A.headers={...j};if($)A.method="POST",A.body=JSON.stringify(T);return z=await fetch(N,A),z.json()}}})}});export{K as createIotexscanClient,L as createIoidClient,J as createClientWithWriteDBServer,H as createClientWithDBServer,G as createClient};
1
+ var Q=({url:C="http://localhost:9527",ctx:D}={})=>new Proxy({},{get(K,F,N){return new Proxy({},{get(L,j){return async(b)=>{for(let G in b){if(typeof b[G]==="object")b[G]=JSON.stringify(b[G],(H,J)=>typeof J==="bigint"?J.toString():J);if(b[G]==null)delete b[G]}const B=`${C}/${String(F)}/${String(j)}?${new URLSearchParams(b).toString()}`;let z;if(D)z=await fetch(B,{headers:{...D}});else z=await fetch(B);return z.json()}}})}}),S=({url:C="http://localhost:9527"}={})=>new Proxy({},{get(D,K,F){return new Proxy({},{get(N,L){return async(j)=>{for(let z in j){if(typeof j[z]==="object")j[z]=JSON.stringify(j[z],(G,H)=>typeof H==="bigint"?H.toString():H);if(j[z]==null)delete j[z]}const b=`${C}/${String(K)}/${String(L)}?${new URLSearchParams(j).toString()}`;return(await fetch(b)).json()}}})}}),U=({url:C="http://localhost:9527",fetchRequestInit:D})=>new Proxy({},{get(K,F,N){return new Proxy({},{get(L,j){return async(b)=>{const B=`${C}/${String(F)}/${String(j)}`;return(await fetch(B,{method:"POST",...D,body:JSON.stringify(b)})).json()}}})}}),V=({url:C="http://localhost:9527",fetchRequestInit:D})=>new Proxy({},{get(K,F,N){return new Proxy({},{get(L,j){return async(b)=>{const B=`${C}/${String(F)}/${String(j)}?${new URLSearchParams(b).toString()}`;return(await fetch(B,{method:"GET",...D})).json()}}})}}),W=({url:C="http://localhost:9527",ctx:D}={})=>new Proxy({},{get(K,F,N){return new Proxy({},{get(L,j){return async(b)=>{let B=!1;for(let J in b){if(typeof b[J]==="object")B=!0;if(b[J]==null)delete b[J]}let z,G,H={};if(B)z=`${C}/${String(F)}/${String(j)}`;else z=`${C}/${String(F)}/${String(j)}?${new URLSearchParams(b).toString()}`;if(D)H.headers={...D};if(B)H.method="POST",H.body=JSON.stringify(b);return G=await fetch(z,H),G.json()}}})}});export{V as createIotexscanClient,W as createIoidClient,U as createClientWithWriteDBServer,S as createClientWithDBServer,Q 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.18",
5
+ "version": "v0.1.20",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {