@iotexproject/kit 0.1.96 → 0.1.98

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +350 -29
  2. package/package.json +84 -59
package/dist/index.d.ts CHANGED
@@ -6953,6 +6953,12 @@ declare class Staking {
6953
6953
  getNFTV2BucketByIndex(args: {
6954
6954
  token_id: string;
6955
6955
  }, ctx?: ConfigContext): Promise<any>;
6956
+ getNFTV3BucketsByIndexes(args: {
6957
+ token_ids: string[];
6958
+ }, ctx?: ConfigContext): Promise<any[]>;
6959
+ getNFTV3BucketByIndex(args: {
6960
+ token_id: string;
6961
+ }, ctx?: ConfigContext): Promise<any>;
6956
6962
  createNativeBucket(args: {
6957
6963
  candName: string;
6958
6964
  amount: string;
@@ -7071,6 +7077,7 @@ declare class Staking {
7071
7077
  getSelfStakeBucketByDelegate(args: {
7072
7078
  ownerAddress: `0x${string}` | `io${string}`;
7073
7079
  }, ctx?: ConfigContext): Promise<CompositeBucket | null>;
7080
+ docs(): Promise<string>;
7074
7081
  }
7075
7082
  declare class utils {
7076
7083
  erc20(args: {
@@ -8663,6 +8670,37 @@ declare class LiquidityMiningV3 {
8663
8670
  chainId: string;
8664
8671
  }>;
8665
8672
  }
8673
+ declare class UseCommon {
8674
+ constructor();
8675
+ emailSubscribe(args: {
8676
+ email: string;
8677
+ audience_Id: string;
8678
+ first_name?: string;
8679
+ last_name?: string;
8680
+ unsubscribed?: boolean;
8681
+ }): Promise<any>;
8682
+ }
8683
+ declare class Delegate {
8684
+ candidateRegister(args: {
8685
+ name: string;
8686
+ operatorAddress: string;
8687
+ rewardAddress: string;
8688
+ ownerAddress: string;
8689
+ amount: string;
8690
+ duration: string;
8691
+ autoStake: boolean;
8692
+ }, ctx?: ConfigContext): Promise<any>;
8693
+ upsertRewardDistribution(args: {
8694
+ foundationRewardPortion: number;
8695
+ epochRewardPortion: number;
8696
+ blockRewardPortion: number;
8697
+ }, ctx?: ConfigContext): Promise<any>;
8698
+ candidateUpdate(args: {
8699
+ name: string;
8700
+ operatorAddress: string;
8701
+ rewardAddress: string;
8702
+ }, ctx?: ConfigContext): Promise<any>;
8703
+ }
8666
8704
  declare const modules: {
8667
8705
  mimo: Mimo;
8668
8706
  staking: Staking;
@@ -8676,6 +8714,8 @@ declare const modules: {
8676
8714
  bondingcurve: BondingCurve;
8677
8715
  liquidityMining: LiquidityMining;
8678
8716
  liquidityMiningV3: LiquidityMiningV3;
8717
+ common: UseCommon;
8718
+ delegate: Delegate;
8679
8719
  };
8680
8720
  export type ModuleType = typeof modules;
8681
8721
  declare class ClickHouseSDK {
@@ -8695,10 +8735,12 @@ declare class BaseDBModule {
8695
8735
  iopay: ReturnType<typeof postgres>;
8696
8736
  nftmarket: ReturnType<typeof postgres>;
8697
8737
  mimo: ReturnType<typeof postgres>;
8738
+ mimoSwapBridge: ReturnType<typeof postgres>;
8698
8739
  depinscan: ReturnType<typeof postgres>;
8699
- analysis: ClickHouseSDK;
8740
+ analysis: ReturnType<typeof postgres>;
8700
8741
  microServiceCenter: ReturnType<typeof postgres>;
8701
8742
  dao: ReturnType<typeof postgres>;
8743
+ nsv3db: ReturnType<typeof postgres>;
8702
8744
  cache: ReturnType<typeof bento.namespace>;
8703
8745
  constructor();
8704
8746
  checkAuth(key: string): Promise<{
@@ -8731,45 +8773,45 @@ declare class Account extends BaseDBModule {
8731
8773
  }
8732
8774
  declare class Analyzer extends BaseDBModule {
8733
8775
  tvl(): Promise<any>;
8734
- dailyTvl({ start_date, end_date }?: {
8776
+ dailyTvl({ start_date, end_date, }?: {
8735
8777
  start_date?: string;
8736
8778
  end_date?: string;
8737
- }): Promise<postgres.RowList<postgres.Row[]>>;
8779
+ }): Promise<import("postgres").RowList<import("postgres").Row[]>>;
8738
8780
  contractCount(): Promise<any>;
8739
8781
  totalStakedIotx(): Promise<any>;
8740
- activeWalletCount({ start_date, end_date }?: {
8782
+ activeWalletCount({ start_date, end_date, }?: {
8741
8783
  start_date?: string;
8742
8784
  end_date?: string;
8743
8785
  }): Promise<any>;
8744
- dailyTxCount({ start_date, end_date }?: {
8786
+ dailyTxCount({ start_date, end_date, }?: {
8745
8787
  start_date?: string;
8746
8788
  end_date?: string;
8747
- }): Promise<postgres.RowList<postgres.Row[]>>;
8748
- dailyAvgTps({ start_date, end_date }?: {
8789
+ }): Promise<import("postgres").RowList<import("postgres").Row[]>>;
8790
+ dailyAvgTps({ start_date, end_date, }?: {
8749
8791
  start_date?: string;
8750
8792
  end_date?: string;
8751
- }): Promise<postgres.RowList<postgres.Row[]>>;
8752
- dailyPeakTps({ start_date, end_date }?: {
8793
+ }): Promise<import("postgres").RowList<import("postgres").Row[]>>;
8794
+ dailyPeakTps({ start_date, end_date, }?: {
8753
8795
  start_date?: string;
8754
8796
  end_date?: string;
8755
- }): Promise<postgres.RowList<postgres.Row[]>>;
8756
- avgDailyTxVolume({ start_date, end_date }?: {
8797
+ }): Promise<import("postgres").RowList<import("postgres").Row[]>>;
8798
+ avgDailyTxVolume({ start_date, end_date, }?: {
8757
8799
  start_date?: string;
8758
8800
  end_date?: string;
8759
8801
  }): Promise<any>;
8760
- sumGasFee({ start_date, end_date }?: {
8802
+ sumGasFee({ start_date, end_date, }?: {
8761
8803
  start_date?: string;
8762
8804
  end_date?: string;
8763
8805
  }): Promise<any>;
8764
- sumGasFeeIotx({ start_date, end_date }?: {
8806
+ sumGasFeeIotx({ start_date, end_date, }?: {
8765
8807
  start_date?: string;
8766
8808
  end_date?: string;
8767
8809
  }): Promise<any>;
8768
- avgGasFee({ start_date, end_date }?: {
8810
+ avgGasFee({ start_date, end_date, }?: {
8769
8811
  start_date?: string;
8770
8812
  end_date?: string;
8771
8813
  }): Promise<any>;
8772
- avgGasFeeIotx({ start_date, end_date }?: {
8814
+ avgGasFeeIotx({ start_date, end_date, }?: {
8773
8815
  start_date?: string;
8774
8816
  end_date?: string;
8775
8817
  }): Promise<any>;
@@ -8777,20 +8819,20 @@ declare class Analyzer extends BaseDBModule {
8777
8819
  dappsCount(): Promise<any>;
8778
8820
  totalCrossChainTxCount(): Promise<number>;
8779
8821
  nftContractCount(): Promise<any>;
8780
- dailyStakingRatio({ start_date, end_date }?: {
8822
+ dailyStakingRatio({ start_date, end_date, }?: {
8781
8823
  start_date?: string;
8782
8824
  end_date?: string;
8783
8825
  }): Promise<{
8784
8826
  date_time: string;
8785
8827
  }[]>;
8786
- dailyIoTexHolder({ start_date, end_date }?: {
8828
+ dailyIoTexHolder({ start_date, end_date, }?: {
8787
8829
  start_date?: string;
8788
8830
  end_date?: string;
8789
- }): Promise<postgres.RowList<postgres.Row[]>>;
8790
- avgStakingDurationHistory({ start_date, end_date }?: {
8831
+ }): Promise<import("postgres").RowList<import("postgres").Row[]>>;
8832
+ avgStakingDurationHistory({ start_date, end_date, }?: {
8791
8833
  start_date?: string;
8792
8834
  end_date?: string;
8793
- }): Promise<postgres.RowList<postgres.Row[]>>;
8835
+ }): Promise<import("postgres").RowList<import("postgres").Row[]>>;
8794
8836
  burned_iotx(): Promise<string>;
8795
8837
  chain_meta(): Promise<{
8796
8838
  height: any;
@@ -8805,7 +8847,8 @@ declare class Analyzer extends BaseDBModule {
8805
8847
  block_height?: number | string;
8806
8848
  start_block?: number | string;
8807
8849
  end_block?: number | string;
8808
- }): Promise<postgres.Row | postgres.RowList<postgres.Row[]>>;
8850
+ }): Promise<import("postgres").Row | import("postgres").RowList<import("postgres").Row[]>>;
8851
+ worker_metrics(): Promise<import("postgres").RowList<import("postgres").Row[]>>;
8809
8852
  }
8810
8853
  export interface ItemNFT {
8811
8854
  collection: string;
@@ -8984,10 +9027,24 @@ declare class Mimo$1 extends BaseDBModule {
8984
9027
  token_detail_v2({ token_address }: {
8985
9028
  token_address: string;
8986
9029
  }): Promise<import("postgres").Row>;
9030
+ token_detail_v3({ token_address }: {
9031
+ token_address: string;
9032
+ }): Promise<{
9033
+ name: any;
9034
+ symbol: any;
9035
+ decimals: any;
9036
+ totalSupply: any;
9037
+ priceUSD: number;
9038
+ volumeUSD: any;
9039
+ tvlUSD: any;
9040
+ }>;
8987
9041
  token_tx_v2({ token, type }: {
8988
9042
  token: string;
8989
9043
  type: string;
8990
9044
  }): Promise<never[] | import("postgres").RowList<import("postgres").Row[]> | undefined>;
9045
+ token_tx_v3({ token }: {
9046
+ token: string;
9047
+ }): Promise<any>;
8991
9048
  mimo_swap_volume(args: {
8992
9049
  token: string;
8993
9050
  user: string;
@@ -8999,6 +9056,23 @@ declare class Mimo$1 extends BaseDBModule {
8999
9056
  v2_token_price({ token }: {
9000
9057
  token: string;
9001
9058
  }): Promise<any>;
9059
+ v3_token_price({ token }: {
9060
+ token: string;
9061
+ }): Promise<any>;
9062
+ v3_pool_trade_rank(): Promise<import("postgres").RowList<import("postgres").Row[]>>;
9063
+ }
9064
+ declare class MimoSwapBridge extends BaseDBModule {
9065
+ addlog(args: {
9066
+ address: string;
9067
+ contractName: string;
9068
+ data: Record<string, any>;
9069
+ hash: string;
9070
+ blockNumber: number;
9071
+ timestamp: number;
9072
+ }): Promise<{
9073
+ success: boolean;
9074
+ message: string;
9075
+ }>;
9002
9076
  }
9003
9077
  declare class Galxe extends BaseDBModule {
9004
9078
  nft_holder({ contract, address }: {
@@ -9145,6 +9219,8 @@ export type Proposal = {
9145
9219
  votes?: Vote[];
9146
9220
  currentUser?: CurrentUser;
9147
9221
  slug: string;
9222
+ vote_count?: string | null;
9223
+ vote_result?: "passed" | "rejected" | "closed" | null;
9148
9224
  };
9149
9225
  export type CurrentUser = {
9150
9226
  voter?: string;
@@ -9204,6 +9280,151 @@ declare class Dao extends BaseDBModule {
9204
9280
  end_time: string;
9205
9281
  }): Promise<import("postgres").RowList<import("postgres").Row[]>>;
9206
9282
  }
9283
+ export type ProfileMeta = {
9284
+ name: string;
9285
+ temp_eth_address: string;
9286
+ };
9287
+ type Candidate$1 = {
9288
+ name?: string;
9289
+ logo?: string;
9290
+ banner_url?: string;
9291
+ location?: string;
9292
+ blurb?: string;
9293
+ website?: string;
9294
+ social_media?: string[];
9295
+ introduction?: string;
9296
+ team?: string;
9297
+ tech_setup?: string;
9298
+ community_plan?: string;
9299
+ reward_plan?: string;
9300
+ temp_eth_address: string;
9301
+ email?: string;
9302
+ reward_distribution_details?: string;
9303
+ webhook?: string;
9304
+ };
9305
+ export type CandidateProfile = {
9306
+ name: string;
9307
+ blurb: string;
9308
+ website: string;
9309
+ logo: string;
9310
+ banner_url: string;
9311
+ social_media: string[];
9312
+ location: string;
9313
+ introduction: string;
9314
+ team: string;
9315
+ tech_setup: string;
9316
+ community_plan: string;
9317
+ reward_plan: string;
9318
+ created_at: Date;
9319
+ updated_at: Date;
9320
+ temp_eth_address: string;
9321
+ id: number;
9322
+ reward_distribution_details: string;
9323
+ candidate_owner: string;
9324
+ webhook: string;
9325
+ badge: string;
9326
+ delegate_status: string;
9327
+ node_version: string;
9328
+ productivity: string;
9329
+ on_chain_name: string;
9330
+ category: string;
9331
+ };
9332
+ export type ProductivityHistory = {
9333
+ date: string;
9334
+ id: number;
9335
+ productivity: string;
9336
+ temp_eth_address: string;
9337
+ };
9338
+ export type ProbationHistory = {
9339
+ date: string;
9340
+ probation: boolean;
9341
+ address: string;
9342
+ };
9343
+ export type NodeVersion = {
9344
+ value: string;
9345
+ };
9346
+ export type DelegateRewards = {
9347
+ block_reward: string | null;
9348
+ epoch_reward: string | null;
9349
+ foundation_bonus: string | null;
9350
+ burn_reward: string | null;
9351
+ };
9352
+ export type DelegateRewardsHistory = {
9353
+ block_reward: string;
9354
+ epoch_reward: string;
9355
+ foundation_bonus: string;
9356
+ burn_reward: string;
9357
+ date_time: string;
9358
+ };
9359
+ export type DelegateMember = {
9360
+ id: number;
9361
+ member_address: string;
9362
+ };
9363
+ declare class Delegate$1 extends BaseDBModule {
9364
+ upsertCandidateProfile(args: ProfileMeta): Promise<{
9365
+ id: number;
9366
+ } | null>;
9367
+ getCandidateByAddress({ delegate }: {
9368
+ delegate: string;
9369
+ }): Promise<CandidateProfile>;
9370
+ upsertCandidateSecret(args: Candidate$1): Promise<{
9371
+ success: boolean;
9372
+ }>;
9373
+ upsertCandidateMeta(args: Candidate$1): Promise<{
9374
+ success: boolean;
9375
+ }>;
9376
+ getDelegateHeight({ name }: {
9377
+ name: string;
9378
+ }): Promise<{
9379
+ block_height: string;
9380
+ }>;
9381
+ getProductivityHistory({ startDate, endDate, delegate }: {
9382
+ startDate?: string;
9383
+ endDate: string;
9384
+ delegate: string;
9385
+ }): Promise<import("postgres").RowList<ProductivityHistory[]>>;
9386
+ getProbationHistory({ startDate, endDate, delegate }: {
9387
+ startDate: string;
9388
+ endDate: string;
9389
+ delegate: string;
9390
+ }): Promise<import("postgres").RowList<ProbationHistory[]>>;
9391
+ getDelegateLatestVersion(): Promise<NodeVersion>;
9392
+ getDelegateRewards({ delegate }: {
9393
+ delegate: string;
9394
+ }): Promise<DelegateRewards>;
9395
+ getDelegateRewardsHistory({ startDate, endDate, delegate }: {
9396
+ startDate: string;
9397
+ endDate: string;
9398
+ delegate: string;
9399
+ }): Promise<import("postgres").RowList<DelegateRewardsHistory[]>>;
9400
+ getDelegateMembers({ candidate_meta_id }: {
9401
+ candidate_meta_id: number;
9402
+ }): Promise<import("postgres").RowList<DelegateMember[]>>;
9403
+ upsertMember({ member_address, candidate_meta_id, is_active, creator }: {
9404
+ member_address: string;
9405
+ candidate_meta_id: number;
9406
+ is_active: boolean;
9407
+ creator: string;
9408
+ }): Promise<{
9409
+ error: string;
9410
+ success?: undefined;
9411
+ } | {
9412
+ success: boolean;
9413
+ error?: undefined;
9414
+ }>;
9415
+ updateCandidateOwner({ candidate_owner, id }: {
9416
+ candidate_owner: string;
9417
+ id: number;
9418
+ }): Promise<{
9419
+ success: boolean;
9420
+ }>;
9421
+ transferDelegateOwnership({ candidate_owner, id }: {
9422
+ candidate_owner: string;
9423
+ id: number;
9424
+ }): Promise<{
9425
+ success: boolean;
9426
+ }>;
9427
+ }
9207
9428
  declare const modules$1: {
9208
9429
  account: Account;
9209
9430
  analyzer: Analyzer;
@@ -9215,12 +9436,14 @@ declare const modules$1: {
9215
9436
  resource: Resource;
9216
9437
  iopay: IoPay;
9217
9438
  mimo: Mimo$1;
9439
+ "mimo-swap-bridge": MimoSwapBridge;
9218
9440
  galxe: Galxe;
9219
9441
  depinscan: DepinScan;
9220
9442
  verification: Verification;
9221
9443
  apis: Apis;
9222
9444
  zkpass: Zkpass;
9223
9445
  dao: Dao;
9446
+ delegate: Delegate$1;
9224
9447
  };
9225
9448
  export type DBModuleType = typeof modules$1;
9226
9449
  export interface ConfigOptions {
@@ -9243,6 +9466,11 @@ export type KitModuleFunction<I extends z.AnyZodObject = z.AnyZodObject, O exten
9243
9466
  export type KitModule<T extends Record<string, Record<string, KitModuleFunction<any, any, any> | any>>> = {
9244
9467
  [K in keyof T]: PickByValue<T[K], KitModuleFunction<any, any, any>>;
9245
9468
  };
9469
+ declare enum CodeFormat {
9470
+ SingleFile = "solidity-single-file",
9471
+ MultipleFile = "solidity-multiple-file",
9472
+ StandardJSONInput = "solidity-standard-json-input"
9473
+ }
9246
9474
  declare const modules$2: {
9247
9475
  readonly contract: {
9248
9476
  getabi: KitModuleFunction<import("zod").ZodObject<{
@@ -9300,14 +9528,46 @@ declare const modules$2: {
9300
9528
  contractaddress: import("zod").ZodEffects<import("zod").ZodString, string, string>;
9301
9529
  sourceCode: import("zod").ZodString;
9302
9530
  compilerversion: import("zod").ZodString;
9531
+ codeformat: import("zod").ZodOptional<import("zod").ZodEnum<[
9532
+ CodeFormat.SingleFile,
9533
+ CodeFormat.MultipleFile,
9534
+ CodeFormat.StandardJSONInput
9535
+ ]>>;
9536
+ contractname: import("zod").ZodOptional<import("zod").ZodString>;
9537
+ optimizationUsed: import("zod").ZodOptional<import("zod").ZodUnion<[
9538
+ import("zod").ZodBoolean,
9539
+ import("zod").ZodNumber,
9540
+ import("zod").ZodString
9541
+ ]>>;
9542
+ runs: import("zod").ZodOptional<import("zod").ZodUnion<[
9543
+ import("zod").ZodNumber,
9544
+ import("zod").ZodString
9545
+ ]>>;
9546
+ evmVersion: import("zod").ZodOptional<import("zod").ZodString>;
9547
+ licenseType: import("zod").ZodOptional<import("zod").ZodUnion<[
9548
+ import("zod").ZodNumber,
9549
+ import("zod").ZodString
9550
+ ]>>;
9303
9551
  }, "strip", import("zod").ZodTypeAny, {
9304
9552
  contractaddress: string;
9305
9553
  sourceCode: string;
9306
9554
  compilerversion: string;
9555
+ evmVersion?: string | undefined;
9556
+ runs?: string | number | undefined;
9557
+ codeformat?: CodeFormat | undefined;
9558
+ contractname?: string | undefined;
9559
+ optimizationUsed?: string | number | boolean | undefined;
9560
+ licenseType?: string | number | undefined;
9307
9561
  }, {
9308
9562
  contractaddress: string;
9309
9563
  sourceCode: string;
9310
9564
  compilerversion: string;
9565
+ evmVersion?: string | undefined;
9566
+ runs?: string | number | undefined;
9567
+ codeformat?: CodeFormat | undefined;
9568
+ contractname?: string | undefined;
9569
+ optimizationUsed?: string | number | boolean | undefined;
9570
+ licenseType?: string | number | undefined;
9311
9571
  }>, import("zod").ZodType<any, import("zod").ZodTypeDef, any> | undefined, unknown>;
9312
9572
  analyzer: ReturnType<typeof import("postgres")>;
9313
9573
  scout: ReturnType<typeof import("postgres")>;
@@ -9315,6 +9575,7 @@ declare const modules$2: {
9315
9575
  iotexscan: ReturnType<typeof import("postgres")>;
9316
9576
  iopay: ReturnType<typeof import("postgres")>;
9317
9577
  nftmarket: ReturnType<typeof import("postgres")>;
9578
+ analyzerSlow: ReturnType<typeof import("postgres")>;
9318
9579
  ch: ClickHouseSDK;
9319
9580
  checkAuth(key: string): Promise<{
9320
9581
  ok: boolean;
@@ -9346,6 +9607,7 @@ declare const modules$2: {
9346
9607
  iotexscan: ReturnType<typeof import("postgres")>;
9347
9608
  iopay: ReturnType<typeof import("postgres")>;
9348
9609
  nftmarket: ReturnType<typeof import("postgres")>;
9610
+ analyzerSlow: ReturnType<typeof import("postgres")>;
9349
9611
  ch: ClickHouseSDK;
9350
9612
  checkAuth(key: string): Promise<{
9351
9613
  ok: boolean;
@@ -9508,6 +9770,7 @@ declare const modules$2: {
9508
9770
  iotexscan: ReturnType<typeof import("postgres")>;
9509
9771
  iopay: ReturnType<typeof import("postgres")>;
9510
9772
  nftmarket: ReturnType<typeof import("postgres")>;
9773
+ analyzerSlow: ReturnType<typeof import("postgres")>;
9511
9774
  ch: ClickHouseSDK;
9512
9775
  checkAuth(key: string): Promise<{
9513
9776
  ok: boolean;
@@ -9803,6 +10066,7 @@ declare const modules$2: {
9803
10066
  iotexscan: ReturnType<typeof import("postgres")>;
9804
10067
  iopay: ReturnType<typeof import("postgres")>;
9805
10068
  nftmarket: ReturnType<typeof import("postgres")>;
10069
+ analyzerSlow: ReturnType<typeof import("postgres")>;
9806
10070
  ch: ClickHouseSDK;
9807
10071
  checkAuth(key: string): Promise<{
9808
10072
  ok: boolean;
@@ -9836,6 +10100,7 @@ declare const modules$2: {
9836
10100
  iotexscan: ReturnType<typeof import("postgres")>;
9837
10101
  iopay: ReturnType<typeof import("postgres")>;
9838
10102
  nftmarket: ReturnType<typeof import("postgres")>;
10103
+ analyzerSlow: ReturnType<typeof import("postgres")>;
9839
10104
  ch: ClickHouseSDK;
9840
10105
  checkAuth(key: string): Promise<{
9841
10106
  ok: boolean;
@@ -9879,6 +10144,7 @@ declare const modules$2: {
9879
10144
  iotexscan: ReturnType<typeof import("postgres")>;
9880
10145
  iopay: ReturnType<typeof import("postgres")>;
9881
10146
  nftmarket: ReturnType<typeof import("postgres")>;
10147
+ analyzerSlow: ReturnType<typeof import("postgres")>;
9882
10148
  ch: ClickHouseSDK;
9883
10149
  checkAuth(key: string): Promise<{
9884
10150
  ok: boolean;
@@ -10011,6 +10277,7 @@ declare const modules$2: {
10011
10277
  iotexscan: ReturnType<typeof import("postgres")>;
10012
10278
  iopay: ReturnType<typeof import("postgres")>;
10013
10279
  nftmarket: ReturnType<typeof import("postgres")>;
10280
+ analyzerSlow: ReturnType<typeof import("postgres")>;
10014
10281
  ch: ClickHouseSDK;
10015
10282
  checkAuth(key: string): Promise<{
10016
10283
  ok: boolean;
@@ -10107,6 +10374,7 @@ declare const modules$2: {
10107
10374
  iotexscan: ReturnType<typeof import("postgres")>;
10108
10375
  iopay: ReturnType<typeof import("postgres")>;
10109
10376
  nftmarket: ReturnType<typeof import("postgres")>;
10377
+ analyzerSlow: ReturnType<typeof import("postgres")>;
10110
10378
  ch: ClickHouseSDK;
10111
10379
  checkAuth(key: string): Promise<{
10112
10380
  ok: boolean;
@@ -10204,6 +10472,7 @@ declare const modules$2: {
10204
10472
  iotexscan: ReturnType<typeof import("postgres")>;
10205
10473
  iopay: ReturnType<typeof import("postgres")>;
10206
10474
  nftmarket: ReturnType<typeof import("postgres")>;
10475
+ analyzerSlow: ReturnType<typeof import("postgres")>;
10207
10476
  ch: ClickHouseSDK;
10208
10477
  checkAuth(key: string): Promise<{
10209
10478
  ok: boolean;
@@ -10268,7 +10537,7 @@ declare const modules$3: {
10268
10537
  ioid: Ioid;
10269
10538
  };
10270
10539
  export type IoIDModuleType = typeof modules$3;
10271
- declare class Point {
10540
+ declare class Auth {
10272
10541
  checkAuth(token: string): Promise<{
10273
10542
  ok: boolean;
10274
10543
  message: string;
@@ -10280,6 +10549,8 @@ declare class Point {
10280
10549
  sub: string;
10281
10550
  };
10282
10551
  }>;
10552
+ }
10553
+ declare class Point extends Auth {
10283
10554
  upload_event({ action_id, device_id, }: {
10284
10555
  action_id: number;
10285
10556
  device_id: string;
@@ -10378,20 +10649,70 @@ declare class Point {
10378
10649
  error?: undefined;
10379
10650
  }>;
10380
10651
  }
10381
- declare class IoPay$1 {
10382
- private queryTokenId;
10652
+ export type UserFeedBackParams = {
10653
+ content: string;
10654
+ email: string;
10655
+ address: string;
10656
+ images: string;
10657
+ version: string;
10658
+ platform: string;
10659
+ };
10660
+ declare class IoPay$1 extends Auth {
10661
+ private queryTokenFromDB;
10383
10662
  queryKlineData(args: {
10384
- symbol: string;
10663
+ id: string;
10664
+ platform: string;
10665
+ contract?: string;
10385
10666
  start: string;
10386
10667
  end: string;
10387
10668
  }): Promise<any>;
10388
10669
  queryTokenPrice(args: {
10389
- symbol: string;
10670
+ id: string;
10671
+ platform: string;
10672
+ contract?: string;
10390
10673
  }): Promise<any>;
10674
+ private queryPriceFromBinance;
10675
+ private queryPriceFromCoinGecko;
10391
10676
  queryQuestions({ symbol, lang }: {
10392
10677
  symbol: string;
10393
10678
  lang?: string;
10394
10679
  }): Promise<string[]>;
10680
+ queryTokenList({ platform }: {
10681
+ platform?: string;
10682
+ }): Promise<never[] | postgres.RowList<postgres.Row[]>>;
10683
+ userFeedBack(params: UserFeedBackParams, ctx?: {
10684
+ authData?: {
10685
+ sub: string;
10686
+ };
10687
+ }): Promise<{
10688
+ status: number;
10689
+ error: string;
10690
+ content?: undefined;
10691
+ email?: undefined;
10692
+ address?: undefined;
10693
+ images?: undefined;
10694
+ version?: undefined;
10695
+ platform?: undefined;
10696
+ } | {
10697
+ error: string;
10698
+ status?: undefined;
10699
+ content?: undefined;
10700
+ email?: undefined;
10701
+ address?: undefined;
10702
+ images?: undefined;
10703
+ version?: undefined;
10704
+ platform?: undefined;
10705
+ } | {
10706
+ content: string;
10707
+ email: string;
10708
+ address: string;
10709
+ images: string;
10710
+ version: string;
10711
+ platform: string;
10712
+ status?: undefined;
10713
+ error?: undefined;
10714
+ }>;
10715
+ sendLarkBotMessage(content: string): Promise<void>;
10395
10716
  }
10396
10717
  declare const modules$4: {
10397
10718
  point: Point;
@@ -10413,15 +10734,15 @@ export declare const createClient: ({ url, ctx }?: {
10413
10734
  }) => ModuleType;
10414
10735
  export declare const createClientWithDBServer: ({ url, fetchRequestInit }: {
10415
10736
  url?: string;
10416
- fetchRequestInit?: FetchRequestInit;
10737
+ fetchRequestInit?: BunFetchRequestInit;
10417
10738
  }) => DBModuleType;
10418
10739
  export declare const createClientWithIoPayServer: ({ url, fetchRequestInit }: {
10419
10740
  url?: string;
10420
- fetchRequestInit?: FetchRequestInit;
10741
+ fetchRequestInit?: BunFetchRequestInit;
10421
10742
  }) => IoPayModuleType;
10422
10743
  export declare const createIotexscanClient: ({ url, fetchRequestInit }: {
10423
10744
  url?: string;
10424
- fetchRequestInit?: FetchRequestInit;
10745
+ fetchRequestInit?: BunFetchRequestInit;
10425
10746
  }) => IotexscanAdapterType<IotexscanModulesType>;
10426
10747
  export declare const createIoidClient: ({ url, ctx }?: {
10427
10748
  url?: string;
package/package.json CHANGED
@@ -2,79 +2,94 @@
2
2
  "name": "@iotexproject/kit",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "0.1.96",
5
+ "version": "0.1.98",
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
- "dev-db": "bun server-db.ts",
10
+ "dev-db": "bun run --watch server-db.ts",
11
11
  "dev-iopay": "bun run build && bun run --watch server-iopay.ts",
12
12
  "dev-iotexscan": "bun server-iotexscan.ts",
13
13
  "dev-ioid": "bun run build && bun run --watch server-ioid.ts",
14
+ "dev-goat": "bun run --watch server-goat.ts",
15
+ "dev-goat-gc": "bun --expose-gc run --watch server-goat.ts",
16
+ "dev-tube": "bun run build && bun run --watch server-tube.ts",
14
17
  "test": "bun --hot run tests/test-marshalldao.ts",
15
18
  "build": "bun run build.mjs",
16
19
  "prepublishOnly": "bun run build",
17
- "gen:grpc": "protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./lib/grpc/generated -I ./lib/grpc/protos ./lib/grpc/protos/*.proto"
20
+ "gen:grpc": "protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./lib/grpc/generated -I ./lib/grpc/protos ./lib/grpc/protos/*.proto",
21
+ "profile:doctor": "./scripts/profile-doctor.sh",
22
+ "profile:memory": "./scripts/profile-memory.sh",
23
+ "profile:cpu": "./scripts/profile-cpu.sh",
24
+ "monitor:metrics": "curl http://localhost:8000/metrics",
25
+ "monitor:health": "curl http://localhost:8000/health/performance",
26
+ "admin:gc": "curl -X POST http://localhost:8000/admin/gc",
27
+ "admin:memory-report": "curl http://localhost:8000/admin/memory-report"
18
28
  },
19
29
  "files": [
20
30
  "dist"
21
31
  ],
22
32
  "dependencies": {
23
- "@asteasolutions/zod-to-openapi": "^7.1.1",
24
- "@clickhouse/client": "^1.4.0",
25
- "@faker-js/faker": "^9.3.0",
26
- "@grpc/grpc-js": "^1.11.1",
27
- "@grpc/proto-loader": "^0.7.13",
28
- "@hyperdx/node-opentelemetry": "^0.8.1",
29
- "@iotexproject/iotex-address-ts": "^1.0.4",
30
- "@noble/curves": "^1.6.0",
31
- "@tokenbound/sdk": "^0.5.5",
32
- "@tryghost/content-api": "^1.11.21",
33
- "@types/bn.js": "^5.1.6",
34
- "@types/p-retry": "^3.0.1",
35
- "@types/utf8": "^3.0.3",
36
- "apollo-cache-inmemory": "^1.6.6",
37
- "apollo-client": "^2.6.10",
38
- "apollo-link-http": "^1.5.17",
39
- "axios": "^1.7.2",
40
- "bech32": "^2.0.0",
41
- "bentocache": "^1.0.0-beta.9",
42
- "bignumber.js": "^9.1.2",
43
- "clickhouse": "^2.6.0",
44
- "crypto-js": "^4.2.0",
45
- "dataloader": "^2.2.2",
46
- "dayjs": "^1.11.12",
47
- "dotenv": "^16.4.7",
48
- "drizzle-orm": "^0.38.2",
49
- "ethereumjs-util": "^7.1.5",
50
- "ethers": "^6.13.2",
51
- "firebase-admin": "^12.6.0",
52
- "graphql-request": "^7.1.0",
53
- "graphql-tag": "^2.12.6",
54
- "hono-pino": "^0.7.2",
55
- "hono-rate-limiter": "^0.4.0",
56
- "ioredis": "^5.4.1",
57
- "jsbi": "^4.3.0",
58
- "jsonwebtoken": "^9.0.2",
59
- "kafkajs": "^2.2.4",
60
- "lodash": "^4.17.21",
61
- "lru-cache": "^11.0.0",
62
- "number-to-bn": "^1.7.0",
63
- "p-retry": "^6.2.1",
64
- "p-timeout": "^6.1.3",
65
- "pg": "^8.13.1",
66
- "pg-format": "^1.0.4",
67
- "postgres": "^3.4.4",
68
- "reflect-metadata": "^0.2.2",
69
- "siwe": "^3.0.0",
70
- "strip-ansi-cjs": "^8.0.0",
71
- "underscore": "^1.13.7",
72
- "utf8": "^3.0.0",
73
- "utility-types": "^3.11.0",
74
- "viem": "^2.21.60",
75
- "web3": "^4.16.0",
76
- "zod": "^3.23.8",
77
- "zod-openapi": "^2.19.0"
33
+ "@asteasolutions/zod-to-openapi": "7.1.1",
34
+ "@clickhouse/client": "1.11.2",
35
+ "@faker-js/faker": "9.3.0",
36
+ "@grpc/grpc-js": "1.11.1",
37
+ "@grpc/proto-loader": "0.7.13",
38
+ "@hyperdx/node-opentelemetry": "0.8.1",
39
+ "@iotexproject/iotex-address-ts": "1.0.4",
40
+ "@noble/curves": "1.6.0",
41
+ "@scalar/hono-api-reference": "0.9.9",
42
+ "@tokenbound/sdk": "0.5.5",
43
+ "@tryghost/content-api": "1.11.21",
44
+ "@types/bn.js": "5.1.6",
45
+ "@types/p-retry": "3.0.1",
46
+ "@types/utf8": "3.0.3",
47
+ "apollo-cache-inmemory": "1.6.6",
48
+ "apollo-client": "2.6.10",
49
+ "apollo-link-http": "1.5.17",
50
+ "axios": "1.7.2",
51
+ "bech32": "2.0.0",
52
+ "bentocache": "1.0.0-beta.9",
53
+ "bignumber.js": "9.1.2",
54
+ "bs58": "6.0.0",
55
+ "clickhouse": "2.6.0",
56
+ "clinic": "13.0.0",
57
+ "crypto-js": "4.2.0",
58
+ "dataloader": "2.2.2",
59
+ "dayjs": "1.11.12",
60
+ "dotenv": "16.4.7",
61
+ "drizzle-orm": "0.38.2",
62
+ "ethereumjs-util": "7.1.5",
63
+ "ethers": "6.13.2",
64
+ "firebase-admin": "12.6.0",
65
+ "graphql": "16.9.0",
66
+ "graphql-request": "7.1.0",
67
+ "graphql-tag": "2.12.6",
68
+ "hono-pino": "0.7.2",
69
+ "hono-rate-limiter": "0.4.0",
70
+ "ioredis": "5.4.1",
71
+ "jsbi": "4.3.0",
72
+ "jsonwebtoken": "9.0.2",
73
+ "kafkajs": "2.2.4",
74
+ "lodash": "4.17.21",
75
+ "lru-cache": "11.0.0",
76
+ "memwatch-next": "0.3.0",
77
+ "number-to-bn": "1.7.0",
78
+ "p-retry": "6.2.1",
79
+ "p-timeout": "6.1.3",
80
+ "pg": "8.13.1",
81
+ "pg-format": "1.0.4",
82
+ "postgres": "3.4.4",
83
+ "prom-client": "15.1.3",
84
+ "reflect-metadata": "0.2.2",
85
+ "siwe": "3.0.0",
86
+ "underscore": "1.13.7",
87
+ "utf8": "3.0.0",
88
+ "utility-types": "3.11.0",
89
+ "viem": "2.21.60",
90
+ "web3": "4.16.0",
91
+ "zod": "3.23.8",
92
+ "zod-openapi": "2.19.0"
78
93
  },
79
94
  "devDependencies": {
80
95
  "@dappworks/kit": "^0.4.198",
@@ -82,10 +97,12 @@
82
97
  "@types/crypto-js": "^4.2.2",
83
98
  "@types/google-protobuf": "^3.15.12",
84
99
  "@types/jsonwebtoken": "^9.0.7",
100
+ "@types/memwatch-next": "^0.3.6",
85
101
  "@types/pg": "^8.11.10",
86
102
  "@types/pg-format": "^1.0.5",
87
103
  "@types/tryghost__content-api": "^1.3.16",
88
104
  "@types/underscore": "^1.11.15",
105
+ "autocannon": "^8.0.0",
89
106
  "bun-plugin-dts": "^0.2.3",
90
107
  "drizzle-kit": "^0.30.1",
91
108
  "grpc-tools": "^1.12.4",
@@ -98,5 +115,13 @@
98
115
  "publishConfig": {
99
116
  "access": "public",
100
117
  "registry": "https://registry.npmjs.org/"
118
+ },
119
+ "overrides": {
120
+ "color-convert": "2.0.1",
121
+ "color-name": "1.1.4",
122
+ "is-core-module": "2.13.1",
123
+ "error-ex": "1.3.2",
124
+ "has-ansi": "5.0.1",
125
+ "@ledgerhq/hw-transport": "6.11.2"
101
126
  }
102
- }
127
+ }