@silvana-one/mina-utils 1.0.42 → 1.1.0
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/node/index.cjs +68 -193
- package/dist/node/transactions/send.js +1 -1
- package/dist/node/transactions/send.js.map +1 -1
- package/dist/node/utils/index.d.ts +0 -1
- package/dist/node/utils/index.js +0 -1
- package/dist/node/utils/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tsconfig.web.tsbuildinfo +1 -1
- package/dist/web/transactions/send.js +1 -1
- package/dist/web/transactions/send.js.map +1 -1
- package/dist/web/utils/index.d.ts +0 -1
- package/dist/web/utils/index.js +0 -1
- package/dist/web/utils/index.js.map +1 -1
- package/package.json +6 -6
- package/src/transactions/send.ts +1 -1
- package/src/utils/index.ts +0 -1
- package/dist/node/utils/indexed-map.d.ts +0 -32
- package/dist/node/utils/indexed-map.js +0 -124
- package/dist/node/utils/indexed-map.js.map +0 -1
- package/dist/web/utils/indexed-map.d.ts +0 -32
- package/dist/web/utils/indexed-map.js +0 -124
- package/dist/web/utils/indexed-map.js.map +0 -1
- package/src/utils/indexed-map.ts +0 -170
package/dist/node/index.cjs
CHANGED
|
@@ -59,7 +59,6 @@ __export(index_exports, {
|
|
|
59
59
|
createTransactionPayloads: () => createTransactionPayloads,
|
|
60
60
|
currentNetwork: () => currentNetwork,
|
|
61
61
|
deserializeFields: () => deserializeFields,
|
|
62
|
-
deserializeIndexedMerkleMap: () => deserializeIndexedMerkleMap,
|
|
63
62
|
digestStruct: () => digestStruct,
|
|
64
63
|
fee: () => fee,
|
|
65
64
|
fetchMinaAccount: () => fetchMinaAccount,
|
|
@@ -86,20 +85,16 @@ __export(index_exports, {
|
|
|
86
85
|
getZkAppTxFromBlockBerry: () => getZkAppTxFromBlockBerry,
|
|
87
86
|
getZkAppTxsFromBlockBerry: () => getZkAppTxsFromBlockBerry,
|
|
88
87
|
initBlockchain: () => initBlockchain,
|
|
89
|
-
loadIndexedMerkleMap: () => loadIndexedMerkleMap,
|
|
90
88
|
makeString: () => makeString,
|
|
91
89
|
networks: () => networks,
|
|
92
|
-
parseIndexedMapSerialized: () => parseIndexedMapSerialized,
|
|
93
90
|
parseTransactionPayloads: () => parseTransactionPayloads,
|
|
94
91
|
pinJSON: () => pinJSON,
|
|
95
92
|
rScalarPow: () => rScalarPow,
|
|
96
93
|
rScalarPowLegacy: () => rScalarPowLegacy,
|
|
97
94
|
rScalarPowProvable: () => rScalarPowProvable,
|
|
98
|
-
saveIndexedMerkleMap: () => saveIndexedMerkleMap,
|
|
99
95
|
scalar: () => scalar,
|
|
100
96
|
sendTx: () => sendTx,
|
|
101
97
|
serializeFields: () => serializeFields,
|
|
102
|
-
serializeIndexedMap: () => serializeIndexedMap,
|
|
103
98
|
serializeTransaction: () => serializeTransaction,
|
|
104
99
|
sleep: () => sleep,
|
|
105
100
|
toBase: () => toBase,
|
|
@@ -555,8 +550,16 @@ async function accountBalanceMina(address) {
|
|
|
555
550
|
return Number((await accountBalance(address)).toBigInt()) / 1e9;
|
|
556
551
|
}
|
|
557
552
|
|
|
558
|
-
// dist/node/
|
|
559
|
-
|
|
553
|
+
// dist/node/storage/ipfs.js
|
|
554
|
+
function createIpfsURL(params) {
|
|
555
|
+
let { hash, gateway, apiToken } = params;
|
|
556
|
+
gateway ??= process.env.PINATA_IPFS_GATEWAY ?? process.env.NEXT_PUBLIC_PINATA_IPFS_GATEWAY ?? process.env.REACT_APP_PINATA_IPFS_GATEWAY;
|
|
557
|
+
apiToken ??= process.env.PINATA_GATEWAY_TOKEN ?? process.env.NEXT_PUBLIC_PINATA_GATEWAY_TOKEN ?? process.env.REACT_APP_PINATA_GATEWAY_TOKEN;
|
|
558
|
+
if (!gateway) {
|
|
559
|
+
gateway = "https://gateway.pinata.cloud/ipfs/";
|
|
560
|
+
}
|
|
561
|
+
return gateway + hash + (apiToken ? "?pinataGatewayToken=" + apiToken : "");
|
|
562
|
+
}
|
|
560
563
|
|
|
561
564
|
// dist/node/storage/pinata.js
|
|
562
565
|
async function pinJSON(params) {
|
|
@@ -595,129 +598,6 @@ async function pinJSON(params) {
|
|
|
595
598
|
}
|
|
596
599
|
}
|
|
597
600
|
|
|
598
|
-
// dist/node/utils/indexed-map.js
|
|
599
|
-
var { IndexedMerkleMap } = import_o1js6.Experimental;
|
|
600
|
-
async function loadIndexedMerkleMap(params) {
|
|
601
|
-
const { url, type, timeout = 6e4, attempts = 5 } = params;
|
|
602
|
-
let attempt = 0;
|
|
603
|
-
const start = Date.now();
|
|
604
|
-
let response = await fetch(url);
|
|
605
|
-
while (!response.ok && attempt < attempts && Date.now() - start < timeout) {
|
|
606
|
-
attempt++;
|
|
607
|
-
await sleep(5e3 * attempt);
|
|
608
|
-
response = await fetch(url);
|
|
609
|
-
}
|
|
610
|
-
if (!response.ok) {
|
|
611
|
-
throw new Error("Failed to fetch IndexedMerkleMap");
|
|
612
|
-
}
|
|
613
|
-
const json = await response.json();
|
|
614
|
-
const serializedIndexedMap = json.map;
|
|
615
|
-
if (!serializedIndexedMap)
|
|
616
|
-
throw new Error("wrong IndexedMerkleMap json format");
|
|
617
|
-
const map = deserializeIndexedMerkleMapInternal({
|
|
618
|
-
serializedIndexedMap,
|
|
619
|
-
type
|
|
620
|
-
});
|
|
621
|
-
if (!map) {
|
|
622
|
-
throw new Error("Failed to deserialize whitelist");
|
|
623
|
-
}
|
|
624
|
-
return map;
|
|
625
|
-
}
|
|
626
|
-
async function saveIndexedMerkleMap(params) {
|
|
627
|
-
const { map, name = "indexed-map", keyvalues, auth } = params;
|
|
628
|
-
const serialized = serializeIndexedMap(map);
|
|
629
|
-
const ipfsHash = await pinJSON({
|
|
630
|
-
data: { map: serialized },
|
|
631
|
-
name,
|
|
632
|
-
keyvalues,
|
|
633
|
-
auth
|
|
634
|
-
});
|
|
635
|
-
return ipfsHash;
|
|
636
|
-
}
|
|
637
|
-
function serializeIndexedMap(map) {
|
|
638
|
-
return {
|
|
639
|
-
height: map.height,
|
|
640
|
-
root: map.root.toJSON(),
|
|
641
|
-
length: map.length.toJSON(),
|
|
642
|
-
nodes: JSON.stringify(map.data.get().nodes, (_, v) => typeof v === "bigint" ? "n" + bigintToBase64(v) : v),
|
|
643
|
-
sortedLeaves: JSON.stringify(map.data.get().sortedLeaves.map((v) => [
|
|
644
|
-
bigintToBase64(v.key),
|
|
645
|
-
bigintToBase64(v.nextKey),
|
|
646
|
-
bigintToBase64(v.value),
|
|
647
|
-
bigintToBase64(BigInt(v.index))
|
|
648
|
-
]))
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
function deserializeIndexedMerkleMap(params) {
|
|
652
|
-
try {
|
|
653
|
-
const { serializedIndexedMap, type } = params;
|
|
654
|
-
return deserializeIndexedMerkleMapInternal({
|
|
655
|
-
serializedIndexedMap,
|
|
656
|
-
type: type ?? IndexedMerkleMap(serializedIndexedMap.height)
|
|
657
|
-
});
|
|
658
|
-
} catch (error) {
|
|
659
|
-
console.error("Error deserializing map:", error?.message ?? error);
|
|
660
|
-
return void 0;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
function parseIndexedMapSerialized(serializedMap) {
|
|
664
|
-
const json = JSON.parse(serializedMap);
|
|
665
|
-
if (json.height === void 0 || json.root === void 0 || json.length === void 0 || json.nodes === void 0 || json.sortedLeaves === void 0)
|
|
666
|
-
throw new Error("wrong IndexedMerkleMap json format");
|
|
667
|
-
if (typeof json.height !== "number")
|
|
668
|
-
throw new Error("wrong IndexedMerkleMap height format");
|
|
669
|
-
if (typeof json.root !== "string")
|
|
670
|
-
throw new Error("wrong IndexedMerkleMap root format");
|
|
671
|
-
if (typeof json.length !== "string")
|
|
672
|
-
throw new Error("wrong IndexedMerkleMap length format");
|
|
673
|
-
if (typeof json.nodes !== "string")
|
|
674
|
-
throw new Error("wrong IndexedMerkleMap nodes format");
|
|
675
|
-
if (typeof json.sortedLeaves !== "string")
|
|
676
|
-
throw new Error("wrong IndexedMerkleMap sortedLeaves format");
|
|
677
|
-
return json;
|
|
678
|
-
}
|
|
679
|
-
function deserializeIndexedMerkleMapInternal(params) {
|
|
680
|
-
const { serializedIndexedMap, type } = params;
|
|
681
|
-
const map = new type();
|
|
682
|
-
if (serializedIndexedMap.height !== map.height) {
|
|
683
|
-
throw new Error("wrong IndexedMap height");
|
|
684
|
-
}
|
|
685
|
-
const nodes = JSON.parse(serializedIndexedMap.nodes, (_, v) => {
|
|
686
|
-
if (typeof v === "string" && v[0] === "n") {
|
|
687
|
-
return bigintFromBase64(v.slice(1));
|
|
688
|
-
}
|
|
689
|
-
return v;
|
|
690
|
-
});
|
|
691
|
-
const sortedLeaves = JSON.parse(serializedIndexedMap.sortedLeaves).map((row) => {
|
|
692
|
-
return {
|
|
693
|
-
key: bigintFromBase64(row[0]),
|
|
694
|
-
nextKey: bigintFromBase64(row[1]),
|
|
695
|
-
value: bigintFromBase64(row[2]),
|
|
696
|
-
index: Number(bigintFromBase64(row[3]))
|
|
697
|
-
};
|
|
698
|
-
});
|
|
699
|
-
map.root = import_o1js6.Field.fromJSON(serializedIndexedMap.root);
|
|
700
|
-
map.length = import_o1js6.Field.fromJSON(serializedIndexedMap.length);
|
|
701
|
-
map.data.updateAsProver(() => {
|
|
702
|
-
return {
|
|
703
|
-
nodes: nodes.map((row) => [...row]),
|
|
704
|
-
sortedLeaves: [...sortedLeaves]
|
|
705
|
-
};
|
|
706
|
-
});
|
|
707
|
-
return map;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
// dist/node/storage/ipfs.js
|
|
711
|
-
function createIpfsURL(params) {
|
|
712
|
-
let { hash, gateway, apiToken } = params;
|
|
713
|
-
gateway ??= process.env.PINATA_IPFS_GATEWAY ?? process.env.NEXT_PUBLIC_PINATA_IPFS_GATEWAY ?? process.env.REACT_APP_PINATA_IPFS_GATEWAY;
|
|
714
|
-
apiToken ??= process.env.PINATA_GATEWAY_TOKEN ?? process.env.NEXT_PUBLIC_PINATA_GATEWAY_TOKEN ?? process.env.REACT_APP_PINATA_GATEWAY_TOKEN;
|
|
715
|
-
if (!gateway) {
|
|
716
|
-
gateway = "https://gateway.pinata.cloud/ipfs/";
|
|
717
|
-
}
|
|
718
|
-
return gateway + hash + (apiToken ? "?pinataGatewayToken=" + apiToken : "");
|
|
719
|
-
}
|
|
720
|
-
|
|
721
601
|
// dist/node/transactions/blockberry.js
|
|
722
602
|
var TIMEOUT = 1e4;
|
|
723
603
|
async function getZkAppTxsFromBlockBerry(params) {
|
|
@@ -841,7 +721,7 @@ async function getZkAppFromBlockBerry(params) {
|
|
|
841
721
|
}
|
|
842
722
|
|
|
843
723
|
// dist/node/transactions/nonce.js
|
|
844
|
-
var
|
|
724
|
+
var import_o1js6 = require("o1js");
|
|
845
725
|
async function getNonce(params) {
|
|
846
726
|
const { account, chain, blockBerryApiKey } = params;
|
|
847
727
|
try {
|
|
@@ -899,9 +779,9 @@ async function getAccountNonce(params) {
|
|
|
899
779
|
const { account, chain = getCurrentNetwork().network.chainId, blockBerryApiKey, verbose = true } = params;
|
|
900
780
|
const canUseBlockBerry = blockBerryApiKey !== void 0 && (chain === "devnet" || chain === "mainnet");
|
|
901
781
|
if (chain === "zeko") {
|
|
902
|
-
const publicKey =
|
|
782
|
+
const publicKey = import_o1js6.PublicKey.fromBase58(account);
|
|
903
783
|
await fetchMinaAccount({ publicKey });
|
|
904
|
-
const nonce = Number(
|
|
784
|
+
const nonce = Number(import_o1js6.Mina.getAccount(publicKey).nonce.toBigint());
|
|
905
785
|
return nonce;
|
|
906
786
|
} else {
|
|
907
787
|
const blockberryNoncePromise = canUseBlockBerry ? getNonce({
|
|
@@ -909,9 +789,9 @@ async function getAccountNonce(params) {
|
|
|
909
789
|
blockBerryApiKey,
|
|
910
790
|
chain
|
|
911
791
|
}) : void 0;
|
|
912
|
-
const publicKey =
|
|
792
|
+
const publicKey = import_o1js6.PublicKey.fromBase58(account);
|
|
913
793
|
await fetchMinaAccount({ publicKey });
|
|
914
|
-
const senderNonce = Number(
|
|
794
|
+
const senderNonce = Number(import_o1js6.Mina.getAccount(publicKey).nonce.toBigint());
|
|
915
795
|
const blockberryNonce = blockberryNoncePromise ? (await blockberryNoncePromise).nonce ?? -1 : -1;
|
|
916
796
|
const nonce = Math.max(senderNonce, blockberryNonce + 1);
|
|
917
797
|
if (verbose && nonce > senderNonce)
|
|
@@ -921,7 +801,7 @@ async function getAccountNonce(params) {
|
|
|
921
801
|
}
|
|
922
802
|
|
|
923
803
|
// dist/node/transactions/transaction.js
|
|
924
|
-
var
|
|
804
|
+
var import_o1js7 = require("o1js");
|
|
925
805
|
function createTransactionPayloads(tx) {
|
|
926
806
|
const transaction = tx.toJSON();
|
|
927
807
|
const txJSON = JSON.parse(transaction);
|
|
@@ -965,11 +845,11 @@ function transactionParams(params) {
|
|
|
965
845
|
const { proverPayload, signedData } = params;
|
|
966
846
|
const signedJson = JSON.parse(signedData);
|
|
967
847
|
const { sender, tx } = JSON.parse(proverPayload);
|
|
968
|
-
const transaction =
|
|
848
|
+
const transaction = import_o1js7.Mina.Transaction.fromJSON(JSON.parse(tx));
|
|
969
849
|
const memo = transaction.transaction.memo;
|
|
970
850
|
return {
|
|
971
|
-
fee:
|
|
972
|
-
sender:
|
|
851
|
+
fee: import_o1js7.UInt64.from(signedJson.zkappCommand.feePayer.body.fee),
|
|
852
|
+
sender: import_o1js7.PublicKey.fromBase58(sender),
|
|
973
853
|
nonce: Number(signedJson.zkappCommand.feePayer.body.nonce),
|
|
974
854
|
memo
|
|
975
855
|
};
|
|
@@ -980,7 +860,7 @@ function parseTransactionPayloads(params) {
|
|
|
980
860
|
const signedData = "payloads" in params ? params.payloads.signedData : params.signedData;
|
|
981
861
|
const signedJson = JSON.parse(signedData);
|
|
982
862
|
const { tx, blindingValues, length, forestJSONs } = JSON.parse(proverPayload);
|
|
983
|
-
const transaction =
|
|
863
|
+
const transaction = import_o1js7.Mina.Transaction.fromJSON(JSON.parse(tx));
|
|
984
864
|
const forests = forestJSONs.map((f) => JSON.parse(f));
|
|
985
865
|
if (length !== txNew.transaction.accountUpdates.length) {
|
|
986
866
|
throw new Error(`New Transaction length mismatch: ${length} !== ${txNew.transaction.accountUpdates.length}`);
|
|
@@ -994,7 +874,7 @@ function parseTransactionPayloads(params) {
|
|
|
994
874
|
if (transaction.transaction.accountUpdates[i].lazyAuthorization === void 0 || transaction.transaction.accountUpdates[i].lazyAuthorization.blindingValue === void 0) {
|
|
995
875
|
throw new Error(`Lazy authorization blinding value is undefined for item ${i}`);
|
|
996
876
|
}
|
|
997
|
-
transaction.transaction.accountUpdates[i].lazyAuthorization.blindingValue =
|
|
877
|
+
transaction.transaction.accountUpdates[i].lazyAuthorization.blindingValue = import_o1js7.Field.fromJSON(blindingValues[i]);
|
|
998
878
|
}
|
|
999
879
|
if (forests[i].length > 0) {
|
|
1000
880
|
if (transaction.transaction.accountUpdates[i].lazyAuthorization === void 0 || transaction.transaction.accountUpdates[i].lazyAuthorization.args === void 0) {
|
|
@@ -1007,7 +887,7 @@ function parseTransactionPayloads(params) {
|
|
|
1007
887
|
}
|
|
1008
888
|
}
|
|
1009
889
|
transaction.transaction.feePayer.authorization = signedJson.zkappCommand.feePayer.authorization;
|
|
1010
|
-
transaction.transaction.feePayer.body.fee =
|
|
890
|
+
transaction.transaction.feePayer.body.fee = import_o1js7.UInt64.from(signedJson.zkappCommand.feePayer.body.fee);
|
|
1011
891
|
for (let i = 0; i < length; i++) {
|
|
1012
892
|
const signature = signedJson.zkappCommand.accountUpdates[i].authorization.signature;
|
|
1013
893
|
if (signature !== void 0 && signature !== null) {
|
|
@@ -1143,29 +1023,29 @@ async function txStatusBlockberry(params) {
|
|
|
1143
1023
|
|
|
1144
1024
|
// dist/node/transactions/tiny-contract.js
|
|
1145
1025
|
var import_tslib = require("tslib");
|
|
1146
|
-
var
|
|
1147
|
-
var TinyContract = class extends
|
|
1026
|
+
var import_o1js8 = require("o1js");
|
|
1027
|
+
var TinyContract = class extends import_o1js8.SmartContract {
|
|
1148
1028
|
constructor() {
|
|
1149
1029
|
super(...arguments);
|
|
1150
|
-
this.value = (0,
|
|
1030
|
+
this.value = (0, import_o1js8.State)();
|
|
1151
1031
|
}
|
|
1152
1032
|
async setValue(value) {
|
|
1153
1033
|
this.value.set(value);
|
|
1154
1034
|
}
|
|
1155
1035
|
};
|
|
1156
1036
|
(0, import_tslib.__decorate)([
|
|
1157
|
-
(0,
|
|
1037
|
+
(0, import_o1js8.state)(import_o1js8.Field),
|
|
1158
1038
|
(0, import_tslib.__metadata)("design:type", Object)
|
|
1159
1039
|
], TinyContract.prototype, "value", void 0);
|
|
1160
1040
|
(0, import_tslib.__decorate)([
|
|
1161
|
-
|
|
1041
|
+
import_o1js8.method,
|
|
1162
1042
|
(0, import_tslib.__metadata)("design:type", Function),
|
|
1163
|
-
(0, import_tslib.__metadata)("design:paramtypes", [
|
|
1043
|
+
(0, import_tslib.__metadata)("design:paramtypes", [import_o1js8.Field]),
|
|
1164
1044
|
(0, import_tslib.__metadata)("design:returntype", Promise)
|
|
1165
1045
|
], TinyContract.prototype, "setValue", null);
|
|
1166
1046
|
|
|
1167
1047
|
// dist/node/transactions/send.js
|
|
1168
|
-
var
|
|
1048
|
+
var import_o1js9 = require("o1js");
|
|
1169
1049
|
async function sendTx(params) {
|
|
1170
1050
|
const { tx, description = "", verbose = true, wait = true, chain = getCurrentNetwork().network.chainId, delay = chain === "zeko" || chain === "lightnet" ? 5e3 : 6e4, retry = 30 } = params;
|
|
1171
1051
|
const accountUpdates = JSON.parse(tx.toJSON()).accountUpdates;
|
|
@@ -1224,7 +1104,7 @@ async function sendTx(params) {
|
|
|
1224
1104
|
if (txIncluded.status !== "included") {
|
|
1225
1105
|
console.error(`${description ?? ""} tx NOT included into block: hash: ${txIncluded.hash} status: ${txIncluded.status}, errors: ${String(txIncluded.errors ?? "")}`);
|
|
1226
1106
|
}
|
|
1227
|
-
if (chain !== "local") {
|
|
1107
|
+
if (chain !== "mina:local") {
|
|
1228
1108
|
const { publicKey, nonce } = tx.transaction.feePayer.body;
|
|
1229
1109
|
const started = Date.now();
|
|
1230
1110
|
while (Date.now() - started < 1e3 * 60 * 10) {
|
|
@@ -1276,7 +1156,7 @@ async function getTxStatusFast(params) {
|
|
|
1276
1156
|
if (chain === "local" || chain === "zeko")
|
|
1277
1157
|
return { success: true, result: true };
|
|
1278
1158
|
try {
|
|
1279
|
-
const txStatus = await (0,
|
|
1159
|
+
const txStatus = await (0, import_o1js9.checkZkappTransaction)(hash);
|
|
1280
1160
|
return {
|
|
1281
1161
|
success: true,
|
|
1282
1162
|
result: txStatus?.success ?? false
|
|
@@ -1288,21 +1168,21 @@ async function getTxStatusFast(params) {
|
|
|
1288
1168
|
}
|
|
1289
1169
|
|
|
1290
1170
|
// dist/node/transactions/account.js
|
|
1291
|
-
var
|
|
1171
|
+
var import_o1js10 = require("o1js");
|
|
1292
1172
|
async function accountExists(address, tokenId) {
|
|
1293
1173
|
try {
|
|
1294
|
-
const publicKey = typeof address === "string" ?
|
|
1174
|
+
const publicKey = typeof address === "string" ? import_o1js10.PublicKey.fromBase58(address) : address;
|
|
1295
1175
|
await fetchMinaAccount({ publicKey, tokenId, force: false });
|
|
1296
|
-
return
|
|
1176
|
+
return import_o1js10.Mina.hasAccount(publicKey, tokenId);
|
|
1297
1177
|
} catch (error) {
|
|
1298
1178
|
return false;
|
|
1299
1179
|
}
|
|
1300
1180
|
}
|
|
1301
1181
|
async function tokenBalance(address, tokenId) {
|
|
1302
1182
|
try {
|
|
1303
|
-
const publicKey = typeof address === "string" ?
|
|
1183
|
+
const publicKey = typeof address === "string" ? import_o1js10.PublicKey.fromBase58(address) : address;
|
|
1304
1184
|
await fetchMinaAccount({ publicKey, tokenId, force: false });
|
|
1305
|
-
return
|
|
1185
|
+
return import_o1js10.Mina.hasAccount(publicKey, tokenId) ? Number(import_o1js10.Mina.getAccount(publicKey, tokenId).balance.toBigInt()) : void 0;
|
|
1306
1186
|
} catch (error) {
|
|
1307
1187
|
console.error("Cannot fetch account balance", error);
|
|
1308
1188
|
return void 0;
|
|
@@ -1314,7 +1194,7 @@ async function checkAddress(address) {
|
|
|
1314
1194
|
return false;
|
|
1315
1195
|
}
|
|
1316
1196
|
try {
|
|
1317
|
-
const publicKey =
|
|
1197
|
+
const publicKey = import_o1js10.PublicKey.fromBase58(address);
|
|
1318
1198
|
if (address !== publicKey.toBase58()) {
|
|
1319
1199
|
console.log("checkAddress: address is not valid", address, publicKey.toBase58());
|
|
1320
1200
|
return false;
|
|
@@ -1327,12 +1207,12 @@ async function checkAddress(address) {
|
|
|
1327
1207
|
}
|
|
1328
1208
|
|
|
1329
1209
|
// dist/node/commitment/commitment.js
|
|
1330
|
-
var
|
|
1210
|
+
var import_o1js14 = require("o1js");
|
|
1331
1211
|
|
|
1332
1212
|
// dist/node/commitment/constants.js
|
|
1333
|
-
var
|
|
1213
|
+
var import_o1js11 = require("o1js");
|
|
1334
1214
|
var BLS_FR = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001n;
|
|
1335
|
-
var Fr = (0,
|
|
1215
|
+
var Fr = (0, import_o1js11.createForeignField)(BLS_FR);
|
|
1336
1216
|
var R_VALUE = 0x149fa8c209ab655fd480a3aff7d16dc72b6a3943e4b95fcf7909f42d9c17a552n;
|
|
1337
1217
|
function getR() {
|
|
1338
1218
|
return Fr.from(R_VALUE);
|
|
@@ -7504,7 +7384,7 @@ var TABLE22 = [
|
|
|
7504
7384
|
];
|
|
7505
7385
|
|
|
7506
7386
|
// dist/node/commitment/exp.js
|
|
7507
|
-
var
|
|
7387
|
+
var import_o1js13 = require("o1js");
|
|
7508
7388
|
|
|
7509
7389
|
// dist/node/commitment/witnesses.js
|
|
7510
7390
|
var TABLE0_ROOT = "14526672229990537846256328881388540660071506673959577780312284853709853948801";
|
|
@@ -13662,15 +13542,15 @@ var WITNESSES2 = [
|
|
|
13662
13542
|
];
|
|
13663
13543
|
|
|
13664
13544
|
// dist/node/commitment/tree.js
|
|
13665
|
-
var
|
|
13545
|
+
var import_o1js12 = require("o1js");
|
|
13666
13546
|
var TREE_DEPTH = 11;
|
|
13667
13547
|
var TABLE_SIZE = 1024;
|
|
13668
|
-
var Witness = class extends (0,
|
|
13548
|
+
var Witness = class extends (0, import_o1js12.MerkleWitness)(TREE_DEPTH) {
|
|
13669
13549
|
};
|
|
13670
13550
|
function createMerkleTree(table) {
|
|
13671
|
-
(0,
|
|
13672
|
-
const tree = new
|
|
13673
|
-
(0,
|
|
13551
|
+
(0, import_o1js12.assert)(table.length === TABLE_SIZE, "Table size must be 1024");
|
|
13552
|
+
const tree = new import_o1js12.MerkleTree(TREE_DEPTH);
|
|
13553
|
+
(0, import_o1js12.assert)(tree.leafCount === BigInt(TABLE_SIZE), "Tree size must be 1024");
|
|
13674
13554
|
for (let i = 0; i < TABLE_SIZE; i++) {
|
|
13675
13555
|
tree.setLeaf(BigInt(i), blsCommitment(Fr.from(table[i])));
|
|
13676
13556
|
}
|
|
@@ -13694,48 +13574,48 @@ function rScalarPow(exp) {
|
|
|
13694
13574
|
return result;
|
|
13695
13575
|
}
|
|
13696
13576
|
function rScalarPowProvable(exp) {
|
|
13697
|
-
(0,
|
|
13698
|
-
const mask = (0,
|
|
13699
|
-
const i0 =
|
|
13700
|
-
const shifted10 =
|
|
13701
|
-
const i1 =
|
|
13702
|
-
const shifted20 =
|
|
13703
|
-
const i2 =
|
|
13704
|
-
const t0 =
|
|
13577
|
+
(0, import_o1js13.assert)(exp.lessThan(import_o1js13.UInt32.from(1024 * 1024 * 1024)), "Exponent out of range (non-provable check)");
|
|
13578
|
+
const mask = (0, import_o1js13.Field)(1023);
|
|
13579
|
+
const i0 = import_o1js13.Gadgets.and(exp.value, mask, 10);
|
|
13580
|
+
const shifted10 = import_o1js13.Gadgets.rightShift64(exp.value, 10);
|
|
13581
|
+
const i1 = import_o1js13.Gadgets.and(shifted10, mask, 10);
|
|
13582
|
+
const shifted20 = import_o1js13.Gadgets.rightShift64(exp.value, 20);
|
|
13583
|
+
const i2 = import_o1js13.Gadgets.and(shifted20, mask, 10);
|
|
13584
|
+
const t0 = import_o1js13.Provable.witness(Fr.Canonical.provable, () => {
|
|
13705
13585
|
const idx = Number(i0.toBigInt());
|
|
13706
13586
|
return getTable0Entry(idx);
|
|
13707
13587
|
});
|
|
13708
|
-
const witness0 =
|
|
13588
|
+
const witness0 = import_o1js13.Provable.witness(Witness, () => {
|
|
13709
13589
|
const idx = Number(i0.toBigInt());
|
|
13710
13590
|
return Witness.fromFields(deserializeFields(WITNESSES0[idx]));
|
|
13711
13591
|
});
|
|
13712
|
-
const root0 = (0,
|
|
13592
|
+
const root0 = (0, import_o1js13.Field)(TABLE0_ROOT);
|
|
13713
13593
|
const witness0root = witness0.calculateRoot(blsCommitment(t0));
|
|
13714
13594
|
const witness0index = witness0.calculateIndex();
|
|
13715
13595
|
witness0root.assertEquals(root0, "Witness0 root should match root0");
|
|
13716
13596
|
witness0index.assertEquals(i0, "Witness0 index should match i0");
|
|
13717
|
-
const t1 =
|
|
13597
|
+
const t1 = import_o1js13.Provable.witness(Fr.Canonical.provable, () => {
|
|
13718
13598
|
const idx = Number(i1.toBigInt());
|
|
13719
13599
|
return getTable1Entry(idx);
|
|
13720
13600
|
});
|
|
13721
|
-
const witness1 =
|
|
13601
|
+
const witness1 = import_o1js13.Provable.witness(Witness, () => {
|
|
13722
13602
|
const idx = Number(i1.toBigInt());
|
|
13723
13603
|
return Witness.fromFields(deserializeFields(WITNESSES1[idx]));
|
|
13724
13604
|
});
|
|
13725
|
-
const root1 = (0,
|
|
13605
|
+
const root1 = (0, import_o1js13.Field)(TABLE1_ROOT);
|
|
13726
13606
|
const witness1root = witness1.calculateRoot(blsCommitment(t1));
|
|
13727
13607
|
const witness1index = witness1.calculateIndex();
|
|
13728
13608
|
witness1root.assertEquals(root1, "Witness1 root should match root1");
|
|
13729
13609
|
witness1index.assertEquals(i1, "Witness1 index should match i1");
|
|
13730
|
-
const t2 =
|
|
13610
|
+
const t2 = import_o1js13.Provable.witness(Fr.Canonical.provable, () => {
|
|
13731
13611
|
const idx = Number(i2.toBigInt());
|
|
13732
13612
|
return getTable2Entry(idx);
|
|
13733
13613
|
});
|
|
13734
|
-
const witness2 =
|
|
13614
|
+
const witness2 = import_o1js13.Provable.witness(Witness, () => {
|
|
13735
13615
|
const idx = Number(i2.toBigInt());
|
|
13736
13616
|
return Witness.fromFields(deserializeFields(WITNESSES2[idx]));
|
|
13737
13617
|
});
|
|
13738
|
-
const root2 = (0,
|
|
13618
|
+
const root2 = (0, import_o1js13.Field)(TABLE2_ROOT);
|
|
13739
13619
|
const witness2root = witness2.calculateRoot(blsCommitment(t2));
|
|
13740
13620
|
const witness2index = witness2.calculateIndex();
|
|
13741
13621
|
witness2root.assertEquals(root2, "Witness2 root should match root2");
|
|
@@ -13756,7 +13636,7 @@ function rScalarPowLegacy(exp) {
|
|
|
13756
13636
|
// dist/node/commitment/commitment.js
|
|
13757
13637
|
var R = getR();
|
|
13758
13638
|
var S = Fr.from(0x1582695da6689f26db7bb3eb32907ecd0ac3af032aefad31a069352705f0d459n);
|
|
13759
|
-
var P = (0,
|
|
13639
|
+
var P = (0, import_o1js14.Field)(20359658106300430391853594957854653514501797417378649347544016260949017072120n);
|
|
13760
13640
|
var P2 = P.mul(P);
|
|
13761
13641
|
function scalar(n) {
|
|
13762
13642
|
return Fr.from(n);
|
|
@@ -13789,16 +13669,16 @@ function update(oldTableCommitment, oldStructDigest, newStructDigest, index) {
|
|
|
13789
13669
|
}
|
|
13790
13670
|
|
|
13791
13671
|
// dist/node/commitment/convert.js
|
|
13792
|
-
var
|
|
13672
|
+
var import_o1js15 = require("o1js");
|
|
13793
13673
|
function convertFieldToCanonicalElement(field) {
|
|
13794
13674
|
const bitsField = field.toBits();
|
|
13795
|
-
(0,
|
|
13796
|
-
const element =
|
|
13675
|
+
(0, import_o1js15.assert)(bitsField.length === 254, "Field has to be 254 bits");
|
|
13676
|
+
const element = import_o1js15.Provable.witness(Fr.Canonical.provable, () => {
|
|
13797
13677
|
return Fr.from(field.toBigInt());
|
|
13798
13678
|
});
|
|
13799
13679
|
const bitsElement = element.toBits();
|
|
13800
|
-
(0,
|
|
13801
|
-
bitsElement[254].assertEquals((0,
|
|
13680
|
+
(0, import_o1js15.assert)(bitsElement.length === 255, "Element has to be 255 bits");
|
|
13681
|
+
bitsElement[254].assertEquals((0, import_o1js15.Bool)(false));
|
|
13802
13682
|
for (let i = 0; i < 254; i++) {
|
|
13803
13683
|
bitsElement[i].assertEquals(bitsField[i]);
|
|
13804
13684
|
}
|
|
@@ -13845,7 +13725,6 @@ function convertFieldToCanonicalElement(field) {
|
|
|
13845
13725
|
createTransactionPayloads,
|
|
13846
13726
|
currentNetwork,
|
|
13847
13727
|
deserializeFields,
|
|
13848
|
-
deserializeIndexedMerkleMap,
|
|
13849
13728
|
digestStruct,
|
|
13850
13729
|
fee,
|
|
13851
13730
|
fetchMinaAccount,
|
|
@@ -13872,20 +13751,16 @@ function convertFieldToCanonicalElement(field) {
|
|
|
13872
13751
|
getZkAppTxFromBlockBerry,
|
|
13873
13752
|
getZkAppTxsFromBlockBerry,
|
|
13874
13753
|
initBlockchain,
|
|
13875
|
-
loadIndexedMerkleMap,
|
|
13876
13754
|
makeString,
|
|
13877
13755
|
networks,
|
|
13878
|
-
parseIndexedMapSerialized,
|
|
13879
13756
|
parseTransactionPayloads,
|
|
13880
13757
|
pinJSON,
|
|
13881
13758
|
rScalarPow,
|
|
13882
13759
|
rScalarPowLegacy,
|
|
13883
13760
|
rScalarPowProvable,
|
|
13884
|
-
saveIndexedMerkleMap,
|
|
13885
13761
|
scalar,
|
|
13886
13762
|
sendTx,
|
|
13887
13763
|
serializeFields,
|
|
13888
|
-
serializeIndexedMap,
|
|
13889
13764
|
serializeTransaction,
|
|
13890
13765
|
sleep,
|
|
13891
13766
|
toBase,
|
|
@@ -78,7 +78,7 @@ export async function sendTx(params) {
|
|
|
78
78
|
if (txIncluded.status !== "included") {
|
|
79
79
|
console.error(`${description ?? ""} tx NOT included into block: hash: ${txIncluded.hash} status: ${txIncluded.status}, errors: ${String(txIncluded.errors ?? "")}`);
|
|
80
80
|
}
|
|
81
|
-
if (chain !== "local") {
|
|
81
|
+
if (chain !== "mina:local") {
|
|
82
82
|
// we still wait for the tx to be included in the block by checking the nonce
|
|
83
83
|
// even in the case of tx NOT included
|
|
84
84
|
// because the tx might still be included in the block in the case of devnet instability
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/transactions/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAG7C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,MAQ5B;IAMC,MAAM,EACJ,EAAE,EACF,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG,IAAI,EACd,IAAI,GAAG,IAAI,EACX,KAAK,GAAG,iBAAiB,EAAE,CAAC,OAAO,CAAC,OAAO,EAC3C,KAAK,GAAG,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAC/D,KAAK,GAAG,EAAE,GACX,GAAG,MAAM,CAAC;IACX,yBAAyB;IACzB,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,cAAc,CAAC;IAC9D,MAAM,OAAO,GAIP,EAAE,CAAC;IACT,IAAI,uBAAuB,GAAG,CAAC,CAAC;IAChC,0EAA0E;IAC1E,KAAK,MAAM,EAAE,IAAI,cAAc,EAAE,CAAC;QAChC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,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CAAC,KAAK,CACX,uDAAuD,EACvD,IAAI,EACJ,KAAK,CACN,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,sBAAsB,EAAE,CAAC;IAC7E,CAAC;AACH,CAAC"}
|
package/dist/node/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|