@cityofzion/bs-neo3 1.15.0 → 1.15.1
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
package/dist/index.js
CHANGED
|
@@ -24,3 +24,4 @@ __exportStar(require("./services/explorer/DoraESNeo3"), exports);
|
|
|
24
24
|
__exportStar(require("./services/ledger/NeonDappKitLedgerServiceNeo3"), exports);
|
|
25
25
|
__exportStar(require("./services/nft-data/GhostMarketNDSNeo3"), exports);
|
|
26
26
|
__exportStar(require("./services/nft-data/RpcNDSNeo3"), exports);
|
|
27
|
+
__exportStar(require("./interfaces"), exports);
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type GenerateSigningCallbackResponse = {
|
|
|
5
5
|
neonJsAccount: Neon.wallet.Account;
|
|
6
6
|
signingCallback: api.SigningFunction;
|
|
7
7
|
};
|
|
8
|
-
type Candidate = {
|
|
8
|
+
export type Candidate = {
|
|
9
9
|
position: number;
|
|
10
10
|
name: string;
|
|
11
11
|
description: string;
|
|
@@ -20,9 +20,10 @@ type Candidate = {
|
|
|
20
20
|
};
|
|
21
21
|
export type GetCandidatesToVoteResponse = Candidate[];
|
|
22
22
|
export type GetVoteDetailsByAddressResponse = {
|
|
23
|
-
candidateName
|
|
24
|
-
candidatePubKey
|
|
23
|
+
candidateName?: string;
|
|
24
|
+
candidatePubKey?: string;
|
|
25
25
|
neoBalance: number;
|
|
26
|
+
address: string;
|
|
26
27
|
};
|
|
27
28
|
export type VoteParams<BSName extends string> = {
|
|
28
29
|
account: Account<BSName>;
|
|
@@ -38,4 +39,3 @@ export interface VoteService<BSName extends string> {
|
|
|
38
39
|
vote(params: VoteParams<BSName>): Promise<VoteResponse>;
|
|
39
40
|
calculateVoteFee(params: CalculateVoteFeeParams<BSName>): Promise<string>;
|
|
40
41
|
}
|
|
41
|
-
export {};
|
|
@@ -73,6 +73,7 @@ class DoraVoteServiceNeo3 extends RpcVoteServiceNeo3_1.RpcVoteServiceNeo3 {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
getVoteDetailsByAddress(address) {
|
|
76
|
+
var _a, _b;
|
|
76
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
78
|
if (!BSNeo3Helper_1.BSNeo3Helper.isMainnet(__classPrivateFieldGet(this, _DoraVoteServiceNeo3_service, "f").network))
|
|
78
79
|
throw new Error('Only Mainnet is supported');
|
|
@@ -80,13 +81,12 @@ class DoraVoteServiceNeo3 extends RpcVoteServiceNeo3_1.RpcVoteServiceNeo3 {
|
|
|
80
81
|
throw new Error('Missing address');
|
|
81
82
|
if (!__classPrivateFieldGet(this, _DoraVoteServiceNeo3_service, "f").validateAddress(address))
|
|
82
83
|
throw new Error('Invalid address');
|
|
83
|
-
const
|
|
84
|
-
if (!candidatePubkey)
|
|
85
|
-
throw new Error('There was a problem to get vote details by address');
|
|
84
|
+
const { data } = yield __classPrivateFieldGet(this, _DoraVoteServiceNeo3_doraAxiosInstance, "f").get(`/mainnet/voter/${address}`);
|
|
86
85
|
return {
|
|
87
|
-
candidateName: data.candidate,
|
|
88
|
-
candidatePubKey: candidatePubkey,
|
|
86
|
+
candidateName: (_a = data.candidate) !== null && _a !== void 0 ? _a : undefined,
|
|
87
|
+
candidatePubKey: (_b = data.candidatePubkey) !== null && _b !== void 0 ? _b : undefined,
|
|
89
88
|
neoBalance: data.balance,
|
|
89
|
+
address,
|
|
90
90
|
};
|
|
91
91
|
});
|
|
92
92
|
}
|