@@ -12,7 +12,6 @@ export class BlockDate {
1212 */
1313export class Settings {
1414 settings : wallet_wasm . Settings ;
15- spending_counter : wallet_wasm . SpendingCounter ;
1615
1716 /**
1817 * Settings type constructor
@@ -30,49 +29,55 @@ export class Settings {
3029 toJson ( ) : string ;
3130}
3231
32+ export class Proposal {
33+ votePlan : string ;
34+ proposalIndex : number ;
35+ voteOptions ?: number ;
36+ voteEncKey ?: string ;
37+
38+ /**
39+ * Proposal constructor
40+ *
41+ * @param {string } votePlan vote plan id bytes representation
42+ * @param {number } voteOptions number of available vote plan options
43+ * @param {number } proposalIndex vote's plan proposal index, mandatory for private proposal
44+ * @param {string } voteEncKey committee public key in hex representation, mandatory for private proposal
45+ * @returns {Proposal }
46+ */
47+ constructor (
48+ votePlan : string ,
49+ voteOptions : number ,
50+ proposalIndex ?: number ,
51+ voteEncKey ?: string
52+ ) : Proposal ;
53+ }
54+
3355/**
3456 * Wrapper over wallet-wasm-js VoteCast type
3557 */
3658export class Vote {
37- voteCast : wallet_wasm . VoteCast ;
59+ proposal : Proposal ;
60+ choice : number ;
61+ expiration : BlockDate ;
3862 spendingCounter : number ;
3963 spendingCounterLane : number ;
40- validUntil : BlockDate ;
41-
42- /**
43- * Constructs public wallet-wasm-js VoteCast vote
44- *
45- * @param {wallet_wasm.SpendingCounter } spending_counter
46- * @param {Uint8Array } vote_plan_bytes vote plan id bytes representation
47- * @param {number } proposal_index vote's plan proposal index
48- * @param {number } choice choosen vote plan option
49- * @returns {Vote }
50- */
51- static public (
52- spending_counter : wallet_wasm . SpendingCounter ,
53- vote_plan_bytes : Uint8Array ,
54- proposal_index : number ,
55- choice : number
56- ) : Vote ;
5764
5865 /**
59- * Constructs public wallet-wasm-js VoteCast vote
66+ * Vote constructor
6067 *
61- * @param {wallet_wasm.SpendingCounter } spending_counter
62- * @param {Uint8Array } vote_plan_bytes vote plan id bytes representation
63- * @param {number } proposal_index vote's plan proposal index
64- * @param {number } options number of available vote plan options
68+ * @param {Proposal } proposal
6569 * @param {number } choice choosen vote plan option
66- * @param {Uint8Array } public_key committee public key bytes representation
70+ * @param {BlockDate } expiration expiration date of vote transaction
71+ * @param {number } spendingCounter
72+ * @param {number } spendingCounterLane
6773 * @returns {Vote }
6874 */
69- static private (
70- spending_counter : wallet_wasm . SpendingCounter ,
71- vote_plan_bytes : Uint8Array ,
72- proposal_index : number ,
73- options : number ,
75+ constructor (
76+ proposal : Proposal ,
7477 choice : number ,
75- public_key : Uint8Array
78+ expiration : BlockDate ,
79+ spendingCounter : number ,
80+ spendingCounterLane : number
7681 ) : Vote ;
7782}
7883
@@ -81,13 +86,11 @@ export class Vote {
8186 *
8287 * @param {Vote[] } votes list of votes
8388 * @param {Settings } settings wallet Settings
84- * @param {wallet_wasm.BlockDate } valid_until
85- * @param {Uint8Array } private_key user private key bytes representation
89+ * @param {string } privateKey user private key hex representation
8690 * @returns {wallet_wasm.Fragment[] }
8791 */
8892function signVotes (
8993 votes : Vote [ ] ,
9094 settings : Settings ,
91- valid_until : wallet_wasm . BlockDate ,
92- private_key : Uint8Array
95+ privateKey : string
9396) : wallet_wasm . Fragment [ ] ;
0 commit comments