@lagoon-protocol/v0-core 0.14.0 → 0.15.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.
@@ -105,7 +105,7 @@ function formatAbiParameter(abiParameter) {
105
105
  if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) {
106
106
  type = "(";
107
107
  const length = abiParameter.components.length;
108
- for (let i = 0;i < length; i++) {
108
+ for (let i = 0; i < length; i++) {
109
109
  const component = abiParameter.components[i];
110
110
  type += formatAbiParameter(component);
111
111
  if (i < length - 1)
@@ -134,7 +134,7 @@ var init_formatAbiParameter = __esm(() => {
134
134
  function formatAbiParameters(abiParameters) {
135
135
  let params = "";
136
136
  const length = abiParameters.length;
137
- for (let i = 0;i < length; i++) {
137
+ for (let i = 0; i < length; i++) {
138
138
  const abiParameter = abiParameters[i];
139
139
  params += formatAbiParameter(abiParameter);
140
140
  if (i !== length - 1)
@@ -500,7 +500,7 @@ function parseAbiParameter(param, options) {
500
500
  const params = splitParameters(match.type);
501
501
  const components_ = [];
502
502
  const length = params.length;
503
- for (let i = 0;i < length; i++) {
503
+ for (let i = 0; i < length; i++) {
504
504
  components_.push(parseAbiParameter(params[i], { structs }));
505
505
  }
506
506
  components = { components: components_ };
@@ -541,7 +541,7 @@ function parseAbiParameter(param, options) {
541
541
  }
542
542
  function splitParameters(params, result = [], current = "", depth = 0) {
543
543
  const length = params.trim().length;
544
- for (let i = 0;i < length; i++) {
544
+ for (let i = 0; i < length; i++) {
545
545
  const char = params[i];
546
546
  const tail = params.slice(i + 1);
547
547
  switch (char) {
@@ -589,7 +589,7 @@ var init_utils = __esm(() => {
589
589
  function parseStructs(signatures) {
590
590
  const shallowStructs = {};
591
591
  const signaturesLength = signatures.length;
592
- for (let i = 0;i < signaturesLength; i++) {
592
+ for (let i = 0; i < signaturesLength; i++) {
593
593
  const signature = signatures[i];
594
594
  if (!isStructSignature(signature))
595
595
  continue;
@@ -599,7 +599,7 @@ function parseStructs(signatures) {
599
599
  const properties = match.properties.split(";");
600
600
  const components = [];
601
601
  const propertiesLength = properties.length;
602
- for (let k = 0;k < propertiesLength; k++) {
602
+ for (let k = 0; k < propertiesLength; k++) {
603
603
  const property = properties[k];
604
604
  const trimmed = property.trim();
605
605
  if (!trimmed)
@@ -616,7 +616,7 @@ function parseStructs(signatures) {
616
616
  const resolvedStructs = {};
617
617
  const entries = Object.entries(shallowStructs);
618
618
  const entriesLength = entries.length;
619
- for (let i = 0;i < entriesLength; i++) {
619
+ for (let i = 0; i < entriesLength; i++) {
620
620
  const [name, parameters] = entries[i];
621
621
  resolvedStructs[name] = resolveStructs(parameters, shallowStructs);
622
622
  }
@@ -625,7 +625,7 @@ function parseStructs(signatures) {
625
625
  function resolveStructs(abiParameters, structs, ancestors = new Set) {
626
626
  const components = [];
627
627
  const length = abiParameters.length;
628
- for (let i = 0;i < length; i++) {
628
+ for (let i = 0; i < length; i++) {
629
629
  const abiParameter = abiParameters[i];
630
630
  const isTuple = isTupleRegex.test(abiParameter.type);
631
631
  if (isTuple)
@@ -675,7 +675,7 @@ function parseAbiParameter2(param) {
675
675
  else {
676
676
  const structs = parseStructs(param);
677
677
  const length = param.length;
678
- for (let i = 0;i < length; i++) {
678
+ for (let i = 0; i < length; i++) {
679
679
  const signature = param[i];
680
680
  if (isStructSignature(signature))
681
681
  continue;
@@ -700,19 +700,19 @@ function parseAbiParameters(params) {
700
700
  if (typeof params === "string") {
701
701
  const parameters = splitParameters(params);
702
702
  const length = parameters.length;
703
- for (let i = 0;i < length; i++) {
703
+ for (let i = 0; i < length; i++) {
704
704
  abiParameters.push(parseAbiParameter(parameters[i], { modifiers }));
705
705
  }
706
706
  } else {
707
707
  const structs = parseStructs(params);
708
708
  const length = params.length;
709
- for (let i = 0;i < length; i++) {
709
+ for (let i = 0; i < length; i++) {
710
710
  const signature = params[i];
711
711
  if (isStructSignature(signature))
712
712
  continue;
713
713
  const parameters = splitParameters(signature);
714
714
  const length2 = parameters.length;
715
- for (let k = 0;k < length2; k++) {
715
+ for (let k = 0; k < length2; k++) {
716
716
  abiParameters.push(parseAbiParameter(parameters[k], { modifiers, structs }));
717
717
  }
718
718
  }
@@ -772,7 +772,7 @@ function size(value) {
772
772
  return Math.ceil((value.length - 2) / 2);
773
773
  return value.length;
774
774
  }
775
- var init_size = () => {};
775
+ var init_size = () => { };
776
776
 
777
777
  // ../../node_modules/viem/_esm/errors/version.js
778
778
  var version2 = "2.37.9";
@@ -994,7 +994,7 @@ function padBytes(bytes, { dir, size: size2 = 32 } = {}) {
994
994
  type: "bytes"
995
995
  });
996
996
  const paddedBytes = new Uint8Array(size2);
997
- for (let i = 0;i < size2; i++) {
997
+ for (let i = 0; i < size2; i++) {
998
998
  const padEnd = dir === "right";
999
999
  paddedBytes[padEnd ? i : size2 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
1000
1000
  }
@@ -1054,7 +1054,7 @@ function boolToHex(value, opts = {}) {
1054
1054
  }
1055
1055
  function bytesToHex(value, opts = {}) {
1056
1056
  let string = "";
1057
- for (let i = 0;i < value.length; i++) {
1057
+ for (let i = 0; i < value.length; i++) {
1058
1058
  string += hexes[value[i]];
1059
1059
  }
1060
1060
  const hex = `0x${string}`;
@@ -1144,7 +1144,7 @@ function hexToBytes(hex_, opts = {}) {
1144
1144
  hexString = `0${hexString}`;
1145
1145
  const length = hexString.length / 2;
1146
1146
  const bytes = new Uint8Array(length);
1147
- for (let index = 0, j = 0;index < length; index++) {
1147
+ for (let index = 0, j = 0; index < length; index++) {
1148
1148
  const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
1149
1149
  const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
1150
1150
  if (nibbleLeft === undefined || nibbleRight === undefined) {
@@ -1193,7 +1193,7 @@ function split(lst, le = false) {
1193
1193
  const len = lst.length;
1194
1194
  let Ah = new Uint32Array(len);
1195
1195
  let Al = new Uint32Array(len);
1196
- for (let i = 0;i < len; i++) {
1196
+ for (let i = 0; i < len; i++) {
1197
1197
  const { h, l } = fromBig(lst[i], le);
1198
1198
  [Ah[i], Al[i]] = [h, l];
1199
1199
  }
@@ -1236,7 +1236,7 @@ function u32(arr) {
1236
1236
  return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
1237
1237
  }
1238
1238
  function clean(...arrays) {
1239
- for (let i = 0;i < arrays.length; i++) {
1239
+ for (let i = 0; i < arrays.length; i++) {
1240
1240
  arrays[i].fill(0);
1241
1241
  }
1242
1242
  }
@@ -1244,7 +1244,7 @@ function byteSwap(word) {
1244
1244
  return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
1245
1245
  }
1246
1246
  function byteSwap32(arr) {
1247
- for (let i = 0;i < arr.length; i++) {
1247
+ for (let i = 0; i < arr.length; i++) {
1248
1248
  arr[i] = byteSwap(arr[i]);
1249
1249
  }
1250
1250
  return arr;
@@ -1281,24 +1281,24 @@ var init_utils2 = __esm(() => {
1281
1281
  // ../../node_modules/@noble/hashes/esm/sha3.js
1282
1282
  function keccakP(s, rounds = 24) {
1283
1283
  const B = new Uint32Array(5 * 2);
1284
- for (let round = 24 - rounds;round < 24; round++) {
1285
- for (let x = 0;x < 10; x++)
1284
+ for (let round = 24 - rounds; round < 24; round++) {
1285
+ for (let x = 0; x < 10; x++)
1286
1286
  B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
1287
- for (let x = 0;x < 10; x += 2) {
1287
+ for (let x = 0; x < 10; x += 2) {
1288
1288
  const idx1 = (x + 8) % 10;
1289
1289
  const idx0 = (x + 2) % 10;
1290
1290
  const B0 = B[idx0];
1291
1291
  const B1 = B[idx0 + 1];
1292
1292
  const Th = rotlH(B0, B1, 1) ^ B[idx1];
1293
1293
  const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
1294
- for (let y = 0;y < 50; y += 10) {
1294
+ for (let y = 0; y < 50; y += 10) {
1295
1295
  s[x + y] ^= Th;
1296
1296
  s[x + y + 1] ^= Tl;
1297
1297
  }
1298
1298
  }
1299
1299
  let curH = s[2];
1300
1300
  let curL = s[3];
1301
- for (let t = 0;t < 24; t++) {
1301
+ for (let t = 0; t < 24; t++) {
1302
1302
  const shift = SHA3_ROTL[t];
1303
1303
  const Th = rotlH(curH, curL, shift);
1304
1304
  const Tl = rotlL(curH, curL, shift);
@@ -1308,10 +1308,10 @@ function keccakP(s, rounds = 24) {
1308
1308
  s[PI] = Th;
1309
1309
  s[PI + 1] = Tl;
1310
1310
  }
1311
- for (let y = 0;y < 50; y += 10) {
1312
- for (let x = 0;x < 10; x++)
1311
+ for (let y = 0; y < 50; y += 10) {
1312
+ for (let x = 0; x < 10; x++)
1313
1313
  B[x] = s[y + x];
1314
- for (let x = 0;x < 10; x++)
1314
+ for (let x = 0; x < 10; x++)
1315
1315
  s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
1316
1316
  }
1317
1317
  s[0] ^= SHA3_IOTA_H[round];
@@ -1332,12 +1332,12 @@ var init_sha3 = __esm(() => {
1332
1332
  SHA3_PI = [];
1333
1333
  SHA3_ROTL = [];
1334
1334
  _SHA3_IOTA = [];
1335
- for (let round = 0, R = _1n, x = 1, y = 0;round < 24; round++) {
1335
+ for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
1336
1336
  [x, y] = [y, (2 * x + 3 * y) % 5];
1337
1337
  SHA3_PI.push(2 * (5 * y + x));
1338
1338
  SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
1339
1339
  let t = _0n;
1340
- for (let j = 0;j < 7; j++) {
1340
+ for (let j = 0; j < 7; j++) {
1341
1341
  R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
1342
1342
  if (R & _2n)
1343
1343
  t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
@@ -1382,9 +1382,9 @@ var init_sha3 = __esm(() => {
1382
1382
  abytes(data);
1383
1383
  const { blockLen, state } = this;
1384
1384
  const len = data.length;
1385
- for (let pos = 0;pos < len; ) {
1385
+ for (let pos = 0; pos < len;) {
1386
1386
  const take = Math.min(blockLen - this.pos, len - pos);
1387
- for (let i = 0;i < take; i++)
1387
+ for (let i = 0; i < take; i++)
1388
1388
  state[this.pos++] ^= data[pos++];
1389
1389
  if (this.pos === blockLen)
1390
1390
  this.keccak();
@@ -1408,7 +1408,7 @@ var init_sha3 = __esm(() => {
1408
1408
  this.finish();
1409
1409
  const bufferOut = this.state;
1410
1410
  const { blockLen } = this;
1411
- for (let pos = 0, len = out.length;pos < len; ) {
1411
+ for (let pos = 0, len = out.length; pos < len;) {
1412
1412
  if (this.posOut >= blockLen)
1413
1413
  this.keccak();
1414
1414
  const take = Math.min(blockLen - this.posOut, len - pos);
@@ -1491,7 +1491,7 @@ function normalizeSignature(signature) {
1491
1491
  let level = 0;
1492
1492
  let result = "";
1493
1493
  let valid = false;
1494
- for (let i = 0;i < signature.length; i++) {
1494
+ for (let i = 0; i < signature.length; i++) {
1495
1495
  const char = signature[i];
1496
1496
  if (["(", ")", ","].includes(char))
1497
1497
  active = true;
@@ -1619,7 +1619,7 @@ function checksumAddress(address_, chainId) {
1619
1619
  const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
1620
1620
  const hash2 = keccak256(stringToBytes(hexAddress), "bytes");
1621
1621
  const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
1622
- for (let i = 0;i < 40; i += 2) {
1622
+ for (let i = 0; i < 40; i += 2) {
1623
1623
  if (hash2[i >> 1] >> 4 >= 8 && address[i]) {
1624
1624
  address[i] = address[i].toUpperCase();
1625
1625
  }
@@ -1758,7 +1758,7 @@ function encodeAbiParameters(params, values) {
1758
1758
  }
1759
1759
  function prepareParams({ params, values }) {
1760
1760
  const preparedParams = [];
1761
- for (let i = 0;i < params.length; i++) {
1761
+ for (let i = 0; i < params.length; i++) {
1762
1762
  preparedParams.push(prepareParam({ param: params[i], value: values[i] }));
1763
1763
  }
1764
1764
  return preparedParams;
@@ -1800,7 +1800,7 @@ function prepareParam({ param, value }) {
1800
1800
  }
1801
1801
  function encodeParams(preparedParams) {
1802
1802
  let staticSize = 0;
1803
- for (let i = 0;i < preparedParams.length; i++) {
1803
+ for (let i = 0; i < preparedParams.length; i++) {
1804
1804
  const { dynamic, encoded } = preparedParams[i];
1805
1805
  if (dynamic)
1806
1806
  staticSize += 32;
@@ -1810,7 +1810,7 @@ function encodeParams(preparedParams) {
1810
1810
  const staticParams = [];
1811
1811
  const dynamicParams = [];
1812
1812
  let dynamicSize = 0;
1813
- for (let i = 0;i < preparedParams.length; i++) {
1813
+ for (let i = 0; i < preparedParams.length; i++) {
1814
1814
  const { dynamic, encoded } = preparedParams[i];
1815
1815
  if (dynamic) {
1816
1816
  staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
@@ -1839,7 +1839,7 @@ function encodeArray(value, { length, param }) {
1839
1839
  });
1840
1840
  let dynamicChild = false;
1841
1841
  const preparedParams = [];
1842
- for (let i = 0;i < value.length; i++) {
1842
+ for (let i = 0; i < value.length; i++) {
1843
1843
  const preparedParam = prepareParam({ param, value: value[i] });
1844
1844
  if (preparedParam.dynamic)
1845
1845
  dynamicChild = true;
@@ -1914,7 +1914,7 @@ function encodeString(value) {
1914
1914
  const hexValue = stringToHex(value);
1915
1915
  const partsLength = Math.ceil(size(hexValue) / 32);
1916
1916
  const parts = [];
1917
- for (let i = 0;i < partsLength; i++) {
1917
+ for (let i = 0; i < partsLength; i++) {
1918
1918
  parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
1919
1919
  dir: "right"
1920
1920
  }));
@@ -1930,7 +1930,7 @@ function encodeString(value) {
1930
1930
  function encodeTuple(value, { param }) {
1931
1931
  let dynamic = false;
1932
1932
  const preparedParams = [];
1933
- for (let i = 0;i < param.components.length; i++) {
1933
+ for (let i = 0; i < param.components.length; i++) {
1934
1934
  const param_ = param.components[i];
1935
1935
  const index = Array.isArray(value) ? i : param_.name;
1936
1936
  const preparedParam = prepareParam({
@@ -2752,6 +2752,7 @@ var ChainId;
2752
2752
  ChainId2[ChainId2["HyperEVMMainnet"] = 999] = "HyperEVMMainnet";
2753
2753
  ChainId2[ChainId2["LineaMainnet"] = 59144] = "LineaMainnet";
2754
2754
  ChainId2[ChainId2["PlasmaMainnet"] = 9745] = "PlasmaMainnet";
2755
+ ChainId2[ChainId2["MonadMainnet"] = 143] = "MonadMainnet";
2755
2756
  })(ChainId ||= {});
2756
2757
  var ChainUtils;
2757
2758
  ((ChainUtils) => {
@@ -2886,6 +2887,13 @@ var ChainUtils;
2886
2887
  nativeCurrency: { name: "XPL", symbol: "XPL", decimals: 18 },
2887
2888
  explorerUrl: "https://plasmascan.to/",
2888
2889
  identifier: "plasma"
2890
+ },
2891
+ [143 /* MonadMainnet */]: {
2892
+ name: "Monad Mainnet",
2893
+ id: 143 /* MonadMainnet */,
2894
+ nativeCurrency: { name: "MON", symbol: "MON", decimals: 18 },
2895
+ explorerUrl: "https://monadvision.com/",
2896
+ identifier: "monad"
2889
2897
  }
2890
2898
  };
2891
2899
  })(ChainUtils ||= {});
@@ -3002,6 +3010,12 @@ var addresses = {
3002
3010
  v0_5_0: "0x50f30E712D535b796C8543012D0C05218b89c7d5",
3003
3011
  wrappedNative: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
3004
3012
  optinFactory: "0x0C0E287f6e4de685f4b44A5282A3ad4A29D05a91"
3013
+ },
3014
+ [143 /* MonadMainnet */]: {
3015
+ feeRegistry: "0xBf994c358f939011595AB4216AC005147863f9D6",
3016
+ v0_5_0: "0x870dd43a868C35b036347c46042D97C7247EEa15",
3017
+ wrappedNative: "0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A",
3018
+ optinFactory: "0xcCdC4d06cA12A29C47D5d105fED59a6D07E9cf70"
3005
3019
  }
3006
3020
  };
3007
3021
  // src/utils.ts
package/dist/esm/index.js CHANGED
@@ -2693,6 +2693,7 @@ var ChainId;
2693
2693
  ChainId2[ChainId2["HyperEVMMainnet"] = 999] = "HyperEVMMainnet";
2694
2694
  ChainId2[ChainId2["LineaMainnet"] = 59144] = "LineaMainnet";
2695
2695
  ChainId2[ChainId2["PlasmaMainnet"] = 9745] = "PlasmaMainnet";
2696
+ ChainId2[ChainId2["MonadMainnet"] = 143] = "MonadMainnet";
2696
2697
  })(ChainId ||= {});
2697
2698
  var ChainUtils;
2698
2699
  ((ChainUtils) => {
@@ -2827,6 +2828,13 @@ var ChainUtils;
2827
2828
  nativeCurrency: { name: "XPL", symbol: "XPL", decimals: 18 },
2828
2829
  explorerUrl: "https://plasmascan.to/",
2829
2830
  identifier: "plasma"
2831
+ },
2832
+ [143 /* MonadMainnet */]: {
2833
+ name: "Monad Mainnet",
2834
+ id: 143 /* MonadMainnet */,
2835
+ nativeCurrency: { name: "MON", symbol: "MON", decimals: 18 },
2836
+ explorerUrl: "https://monadvision.com/",
2837
+ identifier: "monad"
2830
2838
  }
2831
2839
  };
2832
2840
  })(ChainUtils ||= {});
@@ -2943,6 +2951,12 @@ var addresses = {
2943
2951
  v0_5_0: "0x50f30E712D535b796C8543012D0C05218b89c7d5",
2944
2952
  wrappedNative: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
2945
2953
  optinFactory: "0x0C0E287f6e4de685f4b44A5282A3ad4A29D05a91"
2954
+ },
2955
+ [143 /* MonadMainnet */]: {
2956
+ feeRegistry: "0xBf994c358f939011595AB4216AC005147863f9D6",
2957
+ v0_5_0: "0x870dd43a868C35b036347c46042D97C7247EEa15",
2958
+ wrappedNative: "0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A",
2959
+ optinFactory: "0xcCdC4d06cA12A29C47D5d105fED59a6D07E9cf70"
2946
2960
  }
2947
2961
  };
2948
2962
  // src/utils.ts