@iotexproject/kit 0.2.11 → 0.2.13

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 +240 -140
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  import { RouteConfig } from '@asteasolutions/zod-to-openapi';
4
4
  import { BentoCache, bentostore } from 'bentocache';
5
5
  import DataLoader from 'dataloader';
6
+ import { Dayjs } from 'dayjs';
6
7
  import postgres from 'postgres';
7
8
  import { PickByValue } from 'utility-types';
8
9
  import { z } from 'zod';
@@ -7059,11 +7060,6 @@ declare class Staking {
7059
7060
  getDelegateByName(args: {
7060
7061
  delegateName: string;
7061
7062
  }, ctx?: ConfigContext): Promise<CandidateV4>;
7062
- upsertRewardDistribution(args: {
7063
- foundationRewardPortion: number;
7064
- epochRewardPortion: number;
7065
- blockRewardPortion: number;
7066
- }, ctx?: ConfigContext): Promise<any>;
7067
7063
  getRewardDistribution(args: {
7068
7064
  ownerAddress: `0x${string}` | `io${string}`;
7069
7065
  }, ctx?: ConfigContext): Promise<{
@@ -7114,125 +7110,8 @@ declare class utils {
7114
7110
  ];
7115
7111
  }>>;
7116
7112
  }
7117
- export interface IoTexMarketData {
7118
- id: string;
7119
- symbol: string;
7120
- name: string;
7121
- image: string;
7122
- current_price: number;
7123
- market_cap: number;
7124
- market_cap_rank: number;
7125
- fully_diluted_valuation: number;
7126
- total_volume: number;
7127
- high_24h: number;
7128
- low_24h: number;
7129
- price_change_24h: number;
7130
- price_change_percentage_24h: number;
7131
- market_cap_change_24h: number;
7132
- market_cap_change_percentage_24h: number;
7133
- circulating_supply: number;
7134
- total_supply: number;
7135
- max_supply: number;
7136
- ath: number;
7137
- ath_change_percentage: number;
7138
- ath_date: string;
7139
- atl: number;
7140
- atl_change_percentage: number;
7141
- atl_date: string;
7142
- roi?: any;
7143
- last_updated: string;
7144
- }
7145
- export interface DappCategory {
7146
- id: number;
7147
- name: string;
7148
- order: number;
7149
- }
7150
- export interface Dapp {
7151
- id: string;
7152
- chains: string;
7153
- content: string;
7154
- content_cn: string;
7155
- img_url: string;
7156
- popularity: string;
7157
- source_priority: number;
7158
- tags: string;
7159
- title: string;
7160
- url: string;
7161
- weight: number;
7162
- }
7163
- export interface EcosystemDapp {
7164
- date: string;
7165
- id: string;
7166
- logo: string;
7167
- slug: string;
7168
- status: string;
7169
- tag: string;
7170
- telegram: string;
7171
- title: string;
7172
- twitter: string;
7173
- website: string;
7174
- }
7175
7113
  declare class UseHub {
7176
7114
  constructor();
7177
- rewardSummary(args: {
7178
- address: string;
7179
- start_date?: string;
7180
- end_date?: string;
7181
- }): Promise<{
7182
- RewardRecord_aggregate: {
7183
- aggregate: {
7184
- sum: {
7185
- total_reward_delta: number;
7186
- burndrop_reward_delta: number;
7187
- hermes_reward_delta: number;
7188
- apy: number;
7189
- };
7190
- };
7191
- };
7192
- KV: [
7193
- {
7194
- value: string;
7195
- }
7196
- ];
7197
- }>;
7198
- rewardDistribute(args: {
7199
- address: string;
7200
- start_date?: string;
7201
- end_date?: string;
7202
- }): Promise<{
7203
- RewardRecord: {
7204
- total_reward_delta: number;
7205
- burndrop_reward_delta: number;
7206
- hermes_reward_delta: number;
7207
- date: string;
7208
- }[];
7209
- }>;
7210
- stakingReward(args: {
7211
- address: string;
7212
- start_date?: string;
7213
- end_date?: string;
7214
- }): Promise<{
7215
- stakingRewardHistory: {
7216
- total_reward_delta: string;
7217
- date: string;
7218
- }[];
7219
- stakingRewardSum: number;
7220
- error?: undefined;
7221
- } | {
7222
- error: unknown;
7223
- stakingRewardHistory?: undefined;
7224
- stakingRewardSum?: undefined;
7225
- }>;
7226
- userDashboard({ limit }: {
7227
- limit: number;
7228
- }): Promise<{
7229
- blogs: import("@tryghost/content-api").PostsOrPages;
7230
- marketData: IoTexMarketData;
7231
- }>;
7232
- twitter({ pageNo, pageSize }?: {
7233
- pageNo: number;
7234
- pageSize: number;
7235
- }): Promise<any>;
7236
7115
  assets(): Promise<any[] | {
7237
7116
  error: unknown;
7238
7117
  }>;
@@ -7247,24 +7126,6 @@ declare class UseHub {
7247
7126
  } | {
7248
7127
  error: unknown;
7249
7128
  }>;
7250
- explore(): Promise<{
7251
- dappList: Dapp[];
7252
- dappCategory: DappCategory[];
7253
- } | {
7254
- error: any;
7255
- }>;
7256
- ecosystem(): Promise<{
7257
- dappList: EcosystemDapp[];
7258
- tags: string[];
7259
- } | {
7260
- error: any;
7261
- }>;
7262
- ecosystemv2(): Promise<{
7263
- dappList: EcosystemDapp[];
7264
- tags: string[];
7265
- } | {
7266
- error: any;
7267
- }>;
7268
7129
  }
7269
7130
  declare class Health {
7270
7131
  check(): {
@@ -8707,6 +8568,18 @@ declare class Delegate {
8707
8568
  rewardAddress: string;
8708
8569
  blsPubKey: string;
8709
8570
  }, ctx?: ConfigContext): Promise<any>;
8571
+ claim(args: {
8572
+ amount: number | string;
8573
+ }, ctx?: ConfigContext): Promise<any>;
8574
+ unclaimedReward(args: {
8575
+ account: `0x${string}` | `io${string}`;
8576
+ }, ctx?: ConfigContext): Promise<{
8577
+ unclaimedBalance: any;
8578
+ error?: undefined;
8579
+ } | {
8580
+ error: unknown;
8581
+ unclaimedBalance?: undefined;
8582
+ }>;
8710
8583
  }
8711
8584
  declare const modules: {
8712
8585
  mimo: Mimo;
@@ -8748,6 +8621,7 @@ declare class BaseDBModule {
8748
8621
  microServiceCenter: ReturnType<typeof postgres>;
8749
8622
  dao: ReturnType<typeof postgres>;
8750
8623
  nsv3db: ReturnType<typeof postgres>;
8624
+ nsv3dbTest: ReturnType<typeof postgres>;
8751
8625
  cache: ReturnType<typeof bento.namespace>;
8752
8626
  constructor();
8753
8627
  checkAuth(key: string): Promise<{
@@ -8978,6 +8852,17 @@ declare class Staking$1 extends BaseDBModule {
8978
8852
  total: number;
8979
8853
  };
8980
8854
  }>;
8855
+ getStakingHistory({ ownerAddress, page, limit }: {
8856
+ ownerAddress: string;
8857
+ page: number;
8858
+ limit: number;
8859
+ }): Promise<{
8860
+ status: string;
8861
+ data: {
8862
+ data: import("postgres").Row[] & Iterable<import("postgres").Row> & import("postgres").ResultQueryMeta<number, string | number>;
8863
+ total: number;
8864
+ };
8865
+ }>;
8981
8866
  }
8982
8867
  export type ComponentType = "banner-latest" | "token-2049";
8983
8868
  export interface ComponentData {
@@ -9374,7 +9259,24 @@ export type MyProfileListItem = {
9374
9259
  name: string;
9375
9260
  owner_address: string;
9376
9261
  };
9262
+ export type DelegateVote = {
9263
+ staker: string;
9264
+ amount: number;
9265
+ votes: number;
9266
+ duration: number;
9267
+ };
9268
+ export type ServerUpTimeHistory = {
9269
+ date: Date;
9270
+ id: number;
9271
+ temp_eth_address: string;
9272
+ online_time: number;
9273
+ };
9274
+ export type DelegateStatistics = {
9275
+ delegate_count: string;
9276
+ total_amount: string;
9277
+ };
9377
9278
  declare class Delegate$1 extends BaseDBModule {
9279
+ private getNsv3Db;
9378
9280
  upsertCandidateProfile(args: ProfileMeta): Promise<{
9379
9281
  status: string;
9380
9282
  data: {
@@ -9494,6 +9396,202 @@ declare class Delegate$1 extends BaseDBModule {
9494
9396
  status: string;
9495
9397
  data: null;
9496
9398
  }>;
9399
+ getDelegateList(): Promise<{
9400
+ status: string;
9401
+ data: any;
9402
+ }>;
9403
+ getDelegateByName({ name }: {
9404
+ name: string;
9405
+ }): Promise<{
9406
+ status: string;
9407
+ data: any;
9408
+ }>;
9409
+ getDelegateByAddress({ address }: {
9410
+ address: string;
9411
+ }): Promise<{
9412
+ status: string;
9413
+ data: any;
9414
+ }>;
9415
+ getReceivedVotesByAddress({ address }: {
9416
+ address: string;
9417
+ }): Promise<{
9418
+ status: string;
9419
+ data: import("postgres").RowList<DelegateVote[]>;
9420
+ }>;
9421
+ getServerUpTimeHistory({ startDate, endDate, delegate }: {
9422
+ startDate?: string;
9423
+ endDate: string;
9424
+ delegate: string;
9425
+ }): Promise<{
9426
+ status: string;
9427
+ data: import("postgres").RowList<ServerUpTimeHistory[]>;
9428
+ }>;
9429
+ getDelegatesStatistics(): Promise<{
9430
+ status: string;
9431
+ data: DelegateStatistics;
9432
+ }>;
9433
+ getCandidateMetaId({ candidate_owner }: {
9434
+ candidate_owner: string;
9435
+ }): Promise<{
9436
+ status: string;
9437
+ data: number | null;
9438
+ }>;
9439
+ }
9440
+ declare class Block extends BaseDBModule {
9441
+ getBlockByTimestamp(dayjs: Dayjs): Promise<any>;
9442
+ getBlocksInfoByBlocksHeight({ blocksHeight }: {
9443
+ blocksHeight: string[];
9444
+ }): Promise<{
9445
+ status: string;
9446
+ data: import("postgres").RowList<{
9447
+ block_height: string;
9448
+ timestamp: Date;
9449
+ }[]>;
9450
+ }>;
9451
+ getBlockHeight(): Promise<{
9452
+ status: string;
9453
+ data: {
9454
+ block_height: string;
9455
+ timestamp: string;
9456
+ };
9457
+ }>;
9458
+ getChainMeta(): Promise<{
9459
+ status: string;
9460
+ data: {
9461
+ block_height: string;
9462
+ epoch_num: string;
9463
+ };
9464
+ }>;
9465
+ }
9466
+ export interface IoTexMarketData {
9467
+ id: string;
9468
+ symbol: string;
9469
+ name: string;
9470
+ image: string;
9471
+ current_price: number;
9472
+ market_cap: number;
9473
+ market_cap_rank: number;
9474
+ fully_diluted_valuation: number;
9475
+ total_volume: number;
9476
+ high_24h: number;
9477
+ low_24h: number;
9478
+ price_change_24h: number;
9479
+ price_change_percentage_24h: number;
9480
+ market_cap_change_24h: number;
9481
+ market_cap_change_percentage_24h: number;
9482
+ circulating_supply: number;
9483
+ total_supply: string;
9484
+ max_supply: number;
9485
+ ath: number;
9486
+ ath_change_percentage: number;
9487
+ ath_date: string;
9488
+ atl: number;
9489
+ atl_change_percentage: number;
9490
+ atl_date: string;
9491
+ roi?: any;
9492
+ last_updated: string;
9493
+ }
9494
+ export interface EcosystemDapp {
9495
+ date: string;
9496
+ id: string;
9497
+ logo: string;
9498
+ slug: string;
9499
+ status: string;
9500
+ tag: string;
9501
+ telegram: string;
9502
+ title: string;
9503
+ twitter: string;
9504
+ website: string;
9505
+ rank: number;
9506
+ }
9507
+ export interface DappCategory {
9508
+ id: number;
9509
+ name: string;
9510
+ order: number;
9511
+ }
9512
+ export interface Dapp {
9513
+ id: string;
9514
+ chains: string;
9515
+ content: string;
9516
+ content_cn: string;
9517
+ img_url: string;
9518
+ popularity: string;
9519
+ source_priority: number;
9520
+ tags: string;
9521
+ title: string;
9522
+ url: string;
9523
+ weight: number;
9524
+ }
9525
+ declare class Hub extends BaseDBModule {
9526
+ userDashboard({ limit }: {
9527
+ limit: number;
9528
+ }): Promise<{
9529
+ blogs: any[];
9530
+ marketData: IoTexMarketData;
9531
+ }>;
9532
+ ecosystem(): Promise<{
9533
+ dappList: EcosystemDapp[];
9534
+ tags: string[];
9535
+ } | {
9536
+ error: any;
9537
+ }>;
9538
+ ecosystemv2(): Promise<{
9539
+ dappList: EcosystemDapp[];
9540
+ tags: string[];
9541
+ } | {
9542
+ error: any;
9543
+ }>;
9544
+ rewardSummary(args: {
9545
+ address: string;
9546
+ start_date?: string;
9547
+ end_date?: string;
9548
+ }): Promise<{
9549
+ total_reward_delta: number;
9550
+ burndrop_reward_delta: number;
9551
+ hermes_reward_delta: number;
9552
+ apy: number;
9553
+ KV: {
9554
+ value: any;
9555
+ }[];
9556
+ }>;
9557
+ rewardDistribute(args: {
9558
+ address: string;
9559
+ start_date?: string;
9560
+ end_date?: string;
9561
+ }): Promise<{
9562
+ RewardRecord: {
9563
+ total_reward_delta: number;
9564
+ burndrop_reward_delta: number;
9565
+ hermes_reward_delta: number;
9566
+ date: string;
9567
+ }[];
9568
+ }>;
9569
+ stakingReward(args: {
9570
+ address: string;
9571
+ start_date?: string;
9572
+ end_date?: string;
9573
+ }): Promise<{
9574
+ stakingRewardHistory: {
9575
+ total_reward_delta: number;
9576
+ date: string;
9577
+ }[];
9578
+ stakingRewardSum: number;
9579
+ error?: undefined;
9580
+ } | {
9581
+ error: unknown;
9582
+ stakingRewardHistory?: undefined;
9583
+ stakingRewardSum?: undefined;
9584
+ }>;
9585
+ explore(): Promise<{
9586
+ dappList: Dapp[];
9587
+ dappCategory: DappCategory[];
9588
+ } | {
9589
+ error: any;
9590
+ }>;
9591
+ twitter({ pageNo, pageSize }?: {
9592
+ pageNo: number;
9593
+ pageSize: number;
9594
+ }): Promise<any[]>;
9497
9595
  }
9498
9596
  declare const modules$1: {
9499
9597
  account: Account;
@@ -9514,6 +9612,8 @@ declare const modules$1: {
9514
9612
  zkpass: Zkpass;
9515
9613
  dao: Dao;
9516
9614
  delegate: Delegate$1;
9615
+ block: Block;
9616
+ hub: Hub;
9517
9617
  };
9518
9618
  export type DBModuleType = typeof modules$1;
9519
9619
  export interface ConfigOptions {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iotexproject/kit",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "0.2.11",
5
+ "version": "0.2.13",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {