@dorafactory/maci-sdk 0.0.37 → 0.0.39
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.mts +2213 -0
- package/dist/index.d.ts +7 -11
- package/dist/index.js +9 -142
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -135
- package/dist/index.mjs.map +1 -1
- package/dist/libs/contract/contract.d.ts +4 -8
- package/dist/maci.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -16
- package/src/index.ts +25 -11
- package/src/libs/contract/config.ts +1 -4
- package/src/libs/contract/contract.ts +2 -21
- package/src/maci.ts +8 -2
- package/src/types/index.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -301,107 +301,6 @@ var circuits = {
|
|
|
301
301
|
zipUrl: "https://github.com/DoraFactory/Vota-Circuits/archive/refs/heads/main.zip"
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
|
-
var validator_operator_set = {
|
|
305
|
-
doravaloper12yk434ut3un4wx0rult2aww89rsrel8nhmp387: {
|
|
306
|
-
operator_address: "",
|
|
307
|
-
account_address: "dora12yk434ut3un4wx0rult2aww89rsrel8nydy83p",
|
|
308
|
-
allocation: "22571615985356796592128",
|
|
309
|
-
allocation_dora: 22571.615985356795,
|
|
310
|
-
moniker: "\u{1D425}\u{1D41E}\u{1D42C}\u{1D427}\u{1D422}\u{1D424} | \u{1D414}\u{1D413}\u{1D412}\u{1D400}",
|
|
311
|
-
program_voting_power: 0.06432895760166438,
|
|
312
|
-
tokens: "200731587709257889972292"
|
|
313
|
-
},
|
|
314
|
-
doravaloper15frh0nn3v4yp3vv6sk4pn6jg9l8rt82f7uqfk5: {
|
|
315
|
-
operator_address: "",
|
|
316
|
-
account_address: "dora15frh0nn3v4yp3vv6sk4pn6jg9l8rt82fd29lqt",
|
|
317
|
-
allocation: "33745159209325474873344",
|
|
318
|
-
allocation_dora: 33745.15920932547,
|
|
319
|
-
moniker: "NomadValidator",
|
|
320
|
-
program_voting_power: 0.09617348254756773,
|
|
321
|
-
tokens: "300099000000000000000000"
|
|
322
|
-
},
|
|
323
|
-
doravaloper1ddewp74vd2w8jhth2p0uazmc8ajgtcuf3ntqgn: {
|
|
324
|
-
operator_address: "",
|
|
325
|
-
account_address: "dora1ddewp74vd2w8jhth2p0uazmc8ajgtcufz9wk7v",
|
|
326
|
-
allocation: "40789397021635754590208",
|
|
327
|
-
allocation_dora: 40789.397021635756,
|
|
328
|
-
moniker: "polkachu.com",
|
|
329
|
-
program_voting_power: 0.11624951413777938,
|
|
330
|
-
tokens: "362744095556470434789338"
|
|
331
|
-
},
|
|
332
|
-
doravaloper1gh8j89jtc2vx6d3y4ehllcdlvluwa49w6xmjsm: {
|
|
333
|
-
operator_address: "",
|
|
334
|
-
account_address: "dora1gh8j89jtc2vx6d3y4ehllcdlvluwa49wfs7yxy",
|
|
335
|
-
allocation: "33743029941764137943040",
|
|
336
|
-
allocation_dora: 33743.029941764136,
|
|
337
|
-
moniker: "ITRocket",
|
|
338
|
-
program_voting_power: 0.09616741414897524,
|
|
339
|
-
tokens: "300080064215405665352721"
|
|
340
|
-
},
|
|
341
|
-
doravaloper1j8ru7p8zctup6grfwuga6ndrjj7v88wzn407x7: {
|
|
342
|
-
operator_address: "",
|
|
343
|
-
account_address: "dora1j8ru7p8zctup6grfwuga6ndrjj7v88wzqr2gsp",
|
|
344
|
-
allocation: "22646525272055477174272",
|
|
345
|
-
allocation_dora: 22646.525272055478,
|
|
346
|
-
moniker: "StakeUs",
|
|
347
|
-
program_voting_power: 0.06454244857772638,
|
|
348
|
-
tokens: "201397763319500000000000"
|
|
349
|
-
},
|
|
350
|
-
doravaloper1l5zz0kkjt2n7nllsrymy96mc2v2gehda0zc85s: {
|
|
351
|
-
operator_address: "",
|
|
352
|
-
account_address: "dora1l5zz0kkjt2n7nllsrymy96mc2v2gehdau5a3z0",
|
|
353
|
-
allocation: "22622846742220005965824",
|
|
354
|
-
allocation_dora: 22622.846742220005,
|
|
355
|
-
moniker: "BlackNodes",
|
|
356
|
-
program_voting_power: 0.06447496492290769,
|
|
357
|
-
tokens: "201187187838702364379121"
|
|
358
|
-
},
|
|
359
|
-
doravaloper1m9v3txhhtadjxpv09gwjhhs344qsxgfscwxjkg: {
|
|
360
|
-
operator_address: "",
|
|
361
|
-
account_address: "dora1m9v3txhhtadjxpv09gwjhhs344qsxgfstcryqh",
|
|
362
|
-
allocation: "22549006983854435598336",
|
|
363
|
-
allocation_dora: 22549.006983854437,
|
|
364
|
-
moniker: "\u{1F44B} 79anvi \u{1F340}",
|
|
365
|
-
program_voting_power: 0.06426452209558432,
|
|
366
|
-
tokens: "200530523648490887200824"
|
|
367
|
-
},
|
|
368
|
-
doravaloper1tu8006g60t62zwgwf5knkaujv0uzhp2a6wh94h: {
|
|
369
|
-
operator_address: "",
|
|
370
|
-
account_address: "dora1tu8006g60t62zwgwf5knkaujv0uzhp2afcjnrg",
|
|
371
|
-
allocation: "39369183740744815345664",
|
|
372
|
-
allocation_dora: 39369.18374074482,
|
|
373
|
-
moniker: "Citadel.one",
|
|
374
|
-
program_voting_power: 0.11220191559671686,
|
|
375
|
-
tokens: "350114000000000000000000"
|
|
376
|
-
},
|
|
377
|
-
doravaloper1x5z0tkafrgyeuqkrwfjr933vghjxchqnqlhcdw: {
|
|
378
|
-
operator_address: "",
|
|
379
|
-
account_address: "dora1x5z0tkafrgyeuqkrwfjr933vghjxchqnnfjwm3",
|
|
380
|
-
allocation: "22611521290904268701696",
|
|
381
|
-
allocation_dora: 22611.521290904268,
|
|
382
|
-
moniker: "1ce",
|
|
383
|
-
program_voting_power: 0.064442687460896,
|
|
384
|
-
tokens: "201086469492900000000000"
|
|
385
|
-
},
|
|
386
|
-
doravaloper1z6kfew2nhuh02szc2hdecw4fqey2d32auucvux: {
|
|
387
|
-
operator_address: "",
|
|
388
|
-
account_address: "dora1z6kfew2nhuh02szc2hdecw4fqey2d32a02a62e",
|
|
389
|
-
allocation: "45246951843662957379584",
|
|
390
|
-
allocation_dora: 45246.95184366296,
|
|
391
|
-
moniker: "Nodes.Guru",
|
|
392
|
-
program_voting_power: 0.12895351616135226,
|
|
393
|
-
tokens: "402385566389000000000006"
|
|
394
|
-
},
|
|
395
|
-
doravaloper1zzne8ufazycklx4j6mgc987t8ykd6wxu63223v: {
|
|
396
|
-
operator_address: "",
|
|
397
|
-
account_address: "dora1zzne8ufazycklx4j6mgc987t8ykd6wxu63223v",
|
|
398
|
-
allocation: "44982761968475888943104",
|
|
399
|
-
allocation_dora: 44982.76196847589,
|
|
400
|
-
moniker: "ZKV",
|
|
401
|
-
program_voting_power: 0.12820057674882976,
|
|
402
|
-
tokens: "400036100000000000000000"
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
304
|
function getDefaultParams(network = "mainnet") {
|
|
406
305
|
switch (network) {
|
|
407
306
|
case "mainnet":
|
|
@@ -529,10 +428,6 @@ function verifyIsBech32(address) {
|
|
|
529
428
|
function isValidAddress(address) {
|
|
530
429
|
return address.startsWith("dora") && verifyIsBech32(address) === void 0;
|
|
531
430
|
}
|
|
532
|
-
function hexToDecimalString(hexString) {
|
|
533
|
-
const decimalString = BigInt("0x" + hexString).toString(10);
|
|
534
|
-
return decimalString;
|
|
535
|
-
}
|
|
536
431
|
|
|
537
432
|
// src/libs/query/operator.ts
|
|
538
433
|
var Operator = class {
|
|
@@ -2044,9 +1939,7 @@ import {
|
|
|
2044
1939
|
GasPrice,
|
|
2045
1940
|
SigningStargateClient
|
|
2046
1941
|
} from "@cosmjs/stargate";
|
|
2047
|
-
import {
|
|
2048
|
-
SigningCosmWasmClient
|
|
2049
|
-
} from "@cosmjs/cosmwasm-stargate";
|
|
1942
|
+
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
|
|
2050
1943
|
|
|
2051
1944
|
// src/libs/contract/ts/Maci.client.ts
|
|
2052
1945
|
var MaciQueryClient = class {
|
|
@@ -4041,22 +3934,6 @@ var QTR_LIB = {
|
|
|
4041
3934
|
};
|
|
4042
3935
|
|
|
4043
3936
|
// src/libs/contract/utils.ts
|
|
4044
|
-
function getCircuitType(circuitType) {
|
|
4045
|
-
let maciVoteType = null;
|
|
4046
|
-
switch (circuitType) {
|
|
4047
|
-
case "0" /* IP1V */:
|
|
4048
|
-
maciVoteType = "0";
|
|
4049
|
-
break;
|
|
4050
|
-
case "1" /* QV */:
|
|
4051
|
-
maciVoteType = "1";
|
|
4052
|
-
break;
|
|
4053
|
-
default:
|
|
4054
|
-
throw new Error(
|
|
4055
|
-
`Invalid circuit type ${circuitType}, only support 1P1V and QV`
|
|
4056
|
-
);
|
|
4057
|
-
}
|
|
4058
|
-
return maciVoteType;
|
|
4059
|
-
}
|
|
4060
3937
|
function getContractParams(type, circuitType, proofSystem, maxVoter, maxOption) {
|
|
4061
3938
|
let parameters;
|
|
4062
3939
|
let groth16ProcessVkey = null;
|
|
@@ -5826,7 +5703,13 @@ var MaciClient2 = class {
|
|
|
5826
5703
|
});
|
|
5827
5704
|
}
|
|
5828
5705
|
getSigner(signer) {
|
|
5829
|
-
|
|
5706
|
+
if (signer) {
|
|
5707
|
+
return signer;
|
|
5708
|
+
}
|
|
5709
|
+
if (this.signer) {
|
|
5710
|
+
return this.signer;
|
|
5711
|
+
}
|
|
5712
|
+
throw new Error("No signer provided, please provide a signer");
|
|
5830
5713
|
}
|
|
5831
5714
|
getMaciKeypair() {
|
|
5832
5715
|
return this.maciKeypair;
|
|
@@ -6133,20 +6016,15 @@ var MaciClient2 = class {
|
|
|
6133
6016
|
};
|
|
6134
6017
|
export {
|
|
6135
6018
|
Circuit,
|
|
6136
|
-
Contract,
|
|
6137
|
-
Event,
|
|
6138
6019
|
G1Point,
|
|
6139
6020
|
G2Point,
|
|
6140
6021
|
Http,
|
|
6141
|
-
Indexer,
|
|
6142
|
-
MACI,
|
|
6143
6022
|
MaciCertSystemType,
|
|
6144
6023
|
MaciCircuitType,
|
|
6145
6024
|
MaciClient2 as MaciClient,
|
|
6146
6025
|
MaciRoundType,
|
|
6147
6026
|
NOTHING_UP_MY_SLEEVE,
|
|
6148
6027
|
Operator,
|
|
6149
|
-
OracleCertificate,
|
|
6150
6028
|
PAD_KEY_HASH,
|
|
6151
6029
|
Proof,
|
|
6152
6030
|
Round,
|
|
@@ -6169,8 +6047,6 @@ export {
|
|
|
6169
6047
|
genRandomBabyJubValue,
|
|
6170
6048
|
genRandomSalt,
|
|
6171
6049
|
getAMaciRoundCircuitFee,
|
|
6172
|
-
getCircuitType,
|
|
6173
|
-
getContractParams,
|
|
6174
6050
|
getDefaultParams,
|
|
6175
6051
|
hash12,
|
|
6176
6052
|
hash2,
|
|
@@ -6181,7 +6057,6 @@ export {
|
|
|
6181
6057
|
hashLeftRight,
|
|
6182
6058
|
hashN,
|
|
6183
6059
|
hashOne,
|
|
6184
|
-
hexToDecimalString,
|
|
6185
6060
|
isValidAddress,
|
|
6186
6061
|
packPubKey,
|
|
6187
6062
|
poseidon,
|
|
@@ -6193,7 +6068,6 @@ export {
|
|
|
6193
6068
|
sha256Hash,
|
|
6194
6069
|
signMessage2 as signMessage,
|
|
6195
6070
|
stringizing,
|
|
6196
|
-
unpackPubKey
|
|
6197
|
-
validator_operator_set
|
|
6071
|
+
unpackPubKey
|
|
6198
6072
|
};
|
|
6199
6073
|
//# sourceMappingURL=index.mjs.map
|