@iotexproject/kit 0.1.90 → 0.1.92
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 +40 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9088,6 +9088,13 @@ declare class Zkpass extends BaseDBModule {
|
|
|
9088
9088
|
data: null;
|
|
9089
9089
|
}>;
|
|
9090
9090
|
}
|
|
9091
|
+
export type Vote = {
|
|
9092
|
+
voter: string;
|
|
9093
|
+
vote_weight: string;
|
|
9094
|
+
vote_value: "yes" | "no" | "abstain";
|
|
9095
|
+
vote_percentage?: number;
|
|
9096
|
+
created_at: string;
|
|
9097
|
+
};
|
|
9091
9098
|
export type Proposal = {
|
|
9092
9099
|
id: number;
|
|
9093
9100
|
title: string;
|
|
@@ -9096,16 +9103,33 @@ export type Proposal = {
|
|
|
9096
9103
|
total_vote_weight?: number;
|
|
9097
9104
|
voter_count?: number;
|
|
9098
9105
|
yes_vote_count?: number;
|
|
9106
|
+
yes_vote_weight?: number;
|
|
9099
9107
|
no_vote_count?: number;
|
|
9108
|
+
no_vote_weight?: number;
|
|
9100
9109
|
abstain_vote_count?: number;
|
|
9110
|
+
abstain_vote_weight?: number;
|
|
9101
9111
|
created_at: string;
|
|
9102
9112
|
updated_at: string;
|
|
9103
9113
|
start_time: string;
|
|
9104
9114
|
end_time: string;
|
|
9105
9115
|
is_voted?: boolean;
|
|
9116
|
+
votes?: Vote[];
|
|
9117
|
+
currentUser?: CurrentUser;
|
|
9118
|
+
slug: string;
|
|
9119
|
+
};
|
|
9120
|
+
export type CurrentUser = {
|
|
9121
|
+
voter?: string;
|
|
9122
|
+
is_voted: boolean;
|
|
9123
|
+
vote_value: "yes" | "no" | "abstain";
|
|
9124
|
+
vote_weight: number;
|
|
9106
9125
|
};
|
|
9107
9126
|
declare class Dao extends BaseDBModule {
|
|
9127
|
+
checkAuth(key: string): Promise<{
|
|
9128
|
+
ok: boolean;
|
|
9129
|
+
message: string;
|
|
9130
|
+
}>;
|
|
9108
9131
|
proposalsDataLoader: DataLoader<number, Proposal | undefined, number>;
|
|
9132
|
+
proposalsByNamesDataLoader: DataLoader<string, Proposal | undefined, number>;
|
|
9109
9133
|
blockLoader: DataLoader<string, number | undefined, string>;
|
|
9110
9134
|
voteWeightDataLoader: DataLoader<{
|
|
9111
9135
|
height: number;
|
|
@@ -9114,9 +9138,13 @@ declare class Dao extends BaseDBModule {
|
|
|
9114
9138
|
height: number;
|
|
9115
9139
|
address: string;
|
|
9116
9140
|
}>;
|
|
9117
|
-
|
|
9118
|
-
|
|
9141
|
+
getVotesByProposalId({ proposal_id, }: {
|
|
9142
|
+
proposal_id: number;
|
|
9143
|
+
}): Promise<Vote[]>;
|
|
9144
|
+
getProposal({ id, voter, title }: {
|
|
9145
|
+
id?: number;
|
|
9119
9146
|
voter?: string;
|
|
9147
|
+
title?: string;
|
|
9120
9148
|
}): Promise<Proposal | undefined>;
|
|
9121
9149
|
getProposalListByIds({ ids }: {
|
|
9122
9150
|
ids: readonly number[];
|
|
@@ -9135,7 +9163,16 @@ declare class Dao extends BaseDBModule {
|
|
|
9135
9163
|
voter: string;
|
|
9136
9164
|
message: string;
|
|
9137
9165
|
signature: string;
|
|
9138
|
-
proposal_id
|
|
9166
|
+
proposal_id?: number;
|
|
9167
|
+
proposal_title?: string;
|
|
9168
|
+
}): Promise<import("postgres").RowList<import("postgres").Row[]>>;
|
|
9169
|
+
createProposal(args: {
|
|
9170
|
+
title: string;
|
|
9171
|
+
content: string;
|
|
9172
|
+
message: string;
|
|
9173
|
+
signature: string;
|
|
9174
|
+
start_time: string;
|
|
9175
|
+
end_time: string;
|
|
9139
9176
|
}): Promise<import("postgres").RowList<import("postgres").Row[]>>;
|
|
9140
9177
|
}
|
|
9141
9178
|
declare const modules$1: {
|