@iotexproject/kit 0.1.91 → 0.1.93

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 +54 -8
  2. package/package.json +2 -1
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import { RouteConfig } from '@asteasolutions/zod-to-openapi';
4
4
  import { BentoCache, bentostore } from 'bentocache';
5
5
  import DataLoader from 'dataloader';
6
6
  import postgres from 'postgres';
7
+ import { Sql } from 'postgres';
7
8
  import { PickByValue } from 'utility-types';
8
9
  import { z } from 'zod';
9
10
 
@@ -6962,35 +6963,52 @@ declare class Staking {
6962
6963
  max_duration?: undefined;
6963
6964
  one_day?: undefined;
6964
6965
  }>;
6966
+ nftVStakingConfig(args?: {
6967
+ version: "v2" | "v3";
6968
+ }, ctx?: ConfigContext): Promise<{
6969
+ min_amount: any;
6970
+ max_duration: any;
6971
+ one_day: any;
6972
+ error?: undefined;
6973
+ } | {
6974
+ error: unknown;
6975
+ min_amount?: undefined;
6976
+ max_duration?: undefined;
6977
+ one_day?: undefined;
6978
+ }>;
6965
6979
  createNFTV2Bucket(args: {
6966
6980
  duration: string;
6967
6981
  delegate: `0x${string}`;
6968
6982
  }, ctx?: ConfigContext): Promise<any>;
6983
+ createNFTV3Bucket(args: {
6984
+ duration: string;
6985
+ delegate: `0x${string}`;
6986
+ }, ctx?: ConfigContext): Promise<any>;
6969
6987
  NFTBucketChangeDelegate(args: {
6970
6988
  bucketIndex: string;
6971
6989
  delegate: `0x${string}`;
6972
- version: "v1" | "v2";
6990
+ version: "v1" | "v2" | "v3";
6973
6991
  }, ctx?: ConfigContext): Promise<any>;
6974
6992
  NFTBucketRestake(args: {
6975
6993
  bucketIndex: string;
6976
6994
  duration: string;
6977
- version: "v1" | "v2";
6995
+ version: "v1" | "v2" | "v3";
6978
6996
  newAmount?: string;
6979
6997
  }, ctx?: ConfigContext): Promise<any>;
6980
6998
  NFTBucketStakeLock(args: {
6981
6999
  bucketIndex: string;
6982
7000
  autoStake: boolean;
6983
- version: "v1" | "v2";
7001
+ version: "v1" | "v2" | "v3";
6984
7002
  duration?: string;
6985
7003
  }, ctx?: ConfigContext): Promise<any>;
6986
7004
  NFTBucketUnstake(args: {
6987
7005
  bucketIndex: string;
6988
- version: "v1" | "v2";
7006
+ version: "v1" | "v2" | "v3";
6989
7007
  }, ctx?: ConfigContext): Promise<any>;
6990
7008
  NFTBucketWithdrawStake(args: {
6991
7009
  bucketIndex: string;
6992
7010
  receiverAddress: `0x${string}`;
6993
- version: "v1" | "v2";
7011
+ version: "v1" | "v2" | "v3";
6994
7012
  }, ctx?: ConfigContext): Promise<any>;
6995
7013
  delegate_list(args?: {
6996
7014
  isWhole?: boolean;
@@ -9103,17 +9121,33 @@ export type Proposal = {
9103
9121
  total_vote_weight?: number;
9104
9122
  voter_count?: number;
9105
9123
  yes_vote_count?: number;
9124
+ yes_vote_weight?: number;
9106
9125
  no_vote_count?: number;
9126
+ no_vote_weight?: number;
9107
9127
  abstain_vote_count?: number;
9128
+ abstain_vote_weight?: number;
9108
9129
  created_at: string;
9109
9130
  updated_at: string;
9110
9131
  start_time: string;
9111
9132
  end_time: string;
9112
9133
  is_voted?: boolean;
9113
9134
  votes?: Vote[];
9135
+ currentUser?: CurrentUser;
9136
+ slug: string;
9137
+ };
9138
+ export type CurrentUser = {
9139
+ voter?: string;
9140
+ is_voted: boolean;
9141
+ vote_value: "yes" | "no" | "abstain";
9142
+ vote_weight: number;
9114
9143
  };
9115
9144
  declare class Dao extends BaseDBModule {
9145
+ checkAuth(key: string): Promise<{
9146
+ ok: boolean;
9147
+ message: string;
9148
+ }>;
9116
9149
  proposalsDataLoader: DataLoader<number, Proposal | undefined, number>;
9150
+ proposalsByNamesDataLoader: DataLoader<string, Proposal | undefined, number>;
9117
9151
  blockLoader: DataLoader<string, number | undefined, string>;
9118
9152
  voteWeightDataLoader: DataLoader<{
9119
9153
  height: number;
@@ -9125,9 +9159,10 @@ declare class Dao extends BaseDBModule {
9125
9159
  getVotesByProposalId({ proposal_id, }: {
9126
9160
  proposal_id: number;
9127
9161
  }): Promise<Vote[]>;
9128
- getProposal({ id, voter }: {
9129
- id: number;
9162
+ getProposal({ id, voter, title }: {
9163
+ id?: number;
9130
9164
  voter?: string;
9165
+ title?: string;
9131
9166
  }): Promise<Proposal | undefined>;
9132
9167
  getProposalListByIds({ ids }: {
9133
9168
  ids: readonly number[];
@@ -9146,7 +9181,8 @@ declare class Dao extends BaseDBModule {
9146
9181
  voter: string;
9147
9182
  message: string;
9148
9183
  signature: string;
9149
- proposal_id: number;
9184
+ proposal_id?: number;
9185
+ proposal_title?: string;
9150
9186
  }): Promise<import("postgres").RowList<import("postgres").Row[]>>;
9151
9187
  createProposal(args: {
9152
9188
  title: string;
@@ -10331,9 +10367,19 @@ declare class Point {
10331
10367
  error?: undefined;
10332
10368
  }>;
10333
10369
  }
10370
+ declare class IoPay$1 {
10371
+ sql: postgres.Sql;
10372
+ constructor();
10373
+ queryTokenPrice({ token, start, end }: {
10374
+ token: string;
10375
+ start: string;
10376
+ end: string;
10377
+ }): Promise<any>;
10378
+ }
10334
10379
  declare const modules$4: {
10335
10380
  point: Point;
10336
10381
  health: Health;
10382
+ iopay: IoPay$1;
10337
10383
  };
10338
10384
  export type IoPayModuleType = typeof modules$4;
10339
10385
  export type IotexscanAdapterType<T extends Record<string, Record<string, any>>> = {
package/package.json CHANGED
@@ -2,12 +2,13 @@
2
2
  "name": "@iotexproject/kit",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "0.1.91",
5
+ "version": "0.1.93",
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
+ "dev-iopay": "bun run build && bun run --watch server-iopay.ts",
11
12
  "dev-iotexscan": "bun server-iotexscan.ts",
12
13
  "dev-ioid": "bun run build && bun run --watch server-ioid.ts",
13
14
  "test": "bun --hot run tests/test-marshalldao.ts",