@dorafactory/maci-sdk 0.1.3-pre.35 → 0.1.3-pre.36
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.js
CHANGED
|
@@ -9983,9 +9983,7 @@ var EdDSAPoseidonKeypair = class _EdDSAPoseidonKeypair extends Keypair3 {
|
|
|
9983
9983
|
if (!derivedKey.privateKey) {
|
|
9984
9984
|
throw new Error("Invalid key");
|
|
9985
9985
|
}
|
|
9986
|
-
const privateKeyHex = Buffer.from(derivedKey.privateKey).toString(
|
|
9987
|
-
"hex"
|
|
9988
|
-
);
|
|
9986
|
+
const privateKeyHex = Buffer.from(derivedKey.privateKey).toString("hex");
|
|
9989
9987
|
const secretKey = BigInt("0x" + privateKeyHex) % SNARK_FIELD_SIZE;
|
|
9990
9988
|
const unPackedPubKey = genPubKey(secretKey);
|
|
9991
9989
|
const pubKey = packPubKey(unPackedPubKey);
|
|
@@ -10011,10 +10009,7 @@ var EdDSAPoseidonKeypair = class _EdDSAPoseidonKeypair extends Keypair3 {
|
|
|
10011
10009
|
*
|
|
10012
10010
|
* @returns Base64-encoded signature of the payload
|
|
10013
10011
|
*/
|
|
10014
|
-
signPayload({
|
|
10015
|
-
amount,
|
|
10016
|
-
contractAddress
|
|
10017
|
-
}) {
|
|
10012
|
+
signPayload({ amount, contractAddress }) {
|
|
10018
10013
|
const payload = {
|
|
10019
10014
|
amount,
|
|
10020
10015
|
contract_address: addressToUint256(contractAddress).toString(),
|
|
@@ -10042,10 +10037,7 @@ var EdDSAPoseidonKeypair = class _EdDSAPoseidonKeypair extends Keypair3 {
|
|
|
10042
10037
|
*
|
|
10043
10038
|
* @returns Base64-encoded signature of the credential
|
|
10044
10039
|
*/
|
|
10045
|
-
signCredential({
|
|
10046
|
-
amount,
|
|
10047
|
-
contractAddress
|
|
10048
|
-
}) {
|
|
10040
|
+
signCredential({ amount, contractAddress }) {
|
|
10049
10041
|
const messageHash = hash5([
|
|
10050
10042
|
BigInt(amount),
|
|
10051
10043
|
BigInt(addressToUint256(contractAddress)),
|
|
@@ -10064,10 +10056,7 @@ var EdDSAPoseidonKeypair = class _EdDSAPoseidonKeypair extends Keypair3 {
|
|
|
10064
10056
|
* @returns The ECDH shared key.
|
|
10065
10057
|
*/
|
|
10066
10058
|
genEcdhSharedKey(pubKey) {
|
|
10067
|
-
return (0, import_baby_jubjub3.mulPointEscalar)(
|
|
10068
|
-
pubKey,
|
|
10069
|
-
this.keypair.formatedPrivKey
|
|
10070
|
-
);
|
|
10059
|
+
return (0, import_baby_jubjub3.mulPointEscalar)(pubKey, this.keypair.formatedPrivKey);
|
|
10071
10060
|
}
|
|
10072
10061
|
genDeactivateRoot(accounts, stateTreeDepth) {
|
|
10073
10062
|
const unpackedAccounts = accounts.length > 0 && typeof accounts[0] === "bigint" ? accounts.map((account) => unpackPubKey(account)) : accounts;
|