@inco/js 0.1.19 → 0.1.21
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/encryption/{index.js → index.cjs} +47 -34
- package/dist/encryption/index.mjs +24092 -0
- package/dist/fhevm/index.mjs +90 -0
- package/dist/generated/abis/index.mjs +12485 -0
- package/dist/generated/lightning.d.ts +252 -6
- package/dist/{index.js → index.cjs} +47 -34
- package/dist/index.mjs +24019 -0
- package/dist/lite/{index.js → index.cjs} +341 -57
- package/dist/lite/index.mjs +69723 -0
- package/dist/local/index.cjs +21930 -0
- package/dist/local/index.mjs +40378 -0
- package/dist/local/local-node.d.ts +1 -2
- package/dist/reencryption/{index.js → index.cjs} +311 -40
- package/dist/{local/index.js → reencryption/index.mjs} +610 -398
- package/dist/viem.d.ts +53 -52
- package/package.json +16 -23
- /package/dist/fhevm/{index.js → index.cjs} +0 -0
- /package/dist/generated/abis/{index.js → index.cjs} +0 -0
@@ -40,8 +40,15 @@ var __export = (target, all) => {
|
|
40
40
|
});
|
41
41
|
};
|
42
42
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
43
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
44
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
45
|
+
}) : x)(function(x) {
|
46
|
+
if (typeof require !== "undefined")
|
47
|
+
return require.apply(this, arguments);
|
48
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
49
|
+
});
|
43
50
|
|
44
|
-
//
|
51
|
+
// node_modules/viem/_esm/utils/data/isHex.js
|
45
52
|
function isHex(value6, { strict: strict2 = true } = {}) {
|
46
53
|
if (!value6)
|
47
54
|
return false;
|
@@ -50,18 +57,19 @@ function isHex(value6, { strict: strict2 = true } = {}) {
|
|
50
57
|
return strict2 ? /^0x[0-9a-fA-F]*$/.test(value6) : value6.startsWith("0x");
|
51
58
|
}
|
52
59
|
|
53
|
-
//
|
60
|
+
// node_modules/viem/_esm/utils/data/size.js
|
54
61
|
function size21(value6) {
|
55
62
|
if (isHex(value6, { strict: false }))
|
56
63
|
return Math.ceil((value6.length - 2) / 2);
|
57
64
|
return value6.length;
|
58
65
|
}
|
59
|
-
var init_size = () => {
|
66
|
+
var init_size = () => {
|
67
|
+
};
|
60
68
|
|
61
|
-
//
|
62
|
-
var version = "2.
|
69
|
+
// node_modules/viem/_esm/errors/version.js
|
70
|
+
var version = "2.22.23";
|
63
71
|
|
64
|
-
//
|
72
|
+
// node_modules/viem/_esm/errors/base.js
|
65
73
|
function walk(err, fn) {
|
66
74
|
if (fn?.(err))
|
67
75
|
return err;
|
@@ -149,7 +157,7 @@ var init_base = __esm(() => {
|
|
149
157
|
};
|
150
158
|
});
|
151
159
|
|
152
|
-
//
|
160
|
+
// node_modules/viem/_esm/errors/abi.js
|
153
161
|
var AbiEncodingLengthMismatchError, BytesSizeMismatchError, UnsupportedPackedAbiType;
|
154
162
|
var init_abi = __esm(() => {
|
155
163
|
init_base();
|
@@ -179,7 +187,7 @@ var init_abi = __esm(() => {
|
|
179
187
|
};
|
180
188
|
});
|
181
189
|
|
182
|
-
//
|
190
|
+
// node_modules/viem/_esm/errors/data.js
|
183
191
|
var SizeExceedsPaddingSizeError;
|
184
192
|
var init_data = __esm(() => {
|
185
193
|
init_base();
|
@@ -190,7 +198,7 @@ var init_data = __esm(() => {
|
|
190
198
|
};
|
191
199
|
});
|
192
200
|
|
193
|
-
//
|
201
|
+
// node_modules/viem/_esm/utils/data/pad.js
|
194
202
|
function pad(hexOrBytes, { dir: dir2, size: size22 = 32 } = {}) {
|
195
203
|
if (typeof hexOrBytes === "string")
|
196
204
|
return padHex(hexOrBytes, { dir: dir2, size: size22 });
|
@@ -228,7 +236,7 @@ var init_pad = __esm(() => {
|
|
228
236
|
init_data();
|
229
237
|
});
|
230
238
|
|
231
|
-
//
|
239
|
+
// node_modules/viem/_esm/errors/encoding.js
|
232
240
|
var IntegerOutOfRangeError, SizeOverflowError;
|
233
241
|
var init_encoding = __esm(() => {
|
234
242
|
init_base();
|
@@ -244,7 +252,7 @@ var init_encoding = __esm(() => {
|
|
244
252
|
};
|
245
253
|
});
|
246
254
|
|
247
|
-
//
|
255
|
+
// node_modules/viem/_esm/utils/encoding/fromHex.js
|
248
256
|
function assertSize(hexOrBytes, { size: size22 }) {
|
249
257
|
if (size21(hexOrBytes) > size22)
|
250
258
|
throw new SizeOverflowError({
|
@@ -257,7 +265,7 @@ var init_fromHex = __esm(() => {
|
|
257
265
|
init_size();
|
258
266
|
});
|
259
267
|
|
260
|
-
//
|
268
|
+
// node_modules/viem/_esm/utils/encoding/toHex.js
|
261
269
|
function toHex(value6, opts = {}) {
|
262
270
|
if (typeof value6 === "number" || typeof value6 === "bigint")
|
263
271
|
return numberToHex(value6, opts);
|
@@ -329,7 +337,7 @@ var init_toHex = __esm(() => {
|
|
329
337
|
encoder2 = /* @__PURE__ */ new TextEncoder;
|
330
338
|
});
|
331
339
|
|
332
|
-
//
|
340
|
+
// node_modules/viem/_esm/utils/encoding/toBytes.js
|
333
341
|
function toBytes(value6, opts = {}) {
|
334
342
|
if (typeof value6 === "number" || typeof value6 === "bigint")
|
335
343
|
return numberToBytes(value6, opts);
|
@@ -434,7 +442,8 @@ function aoutput(out, instance) {
|
|
434
442
|
throw new Error("digestInto() expects output buffer of length at least " + min4);
|
435
443
|
}
|
436
444
|
}
|
437
|
-
var init__assert = () => {
|
445
|
+
var init__assert = () => {
|
446
|
+
};
|
438
447
|
|
439
448
|
// ../node_modules/@noble/hashes/esm/_u64.js
|
440
449
|
function fromBig(n, le = false) {
|
@@ -696,7 +705,7 @@ var init_sha3 = __esm(() => {
|
|
696
705
|
shake256 = /* @__PURE__ */ genShake(31, 136, 256 / 8);
|
697
706
|
});
|
698
707
|
|
699
|
-
//
|
708
|
+
// node_modules/viem/_esm/utils/hash/keccak256.js
|
700
709
|
function keccak256(value6, to_) {
|
701
710
|
const to = to_ || "hex";
|
702
711
|
const bytes = keccak_256(isHex(value6, { strict: false }) ? toBytes(value6) : value6);
|
@@ -710,7 +719,7 @@ var init_keccak256 = __esm(() => {
|
|
710
719
|
init_toHex();
|
711
720
|
});
|
712
721
|
|
713
|
-
//
|
722
|
+
// node_modules/viem/_esm/errors/address.js
|
714
723
|
var InvalidAddressError;
|
715
724
|
var init_address = __esm(() => {
|
716
725
|
init_base();
|
@@ -727,7 +736,7 @@ var init_address = __esm(() => {
|
|
727
736
|
};
|
728
737
|
});
|
729
738
|
|
730
|
-
//
|
739
|
+
// node_modules/viem/_esm/utils/lru.js
|
731
740
|
var LruMap;
|
732
741
|
var init_lru = __esm(() => {
|
733
742
|
LruMap = class LruMap extends Map {
|
@@ -761,7 +770,7 @@ var init_lru = __esm(() => {
|
|
761
770
|
};
|
762
771
|
});
|
763
772
|
|
764
|
-
//
|
773
|
+
// node_modules/viem/_esm/utils/address/getAddress.js
|
765
774
|
function checksumAddress(address_, chainId) {
|
766
775
|
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
767
776
|
return checksumAddressCache.get(`${address_}.${chainId}`);
|
@@ -788,7 +797,7 @@ var init_getAddress = __esm(() => {
|
|
788
797
|
checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
789
798
|
});
|
790
799
|
|
791
|
-
//
|
800
|
+
// node_modules/viem/_esm/utils/address/isAddress.js
|
792
801
|
function isAddress(address, options) {
|
793
802
|
const { strict: strict2 = true } = options ?? {};
|
794
803
|
const cacheKey = `${address}.${strict2}`;
|
@@ -814,12 +823,12 @@ var init_isAddress = __esm(() => {
|
|
814
823
|
isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
815
824
|
});
|
816
825
|
|
817
|
-
//
|
826
|
+
// node_modules/viem/_esm/utils/data/concat.js
|
818
827
|
function concatHex(values7) {
|
819
828
|
return `0x${values7.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
820
829
|
}
|
821
830
|
|
822
|
-
//
|
831
|
+
// node_modules/viem/_esm/utils/regex.js
|
823
832
|
var arrayRegex, bytesRegex, integerRegex;
|
824
833
|
var init_regex = __esm(() => {
|
825
834
|
arrayRegex = /^(.*)\[([0-9]*)\]$/;
|
@@ -827,346 +836,6 @@ var init_regex = __esm(() => {
|
|
827
836
|
integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
|
828
837
|
});
|
829
838
|
|
830
|
-
// ../node_modules/dotenv/package.json
|
831
|
-
var require_package = __commonJS((exports2, module2) => {
|
832
|
-
module2.exports = {
|
833
|
-
name: "dotenv",
|
834
|
-
version: "16.4.7",
|
835
|
-
description: "Loads environment variables from .env file",
|
836
|
-
main: "lib/main.js",
|
837
|
-
types: "lib/main.d.ts",
|
838
|
-
exports: {
|
839
|
-
".": {
|
840
|
-
types: "./lib/main.d.ts",
|
841
|
-
require: "./lib/main.js",
|
842
|
-
default: "./lib/main.js"
|
843
|
-
},
|
844
|
-
"./config": "./config.js",
|
845
|
-
"./config.js": "./config.js",
|
846
|
-
"./lib/env-options": "./lib/env-options.js",
|
847
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
848
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
849
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
850
|
-
"./package.json": "./package.json"
|
851
|
-
},
|
852
|
-
scripts: {
|
853
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
854
|
-
lint: "standard",
|
855
|
-
pretest: "npm run lint && npm run dts-check",
|
856
|
-
test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
|
857
|
-
"test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",
|
858
|
-
prerelease: "npm test",
|
859
|
-
release: "standard-version"
|
860
|
-
},
|
861
|
-
repository: {
|
862
|
-
type: "git",
|
863
|
-
url: "git://github.com/motdotla/dotenv.git"
|
864
|
-
},
|
865
|
-
funding: "https://dotenvx.com",
|
866
|
-
keywords: [
|
867
|
-
"dotenv",
|
868
|
-
"env",
|
869
|
-
".env",
|
870
|
-
"environment",
|
871
|
-
"variables",
|
872
|
-
"config",
|
873
|
-
"settings"
|
874
|
-
],
|
875
|
-
readmeFilename: "README.md",
|
876
|
-
license: "BSD-2-Clause",
|
877
|
-
devDependencies: {
|
878
|
-
"@types/node": "^18.11.3",
|
879
|
-
decache: "^4.6.2",
|
880
|
-
sinon: "^14.0.1",
|
881
|
-
standard: "^17.0.0",
|
882
|
-
"standard-version": "^9.5.0",
|
883
|
-
tap: "^19.2.0",
|
884
|
-
typescript: "^4.8.4"
|
885
|
-
},
|
886
|
-
engines: {
|
887
|
-
node: ">=12"
|
888
|
-
},
|
889
|
-
browser: {
|
890
|
-
fs: false
|
891
|
-
}
|
892
|
-
};
|
893
|
-
});
|
894
|
-
|
895
|
-
// ../node_modules/dotenv/lib/main.js
|
896
|
-
var require_main = __commonJS((exports2, module2) => {
|
897
|
-
var fs = require("fs");
|
898
|
-
var path = require("path");
|
899
|
-
var os = require("os");
|
900
|
-
var crypto = require("crypto");
|
901
|
-
var packageJson = require_package();
|
902
|
-
var version2 = packageJson.version;
|
903
|
-
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
904
|
-
function parse3(src) {
|
905
|
-
const obj = {};
|
906
|
-
let lines = src.toString();
|
907
|
-
lines = lines.replace(/\r\n?/mg, `
|
908
|
-
`);
|
909
|
-
let match24;
|
910
|
-
while ((match24 = LINE.exec(lines)) != null) {
|
911
|
-
const key = match24[1];
|
912
|
-
let value6 = match24[2] || "";
|
913
|
-
value6 = value6.trim();
|
914
|
-
const maybeQuote = value6[0];
|
915
|
-
value6 = value6.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
916
|
-
if (maybeQuote === '"') {
|
917
|
-
value6 = value6.replace(/\\n/g, `
|
918
|
-
`);
|
919
|
-
value6 = value6.replace(/\\r/g, "\r");
|
920
|
-
}
|
921
|
-
obj[key] = value6;
|
922
|
-
}
|
923
|
-
return obj;
|
924
|
-
}
|
925
|
-
function _parseVault(options) {
|
926
|
-
const vaultPath = _vaultPath(options);
|
927
|
-
const result = DotenvModule.configDotenv({ path: vaultPath });
|
928
|
-
if (!result.parsed) {
|
929
|
-
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
930
|
-
err.code = "MISSING_DATA";
|
931
|
-
throw err;
|
932
|
-
}
|
933
|
-
const keys9 = _dotenvKey(options).split(",");
|
934
|
-
const length4 = keys9.length;
|
935
|
-
let decrypted;
|
936
|
-
for (let i = 0;i < length4; i++) {
|
937
|
-
try {
|
938
|
-
const key = keys9[i].trim();
|
939
|
-
const attrs = _instructions(result, key);
|
940
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
941
|
-
break;
|
942
|
-
} catch (error2) {
|
943
|
-
if (i + 1 >= length4) {
|
944
|
-
throw error2;
|
945
|
-
}
|
946
|
-
}
|
947
|
-
}
|
948
|
-
return DotenvModule.parse(decrypted);
|
949
|
-
}
|
950
|
-
function _log(message) {
|
951
|
-
console.log(`[dotenv@${version2}][INFO] ${message}`);
|
952
|
-
}
|
953
|
-
function _warn(message) {
|
954
|
-
console.log(`[dotenv@${version2}][WARN] ${message}`);
|
955
|
-
}
|
956
|
-
function _debug(message) {
|
957
|
-
console.log(`[dotenv@${version2}][DEBUG] ${message}`);
|
958
|
-
}
|
959
|
-
function _dotenvKey(options) {
|
960
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
961
|
-
return options.DOTENV_KEY;
|
962
|
-
}
|
963
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
964
|
-
return process.env.DOTENV_KEY;
|
965
|
-
}
|
966
|
-
return "";
|
967
|
-
}
|
968
|
-
function _instructions(result, dotenvKey) {
|
969
|
-
let uri;
|
970
|
-
try {
|
971
|
-
uri = new URL(dotenvKey);
|
972
|
-
} catch (error2) {
|
973
|
-
if (error2.code === "ERR_INVALID_URL") {
|
974
|
-
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
975
|
-
err.code = "INVALID_DOTENV_KEY";
|
976
|
-
throw err;
|
977
|
-
}
|
978
|
-
throw error2;
|
979
|
-
}
|
980
|
-
const key = uri.password;
|
981
|
-
if (!key) {
|
982
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
983
|
-
err.code = "INVALID_DOTENV_KEY";
|
984
|
-
throw err;
|
985
|
-
}
|
986
|
-
const environment2 = uri.searchParams.get("environment");
|
987
|
-
if (!environment2) {
|
988
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
989
|
-
err.code = "INVALID_DOTENV_KEY";
|
990
|
-
throw err;
|
991
|
-
}
|
992
|
-
const environmentKey = `DOTENV_VAULT_${environment2.toUpperCase()}`;
|
993
|
-
const ciphertext = result.parsed[environmentKey];
|
994
|
-
if (!ciphertext) {
|
995
|
-
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
996
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
997
|
-
throw err;
|
998
|
-
}
|
999
|
-
return { ciphertext, key };
|
1000
|
-
}
|
1001
|
-
function _vaultPath(options) {
|
1002
|
-
let possibleVaultPath = null;
|
1003
|
-
if (options && options.path && options.path.length > 0) {
|
1004
|
-
if (Array.isArray(options.path)) {
|
1005
|
-
for (const filepath of options.path) {
|
1006
|
-
if (fs.existsSync(filepath)) {
|
1007
|
-
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
1008
|
-
}
|
1009
|
-
}
|
1010
|
-
} else {
|
1011
|
-
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
1012
|
-
}
|
1013
|
-
} else {
|
1014
|
-
possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
|
1015
|
-
}
|
1016
|
-
if (fs.existsSync(possibleVaultPath)) {
|
1017
|
-
return possibleVaultPath;
|
1018
|
-
}
|
1019
|
-
return null;
|
1020
|
-
}
|
1021
|
-
function _resolveHome(envPath) {
|
1022
|
-
return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
|
1023
|
-
}
|
1024
|
-
function _configVault(options) {
|
1025
|
-
_log("Loading env from encrypted .env.vault");
|
1026
|
-
const parsed = DotenvModule._parseVault(options);
|
1027
|
-
let processEnv = process.env;
|
1028
|
-
if (options && options.processEnv != null) {
|
1029
|
-
processEnv = options.processEnv;
|
1030
|
-
}
|
1031
|
-
DotenvModule.populate(processEnv, parsed, options);
|
1032
|
-
return { parsed };
|
1033
|
-
}
|
1034
|
-
function configDotenv(options) {
|
1035
|
-
const dotenvPath = path.resolve(process.cwd(), ".env");
|
1036
|
-
let encoding = "utf8";
|
1037
|
-
const debug2 = Boolean(options && options.debug);
|
1038
|
-
if (options && options.encoding) {
|
1039
|
-
encoding = options.encoding;
|
1040
|
-
} else {
|
1041
|
-
if (debug2) {
|
1042
|
-
_debug("No encoding is specified. UTF-8 is used by default");
|
1043
|
-
}
|
1044
|
-
}
|
1045
|
-
let optionPaths = [dotenvPath];
|
1046
|
-
if (options && options.path) {
|
1047
|
-
if (!Array.isArray(options.path)) {
|
1048
|
-
optionPaths = [_resolveHome(options.path)];
|
1049
|
-
} else {
|
1050
|
-
optionPaths = [];
|
1051
|
-
for (const filepath of options.path) {
|
1052
|
-
optionPaths.push(_resolveHome(filepath));
|
1053
|
-
}
|
1054
|
-
}
|
1055
|
-
}
|
1056
|
-
let lastError;
|
1057
|
-
const parsedAll = {};
|
1058
|
-
for (const path2 of optionPaths) {
|
1059
|
-
try {
|
1060
|
-
const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding }));
|
1061
|
-
DotenvModule.populate(parsedAll, parsed, options);
|
1062
|
-
} catch (e) {
|
1063
|
-
if (debug2) {
|
1064
|
-
_debug(`Failed to load ${path2} ${e.message}`);
|
1065
|
-
}
|
1066
|
-
lastError = e;
|
1067
|
-
}
|
1068
|
-
}
|
1069
|
-
let processEnv = process.env;
|
1070
|
-
if (options && options.processEnv != null) {
|
1071
|
-
processEnv = options.processEnv;
|
1072
|
-
}
|
1073
|
-
DotenvModule.populate(processEnv, parsedAll, options);
|
1074
|
-
if (lastError) {
|
1075
|
-
return { parsed: parsedAll, error: lastError };
|
1076
|
-
} else {
|
1077
|
-
return { parsed: parsedAll };
|
1078
|
-
}
|
1079
|
-
}
|
1080
|
-
function config2(options) {
|
1081
|
-
if (_dotenvKey(options).length === 0) {
|
1082
|
-
return DotenvModule.configDotenv(options);
|
1083
|
-
}
|
1084
|
-
const vaultPath = _vaultPath(options);
|
1085
|
-
if (!vaultPath) {
|
1086
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
1087
|
-
return DotenvModule.configDotenv(options);
|
1088
|
-
}
|
1089
|
-
return DotenvModule._configVault(options);
|
1090
|
-
}
|
1091
|
-
function decrypt(encrypted, keyStr) {
|
1092
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
1093
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
1094
|
-
const nonce = ciphertext.subarray(0, 12);
|
1095
|
-
const authTag = ciphertext.subarray(-16);
|
1096
|
-
ciphertext = ciphertext.subarray(12, -16);
|
1097
|
-
try {
|
1098
|
-
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
1099
|
-
aesgcm.setAuthTag(authTag);
|
1100
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
1101
|
-
} catch (error2) {
|
1102
|
-
const isRange = error2 instanceof RangeError;
|
1103
|
-
const invalidKeyLength = error2.message === "Invalid key length";
|
1104
|
-
const decryptionFailed = error2.message === "Unsupported state or unable to authenticate data";
|
1105
|
-
if (isRange || invalidKeyLength) {
|
1106
|
-
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
1107
|
-
err.code = "INVALID_DOTENV_KEY";
|
1108
|
-
throw err;
|
1109
|
-
} else if (decryptionFailed) {
|
1110
|
-
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
1111
|
-
err.code = "DECRYPTION_FAILED";
|
1112
|
-
throw err;
|
1113
|
-
} else {
|
1114
|
-
throw error2;
|
1115
|
-
}
|
1116
|
-
}
|
1117
|
-
}
|
1118
|
-
function populate(processEnv, parsed, options = {}) {
|
1119
|
-
const debug2 = Boolean(options && options.debug);
|
1120
|
-
const override = Boolean(options && options.override);
|
1121
|
-
if (typeof parsed !== "object") {
|
1122
|
-
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
1123
|
-
err.code = "OBJECT_REQUIRED";
|
1124
|
-
throw err;
|
1125
|
-
}
|
1126
|
-
for (const key of Object.keys(parsed)) {
|
1127
|
-
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
1128
|
-
if (override === true) {
|
1129
|
-
processEnv[key] = parsed[key];
|
1130
|
-
}
|
1131
|
-
if (debug2) {
|
1132
|
-
if (override === true) {
|
1133
|
-
_debug(`"${key}" is already defined and WAS overwritten`);
|
1134
|
-
} else {
|
1135
|
-
_debug(`"${key}" is already defined and was NOT overwritten`);
|
1136
|
-
}
|
1137
|
-
}
|
1138
|
-
} else {
|
1139
|
-
processEnv[key] = parsed[key];
|
1140
|
-
}
|
1141
|
-
}
|
1142
|
-
}
|
1143
|
-
var DotenvModule = {
|
1144
|
-
configDotenv,
|
1145
|
-
_configVault,
|
1146
|
-
_parseVault,
|
1147
|
-
config: config2,
|
1148
|
-
decrypt,
|
1149
|
-
parse: parse3,
|
1150
|
-
populate
|
1151
|
-
};
|
1152
|
-
module2.exports.configDotenv = DotenvModule.configDotenv;
|
1153
|
-
module2.exports._configVault = DotenvModule._configVault;
|
1154
|
-
module2.exports._parseVault = DotenvModule._parseVault;
|
1155
|
-
module2.exports.config = DotenvModule.config;
|
1156
|
-
module2.exports.decrypt = DotenvModule.decrypt;
|
1157
|
-
module2.exports.parse = DotenvModule.parse;
|
1158
|
-
module2.exports.populate = DotenvModule.populate;
|
1159
|
-
module2.exports = DotenvModule;
|
1160
|
-
});
|
1161
|
-
|
1162
|
-
// src/local/index.ts
|
1163
|
-
var exports_local = {};
|
1164
|
-
__export(exports_local, {
|
1165
|
-
parseLocalEnv: () => parseLocalEnv,
|
1166
|
-
LocalNodeEnv: () => LocalNodeEnv
|
1167
|
-
});
|
1168
|
-
module.exports = __toCommonJS(exports_local);
|
1169
|
-
|
1170
839
|
// ../node_modules/effect/dist/esm/Function.js
|
1171
840
|
var isFunction = (input) => typeof input === "function";
|
1172
841
|
var dual = function(arity, body) {
|
@@ -1485,7 +1154,8 @@ var tracingFunction = (name) => {
|
|
1485
1154
|
};
|
1486
1155
|
};
|
1487
1156
|
var internalCall = /* @__PURE__ */ tracingFunction("effect_internal_function");
|
1488
|
-
var genConstructor = function* () {
|
1157
|
+
var genConstructor = function* () {
|
1158
|
+
}.constructor;
|
1489
1159
|
|
1490
1160
|
// ../node_modules/effect/dist/esm/Hash.js
|
1491
1161
|
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => new WeakMap);
|
@@ -1832,7 +1502,8 @@ var StructuralCommitPrototype = {
|
|
1832
1502
|
...StructuralPrototype
|
1833
1503
|
};
|
1834
1504
|
var Base = /* @__PURE__ */ function() {
|
1835
|
-
function Base2() {
|
1505
|
+
function Base2() {
|
1506
|
+
}
|
1836
1507
|
Base2.prototype = CommitPrototype;
|
1837
1508
|
return Base2;
|
1838
1509
|
}();
|
@@ -5335,7 +5006,8 @@ var Reference = () => (id, options) => {
|
|
5335
5006
|
Error.stackTraceLimit = 2;
|
5336
5007
|
const creationError = new Error;
|
5337
5008
|
Error.stackTraceLimit = limit;
|
5338
|
-
function ReferenceClass() {
|
5009
|
+
function ReferenceClass() {
|
5010
|
+
}
|
5339
5011
|
Object.setPrototypeOf(ReferenceClass, ReferenceProto);
|
5340
5012
|
ReferenceClass.key = id;
|
5341
5013
|
ReferenceClass.defaultValue = options.defaultValue;
|
@@ -8275,7 +7947,8 @@ var prettyErrorMessage = (u) => {
|
|
8275
7947
|
if (hasProperty(u, "toString") && isFunction2(u["toString"]) && u["toString"] !== Object.prototype.toString && u["toString"] !== globalThis.Array.prototype.toString) {
|
8276
7948
|
return u["toString"]();
|
8277
7949
|
}
|
8278
|
-
} catch {
|
7950
|
+
} catch {
|
7951
|
+
}
|
8279
7952
|
return stringifyCircular(u);
|
8280
7953
|
};
|
8281
7954
|
var locationRegex = /\((.*)\)/g;
|
@@ -8849,7 +8522,8 @@ var zip2 = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, (a) => map9(th
|
|
8849
8522
|
var zipLeft = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, (a) => as(that, a)));
|
8850
8523
|
var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap6(self, () => that));
|
8851
8524
|
var never = /* @__PURE__ */ asyncInterrupt(() => {
|
8852
|
-
const interval = setInterval(() => {
|
8525
|
+
const interval = setInterval(() => {
|
8526
|
+
}, 2 ** 31 - 1);
|
8853
8527
|
return sync(() => clearInterval(interval));
|
8854
8528
|
});
|
8855
8529
|
var interruptFiber = (self) => flatMap6(fiberId, (fiberId2) => pipe(self, interruptAsFiber(fiberId2)));
|
@@ -12669,11 +12343,16 @@ class Const {
|
|
12669
12343
|
get value() {
|
12670
12344
|
return this.effect;
|
12671
12345
|
}
|
12672
|
-
onStart(_context, _effect, _parent, _fiber) {
|
12673
|
-
|
12674
|
-
|
12675
|
-
|
12676
|
-
|
12346
|
+
onStart(_context, _effect, _parent, _fiber) {
|
12347
|
+
}
|
12348
|
+
onEnd(_value, _fiber) {
|
12349
|
+
}
|
12350
|
+
onEffect(_fiber, _effect) {
|
12351
|
+
}
|
12352
|
+
onSuspend(_fiber) {
|
12353
|
+
}
|
12354
|
+
onResume(_fiber) {
|
12355
|
+
}
|
12677
12356
|
map(f) {
|
12678
12357
|
return new ProxySupervisor(this, pipe(this.value, map9(f)));
|
12679
12358
|
}
|
@@ -13147,7 +12826,8 @@ class FiberRuntime extends Class {
|
|
13147
12826
|
return whileLoop({
|
13148
12827
|
while: () => !isDone3,
|
13149
12828
|
body,
|
13150
|
-
step: () => {
|
12829
|
+
step: () => {
|
12830
|
+
}
|
13151
12831
|
});
|
13152
12832
|
}
|
13153
12833
|
return null;
|
@@ -22677,7 +22357,7 @@ class TrieIterator {
|
|
22677
22357
|
}
|
22678
22358
|
}
|
22679
22359
|
var isTrie = (u) => hasProperty(u, TrieTypeId);
|
22680
|
-
//
|
22360
|
+
// node_modules/viem/_esm/utils/abi/encodePacked.js
|
22681
22361
|
init_abi();
|
22682
22362
|
init_address();
|
22683
22363
|
init_isAddress();
|
@@ -22746,32 +22426,564 @@ function encode6(type2, value6, isArray2 = false) {
|
|
22746
22426
|
throw new UnsupportedPackedAbiType(type2);
|
22747
22427
|
}
|
22748
22428
|
|
22749
|
-
//
|
22429
|
+
// node_modules/viem/_esm/index.js
|
22750
22430
|
init_toBytes();
|
22751
22431
|
init_toHex();
|
22752
|
-
//
|
22432
|
+
// src/schema.ts
|
22433
|
+
function parse3(schema, obj, options) {
|
22434
|
+
return exports_Schema.decodeUnknownSync(schema)(obj, options);
|
22435
|
+
}
|
22436
|
+
function parseJson2(schema, json, options) {
|
22437
|
+
if (typeof json !== "string") {
|
22438
|
+
json = json.toString();
|
22439
|
+
}
|
22440
|
+
return exports_Schema.decodeUnknownSync(exports_Schema.parseJson(schema))(json, options);
|
22441
|
+
}
|
22442
|
+
|
22443
|
+
// src/binary.ts
|
22753
22444
|
var HexString = exports_Schema.TemplateLiteral("0x", exports_Schema.String);
|
22754
|
-
|
22755
|
-
|
22756
|
-
|
22757
|
-
|
22758
|
-
|
22759
|
-
|
22760
|
-
|
22761
|
-
|
22762
|
-
ADD_TWO_ADDRESS: Address,
|
22763
|
-
EXECUTOR_ADDRESS: Address,
|
22764
|
-
ECIES_PUBLIC_KEY: HexString,
|
22765
|
-
CALLBACK_ADDRESS: HexString,
|
22766
|
-
SENDER_ADDRESS: Address,
|
22767
|
-
SENDER_PRIVATE_KEY: HexString,
|
22768
|
-
COVALIDATOR_ECIES_PRIVATE_KEY: HexString,
|
22769
|
-
COVALIDATOR_CALLBACK_PRIVATE_KEY: HexString,
|
22770
|
-
COVALIDATOR_ACL_ADDR: Address,
|
22771
|
-
COVALIDATOR_INCO_EXECUTOR_ADDR: Address,
|
22772
|
-
COVALIDATOR_DECRYPTION_HANDLER_ADDR: Address
|
22773
|
-
});
|
22774
|
-
function parseLocalEnv(envFileContents) {
|
22775
|
-
const envObj = dotenv.parse(envFileContents);
|
22776
|
-
return exports_Schema.decodeUnknownSync(LocalNodeEnv)(envObj);
|
22445
|
+
function bytesToBigInt(byteArray) {
|
22446
|
+
return !byteArray?.length ? BigInt(0) : BigInt("0x" + Buffer.from(byteArray).toString("hex"));
|
22447
|
+
}
|
22448
|
+
function bufferToBigInt(buffer3) {
|
22449
|
+
return bytesToBigInt(Uint8Array.from(buffer3));
|
22450
|
+
}
|
22451
|
+
function bigintToBytes32(value6) {
|
22452
|
+
return parse3(Bytes32, Buffer.from(value6.toString(16).padStart(64, "0"), "hex").toString("hex"));
|
22777
22453
|
}
|
22454
|
+
function padLeft(bs, n) {
|
22455
|
+
if (bs.length > n) {
|
22456
|
+
throw new Error(`Cannot pad ${bs.length} bytes to ${n} - would truncate`);
|
22457
|
+
}
|
22458
|
+
const buf = Buffer.alloc(n);
|
22459
|
+
buf.set(bs, n - bs.length);
|
22460
|
+
return buf;
|
22461
|
+
}
|
22462
|
+
function bytes32ToBigint(bs) {
|
22463
|
+
const bytes32 = asBytes32(bs);
|
22464
|
+
return BigInt(bytes32);
|
22465
|
+
}
|
22466
|
+
function bytesFromHexString(hexString) {
|
22467
|
+
return Buffer.from(hexString.startsWith("0x") ? hexString.slice(2) : hexString, "hex");
|
22468
|
+
}
|
22469
|
+
function mustBeHex(value6) {
|
22470
|
+
if (!isHex(value6)) {
|
22471
|
+
throw new Error(`Expected hex string, got: ${value6}`);
|
22472
|
+
}
|
22473
|
+
return value6;
|
22474
|
+
}
|
22475
|
+
function normaliseToHex(value6) {
|
22476
|
+
return mustBeHex(value6.startsWith("0x") ? value6 : `0x${value6}`);
|
22477
|
+
}
|
22478
|
+
function bytesToHex3(bs) {
|
22479
|
+
return "0x" + Buffer.from(bs).toString("hex");
|
22480
|
+
}
|
22481
|
+
var ByteArray = exports_Schema.Object.pipe(exports_Schema.filter((x) => x instanceof Uint8Array));
|
22482
|
+
var BytesToHex = exports_Schema.transformOrFail(exports_Schema.Union(exports_Schema.String, ByteArray), HexString, {
|
22483
|
+
strict: true,
|
22484
|
+
encode: exports_ParseResult.succeed,
|
22485
|
+
decode: (x) => x instanceof Uint8Array ? exports_ParseResult.succeed(bytesToHex3(x)) : ((y) => isHex(y) ? exports_ParseResult.succeed(y) : exports_ParseResult.fail(new exports_ParseResult.Unexpected(y, `'${y}' is not a hex string`)))(normaliseToHex(x))
|
22486
|
+
});
|
22487
|
+
var Bytes32 = BytesToHex.pipe(exports_Schema.filter((x) => x.length === 66 || `Expected 32-byte hex string (66 characters with 0x prefix) but got ${x.length} character string`), exports_Schema.brand("Bytes32"));
|
22488
|
+
function asBytes32(x) {
|
22489
|
+
return parse3(Bytes32, x);
|
22490
|
+
}
|
22491
|
+
|
22492
|
+
// src/chain.ts
|
22493
|
+
var supportedChains = {
|
22494
|
+
baseSepolia: 84532,
|
22495
|
+
sepolia: 11155111,
|
22496
|
+
monadTestnet: 10143
|
22497
|
+
};
|
22498
|
+
var fheSupportedChains = { baseSepolia: 84532, sepolia: 11155111 };
|
22499
|
+
function getSupportedChain(chainish) {
|
22500
|
+
const found = typeof chainish === "number" || typeof chainish === "bigint" ? Object.entries(supportedChains).find(([, id3]) => id3 === Number(chainish)) : typeof chainish === "object" ? Object.entries(supportedChains).find(([, id3]) => id3 === Number(chainish.id)) : Object.entries(supportedChains).find(([shortName]) => shortName === chainish);
|
22501
|
+
if (!found) {
|
22502
|
+
throw new Error(`Supported chain ${JSON.stringify(chainish)} not found`);
|
22503
|
+
}
|
22504
|
+
const [name, id2] = found;
|
22505
|
+
return { name, id: id2 };
|
22506
|
+
}
|
22507
|
+
|
22508
|
+
// src/generated/lightning.ts
|
22509
|
+
var lightningDeployments = [
|
22510
|
+
{
|
22511
|
+
name: "incoLightning_0_1_29__183408998",
|
22512
|
+
executorAddress: "0x63D8135aF4D393B1dB43B649010c8D3EE19FC9fd",
|
22513
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22514
|
+
pepper: "testnet",
|
22515
|
+
version: {
|
22516
|
+
major: 0,
|
22517
|
+
minor: 1,
|
22518
|
+
patch: 29,
|
22519
|
+
shortSalt: "183408998"
|
22520
|
+
},
|
22521
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00d75ffa0caf0797c3f12d66",
|
22522
|
+
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
22523
|
+
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
22524
|
+
chainId: "7311099111",
|
22525
|
+
blockNumber: "1",
|
22526
|
+
chainName: "Inco Release Chain",
|
22527
|
+
active: true,
|
22528
|
+
deployDate: "2025-04-22T16:02:38.372Z",
|
22529
|
+
commit: "v3-28-g93c05a49-dirty",
|
22530
|
+
addTwoAddress: "0x04461CD161001BC484C55D253F744462A6eADc10"
|
22531
|
+
},
|
22532
|
+
{
|
22533
|
+
name: "incoLightning_0_1_29__183408998",
|
22534
|
+
executorAddress: "0x63D8135aF4D393B1dB43B649010c8D3EE19FC9fd",
|
22535
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22536
|
+
pepper: "testnet",
|
22537
|
+
version: {
|
22538
|
+
major: 0,
|
22539
|
+
minor: 1,
|
22540
|
+
patch: 29,
|
22541
|
+
shortSalt: "183408998"
|
22542
|
+
},
|
22543
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00d75ffa0caf0797c3f12d66",
|
22544
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22545
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22546
|
+
chainId: "10143",
|
22547
|
+
blockNumber: "13464615",
|
22548
|
+
chainName: "Monad Testnet",
|
22549
|
+
active: true,
|
22550
|
+
deployDate: "2025-04-22T16:01:14.380Z",
|
22551
|
+
commit: "v3-28-g93c05a49-dirty",
|
22552
|
+
addTwoAddress: "0x3E0Aa45e4BD7E86093460A302803298a0EE7155a"
|
22553
|
+
},
|
22554
|
+
{
|
22555
|
+
name: "incoLightning_0_1_29__183408998",
|
22556
|
+
executorAddress: "0x63D8135aF4D393B1dB43B649010c8D3EE19FC9fd",
|
22557
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22558
|
+
pepper: "testnet",
|
22559
|
+
version: {
|
22560
|
+
major: 0,
|
22561
|
+
minor: 1,
|
22562
|
+
patch: 29,
|
22563
|
+
shortSalt: "183408998"
|
22564
|
+
},
|
22565
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00d75ffa0caf0797c3f12d66",
|
22566
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22567
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22568
|
+
chainId: "84532",
|
22569
|
+
blockNumber: "24784654",
|
22570
|
+
chainName: "Base Sepolia",
|
22571
|
+
active: true,
|
22572
|
+
deployDate: "2025-04-22T16:00:02.028Z",
|
22573
|
+
commit: "v3-28-g93c05a49-dirty",
|
22574
|
+
addTwoAddress: "0xF10E6B2ddd168D105546f39E1Ba64004E4FbeF10"
|
22575
|
+
},
|
22576
|
+
{
|
22577
|
+
name: "incoLightning_0_1_29__340846814",
|
22578
|
+
executorAddress: "0x3B22be60Ae699933959CA3cE147C96caa88Ccd3D",
|
22579
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22580
|
+
pepper: "devnet",
|
22581
|
+
version: {
|
22582
|
+
major: 0,
|
22583
|
+
minor: 1,
|
22584
|
+
patch: 29,
|
22585
|
+
shortSalt: "340846814"
|
22586
|
+
},
|
22587
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00b001d6742fded0dd599ede",
|
22588
|
+
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
22589
|
+
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
22590
|
+
chainId: "7311099111",
|
22591
|
+
blockNumber: "1",
|
22592
|
+
chainName: "Inco Release Chain",
|
22593
|
+
active: true,
|
22594
|
+
deployDate: "2025-04-22T15:59:01.071Z",
|
22595
|
+
commit: "v3-28-g93c05a49-dirty",
|
22596
|
+
addTwoAddress: "0x04461CD161001BC484C55D253F744462A6eADc10"
|
22597
|
+
},
|
22598
|
+
{
|
22599
|
+
name: "incoLightning_0_1_29__340846814",
|
22600
|
+
executorAddress: "0x3B22be60Ae699933959CA3cE147C96caa88Ccd3D",
|
22601
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22602
|
+
pepper: "devnet",
|
22603
|
+
version: {
|
22604
|
+
major: 0,
|
22605
|
+
minor: 1,
|
22606
|
+
patch: 29,
|
22607
|
+
shortSalt: "340846814"
|
22608
|
+
},
|
22609
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00b001d6742fded0dd599ede",
|
22610
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22611
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22612
|
+
chainId: "10143",
|
22613
|
+
blockNumber: "13464197",
|
22614
|
+
chainName: "Monad Testnet",
|
22615
|
+
active: true,
|
22616
|
+
deployDate: "2025-04-22T15:57:26.862Z",
|
22617
|
+
commit: "v3-28-g93c05a49-dirty",
|
22618
|
+
addTwoAddress: "0x6A23b79203F1Db95947423291C8177B144DDE372"
|
22619
|
+
},
|
22620
|
+
{
|
22621
|
+
name: "incoLightning_0_1_29__340846814",
|
22622
|
+
executorAddress: "0x3B22be60Ae699933959CA3cE147C96caa88Ccd3D",
|
22623
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22624
|
+
pepper: "devnet",
|
22625
|
+
version: {
|
22626
|
+
major: 0,
|
22627
|
+
minor: 1,
|
22628
|
+
patch: 29,
|
22629
|
+
shortSalt: "340846814"
|
22630
|
+
},
|
22631
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00b001d6742fded0dd599ede",
|
22632
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22633
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22634
|
+
chainId: "84532",
|
22635
|
+
blockNumber: "24784527",
|
22636
|
+
chainName: "Base Sepolia",
|
22637
|
+
active: true,
|
22638
|
+
deployDate: "2025-04-22T15:55:47.828Z",
|
22639
|
+
commit: "v3-28-g93c05a49-dirty",
|
22640
|
+
addTwoAddress: "0x1A98fB1f7E57C0648b1d2A7DEA6e126C302A7e93"
|
22641
|
+
},
|
22642
|
+
{
|
22643
|
+
name: "incoLightning_0_1_27__558243565",
|
22644
|
+
executorAddress: "0x595dc0fA68e7847aC1b1d52a56A1551ad0e38472",
|
22645
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22646
|
+
pepper: "testnet",
|
22647
|
+
version: {
|
22648
|
+
major: 0,
|
22649
|
+
minor: 1,
|
22650
|
+
patch: 27,
|
22651
|
+
shortSalt: "558243565"
|
22652
|
+
},
|
22653
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc008f0e1b154a58f3ce49d6ed",
|
22654
|
+
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
22655
|
+
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
22656
|
+
chainId: "7311099111",
|
22657
|
+
blockNumber: "1",
|
22658
|
+
chainName: "Inco Release Chain",
|
22659
|
+
active: true,
|
22660
|
+
deployDate: "2025-04-22T14:57:24.620Z",
|
22661
|
+
commit: "v3-28-g652cc4a1-dirty",
|
22662
|
+
addTwoAddress: "0x04461CD161001BC484C55D253F744462A6eADc10"
|
22663
|
+
},
|
22664
|
+
{
|
22665
|
+
name: "incoLightning_0_1_27__558243565",
|
22666
|
+
executorAddress: "0x595dc0fA68e7847aC1b1d52a56A1551ad0e38472",
|
22667
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22668
|
+
pepper: "testnet",
|
22669
|
+
version: {
|
22670
|
+
major: 0,
|
22671
|
+
minor: 1,
|
22672
|
+
patch: 27,
|
22673
|
+
shortSalt: "558243565"
|
22674
|
+
},
|
22675
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc008f0e1b154a58f3ce49d6ed",
|
22676
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22677
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22678
|
+
chainId: "10143",
|
22679
|
+
blockNumber: "13457424",
|
22680
|
+
chainName: "Monad Testnet",
|
22681
|
+
active: true,
|
22682
|
+
deployDate: "2025-04-22T14:57:15.486Z",
|
22683
|
+
commit: "v3-28-g652cc4a1-dirty",
|
22684
|
+
addTwoAddress: "0xbbf1f797b5e132b72f4a45E1923cBb0BFeca80FA"
|
22685
|
+
},
|
22686
|
+
{
|
22687
|
+
name: "incoLightning_0_1_27__558243565",
|
22688
|
+
executorAddress: "0x595dc0fA68e7847aC1b1d52a56A1551ad0e38472",
|
22689
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22690
|
+
pepper: "testnet",
|
22691
|
+
version: {
|
22692
|
+
major: 0,
|
22693
|
+
minor: 1,
|
22694
|
+
patch: 27,
|
22695
|
+
shortSalt: "558243565"
|
22696
|
+
},
|
22697
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc008f0e1b154a58f3ce49d6ed",
|
22698
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22699
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22700
|
+
chainId: "84532",
|
22701
|
+
blockNumber: "24782764",
|
22702
|
+
chainName: "Base Sepolia",
|
22703
|
+
active: true,
|
22704
|
+
deployDate: "2025-04-22T14:57:02.375Z",
|
22705
|
+
commit: "v3-28-g652cc4a1",
|
22706
|
+
addTwoAddress: "0x0c6320A91ec6BA7d42B4f079132fD71A90C12e22"
|
22707
|
+
},
|
22708
|
+
{
|
22709
|
+
name: "incoLightning_0_1_27__125335042",
|
22710
|
+
executorAddress: "0x902B77583C7C5df71C95114707C4974A8d5Dff9D",
|
22711
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22712
|
+
pepper: "devnet",
|
22713
|
+
version: {
|
22714
|
+
major: 0,
|
22715
|
+
minor: 1,
|
22716
|
+
patch: 27,
|
22717
|
+
shortSalt: "125335042"
|
22718
|
+
},
|
22719
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc003343825a7e951afb24c202",
|
22720
|
+
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
22721
|
+
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
22722
|
+
chainId: "7311099111",
|
22723
|
+
blockNumber: "1",
|
22724
|
+
chainName: "Inco Release Chain",
|
22725
|
+
active: true,
|
22726
|
+
deployDate: "2025-04-22T14:35:10.281Z",
|
22727
|
+
commit: "v3-27-ge3d04b6a-dirty",
|
22728
|
+
addTwoAddress: "0x04461CD161001BC484C55D253F744462A6eADc10"
|
22729
|
+
},
|
22730
|
+
{
|
22731
|
+
name: "incoLightning_0_1_27__125335042",
|
22732
|
+
executorAddress: "0x902B77583C7C5df71C95114707C4974A8d5Dff9D",
|
22733
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22734
|
+
pepper: "devnet",
|
22735
|
+
version: {
|
22736
|
+
major: 0,
|
22737
|
+
minor: 1,
|
22738
|
+
patch: 27,
|
22739
|
+
shortSalt: "125335042"
|
22740
|
+
},
|
22741
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc003343825a7e951afb24c202",
|
22742
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22743
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22744
|
+
chainId: "10143",
|
22745
|
+
blockNumber: "13454931",
|
22746
|
+
chainName: "Monad Testnet",
|
22747
|
+
active: true,
|
22748
|
+
deployDate: "2025-04-22T14:35:02.958Z",
|
22749
|
+
commit: "v3-27-ge3d04b6a-dirty",
|
22750
|
+
addTwoAddress: "0xC1ee708D522B8b0743B5C5309AeD6b6b4C4102a6"
|
22751
|
+
},
|
22752
|
+
{
|
22753
|
+
name: "incoLightning_0_1_27__125335042",
|
22754
|
+
executorAddress: "0x902B77583C7C5df71C95114707C4974A8d5Dff9D",
|
22755
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22756
|
+
pepper: "devnet",
|
22757
|
+
version: {
|
22758
|
+
major: 0,
|
22759
|
+
minor: 1,
|
22760
|
+
patch: 27,
|
22761
|
+
shortSalt: "125335042"
|
22762
|
+
},
|
22763
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc003343825a7e951afb24c202",
|
22764
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22765
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22766
|
+
chainId: "84532",
|
22767
|
+
blockNumber: "24782097",
|
22768
|
+
chainName: "Base Sepolia",
|
22769
|
+
active: true,
|
22770
|
+
deployDate: "2025-04-22T14:34:47.565Z",
|
22771
|
+
commit: "v3-27-ge3d04b6a-dirty",
|
22772
|
+
addTwoAddress: "0xAac318ca07FCA665c4d27A7e9e8FB65B89AfAC83"
|
22773
|
+
},
|
22774
|
+
{
|
22775
|
+
name: "incoLightning_0_1_26__18043964",
|
22776
|
+
executorAddress: "0x69Ef6a59f9eE2d6f3b49eA3F79bcF1553512DF0e",
|
22777
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22778
|
+
pepper: "testnet",
|
22779
|
+
version: {
|
22780
|
+
major: 0,
|
22781
|
+
minor: 1,
|
22782
|
+
patch: 26,
|
22783
|
+
shortSalt: "18043964"
|
22784
|
+
},
|
22785
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00858064cb0f58c7ef7a843c",
|
22786
|
+
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
22787
|
+
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
22788
|
+
chainId: "7311099111",
|
22789
|
+
blockNumber: "1",
|
22790
|
+
chainName: "Inco Release Chain",
|
22791
|
+
active: true,
|
22792
|
+
deployDate: "2025-04-22T12:14:50.447Z",
|
22793
|
+
commit: "v3-26-g623cec72-dirty",
|
22794
|
+
addTwoAddress: "0x70fC34B18B12E945cb2204FA77E5f8e1581890C3"
|
22795
|
+
},
|
22796
|
+
{
|
22797
|
+
name: "incoLightning_0_1_26__18043964",
|
22798
|
+
executorAddress: "0x69Ef6a59f9eE2d6f3b49eA3F79bcF1553512DF0e",
|
22799
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22800
|
+
pepper: "testnet",
|
22801
|
+
version: {
|
22802
|
+
major: 0,
|
22803
|
+
minor: 1,
|
22804
|
+
patch: 26,
|
22805
|
+
shortSalt: "18043964"
|
22806
|
+
},
|
22807
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00858064cb0f58c7ef7a843c",
|
22808
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22809
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22810
|
+
chainId: "10143",
|
22811
|
+
blockNumber: "13439069",
|
22812
|
+
chainName: "Monad Testnet",
|
22813
|
+
active: true,
|
22814
|
+
deployDate: "2025-04-22T12:14:42.391Z",
|
22815
|
+
commit: "v3-26-g623cec72-dirty",
|
22816
|
+
addTwoAddress: "0x4A49112FB866F6d5D05845D264b430cD3bbAb9f6"
|
22817
|
+
},
|
22818
|
+
{
|
22819
|
+
name: "incoLightning_0_1_26__18043964",
|
22820
|
+
executorAddress: "0x69Ef6a59f9eE2d6f3b49eA3F79bcF1553512DF0e",
|
22821
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22822
|
+
pepper: "testnet",
|
22823
|
+
version: {
|
22824
|
+
major: 0,
|
22825
|
+
minor: 1,
|
22826
|
+
patch: 26,
|
22827
|
+
shortSalt: "18043964"
|
22828
|
+
},
|
22829
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00858064cb0f58c7ef7a843c",
|
22830
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22831
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22832
|
+
chainId: "84532",
|
22833
|
+
blockNumber: "24777885",
|
22834
|
+
chainName: "Base Sepolia",
|
22835
|
+
active: true,
|
22836
|
+
deployDate: "2025-04-22T12:14:25.354Z",
|
22837
|
+
commit: "v3-26-g623cec72-dirty",
|
22838
|
+
addTwoAddress: "0x2b5E34844997681168049783D30CD84B5962cb50"
|
22839
|
+
},
|
22840
|
+
{
|
22841
|
+
name: "incoLightning_0_1_26__444235330",
|
22842
|
+
executorAddress: "0xdc8eD938ff2eB900bD5f86A88555a9f1956994fC",
|
22843
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22844
|
+
pepper: "devnet",
|
22845
|
+
version: {
|
22846
|
+
major: 0,
|
22847
|
+
minor: 1,
|
22848
|
+
patch: 26,
|
22849
|
+
shortSalt: "444235330"
|
22850
|
+
},
|
22851
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc001bab4c5927c52fbea0d042",
|
22852
|
+
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
22853
|
+
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
22854
|
+
chainId: "7311099111",
|
22855
|
+
blockNumber: "1",
|
22856
|
+
chainName: "Inco Release Chain",
|
22857
|
+
active: true,
|
22858
|
+
deployDate: "2025-04-22T09:11:15.398Z",
|
22859
|
+
commit: "v3-24-gc9716e6c-dirty",
|
22860
|
+
addTwoAddress: "0x70fC34B18B12E945cb2204FA77E5f8e1581890C3"
|
22861
|
+
},
|
22862
|
+
{
|
22863
|
+
name: "incoLightning_0_1_26__444235330",
|
22864
|
+
executorAddress: "0xdc8eD938ff2eB900bD5f86A88555a9f1956994fC",
|
22865
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22866
|
+
pepper: "devnet",
|
22867
|
+
version: {
|
22868
|
+
major: 0,
|
22869
|
+
minor: 1,
|
22870
|
+
patch: 26,
|
22871
|
+
shortSalt: "444235330"
|
22872
|
+
},
|
22873
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc001bab4c5927c52fbea0d042",
|
22874
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22875
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22876
|
+
chainId: "10143",
|
22877
|
+
blockNumber: "13418528",
|
22878
|
+
chainName: "Monad Testnet",
|
22879
|
+
active: true,
|
22880
|
+
deployDate: "2025-04-22T09:11:06.223Z",
|
22881
|
+
commit: "v3-24-gc9716e6c-dirty",
|
22882
|
+
addTwoAddress: "0xfeE9C1E41b2268a4ad8EaDA35f510b8d89Cd041c"
|
22883
|
+
},
|
22884
|
+
{
|
22885
|
+
name: "incoLightning_0_1_26__444235330",
|
22886
|
+
executorAddress: "0xdc8eD938ff2eB900bD5f86A88555a9f1956994fC",
|
22887
|
+
deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC",
|
22888
|
+
pepper: "devnet",
|
22889
|
+
version: {
|
22890
|
+
major: 0,
|
22891
|
+
minor: 1,
|
22892
|
+
patch: 26,
|
22893
|
+
shortSalt: "444235330"
|
22894
|
+
},
|
22895
|
+
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc001bab4c5927c52fbea0d042",
|
22896
|
+
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
22897
|
+
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
22898
|
+
chainId: "84532",
|
22899
|
+
blockNumber: "24772369",
|
22900
|
+
chainName: "Base Sepolia",
|
22901
|
+
active: true,
|
22902
|
+
deployDate: "2025-04-22T09:10:33.275Z",
|
22903
|
+
commit: "v3-24-gc9716e6c-dirty",
|
22904
|
+
addTwoAddress: "0xeEa387f7c866A81c2AF532D9ed48c60F179C9827"
|
22905
|
+
}
|
22906
|
+
];
|
22907
|
+
|
22908
|
+
// src/lite/deployments.ts
|
22909
|
+
function getActiveLightningDeployment(chain) {
|
22910
|
+
const supportedChain = getSupportedChain(chain);
|
22911
|
+
const deployments = lightningDeployments.filter((d) => d.chainId === String(supportedChain.id));
|
22912
|
+
if (!deployments?.length) {
|
22913
|
+
throw new Error(`No deployments found for chain ${chain}`);
|
22914
|
+
}
|
22915
|
+
return deployments[0];
|
22916
|
+
}
|
22917
|
+
function getLightningDeployments(chainId) {
|
22918
|
+
const supportedChain = getSupportedChain(chainId);
|
22919
|
+
const deployments = lightningDeployments.filter((d) => d.chainId === String(supportedChain.id));
|
22920
|
+
return deployments ?? [];
|
22921
|
+
}
|
22922
|
+
|
22923
|
+
// src/reencryption/eip712.ts
|
22924
|
+
var baseEIP712 = exports_Schema.Struct({
|
22925
|
+
domain: exports_Schema.Struct({
|
22926
|
+
chainId: exports_Schema.BigInt,
|
22927
|
+
name: exports_Schema.String,
|
22928
|
+
version: exports_Schema.String,
|
22929
|
+
verifyingContract: exports_Schema.optional(HexString)
|
22930
|
+
}),
|
22931
|
+
primaryType: exports_Schema.String,
|
22932
|
+
types: exports_Schema.Record({
|
22933
|
+
key: exports_Schema.String,
|
22934
|
+
value: exports_Schema.Array(exports_Schema.Struct({
|
22935
|
+
name: exports_Schema.String,
|
22936
|
+
type: exports_Schema.String
|
22937
|
+
}))
|
22938
|
+
})
|
22939
|
+
});
|
22940
|
+
function createEIP712Payload({
|
22941
|
+
chainId,
|
22942
|
+
primaryType,
|
22943
|
+
primaryTypeFields,
|
22944
|
+
message,
|
22945
|
+
verifyingContract,
|
22946
|
+
domainName,
|
22947
|
+
domainVersion
|
22948
|
+
}) {
|
22949
|
+
const types = {
|
22950
|
+
EIP712Domain: [
|
22951
|
+
{ name: "name", type: "string" },
|
22952
|
+
{ name: "version", type: "string" },
|
22953
|
+
{ name: "chainId", type: "uint256" }
|
22954
|
+
],
|
22955
|
+
[primaryType]: primaryTypeFields
|
22956
|
+
};
|
22957
|
+
if (verifyingContract) {
|
22958
|
+
types.EIP712Domain.push({ name: "verifyingContract", type: "address" });
|
22959
|
+
}
|
22960
|
+
const messageKeys = Object.keys(message);
|
22961
|
+
const primaryTypeFieldsKeys = primaryTypeFields.map((field) => field.name);
|
22962
|
+
if (messageKeys.length !== primaryTypeFieldsKeys.length) {
|
22963
|
+
throw new Error("Message keys do not match primaryTypeFields keys");
|
22964
|
+
}
|
22965
|
+
for (const key of messageKeys) {
|
22966
|
+
if (!primaryTypeFieldsKeys.includes(key)) {
|
22967
|
+
throw new Error(`Message key ${key} does not match primaryTypeFields key`);
|
22968
|
+
}
|
22969
|
+
}
|
22970
|
+
if (!domainVersion) {
|
22971
|
+
const incoLite = getActiveLightningDeployment(chainId);
|
22972
|
+
domainVersion = `${incoLite.version.major}_${incoLite.version.minor}_${incoLite.version.patch}`;
|
22973
|
+
}
|
22974
|
+
const msgParams = {
|
22975
|
+
types,
|
22976
|
+
primaryType,
|
22977
|
+
domain: {
|
22978
|
+
name: domainName ?? "incoLite",
|
22979
|
+
version: domainVersion,
|
22980
|
+
chainId,
|
22981
|
+
verifyingContract
|
22982
|
+
},
|
22983
|
+
message
|
22984
|
+
};
|
22985
|
+
return msgParams;
|
22986
|
+
}
|
22987
|
+
export {
|
22988
|
+
createEIP712Payload
|
22989
|
+
};
|