@inco/js 0.1.27 → 0.1.29
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/binary.d.ts +1 -0
- package/dist/encryption/index.cjs +3 -0
- package/dist/encryption/index.mjs +3 -0
- package/dist/generated/lightning.d.ts +36 -36
- package/dist/generated/local-node.d.ts +6 -0
- package/dist/index.cjs +4 -0
- package/dist/index.mjs +4 -0
- package/dist/lite/index.cjs +302 -52
- package/dist/lite/index.mjs +302 -52
- package/dist/lite/lightning.d.ts +26 -18
- package/dist/local/index.cjs +1 -0
- package/dist/local/index.mjs +1 -0
- package/dist/local/local-node.d.ts +1 -0
- package/dist/reencryption/index.cjs +41 -38
- package/dist/reencryption/index.mjs +41 -38
- package/package.json +1 -1
package/dist/lite/index.mjs
CHANGED
@@ -52816,6 +52816,9 @@ var Address = HexString.pipe(exports_Schema.filter((s) => s.length === 42 || `Ad
|
|
52816
52816
|
function parseAddress(address) {
|
52817
52817
|
return parse3(Address, address);
|
52818
52818
|
}
|
52819
|
+
function parseHex(hex) {
|
52820
|
+
return parse3(HexString, hex);
|
52821
|
+
}
|
52819
52822
|
|
52820
52823
|
// src/handle.ts
|
52821
52824
|
var import_sha32 = __toESM(require_sha3(), 1);
|
@@ -65356,8 +65359,8 @@ var lightningDeployments = [
|
|
65356
65359
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00d75ffa0caf0797c3f12d66",
|
65357
65360
|
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
65358
65361
|
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
65359
|
-
chainId:
|
65360
|
-
blockNumber:
|
65362
|
+
chainId: 7311099111,
|
65363
|
+
blockNumber: 1,
|
65361
65364
|
chainName: "Inco Release Chain",
|
65362
65365
|
active: true,
|
65363
65366
|
deployDate: "2025-04-22T16:02:38.372Z",
|
@@ -65378,8 +65381,8 @@ var lightningDeployments = [
|
|
65378
65381
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00d75ffa0caf0797c3f12d66",
|
65379
65382
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65380
65383
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65381
|
-
chainId:
|
65382
|
-
blockNumber:
|
65384
|
+
chainId: 10143,
|
65385
|
+
blockNumber: 13464615,
|
65383
65386
|
chainName: "Monad Testnet",
|
65384
65387
|
active: true,
|
65385
65388
|
deployDate: "2025-04-22T16:01:14.380Z",
|
@@ -65400,8 +65403,8 @@ var lightningDeployments = [
|
|
65400
65403
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00d75ffa0caf0797c3f12d66",
|
65401
65404
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65402
65405
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65403
|
-
chainId:
|
65404
|
-
blockNumber:
|
65406
|
+
chainId: 84532,
|
65407
|
+
blockNumber: 24784654,
|
65405
65408
|
chainName: "Base Sepolia",
|
65406
65409
|
active: true,
|
65407
65410
|
deployDate: "2025-04-22T16:00:02.028Z",
|
@@ -65422,8 +65425,8 @@ var lightningDeployments = [
|
|
65422
65425
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00b001d6742fded0dd599ede",
|
65423
65426
|
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
65424
65427
|
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
65425
|
-
chainId:
|
65426
|
-
blockNumber:
|
65428
|
+
chainId: 7311099111,
|
65429
|
+
blockNumber: 1,
|
65427
65430
|
chainName: "Inco Release Chain",
|
65428
65431
|
active: true,
|
65429
65432
|
deployDate: "2025-04-22T15:59:01.071Z",
|
@@ -65444,8 +65447,8 @@ var lightningDeployments = [
|
|
65444
65447
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00b001d6742fded0dd599ede",
|
65445
65448
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65446
65449
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65447
|
-
chainId:
|
65448
|
-
blockNumber:
|
65450
|
+
chainId: 10143,
|
65451
|
+
blockNumber: 13464197,
|
65449
65452
|
chainName: "Monad Testnet",
|
65450
65453
|
active: true,
|
65451
65454
|
deployDate: "2025-04-22T15:57:26.862Z",
|
@@ -65466,8 +65469,8 @@ var lightningDeployments = [
|
|
65466
65469
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00b001d6742fded0dd599ede",
|
65467
65470
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65468
65471
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65469
|
-
chainId:
|
65470
|
-
blockNumber:
|
65472
|
+
chainId: 84532,
|
65473
|
+
blockNumber: 24784527,
|
65471
65474
|
chainName: "Base Sepolia",
|
65472
65475
|
active: true,
|
65473
65476
|
deployDate: "2025-04-22T15:55:47.828Z",
|
@@ -65488,8 +65491,8 @@ var lightningDeployments = [
|
|
65488
65491
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc008f0e1b154a58f3ce49d6ed",
|
65489
65492
|
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
65490
65493
|
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
65491
|
-
chainId:
|
65492
|
-
blockNumber:
|
65494
|
+
chainId: 7311099111,
|
65495
|
+
blockNumber: 1,
|
65493
65496
|
chainName: "Inco Release Chain",
|
65494
65497
|
active: true,
|
65495
65498
|
deployDate: "2025-04-22T14:57:24.620Z",
|
@@ -65510,8 +65513,8 @@ var lightningDeployments = [
|
|
65510
65513
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc008f0e1b154a58f3ce49d6ed",
|
65511
65514
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65512
65515
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65513
|
-
chainId:
|
65514
|
-
blockNumber:
|
65516
|
+
chainId: 10143,
|
65517
|
+
blockNumber: 13457424,
|
65515
65518
|
chainName: "Monad Testnet",
|
65516
65519
|
active: true,
|
65517
65520
|
deployDate: "2025-04-22T14:57:15.486Z",
|
@@ -65532,8 +65535,8 @@ var lightningDeployments = [
|
|
65532
65535
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc008f0e1b154a58f3ce49d6ed",
|
65533
65536
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65534
65537
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65535
|
-
chainId:
|
65536
|
-
blockNumber:
|
65538
|
+
chainId: 84532,
|
65539
|
+
blockNumber: 24782764,
|
65537
65540
|
chainName: "Base Sepolia",
|
65538
65541
|
active: true,
|
65539
65542
|
deployDate: "2025-04-22T14:57:02.375Z",
|
@@ -65554,8 +65557,8 @@ var lightningDeployments = [
|
|
65554
65557
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc003343825a7e951afb24c202",
|
65555
65558
|
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
65556
65559
|
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
65557
|
-
chainId:
|
65558
|
-
blockNumber:
|
65560
|
+
chainId: 7311099111,
|
65561
|
+
blockNumber: 1,
|
65559
65562
|
chainName: "Inco Release Chain",
|
65560
65563
|
active: true,
|
65561
65564
|
deployDate: "2025-04-22T14:35:10.281Z",
|
@@ -65576,8 +65579,8 @@ var lightningDeployments = [
|
|
65576
65579
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc003343825a7e951afb24c202",
|
65577
65580
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65578
65581
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65579
|
-
chainId:
|
65580
|
-
blockNumber:
|
65582
|
+
chainId: 10143,
|
65583
|
+
blockNumber: 13454931,
|
65581
65584
|
chainName: "Monad Testnet",
|
65582
65585
|
active: true,
|
65583
65586
|
deployDate: "2025-04-22T14:35:02.958Z",
|
@@ -65598,8 +65601,8 @@ var lightningDeployments = [
|
|
65598
65601
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc003343825a7e951afb24c202",
|
65599
65602
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65600
65603
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65601
|
-
chainId:
|
65602
|
-
blockNumber:
|
65604
|
+
chainId: 84532,
|
65605
|
+
blockNumber: 24782097,
|
65603
65606
|
chainName: "Base Sepolia",
|
65604
65607
|
active: true,
|
65605
65608
|
deployDate: "2025-04-22T14:34:47.565Z",
|
@@ -65620,8 +65623,8 @@ var lightningDeployments = [
|
|
65620
65623
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00858064cb0f58c7ef7a843c",
|
65621
65624
|
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
65622
65625
|
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
65623
|
-
chainId:
|
65624
|
-
blockNumber:
|
65626
|
+
chainId: 7311099111,
|
65627
|
+
blockNumber: 1,
|
65625
65628
|
chainName: "Inco Release Chain",
|
65626
65629
|
active: true,
|
65627
65630
|
deployDate: "2025-04-22T12:14:50.447Z",
|
@@ -65642,8 +65645,8 @@ var lightningDeployments = [
|
|
65642
65645
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00858064cb0f58c7ef7a843c",
|
65643
65646
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65644
65647
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65645
|
-
chainId:
|
65646
|
-
blockNumber:
|
65648
|
+
chainId: 10143,
|
65649
|
+
blockNumber: 13439069,
|
65647
65650
|
chainName: "Monad Testnet",
|
65648
65651
|
active: true,
|
65649
65652
|
deployDate: "2025-04-22T12:14:42.391Z",
|
@@ -65664,8 +65667,8 @@ var lightningDeployments = [
|
|
65664
65667
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00858064cb0f58c7ef7a843c",
|
65665
65668
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65666
65669
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65667
|
-
chainId:
|
65668
|
-
blockNumber:
|
65670
|
+
chainId: 84532,
|
65671
|
+
blockNumber: 24777885,
|
65669
65672
|
chainName: "Base Sepolia",
|
65670
65673
|
active: true,
|
65671
65674
|
deployDate: "2025-04-22T12:14:25.354Z",
|
@@ -65686,8 +65689,8 @@ var lightningDeployments = [
|
|
65686
65689
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc001bab4c5927c52fbea0d042",
|
65687
65690
|
decryptSigner: "0x000000000000000000000000000000000000baBe",
|
65688
65691
|
eciesPublicKey: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000babe",
|
65689
|
-
chainId:
|
65690
|
-
blockNumber:
|
65692
|
+
chainId: 7311099111,
|
65693
|
+
blockNumber: 1,
|
65691
65694
|
chainName: "Inco Release Chain",
|
65692
65695
|
active: true,
|
65693
65696
|
deployDate: "2025-04-22T09:11:15.398Z",
|
@@ -65708,8 +65711,8 @@ var lightningDeployments = [
|
|
65708
65711
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc001bab4c5927c52fbea0d042",
|
65709
65712
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65710
65713
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65711
|
-
chainId:
|
65712
|
-
blockNumber:
|
65714
|
+
chainId: 10143,
|
65715
|
+
blockNumber: 13418528,
|
65713
65716
|
chainName: "Monad Testnet",
|
65714
65717
|
active: true,
|
65715
65718
|
deployDate: "2025-04-22T09:11:06.223Z",
|
@@ -65730,8 +65733,8 @@ var lightningDeployments = [
|
|
65730
65733
|
salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc001bab4c5927c52fbea0d042",
|
65731
65734
|
decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0",
|
65732
65735
|
eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235",
|
65733
|
-
chainId:
|
65734
|
-
blockNumber:
|
65736
|
+
chainId: 84532,
|
65737
|
+
blockNumber: 24772369,
|
65735
65738
|
chainName: "Base Sepolia",
|
65736
65739
|
active: true,
|
65737
65740
|
deployDate: "2025-04-22T09:10:33.275Z",
|
@@ -65743,7 +65746,7 @@ var lightningDeployments = [
|
|
65743
65746
|
// src/lite/deployments.ts
|
65744
65747
|
function getActiveLightningDeployment(chain) {
|
65745
65748
|
const supportedChain = getSupportedChain(chain);
|
65746
|
-
const deployments = lightningDeployments.filter((d) => d.chainId ===
|
65749
|
+
const deployments = lightningDeployments.filter((d) => d.chainId === supportedChain.id);
|
65747
65750
|
if (!deployments?.length) {
|
65748
65751
|
throw new Error(`No deployments found for chain ${chain}`);
|
65749
65752
|
}
|
@@ -65751,7 +65754,7 @@ function getActiveLightningDeployment(chain) {
|
|
65751
65754
|
}
|
65752
65755
|
function getLightningDeployments(chainId) {
|
65753
65756
|
const supportedChain = getSupportedChain(chainId);
|
65754
|
-
const deployments = lightningDeployments.filter((d) => d.chainId ===
|
65757
|
+
const deployments = lightningDeployments.filter((d) => d.chainId === supportedChain.id);
|
65755
65758
|
return deployments ?? [];
|
65756
65759
|
}
|
65757
65760
|
// src/lite/ecies.ts
|
@@ -65880,6 +65883,253 @@ function getEciesDecryptor({ privKeyA }) {
|
|
65880
65883
|
return plaintext;
|
65881
65884
|
};
|
65882
65885
|
}
|
65886
|
+
// ../node_modules/viem/_esm/op-stack/contracts.js
|
65887
|
+
var contracts = {
|
65888
|
+
gasPriceOracle: { address: "0x420000000000000000000000000000000000000F" },
|
65889
|
+
l1Block: { address: "0x4200000000000000000000000000000000000015" },
|
65890
|
+
l2CrossDomainMessenger: {
|
65891
|
+
address: "0x4200000000000000000000000000000000000007"
|
65892
|
+
},
|
65893
|
+
l2Erc721Bridge: { address: "0x4200000000000000000000000000000000000014" },
|
65894
|
+
l2StandardBridge: { address: "0x4200000000000000000000000000000000000010" },
|
65895
|
+
l2ToL1MessagePasser: {
|
65896
|
+
address: "0x4200000000000000000000000000000000000016"
|
65897
|
+
}
|
65898
|
+
};
|
65899
|
+
|
65900
|
+
// ../node_modules/viem/_esm/op-stack/formatters.js
|
65901
|
+
init_fromHex();
|
65902
|
+
var formatters = {
|
65903
|
+
block: /* @__PURE__ */ defineBlock({
|
65904
|
+
format(args2) {
|
65905
|
+
const transactions = args2.transactions?.map((transaction) => {
|
65906
|
+
if (typeof transaction === "string")
|
65907
|
+
return transaction;
|
65908
|
+
const formatted = formatTransaction(transaction);
|
65909
|
+
if (formatted.typeHex === "0x7e") {
|
65910
|
+
formatted.isSystemTx = transaction.isSystemTx;
|
65911
|
+
formatted.mint = transaction.mint ? hexToBigInt(transaction.mint) : undefined;
|
65912
|
+
formatted.sourceHash = transaction.sourceHash;
|
65913
|
+
formatted.type = "deposit";
|
65914
|
+
}
|
65915
|
+
return formatted;
|
65916
|
+
});
|
65917
|
+
return {
|
65918
|
+
transactions,
|
65919
|
+
stateRoot: args2.stateRoot
|
65920
|
+
};
|
65921
|
+
}
|
65922
|
+
}),
|
65923
|
+
transaction: /* @__PURE__ */ defineTransaction({
|
65924
|
+
format(args2) {
|
65925
|
+
const transaction = {};
|
65926
|
+
if (args2.type === "0x7e") {
|
65927
|
+
transaction.isSystemTx = args2.isSystemTx;
|
65928
|
+
transaction.mint = args2.mint ? hexToBigInt(args2.mint) : undefined;
|
65929
|
+
transaction.sourceHash = args2.sourceHash;
|
65930
|
+
transaction.type = "deposit";
|
65931
|
+
}
|
65932
|
+
return transaction;
|
65933
|
+
}
|
65934
|
+
}),
|
65935
|
+
transactionReceipt: /* @__PURE__ */ defineTransactionReceipt({
|
65936
|
+
format(args2) {
|
65937
|
+
return {
|
65938
|
+
l1GasPrice: args2.l1GasPrice ? hexToBigInt(args2.l1GasPrice) : null,
|
65939
|
+
l1GasUsed: args2.l1GasUsed ? hexToBigInt(args2.l1GasUsed) : null,
|
65940
|
+
l1Fee: args2.l1Fee ? hexToBigInt(args2.l1Fee) : null,
|
65941
|
+
l1FeeScalar: args2.l1FeeScalar ? Number(args2.l1FeeScalar) : null
|
65942
|
+
};
|
65943
|
+
}
|
65944
|
+
})
|
65945
|
+
};
|
65946
|
+
|
65947
|
+
// ../node_modules/viem/_esm/op-stack/serializers.js
|
65948
|
+
init_address();
|
65949
|
+
init_isAddress();
|
65950
|
+
init_toHex();
|
65951
|
+
function serializeTransaction2(transaction, signature) {
|
65952
|
+
if (isDeposit(transaction))
|
65953
|
+
return serializeTransactionDeposit(transaction);
|
65954
|
+
return serializeTransaction(transaction, signature);
|
65955
|
+
}
|
65956
|
+
var serializers = {
|
65957
|
+
transaction: serializeTransaction2
|
65958
|
+
};
|
65959
|
+
function serializeTransactionDeposit(transaction) {
|
65960
|
+
assertTransactionDeposit(transaction);
|
65961
|
+
const { sourceHash, data, from, gas, isSystemTx, mint, to, value: value6 } = transaction;
|
65962
|
+
const serializedTransaction = [
|
65963
|
+
sourceHash,
|
65964
|
+
from,
|
65965
|
+
to ?? "0x",
|
65966
|
+
mint ? toHex(mint) : "0x",
|
65967
|
+
value6 ? toHex(value6) : "0x",
|
65968
|
+
gas ? toHex(gas) : "0x",
|
65969
|
+
isSystemTx ? "0x1" : "0x",
|
65970
|
+
data ?? "0x"
|
65971
|
+
];
|
65972
|
+
return concatHex([
|
65973
|
+
"0x7e",
|
65974
|
+
toRlp(serializedTransaction)
|
65975
|
+
]);
|
65976
|
+
}
|
65977
|
+
function isDeposit(transaction) {
|
65978
|
+
if (transaction.type === "deposit")
|
65979
|
+
return true;
|
65980
|
+
if (typeof transaction.sourceHash !== "undefined")
|
65981
|
+
return true;
|
65982
|
+
return false;
|
65983
|
+
}
|
65984
|
+
function assertTransactionDeposit(transaction) {
|
65985
|
+
const { from, to } = transaction;
|
65986
|
+
if (from && !isAddress(from))
|
65987
|
+
throw new InvalidAddressError({ address: from });
|
65988
|
+
if (to && !isAddress(to))
|
65989
|
+
throw new InvalidAddressError({ address: to });
|
65990
|
+
}
|
65991
|
+
|
65992
|
+
// ../node_modules/viem/_esm/op-stack/chainConfig.js
|
65993
|
+
var chainConfig = {
|
65994
|
+
contracts,
|
65995
|
+
formatters,
|
65996
|
+
serializers
|
65997
|
+
};
|
65998
|
+
|
65999
|
+
// ../node_modules/viem/_esm/chains/definitions/anvil.js
|
66000
|
+
var anvil = /* @__PURE__ */ defineChain({
|
66001
|
+
id: 31337,
|
66002
|
+
name: "Anvil",
|
66003
|
+
nativeCurrency: {
|
66004
|
+
decimals: 18,
|
66005
|
+
name: "Ether",
|
66006
|
+
symbol: "ETH"
|
66007
|
+
},
|
66008
|
+
rpcUrls: {
|
66009
|
+
default: {
|
66010
|
+
http: ["http://127.0.0.1:8545"],
|
66011
|
+
webSocket: ["ws://127.0.0.1:8545"]
|
66012
|
+
}
|
66013
|
+
}
|
66014
|
+
});
|
66015
|
+
// ../node_modules/viem/_esm/chains/definitions/baseSepolia.js
|
66016
|
+
var sourceId = 11155111;
|
66017
|
+
var baseSepolia = /* @__PURE__ */ defineChain({
|
66018
|
+
...chainConfig,
|
66019
|
+
id: 84532,
|
66020
|
+
network: "base-sepolia",
|
66021
|
+
name: "Base Sepolia",
|
66022
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
66023
|
+
rpcUrls: {
|
66024
|
+
default: {
|
66025
|
+
http: ["https://sepolia.base.org"]
|
66026
|
+
}
|
66027
|
+
},
|
66028
|
+
blockExplorers: {
|
66029
|
+
default: {
|
66030
|
+
name: "Basescan",
|
66031
|
+
url: "https://sepolia.basescan.org",
|
66032
|
+
apiUrl: "https://api-sepolia.basescan.org/api"
|
66033
|
+
}
|
66034
|
+
},
|
66035
|
+
contracts: {
|
66036
|
+
...chainConfig.contracts,
|
66037
|
+
disputeGameFactory: {
|
66038
|
+
[sourceId]: {
|
66039
|
+
address: "0xd6E6dBf4F7EA0ac412fD8b65ED297e64BB7a06E1"
|
66040
|
+
}
|
66041
|
+
},
|
66042
|
+
l2OutputOracle: {
|
66043
|
+
[sourceId]: {
|
66044
|
+
address: "0x84457ca9D0163FbC4bbfe4Dfbb20ba46e48DF254"
|
66045
|
+
}
|
66046
|
+
},
|
66047
|
+
portal: {
|
66048
|
+
[sourceId]: {
|
66049
|
+
address: "0x49f53e41452c74589e85ca1677426ba426459e85",
|
66050
|
+
blockCreated: 4446677
|
66051
|
+
}
|
66052
|
+
},
|
66053
|
+
l1StandardBridge: {
|
66054
|
+
[sourceId]: {
|
66055
|
+
address: "0xfd0Bf71F60660E2f608ed56e1659C450eB113120",
|
66056
|
+
blockCreated: 4446677
|
66057
|
+
}
|
66058
|
+
},
|
66059
|
+
multicall3: {
|
66060
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
66061
|
+
blockCreated: 1059647
|
66062
|
+
}
|
66063
|
+
},
|
66064
|
+
testnet: true,
|
66065
|
+
sourceId
|
66066
|
+
});
|
66067
|
+
// ../node_modules/viem/_esm/chains/definitions/monadTestnet.js
|
66068
|
+
var monadTestnet = /* @__PURE__ */ defineChain({
|
66069
|
+
id: 10143,
|
66070
|
+
name: "Monad Testnet",
|
66071
|
+
nativeCurrency: {
|
66072
|
+
name: "Testnet MON Token",
|
66073
|
+
symbol: "MON",
|
66074
|
+
decimals: 18
|
66075
|
+
},
|
66076
|
+
rpcUrls: {
|
66077
|
+
default: {
|
66078
|
+
http: ["https://testnet-rpc.monad.xyz"]
|
66079
|
+
}
|
66080
|
+
},
|
66081
|
+
blockExplorers: {
|
66082
|
+
default: {
|
66083
|
+
name: "Monad Testnet explorer",
|
66084
|
+
url: "https://testnet.monadexplorer.com"
|
66085
|
+
}
|
66086
|
+
},
|
66087
|
+
contracts: {
|
66088
|
+
multicall3: {
|
66089
|
+
address: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
66090
|
+
blockCreated: 251449
|
66091
|
+
}
|
66092
|
+
},
|
66093
|
+
testnet: true
|
66094
|
+
});
|
66095
|
+
// ../node_modules/viem/_esm/chains/definitions/sepolia.js
|
66096
|
+
var sepolia = /* @__PURE__ */ defineChain({
|
66097
|
+
id: 11155111,
|
66098
|
+
name: "Sepolia",
|
66099
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
66100
|
+
rpcUrls: {
|
66101
|
+
default: {
|
66102
|
+
http: ["https://sepolia.drpc.org"]
|
66103
|
+
}
|
66104
|
+
},
|
66105
|
+
blockExplorers: {
|
66106
|
+
default: {
|
66107
|
+
name: "Etherscan",
|
66108
|
+
url: "https://sepolia.etherscan.io",
|
66109
|
+
apiUrl: "https://api-sepolia.etherscan.io/api"
|
66110
|
+
}
|
66111
|
+
},
|
66112
|
+
contracts: {
|
66113
|
+
multicall3: {
|
66114
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
66115
|
+
blockCreated: 751532
|
66116
|
+
},
|
66117
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
66118
|
+
ensUniversalResolver: {
|
66119
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
66120
|
+
blockCreated: 5317080
|
66121
|
+
}
|
66122
|
+
},
|
66123
|
+
testnet: true
|
66124
|
+
});
|
66125
|
+
// src/generated/local-node.ts
|
66126
|
+
var localNodeLightningConfig = {
|
66127
|
+
executorAddress: "0x63D8135aF4D393B1dB43B649010c8D3EE19FC9fd",
|
66128
|
+
eciesPublicKey: "0x026812a7776af85b464bbcffb2227f8859338c4726f896cf47a12406467f9dc8ab",
|
66129
|
+
chainId: 31337,
|
66130
|
+
covalidatorUrl: "http://localhost:50055"
|
66131
|
+
};
|
66132
|
+
|
65883
66133
|
// ../node_modules/@connectrpc/connect/dist/esm/code.js
|
65884
66134
|
var Code;
|
65885
66135
|
(function(Code2) {
|
@@ -71286,27 +71536,28 @@ class Lightning {
|
|
71286
71536
|
privKeyB: this.ephemeralKeypair
|
71287
71537
|
});
|
71288
71538
|
}
|
71539
|
+
static baseSepoliaTestnet() {
|
71540
|
+
return Lightning.latest("testnet", baseSepolia.id);
|
71541
|
+
}
|
71542
|
+
static localNode() {
|
71543
|
+
return Lightning.custom(localNodeLightningConfig);
|
71544
|
+
}
|
71289
71545
|
static at(id3) {
|
71290
|
-
const deployment = this.isIdByName(id3) ? lightningDeployments.find((d) => d.name === id3.name &&
|
71546
|
+
const deployment = this.isIdByName(id3) ? lightningDeployments.find((d) => d.name === id3.name && d.chainId === id3.chainId) : lightningDeployments.find((d) => d.executorAddress === id3.executorAddress && d.chainId === id3.chainId);
|
71291
71547
|
if (!deployment) {
|
71292
71548
|
throw new Error(`No deployment found for ${JSON.stringify(id3)}`);
|
71293
71549
|
}
|
71294
71550
|
return new Lightning(deployment, Lightning.getCovalidatorUrl(deployment));
|
71295
71551
|
}
|
71296
|
-
static custom({
|
71297
|
-
executorAddress,
|
71298
|
-
eciesPublicKey,
|
71299
|
-
chainId,
|
71300
|
-
covalidatorUrl
|
71301
|
-
}) {
|
71552
|
+
static custom({ executorAddress, eciesPublicKey, chainId, covalidatorUrl }) {
|
71302
71553
|
return new Lightning({
|
71303
|
-
chainId
|
71554
|
+
chainId,
|
71304
71555
|
executorAddress,
|
71305
71556
|
eciesPublicKey
|
71306
71557
|
}, covalidatorUrl);
|
71307
71558
|
}
|
71308
71559
|
static latestDeployment(pepper, chainId) {
|
71309
|
-
const latestByPepper = lightningDeployments.find((d) => d.pepper === pepper &&
|
71560
|
+
const latestByPepper = lightningDeployments.find((d) => d.pepper === pepper && d.chainId === chainId);
|
71310
71561
|
if (!latestByPepper) {
|
71311
71562
|
throw new Error(`No deployment found for pepper ${pepper}`);
|
71312
71563
|
}
|
@@ -71322,19 +71573,19 @@ class Lightning {
|
|
71322
71573
|
const { ciphertext } = await this.encryptor({
|
71323
71574
|
plaintext: Lightning.plaintextFromValue(value6),
|
71324
71575
|
context: {
|
71325
|
-
hostChainId:
|
71326
|
-
aclAddress:
|
71576
|
+
hostChainId: this.chainId,
|
71577
|
+
aclAddress: this.executorAddress,
|
71327
71578
|
userAddress: parseAddress(accountAddress),
|
71328
|
-
contractAddress:
|
71579
|
+
contractAddress: parseAddress(dappAddress)
|
71329
71580
|
}
|
71330
71581
|
});
|
71331
71582
|
return ciphertext.value;
|
71332
71583
|
}
|
71333
71584
|
getReencryptor(walletClient) {
|
71334
71585
|
return incoLiteReencryptor({
|
71586
|
+
walletClient,
|
71335
71587
|
kmsConnectRpcEndpointOrClient: this.kmsClient,
|
71336
71588
|
chainId: this.chainId,
|
71337
|
-
walletClient,
|
71338
71589
|
ephemeralKeypair: this.ephemeralKeypair
|
71339
71590
|
});
|
71340
71591
|
}
|
@@ -71363,7 +71614,6 @@ class Lightning {
|
|
71363
71614
|
}
|
71364
71615
|
}
|
71365
71616
|
}
|
71366
|
-
var foo = Lightning.at({ name: "incoLightning_0_1_27__558243565", chainId: 84532n });
|
71367
71617
|
export {
|
71368
71618
|
versionAbi,
|
71369
71619
|
uupsUpgradeableAbi,
|
package/dist/lite/lightning.d.ts
CHANGED
@@ -4,21 +4,13 @@ import { EciesScheme } from '../encryption';
|
|
4
4
|
import { lightningDeployments } from '../generated/lightning';
|
5
5
|
import type { Reencryptor } from '../reencryption';
|
6
6
|
type TupleToUnion<T> = T extends readonly unknown[] ? T[number] : never;
|
7
|
-
type ToBigInt<T extends number | string | bigint> = `${T}` extends `${infer N extends bigint}` ? N : never;
|
8
|
-
type ToNumber<T extends number | string | bigint> = `${T}` extends `${infer N extends number}` ? N : never;
|
9
|
-
type Numberish<T extends number | string | bigint> = T | ToBigInt<T> | ToNumber<T>;
|
10
|
-
type ValuesToBigInt<T> = {
|
11
|
-
[K in keyof T]: T[K] extends string ? ToBigInt<T[K]> : never;
|
12
|
-
};
|
13
|
-
type DistributedToBigInt<T, K> = T extends infer U ? K extends keyof U ? Omit<U, K> & (ValuesToBigInt<Pick<U, K>> | Pick<U, K>) : never : never;
|
14
7
|
type Deployment = TupleToUnion<typeof lightningDeployments>;
|
15
|
-
type DeploymentWithBigIntChainId = DistributedToBigInt<Deployment, 'chainId'>;
|
16
8
|
type DistributedPick<T, K> = T extends any ? Pick<T, Extract<keyof T, K>> : never;
|
17
|
-
export type DeploymentByName = DistributedPick<
|
18
|
-
export type DeploymentByExecutor = DistributedPick<
|
9
|
+
export type DeploymentByName = DistributedPick<Deployment, 'name' | 'chainId'>;
|
10
|
+
export type DeploymentByExecutor = DistributedPick<Deployment, 'executorAddress' | 'chainId'>;
|
19
11
|
export type DeploymentId = DeploymentByName | DeploymentByExecutor;
|
20
12
|
export type Pepper = Deployment['pepper'];
|
21
|
-
export type ChainId =
|
13
|
+
export type ChainId = Deployment['chainId'];
|
22
14
|
export type SupportedNativeType = boolean | bigint | number;
|
23
15
|
export type EncryptionContext = {
|
24
16
|
accountAddress: string;
|
@@ -27,7 +19,13 @@ export type EncryptionContext = {
|
|
27
19
|
export type DeploymentSlice = {
|
28
20
|
executorAddress: string;
|
29
21
|
eciesPublicKey: string;
|
30
|
-
chainId:
|
22
|
+
chainId: number;
|
23
|
+
};
|
24
|
+
export type CustomConfig = {
|
25
|
+
executorAddress: string;
|
26
|
+
eciesPublicKey: string;
|
27
|
+
chainId: number;
|
28
|
+
covalidatorUrl: string;
|
31
29
|
};
|
32
30
|
/**
|
33
31
|
* The Lightning class provides a convenient way to interact with the Inco Lightning contract by binding to a specific
|
@@ -43,6 +41,21 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
43
41
|
private readonly ephemeralKeypair;
|
44
42
|
private readonly kmsClient;
|
45
43
|
private constructor();
|
44
|
+
/**
|
45
|
+
* Get a Lightning instance bound to the latest Lightning deployment for the Base Sepolia testnet.
|
46
|
+
*/
|
47
|
+
static baseSepoliaTestnet(): Lightning<Deployment>;
|
48
|
+
/**
|
49
|
+
* Get a Lightning instance bound to our canonical Anvil-based test node and test Covalidator node
|
50
|
+
*
|
51
|
+
* These can be run in docker-compose using images pushed to dockerhub as:
|
52
|
+
* - inconetwork/local-node-anvil
|
53
|
+
* - inconetwork/local-node-covalidator
|
54
|
+
*
|
55
|
+
* See the sample docker-compose file here: https://github.com/Inco-fhevm/lightning-rod/blob/main/docker-compose.yaml
|
56
|
+
*
|
57
|
+
*/
|
58
|
+
static localNode(): Lightning;
|
46
59
|
/**
|
47
60
|
* Get a Lightning deployment by name or executor address on a particular chain.
|
48
61
|
*
|
@@ -57,12 +70,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
57
70
|
* @param chainId the chainId of the host chain
|
58
71
|
* @param covalidatorUrl the gRPC endpoint of the covalidator
|
59
72
|
*/
|
60
|
-
static custom({ executorAddress, eciesPublicKey, chainId, covalidatorUrl
|
61
|
-
executorAddress: string;
|
62
|
-
eciesPublicKey: string;
|
63
|
-
chainId: bigint;
|
64
|
-
covalidatorUrl: string;
|
65
|
-
}): Lightning;
|
73
|
+
static custom({ executorAddress, eciesPublicKey, chainId, covalidatorUrl }: CustomConfig): Lightning;
|
66
74
|
/**
|
67
75
|
* Get the latest deployment for a given pepper, which usually denotes a family of deployments distinct from their
|
68
76
|
* version such as 'devnet', 'testnet', 'mainnet', etc.
|
package/dist/local/index.cjs
CHANGED
@@ -24466,6 +24466,7 @@ var LocalNodeEnv = exports_Schema.Struct({
|
|
24466
24466
|
CALLBACK_ADDRESS: HexString,
|
24467
24467
|
SENDER_ADDRESS: Address,
|
24468
24468
|
SENDER_PRIVATE_KEY: HexString,
|
24469
|
+
PEPPER: exports_Schema.String,
|
24469
24470
|
COVALIDATOR_ECIES_PRIVATE_KEY: HexString,
|
24470
24471
|
COVALIDATOR_CALLBACK_PRIVATE_KEY: HexString,
|
24471
24472
|
COVALIDATOR_ACL_ADDR: Address,
|
package/dist/local/index.mjs
CHANGED
@@ -42847,6 +42847,7 @@ var LocalNodeEnv = exports_Schema.Struct({
|
|
42847
42847
|
CALLBACK_ADDRESS: HexString,
|
42848
42848
|
SENDER_ADDRESS: Address,
|
42849
42849
|
SENDER_PRIVATE_KEY: HexString,
|
42850
|
+
PEPPER: exports_Schema.String,
|
42850
42851
|
COVALIDATOR_ECIES_PRIVATE_KEY: HexString,
|
42851
42852
|
COVALIDATOR_CALLBACK_PRIVATE_KEY: HexString,
|
42852
42853
|
COVALIDATOR_ACL_ADDR: Address,
|
@@ -8,6 +8,7 @@ export declare const LocalNodeEnv: Schema.Struct<{
|
|
8
8
|
CALLBACK_ADDRESS: Schema.TemplateLiteral<`0x${string}`>;
|
9
9
|
SENDER_ADDRESS: Schema.brand<Schema.filter<Schema.TemplateLiteral<`0x${string}`>>, "Address">;
|
10
10
|
SENDER_PRIVATE_KEY: Schema.TemplateLiteral<`0x${string}`>;
|
11
|
+
PEPPER: typeof Schema.String;
|
11
12
|
COVALIDATOR_ECIES_PRIVATE_KEY: Schema.TemplateLiteral<`0x${string}`>;
|
12
13
|
COVALIDATOR_CALLBACK_PRIVATE_KEY: Schema.TemplateLiteral<`0x${string}`>;
|
13
14
|
COVALIDATOR_ACL_ADDR: Schema.brand<Schema.filter<Schema.TemplateLiteral<`0x${string}`>>, "Address">;
|