@gvnrdao/dh-sdk 0.0.209 → 0.0.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1984 -387
- package/dist/index.mjs +1984 -387
- package/dist/modules/bitcoin/bitcoin-operations.module.d.ts +2 -2
- package/dist/modules/diamond-hands-sdk.d.ts +10 -10
- package/dist/modules/loan/loan-query.module.d.ts +1 -1
- package/dist/modules/pkp/pkp-manager.module.d.ts +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -12685,6 +12685,1671 @@ var require_elliptic = __commonJS({
|
|
|
12685
12685
|
}
|
|
12686
12686
|
});
|
|
12687
12687
|
|
|
12688
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/pkp-info.i.js
|
|
12689
|
+
var require_pkp_info_i = __commonJS({
|
|
12690
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/pkp-info.i.js"(exports) {
|
|
12691
|
+
"use strict";
|
|
12692
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12693
|
+
}
|
|
12694
|
+
});
|
|
12695
|
+
|
|
12696
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/lit-action-config.i.js
|
|
12697
|
+
var require_lit_action_config_i = __commonJS({
|
|
12698
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/lit-action-config.i.js"(exports) {
|
|
12699
|
+
"use strict";
|
|
12700
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12701
|
+
}
|
|
12702
|
+
});
|
|
12703
|
+
|
|
12704
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/diamond-hands-lit-actions.i.js
|
|
12705
|
+
var require_diamond_hands_lit_actions_i = __commonJS({
|
|
12706
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/diamond-hands-lit-actions.i.js"(exports) {
|
|
12707
|
+
"use strict";
|
|
12708
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12709
|
+
}
|
|
12710
|
+
});
|
|
12711
|
+
|
|
12712
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/lit-action-registry.i.js
|
|
12713
|
+
var require_lit_action_registry_i = __commonJS({
|
|
12714
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/lit-action-registry.i.js"(exports) {
|
|
12715
|
+
"use strict";
|
|
12716
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12717
|
+
}
|
|
12718
|
+
});
|
|
12719
|
+
|
|
12720
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/index.js
|
|
12721
|
+
var require_interfaces = __commonJS({
|
|
12722
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/index.js"(exports) {
|
|
12723
|
+
"use strict";
|
|
12724
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
12725
|
+
if (k2 === void 0)
|
|
12726
|
+
k2 = k;
|
|
12727
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12728
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12729
|
+
desc = { enumerable: true, get: function() {
|
|
12730
|
+
return m[k];
|
|
12731
|
+
} };
|
|
12732
|
+
}
|
|
12733
|
+
Object.defineProperty(o, k2, desc);
|
|
12734
|
+
} : function(o, m, k, k2) {
|
|
12735
|
+
if (k2 === void 0)
|
|
12736
|
+
k2 = k;
|
|
12737
|
+
o[k2] = m[k];
|
|
12738
|
+
});
|
|
12739
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
12740
|
+
for (var p in m)
|
|
12741
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
12742
|
+
__createBinding(exports2, m, p);
|
|
12743
|
+
};
|
|
12744
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12745
|
+
__exportStar(require_pkp_info_i(), exports);
|
|
12746
|
+
__exportStar(require_lit_action_config_i(), exports);
|
|
12747
|
+
__exportStar(require_diamond_hands_lit_actions_i(), exports);
|
|
12748
|
+
__exportStar(require_lit_action_registry_i(), exports);
|
|
12749
|
+
}
|
|
12750
|
+
});
|
|
12751
|
+
|
|
12752
|
+
// node_modules/base-x/src/cjs/index.cjs
|
|
12753
|
+
var require_cjs = __commonJS({
|
|
12754
|
+
"node_modules/base-x/src/cjs/index.cjs"(exports) {
|
|
12755
|
+
"use strict";
|
|
12756
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12757
|
+
function base2(ALPHABET) {
|
|
12758
|
+
if (ALPHABET.length >= 255) {
|
|
12759
|
+
throw new TypeError("Alphabet too long");
|
|
12760
|
+
}
|
|
12761
|
+
const BASE_MAP = new Uint8Array(256);
|
|
12762
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
12763
|
+
BASE_MAP[j] = 255;
|
|
12764
|
+
}
|
|
12765
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
12766
|
+
const x = ALPHABET.charAt(i);
|
|
12767
|
+
const xc = x.charCodeAt(0);
|
|
12768
|
+
if (BASE_MAP[xc] !== 255) {
|
|
12769
|
+
throw new TypeError(x + " is ambiguous");
|
|
12770
|
+
}
|
|
12771
|
+
BASE_MAP[xc] = i;
|
|
12772
|
+
}
|
|
12773
|
+
const BASE = ALPHABET.length;
|
|
12774
|
+
const LEADER = ALPHABET.charAt(0);
|
|
12775
|
+
const FACTOR = Math.log(BASE) / Math.log(256);
|
|
12776
|
+
const iFACTOR = Math.log(256) / Math.log(BASE);
|
|
12777
|
+
function encode4(source) {
|
|
12778
|
+
if (source instanceof Uint8Array) {
|
|
12779
|
+
} else if (ArrayBuffer.isView(source)) {
|
|
12780
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
12781
|
+
} else if (Array.isArray(source)) {
|
|
12782
|
+
source = Uint8Array.from(source);
|
|
12783
|
+
}
|
|
12784
|
+
if (!(source instanceof Uint8Array)) {
|
|
12785
|
+
throw new TypeError("Expected Uint8Array");
|
|
12786
|
+
}
|
|
12787
|
+
if (source.length === 0) {
|
|
12788
|
+
return "";
|
|
12789
|
+
}
|
|
12790
|
+
let zeroes = 0;
|
|
12791
|
+
let length = 0;
|
|
12792
|
+
let pbegin = 0;
|
|
12793
|
+
const pend = source.length;
|
|
12794
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
12795
|
+
pbegin++;
|
|
12796
|
+
zeroes++;
|
|
12797
|
+
}
|
|
12798
|
+
const size = (pend - pbegin) * iFACTOR + 1 >>> 0;
|
|
12799
|
+
const b58 = new Uint8Array(size);
|
|
12800
|
+
while (pbegin !== pend) {
|
|
12801
|
+
let carry = source[pbegin];
|
|
12802
|
+
let i = 0;
|
|
12803
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
|
|
12804
|
+
carry += 256 * b58[it1] >>> 0;
|
|
12805
|
+
b58[it1] = carry % BASE >>> 0;
|
|
12806
|
+
carry = carry / BASE >>> 0;
|
|
12807
|
+
}
|
|
12808
|
+
if (carry !== 0) {
|
|
12809
|
+
throw new Error("Non-zero carry");
|
|
12810
|
+
}
|
|
12811
|
+
length = i;
|
|
12812
|
+
pbegin++;
|
|
12813
|
+
}
|
|
12814
|
+
let it2 = size - length;
|
|
12815
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
12816
|
+
it2++;
|
|
12817
|
+
}
|
|
12818
|
+
let str = LEADER.repeat(zeroes);
|
|
12819
|
+
for (; it2 < size; ++it2) {
|
|
12820
|
+
str += ALPHABET.charAt(b58[it2]);
|
|
12821
|
+
}
|
|
12822
|
+
return str;
|
|
12823
|
+
}
|
|
12824
|
+
function decodeUnsafe(source) {
|
|
12825
|
+
if (typeof source !== "string") {
|
|
12826
|
+
throw new TypeError("Expected String");
|
|
12827
|
+
}
|
|
12828
|
+
if (source.length === 0) {
|
|
12829
|
+
return new Uint8Array();
|
|
12830
|
+
}
|
|
12831
|
+
let psz = 0;
|
|
12832
|
+
let zeroes = 0;
|
|
12833
|
+
let length = 0;
|
|
12834
|
+
while (source[psz] === LEADER) {
|
|
12835
|
+
zeroes++;
|
|
12836
|
+
psz++;
|
|
12837
|
+
}
|
|
12838
|
+
const size = (source.length - psz) * FACTOR + 1 >>> 0;
|
|
12839
|
+
const b256 = new Uint8Array(size);
|
|
12840
|
+
while (psz < source.length) {
|
|
12841
|
+
const charCode = source.charCodeAt(psz);
|
|
12842
|
+
if (charCode > 255) {
|
|
12843
|
+
return;
|
|
12844
|
+
}
|
|
12845
|
+
let carry = BASE_MAP[charCode];
|
|
12846
|
+
if (carry === 255) {
|
|
12847
|
+
return;
|
|
12848
|
+
}
|
|
12849
|
+
let i = 0;
|
|
12850
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
|
|
12851
|
+
carry += BASE * b256[it3] >>> 0;
|
|
12852
|
+
b256[it3] = carry % 256 >>> 0;
|
|
12853
|
+
carry = carry / 256 >>> 0;
|
|
12854
|
+
}
|
|
12855
|
+
if (carry !== 0) {
|
|
12856
|
+
throw new Error("Non-zero carry");
|
|
12857
|
+
}
|
|
12858
|
+
length = i;
|
|
12859
|
+
psz++;
|
|
12860
|
+
}
|
|
12861
|
+
let it4 = size - length;
|
|
12862
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
12863
|
+
it4++;
|
|
12864
|
+
}
|
|
12865
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
12866
|
+
let j = zeroes;
|
|
12867
|
+
while (it4 !== size) {
|
|
12868
|
+
vch[j++] = b256[it4++];
|
|
12869
|
+
}
|
|
12870
|
+
return vch;
|
|
12871
|
+
}
|
|
12872
|
+
function decode3(string) {
|
|
12873
|
+
const buffer = decodeUnsafe(string);
|
|
12874
|
+
if (buffer) {
|
|
12875
|
+
return buffer;
|
|
12876
|
+
}
|
|
12877
|
+
throw new Error("Non-base" + BASE + " character");
|
|
12878
|
+
}
|
|
12879
|
+
return {
|
|
12880
|
+
encode: encode4,
|
|
12881
|
+
decodeUnsafe,
|
|
12882
|
+
decode: decode3
|
|
12883
|
+
};
|
|
12884
|
+
}
|
|
12885
|
+
exports.default = base2;
|
|
12886
|
+
}
|
|
12887
|
+
});
|
|
12888
|
+
|
|
12889
|
+
// node_modules/bs58/src/cjs/index.cjs
|
|
12890
|
+
var require_cjs2 = __commonJS({
|
|
12891
|
+
"node_modules/bs58/src/cjs/index.cjs"(exports) {
|
|
12892
|
+
"use strict";
|
|
12893
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
12894
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12895
|
+
};
|
|
12896
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12897
|
+
var base_x_1 = __importDefault(require_cjs());
|
|
12898
|
+
var ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
12899
|
+
exports.default = (0, base_x_1.default)(ALPHABET);
|
|
12900
|
+
}
|
|
12901
|
+
});
|
|
12902
|
+
|
|
12903
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/cid-utils.js
|
|
12904
|
+
var require_cid_utils = __commonJS({
|
|
12905
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/cid-utils.js"(exports) {
|
|
12906
|
+
"use strict";
|
|
12907
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
12908
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12909
|
+
};
|
|
12910
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12911
|
+
exports.cidToHex = cidToHex;
|
|
12912
|
+
var bs58_1 = __importDefault(require_cjs2());
|
|
12913
|
+
function cidToHex(cid) {
|
|
12914
|
+
try {
|
|
12915
|
+
if (cid.startsWith("Qm")) {
|
|
12916
|
+
const bytes = bs58_1.default.decode(cid);
|
|
12917
|
+
return "0x" + Buffer.from(bytes).toString("hex");
|
|
12918
|
+
} else if (cid.startsWith("0x")) {
|
|
12919
|
+
return cid;
|
|
12920
|
+
} else {
|
|
12921
|
+
throw new Error(`Unsupported CID format: ${cid}. Only CIDv0 (Qm...) and hex (0x...) formats are supported.`);
|
|
12922
|
+
}
|
|
12923
|
+
} catch (error) {
|
|
12924
|
+
if (error instanceof Error && error.message.includes("Unsupported CID format")) {
|
|
12925
|
+
throw error;
|
|
12926
|
+
}
|
|
12927
|
+
throw new Error(`Failed to convert CID ${cid} to hex: ${error instanceof Error ? error.message : String(error)}`);
|
|
12928
|
+
}
|
|
12929
|
+
}
|
|
12930
|
+
}
|
|
12931
|
+
});
|
|
12932
|
+
|
|
12933
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.js
|
|
12934
|
+
var require_lit_actions_registry = __commonJS({
|
|
12935
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.js"(exports) {
|
|
12936
|
+
"use strict";
|
|
12937
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12938
|
+
exports.CHIPOTLE_DEPLOYMENTS = exports.DH_LIT_ACTIONS_CHIPOTLE = void 0;
|
|
12939
|
+
exports.getDeploymentsForNetwork = getDeploymentsForNetwork;
|
|
12940
|
+
var cid_utils_1 = require_cid_utils();
|
|
12941
|
+
exports.DH_LIT_ACTIONS_CHIPOTLE = {
|
|
12942
|
+
authorizationDummy: {
|
|
12943
|
+
cid: "QmXPh5RTReLqjqZDRNhgVKi1TWMJK2vS9QSRPkWPhLBQJN",
|
|
12944
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmXPh5RTReLqjqZDRNhgVKi1TWMJK2vS9QSRPkWPhLBQJN"),
|
|
12945
|
+
name: "Authorization Dummy",
|
|
12946
|
+
description: "Production Authorization Dummy",
|
|
12947
|
+
version: "1.0.0",
|
|
12948
|
+
deployed: true,
|
|
12949
|
+
deployedAt: 1776707622939,
|
|
12950
|
+
size: 2026,
|
|
12951
|
+
hash: "349d51aa096d56b394f82de75ed34cd4eef72719969f7e5fe584f4582b2745fa"
|
|
12952
|
+
},
|
|
12953
|
+
authorizationDummyB: {
|
|
12954
|
+
cid: "QmQXTcAU9tr4YAVrzHujEJw9moJgM1o5gnJU2ojcvhigua",
|
|
12955
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmQXTcAU9tr4YAVrzHujEJw9moJgM1o5gnJU2ojcvhigua"),
|
|
12956
|
+
name: "Authorization Dummy B",
|
|
12957
|
+
description: "Production Authorization Dummy B",
|
|
12958
|
+
version: "1.0.0",
|
|
12959
|
+
deployed: true,
|
|
12960
|
+
deployedAt: 1776707632987,
|
|
12961
|
+
size: 1695,
|
|
12962
|
+
hash: "def4576ba6c382d145f996c4f950b5e39e58792415ee7fdd749e0d2bc61e8f0b"
|
|
12963
|
+
},
|
|
12964
|
+
pkpValidator: {
|
|
12965
|
+
cid: "QmSo9fkRJA5rS2AnkpKyFgE7ADdGRC2mXvcXVUPaSBRxv1",
|
|
12966
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmSo9fkRJA5rS2AnkpKyFgE7ADdGRC2mXvcXVUPaSBRxv1"),
|
|
12967
|
+
name: "Pkp Validator",
|
|
12968
|
+
description: "Production Pkp Validator",
|
|
12969
|
+
version: "1.0.0",
|
|
12970
|
+
deployed: true,
|
|
12971
|
+
deployedAt: 1776315028869,
|
|
12972
|
+
size: 4030,
|
|
12973
|
+
hash: "f57523311d2f1f1f1fae5a1bbdcd877582e64268c1cb90396c0d1dc26ab9a1fb",
|
|
12974
|
+
validatorWalletAddress: "0x9ee56687f7a984d5df7ab79330271a619ef56ddd",
|
|
12975
|
+
pkp: {
|
|
12976
|
+
publicKey: "0x04ec0e3acc40884e3f366ca469d08899eb640ad5259fa196b0238075086208a9f8732a3175704f35f0bcc28e07406cfb24c254efd1e7355640577330f0d2dd755f",
|
|
12977
|
+
ethAddress: "0x9eE56687F7a984D5DF7aB79330271a619ef56DdD"
|
|
12978
|
+
}
|
|
12979
|
+
},
|
|
12980
|
+
btcTransactionSigner: {
|
|
12981
|
+
cid: "QmYSvuDcn2EPjRoDsPBLK2e3PGYEUHtWAPxwB51s4unkaG",
|
|
12982
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmYSvuDcn2EPjRoDsPBLK2e3PGYEUHtWAPxwB51s4unkaG"),
|
|
12983
|
+
name: "Btc Transaction Signer",
|
|
12984
|
+
description: "Production Btc Transaction Signer",
|
|
12985
|
+
version: "1.0.0",
|
|
12986
|
+
deployed: true,
|
|
12987
|
+
deployedAt: 1776767100453,
|
|
12988
|
+
size: 25657,
|
|
12989
|
+
hash: "422311d10447a806bf435a1df440ff00d4eee986c019ccdb4af15bdbfd8019cf"
|
|
12990
|
+
},
|
|
12991
|
+
ucdMintValidator: {
|
|
12992
|
+
cid: "QmRrL2oTyEyAsTNQQDbq7LpMtU6EJJCbmnLGKGJM4ULr1h",
|
|
12993
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmRrL2oTyEyAsTNQQDbq7LpMtU6EJJCbmnLGKGJM4ULr1h"),
|
|
12994
|
+
name: "Ucd Mint Validator",
|
|
12995
|
+
description: "Production Ucd Mint Validator",
|
|
12996
|
+
version: "1.0.0",
|
|
12997
|
+
deployed: true,
|
|
12998
|
+
deployedAt: 1776782297891,
|
|
12999
|
+
size: 64983,
|
|
13000
|
+
hash: "001bbe2c2ba746daf2a29653c053fbe3ac84312df45dada048e18947fa3cc05b",
|
|
13001
|
+
validatorWalletAddress: "0x36f3dd61c4c08a56d29ed2fd6d5f111b67b6a7a1",
|
|
13002
|
+
pkp: {
|
|
13003
|
+
publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
|
|
13004
|
+
ethAddress: "0x4D9299055093938d0CD2F26C42A87260CB50adD8"
|
|
13005
|
+
}
|
|
13006
|
+
},
|
|
13007
|
+
processPaymentValidator: {
|
|
13008
|
+
cid: "QmR7rT7iG74YeSVoavTSTgBtZqcmCKG3Tf3hmzQ3zTFUb3",
|
|
13009
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmR7rT7iG74YeSVoavTSTgBtZqcmCKG3Tf3hmzQ3zTFUb3"),
|
|
13010
|
+
name: "Process Payment Validator",
|
|
13011
|
+
description: "Production Process Payment Validator",
|
|
13012
|
+
version: "1.0.0",
|
|
13013
|
+
deployed: true,
|
|
13014
|
+
deployedAt: 1776782306970,
|
|
13015
|
+
size: 60889,
|
|
13016
|
+
hash: "2153e187d2bbd713d41a87d1dac2199ab879590761becf55c708e5fb970bf941",
|
|
13017
|
+
validatorWalletAddress: "0xc2ed5a59bd81eb4d1a19a0147b86ab69aa4c28ba",
|
|
13018
|
+
pkp: {
|
|
13019
|
+
publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
|
|
13020
|
+
ethAddress: "0x440Fd7B157766b95eb551825C06DF4f92E41D55b"
|
|
13021
|
+
}
|
|
13022
|
+
},
|
|
13023
|
+
extendPositionValidator: {
|
|
13024
|
+
cid: "QmZGWWnjVcfHzSBQzgXfMmxQJUYXKt9jsCXrCPZXzuPxPv",
|
|
13025
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmZGWWnjVcfHzSBQzgXfMmxQJUYXKt9jsCXrCPZXzuPxPv"),
|
|
13026
|
+
name: "Extend Position Validator",
|
|
13027
|
+
description: "Production Extend Position Validator",
|
|
13028
|
+
version: "1.0.0",
|
|
13029
|
+
deployed: true,
|
|
13030
|
+
deployedAt: 1776782316021,
|
|
13031
|
+
size: 60346,
|
|
13032
|
+
hash: "630dacf25495e39a4011c5e28a74a5d9f09e9b89eb0d701868e8881e28609269",
|
|
13033
|
+
validatorWalletAddress: "0xb3f4271c475887a86a2f21446f0968c30cc74c97",
|
|
13034
|
+
pkp: {
|
|
13035
|
+
publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
|
|
13036
|
+
ethAddress: "0x4cb7651Ba27610991A5775486B5F4487F3Dd7cDA"
|
|
13037
|
+
}
|
|
13038
|
+
},
|
|
13039
|
+
btcWithdrawal: {
|
|
13040
|
+
cid: "QmX9HxZsogBTBSurQPnopMtGDQRXtd3HynHxkqgq23u3rm",
|
|
13041
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmX9HxZsogBTBSurQPnopMtGDQRXtd3HynHxkqgq23u3rm"),
|
|
13042
|
+
name: "Btc Withdrawal",
|
|
13043
|
+
description: "Production Btc Withdrawal",
|
|
13044
|
+
version: "1.0.0",
|
|
13045
|
+
deployed: true,
|
|
13046
|
+
deployedAt: 1776782325228,
|
|
13047
|
+
size: 69488,
|
|
13048
|
+
hash: "361055707df1851003f867635bb8c29eaaef6ced2e57c9d0250b8739d01e6b13",
|
|
13049
|
+
validatorWalletAddress: "0xbb137fbda353199e9419b698c57a742124d4987d",
|
|
13050
|
+
pkp: {
|
|
13051
|
+
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
13052
|
+
ethAddress: "0x7b9316cAA00B257F7CE30F7F6979bd6867BA9eE2"
|
|
13053
|
+
}
|
|
13054
|
+
},
|
|
13055
|
+
liquidationValidator: {
|
|
13056
|
+
cid: "QmbufZa57vL7k3eeeFs9vy6LPry5XMYjJrYw7wCHzc3TWH",
|
|
13057
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmbufZa57vL7k3eeeFs9vy6LPry5XMYjJrYw7wCHzc3TWH"),
|
|
13058
|
+
name: "Liquidation Validator",
|
|
13059
|
+
description: "Production Liquidation Validator",
|
|
13060
|
+
version: "1.0.0",
|
|
13061
|
+
deployed: true,
|
|
13062
|
+
deployedAt: 1776782332379,
|
|
13063
|
+
size: 54383,
|
|
13064
|
+
hash: "a2acf645716ed249b62ecc2069609eb53b17fe60c41d3027f0c3e98c3bffb4ca",
|
|
13065
|
+
validatorWalletAddress: "0x1542f863ee0340f6a067573e80ae66dd9b3838fa",
|
|
13066
|
+
pkp: {
|
|
13067
|
+
publicKey: "0x041a241de58976c13e3d7ca5a18e494f7330151e3818706135d50176e78ffb673e58b11f0b67a87c73fade6c6b27d6e7a7377ea9f4c10bf31880f1d725f18cc6f8",
|
|
13068
|
+
ethAddress: "0x8770470620Db25bBf2BFBca1eF7Bdd6CF91ab1b5"
|
|
13069
|
+
}
|
|
13070
|
+
},
|
|
13071
|
+
priceOracle: {
|
|
13072
|
+
cid: "QmXKfK7JJFixFPvm48uwgVVW7s3eoE3sEyFEbZZ3dfNK1e",
|
|
13073
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmXKfK7JJFixFPvm48uwgVVW7s3eoE3sEyFEbZZ3dfNK1e"),
|
|
13074
|
+
name: "Price Oracle",
|
|
13075
|
+
description: "Production Price Oracle (Chipotle main+getPrivateKey)",
|
|
13076
|
+
version: "1.1.0",
|
|
13077
|
+
deployed: true,
|
|
13078
|
+
deployedAt: 1776708126597,
|
|
13079
|
+
size: 11644,
|
|
13080
|
+
hash: "d175d8571aa4337d465115f9939a2d72965255c7c7a64c33e546ffff141e7a09",
|
|
13081
|
+
validatorWalletAddress: "0x831ddf3048547b983efe3ccbbb35a45a53191651",
|
|
13082
|
+
pkp: {
|
|
13083
|
+
publicKey: "0x043beaa1da47875601a8d6f430b1438ee2d4732eefd06e5c63a474bbdaf9e7df1797b1b951e041b627c2bf839788164825324c9cbd1e2d6f740fdd4bff69b1900b",
|
|
13084
|
+
ethAddress: "0x831DdF3048547B983EFE3ccBBB35a45a53191651"
|
|
13085
|
+
}
|
|
13086
|
+
},
|
|
13087
|
+
loanVaultBtcBalance: {
|
|
13088
|
+
cid: "QmUdw25GDYMY6gm7nChBxpHtkwtoSEMjf66QWJ1dCikWkt",
|
|
13089
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmUdw25GDYMY6gm7nChBxpHtkwtoSEMjf66QWJ1dCikWkt"),
|
|
13090
|
+
name: "Loan Vault Btc Balance",
|
|
13091
|
+
description: "Production Loan Vault Btc Balance",
|
|
13092
|
+
version: "1.0.0",
|
|
13093
|
+
deployed: true,
|
|
13094
|
+
deployedAt: 1776782341246,
|
|
13095
|
+
size: 43769,
|
|
13096
|
+
hash: "780ea6731fa48e0b15e1666ab1c6aa91471dbf748d36fa1e93f74614047bacb7",
|
|
13097
|
+
validatorWalletAddress: "0x47feea74c8739d24b44faa67217f2f99970e15e7",
|
|
13098
|
+
pkp: {
|
|
13099
|
+
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
13100
|
+
ethAddress: "0x7b9316cAA00B257F7CE30F7F6979bd6867BA9eE2"
|
|
13101
|
+
}
|
|
13102
|
+
},
|
|
13103
|
+
adminLiquidationValidator: {
|
|
13104
|
+
cid: "QmYBpkLWKZbEBgdZnfFMabszmPYQJsfdVsqwVyJqdrMnP4",
|
|
13105
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmYBpkLWKZbEBgdZnfFMabszmPYQJsfdVsqwVyJqdrMnP4"),
|
|
13106
|
+
name: "Admin Liquidation Validator",
|
|
13107
|
+
description: "Production Admin Liquidation Validator",
|
|
13108
|
+
version: "1.0.0",
|
|
13109
|
+
deployed: true,
|
|
13110
|
+
deployedAt: 1776782348498,
|
|
13111
|
+
size: 51032,
|
|
13112
|
+
hash: "b3af59aab3d71841e2b06e11da7c1664e451e636ead6ee746604be82ff472a13",
|
|
13113
|
+
validatorWalletAddress: "0x2a83b78842d75358877deb8854ccc5bbbaa5012e",
|
|
13114
|
+
pkp: {
|
|
13115
|
+
publicKey: "0x04ee4316afb8538280ede6c56def9cbe791f18f96ccba97768b28e2966d9c46a9493a6b81f4571495c3ce56c2d0b33fe8cf63726cd12d395832ea54162b5c67801",
|
|
13116
|
+
ethAddress: "0x038B7a1918ae9121bC641236b7946a069BE21591"
|
|
13117
|
+
}
|
|
13118
|
+
},
|
|
13119
|
+
alwaysSigner: {
|
|
13120
|
+
cid: "QmXQjybSsdE19Da66to9Hh7X2dLFwpZPhjoqojxbpk7Nvs",
|
|
13121
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmXQjybSsdE19Da66to9Hh7X2dLFwpZPhjoqojxbpk7Nvs"),
|
|
13122
|
+
name: "Always Signer",
|
|
13123
|
+
description: "Production Always Signer",
|
|
13124
|
+
version: "1.0.0",
|
|
13125
|
+
deployed: true,
|
|
13126
|
+
deployedAt: 1776708176283,
|
|
13127
|
+
size: 4143,
|
|
13128
|
+
hash: "25007f80b4ed3169470bf617d403971136be431eb29dfb09f78afe2494bf0138"
|
|
13129
|
+
}
|
|
13130
|
+
};
|
|
13131
|
+
function getDeploymentsForNetwork(network) {
|
|
13132
|
+
if (network === "chipotle")
|
|
13133
|
+
return exports.DH_LIT_ACTIONS_CHIPOTLE;
|
|
13134
|
+
throw new Error(`Unsupported LIT network: ${network}`);
|
|
13135
|
+
}
|
|
13136
|
+
exports.CHIPOTLE_DEPLOYMENTS = exports.DH_LIT_ACTIONS_CHIPOTLE;
|
|
13137
|
+
}
|
|
13138
|
+
});
|
|
13139
|
+
|
|
13140
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.js
|
|
13141
|
+
var require_lit_action_helpers = __commonJS({
|
|
13142
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.js"(exports) {
|
|
13143
|
+
"use strict";
|
|
13144
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13145
|
+
exports.getLitActionCID = getLitActionCID;
|
|
13146
|
+
exports.getLitActionConfig = getLitActionConfig;
|
|
13147
|
+
exports.isLitActionDeployed = isLitActionDeployed;
|
|
13148
|
+
exports.validateDeployedActions = validateDeployedActions;
|
|
13149
|
+
exports.getDeployedActions = getDeployedActions;
|
|
13150
|
+
var lit_actions_registry_1 = require_lit_actions_registry();
|
|
13151
|
+
function getLitActionCID(litNetwork = "chipotle", actionName) {
|
|
13152
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13153
|
+
const action = deployments[actionName];
|
|
13154
|
+
if (!action || !action.deployed || !action.cid) {
|
|
13155
|
+
throw new Error(`LIT Action '${actionName}' not deployed on network '${litNetwork}'. Check deployment status.`);
|
|
13156
|
+
}
|
|
13157
|
+
return action.cid;
|
|
13158
|
+
}
|
|
13159
|
+
function getLitActionConfig(actionName, litNetwork = "chipotle") {
|
|
13160
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13161
|
+
const action = deployments[actionName];
|
|
13162
|
+
if (!action) {
|
|
13163
|
+
throw new Error(`LIT Action '${actionName}' not found in registry for network '${litNetwork}'.`);
|
|
13164
|
+
}
|
|
13165
|
+
return action;
|
|
13166
|
+
}
|
|
13167
|
+
function isLitActionDeployed(actionName, litNetwork = "chipotle") {
|
|
13168
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13169
|
+
const action = deployments[actionName];
|
|
13170
|
+
return !!(action && action.deployed && action.cid);
|
|
13171
|
+
}
|
|
13172
|
+
function validateDeployedActions(requiredActions, litNetwork = "chipotle") {
|
|
13173
|
+
return requiredActions.every((actionName) => isLitActionDeployed(actionName, litNetwork));
|
|
13174
|
+
}
|
|
13175
|
+
function getDeployedActions(litNetwork = "chipotle") {
|
|
13176
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13177
|
+
return Object.values(deployments).filter((action) => action && action.deployed);
|
|
13178
|
+
}
|
|
13179
|
+
}
|
|
13180
|
+
});
|
|
13181
|
+
|
|
13182
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/pkp-setup.js
|
|
13183
|
+
var require_pkp_setup = __commonJS({
|
|
13184
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/pkp-setup.js"(exports) {
|
|
13185
|
+
"use strict";
|
|
13186
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13187
|
+
exports.getPKPValidatorSetup = getPKPValidatorSetup;
|
|
13188
|
+
var lit_actions_registry_1 = require_lit_actions_registry();
|
|
13189
|
+
function getPKPValidatorSetup(litNetwork = "chipotle") {
|
|
13190
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13191
|
+
const litAction = deployments.pkpValidator;
|
|
13192
|
+
if (!litAction || !litAction.pkp) {
|
|
13193
|
+
throw new Error(`PKP validator setup is not available for litNetwork='${litNetwork}'. Ensure the pkpValidator action (with pkp attached) is defined in the registry.`);
|
|
13194
|
+
}
|
|
13195
|
+
return {
|
|
13196
|
+
litAction,
|
|
13197
|
+
pkp: litAction.pkp
|
|
13198
|
+
};
|
|
13199
|
+
}
|
|
13200
|
+
}
|
|
13201
|
+
});
|
|
13202
|
+
|
|
13203
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/debug-logger.js
|
|
13204
|
+
var require_debug_logger = __commonJS({
|
|
13205
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/debug-logger.js"(exports) {
|
|
13206
|
+
"use strict";
|
|
13207
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13208
|
+
exports.networkMetrics = exports.PerformanceTracker = exports.DEFAULT_DEBUG_CONFIG = exports.LogLevel = void 0;
|
|
13209
|
+
exports.configureDebugLogging = configureDebugLogging;
|
|
13210
|
+
exports.debugError = debugError;
|
|
13211
|
+
exports.debugWarn = debugWarn;
|
|
13212
|
+
exports.debugInfo = debugInfo;
|
|
13213
|
+
exports.debugLog = debugLog;
|
|
13214
|
+
exports.debugTrace = debugTrace;
|
|
13215
|
+
exports.logRequest = logRequest;
|
|
13216
|
+
exports.logResponse = logResponse;
|
|
13217
|
+
exports.logError = logError;
|
|
13218
|
+
exports.logConnectionAttempt = logConnectionAttempt;
|
|
13219
|
+
exports.logConnectionSuccess = logConnectionSuccess;
|
|
13220
|
+
exports.logConnectionFailure = logConnectionFailure;
|
|
13221
|
+
exports.logPkpOperation = logPkpOperation;
|
|
13222
|
+
exports.logSessionSignatures = logSessionSignatures;
|
|
13223
|
+
exports.logLitActionExecution = logLitActionExecution;
|
|
13224
|
+
exports.logLitActionResult = logLitActionResult;
|
|
13225
|
+
exports.logTestStart = logTestStart;
|
|
13226
|
+
exports.logTestEnd = logTestEnd;
|
|
13227
|
+
var LogLevel2;
|
|
13228
|
+
(function(LogLevel3) {
|
|
13229
|
+
LogLevel3[LogLevel3["ERROR"] = 0] = "ERROR";
|
|
13230
|
+
LogLevel3[LogLevel3["WARN"] = 1] = "WARN";
|
|
13231
|
+
LogLevel3[LogLevel3["INFO"] = 2] = "INFO";
|
|
13232
|
+
LogLevel3[LogLevel3["DEBUG"] = 3] = "DEBUG";
|
|
13233
|
+
LogLevel3[LogLevel3["TRACE"] = 4] = "TRACE";
|
|
13234
|
+
})(LogLevel2 || (exports.LogLevel = LogLevel2 = {}));
|
|
13235
|
+
exports.DEFAULT_DEBUG_CONFIG = {
|
|
13236
|
+
level: LogLevel2.INFO,
|
|
13237
|
+
enableTimestamps: true,
|
|
13238
|
+
enablePerformanceMetrics: true,
|
|
13239
|
+
enableRequestLogging: true,
|
|
13240
|
+
enableNetworkMetrics: true
|
|
13241
|
+
};
|
|
13242
|
+
var debugConfig = { ...exports.DEFAULT_DEBUG_CONFIG };
|
|
13243
|
+
function configureDebugLogging(config) {
|
|
13244
|
+
debugConfig = { ...debugConfig, ...config };
|
|
13245
|
+
}
|
|
13246
|
+
function getTimestamp() {
|
|
13247
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
13248
|
+
}
|
|
13249
|
+
function formatMessage(level, component, message, metadata) {
|
|
13250
|
+
const timestamp = debugConfig.enableTimestamps ? `[${getTimestamp()}] ` : "";
|
|
13251
|
+
const metadataStr = metadata ? ` ${JSON.stringify(metadata)}` : "";
|
|
13252
|
+
return `${timestamp}[${level}] [${component}] ${message}${metadataStr}`;
|
|
13253
|
+
}
|
|
13254
|
+
var PerformanceTracker = class {
|
|
13255
|
+
constructor(operationName) {
|
|
13256
|
+
this.operationName = operationName;
|
|
13257
|
+
this.markers = /* @__PURE__ */ new Map();
|
|
13258
|
+
this.startTime = Date.now();
|
|
13259
|
+
this.log("PERF", `Started: ${operationName}`);
|
|
13260
|
+
}
|
|
13261
|
+
mark(label) {
|
|
13262
|
+
const elapsed = Date.now() - this.startTime;
|
|
13263
|
+
this.markers.set(label, elapsed);
|
|
13264
|
+
this.log("PERF", `${this.operationName} - ${label}: ${elapsed}ms`);
|
|
13265
|
+
}
|
|
13266
|
+
end(success2 = true) {
|
|
13267
|
+
const totalTime = Date.now() - this.startTime;
|
|
13268
|
+
const status = success2 ? "SUCCESS" : "FAILED";
|
|
13269
|
+
this.log("PERF", `${this.operationName} - ${status}: ${totalTime}ms`);
|
|
13270
|
+
if (debugConfig.enablePerformanceMetrics && this.markers.size > 0) {
|
|
13271
|
+
console.log(`\u{1F4CA} Performance Breakdown for ${this.operationName}:`);
|
|
13272
|
+
for (const [label, time] of this.markers) {
|
|
13273
|
+
console.log(` ${label}: ${time}ms`);
|
|
13274
|
+
}
|
|
13275
|
+
console.log(` Total: ${totalTime}ms`);
|
|
13276
|
+
}
|
|
13277
|
+
return totalTime;
|
|
13278
|
+
}
|
|
13279
|
+
log(level, message) {
|
|
13280
|
+
if (debugConfig.enablePerformanceMetrics) {
|
|
13281
|
+
console.log(formatMessage(level, "PERFORMANCE", message));
|
|
13282
|
+
}
|
|
13283
|
+
}
|
|
13284
|
+
};
|
|
13285
|
+
exports.PerformanceTracker = PerformanceTracker;
|
|
13286
|
+
var NetworkMetricsCollector = class {
|
|
13287
|
+
constructor() {
|
|
13288
|
+
this.metrics = /* @__PURE__ */ new Map();
|
|
13289
|
+
}
|
|
13290
|
+
getMetrics(operation) {
|
|
13291
|
+
if (!this.metrics.has(operation)) {
|
|
13292
|
+
this.metrics.set(operation, {
|
|
13293
|
+
requestCount: 0,
|
|
13294
|
+
successCount: 0,
|
|
13295
|
+
failureCount: 0,
|
|
13296
|
+
averageLatency: 0,
|
|
13297
|
+
startTime: Date.now()
|
|
13298
|
+
});
|
|
13299
|
+
}
|
|
13300
|
+
return this.metrics.get(operation);
|
|
13301
|
+
}
|
|
13302
|
+
recordRequest(operation, success2, latency, error) {
|
|
13303
|
+
const metrics = this.getMetrics(operation);
|
|
13304
|
+
metrics.requestCount++;
|
|
13305
|
+
if (success2) {
|
|
13306
|
+
metrics.successCount++;
|
|
13307
|
+
metrics.averageLatency = (metrics.averageLatency * (metrics.successCount - 1) + latency) / metrics.successCount;
|
|
13308
|
+
} else {
|
|
13309
|
+
metrics.failureCount++;
|
|
13310
|
+
if (error)
|
|
13311
|
+
metrics.lastError = error;
|
|
13312
|
+
}
|
|
13313
|
+
if (debugConfig.enableNetworkMetrics) {
|
|
13314
|
+
const successRate = (metrics.successCount / metrics.requestCount * 100).toFixed(1);
|
|
13315
|
+
debugLog("NETWORK", `${operation} - Success: ${success2}, Latency: ${latency}ms, Success Rate: ${successRate}%`);
|
|
13316
|
+
}
|
|
13317
|
+
}
|
|
13318
|
+
printSummary() {
|
|
13319
|
+
if (!debugConfig.enableNetworkMetrics)
|
|
13320
|
+
return;
|
|
13321
|
+
console.log("\n\u{1F4C8} Network Metrics Summary:");
|
|
13322
|
+
for (const [operation, metrics] of this.metrics) {
|
|
13323
|
+
const successRate = (metrics.successCount / metrics.requestCount * 100).toFixed(1);
|
|
13324
|
+
const runtime = Date.now() - metrics.startTime;
|
|
13325
|
+
console.log(` ${operation}:`);
|
|
13326
|
+
console.log(` Requests: ${metrics.requestCount}`);
|
|
13327
|
+
console.log(` Success Rate: ${successRate}%`);
|
|
13328
|
+
console.log(` Avg Latency: ${metrics.averageLatency.toFixed(0)}ms`);
|
|
13329
|
+
console.log(` Runtime: ${runtime}ms`);
|
|
13330
|
+
if (metrics.lastError) {
|
|
13331
|
+
console.log(` Last Error: ${metrics.lastError}`);
|
|
13332
|
+
}
|
|
13333
|
+
}
|
|
13334
|
+
}
|
|
13335
|
+
};
|
|
13336
|
+
exports.networkMetrics = new NetworkMetricsCollector();
|
|
13337
|
+
function debugError(component, message, metadata) {
|
|
13338
|
+
if (debugConfig.level >= LogLevel2.ERROR) {
|
|
13339
|
+
console.error(formatMessage("ERROR", component, message, metadata));
|
|
13340
|
+
}
|
|
13341
|
+
}
|
|
13342
|
+
function debugWarn(component, message, metadata) {
|
|
13343
|
+
if (debugConfig.level >= LogLevel2.WARN) {
|
|
13344
|
+
console.warn(formatMessage("WARN", component, message, metadata));
|
|
13345
|
+
}
|
|
13346
|
+
}
|
|
13347
|
+
function debugInfo(component, message, metadata) {
|
|
13348
|
+
if (debugConfig.level >= LogLevel2.INFO) {
|
|
13349
|
+
console.log(formatMessage("INFO", component, message, metadata));
|
|
13350
|
+
}
|
|
13351
|
+
}
|
|
13352
|
+
function debugLog(component, message, metadata) {
|
|
13353
|
+
if (debugConfig.level >= LogLevel2.DEBUG) {
|
|
13354
|
+
console.log(formatMessage("DEBUG", component, message, metadata));
|
|
13355
|
+
}
|
|
13356
|
+
}
|
|
13357
|
+
function debugTrace(component, message, metadata) {
|
|
13358
|
+
if (debugConfig.level >= LogLevel2.TRACE) {
|
|
13359
|
+
console.log(formatMessage("TRACE", component, message, metadata));
|
|
13360
|
+
}
|
|
13361
|
+
}
|
|
13362
|
+
function logRequest(component, operation, params) {
|
|
13363
|
+
if (!debugConfig.enableRequestLogging)
|
|
13364
|
+
return;
|
|
13365
|
+
debugLog(component, `\u{1F504} Request: ${operation}`, {
|
|
13366
|
+
operation,
|
|
13367
|
+
params: JSON.stringify(params, null, 2)
|
|
13368
|
+
});
|
|
13369
|
+
}
|
|
13370
|
+
function logResponse(component, operation, response, duration) {
|
|
13371
|
+
if (!debugConfig.enableRequestLogging)
|
|
13372
|
+
return;
|
|
13373
|
+
debugLog(component, `\u2705 Response: ${operation} (${duration}ms)`, {
|
|
13374
|
+
operation,
|
|
13375
|
+
duration,
|
|
13376
|
+
response: typeof response === "object" ? JSON.stringify(response, null, 2) : response
|
|
13377
|
+
});
|
|
13378
|
+
}
|
|
13379
|
+
function logError(component, operation, error, duration) {
|
|
13380
|
+
const durationStr = duration ? ` (${duration}ms)` : "";
|
|
13381
|
+
debugError(component, `\u274C Error: ${operation}${durationStr}`, {
|
|
13382
|
+
operation,
|
|
13383
|
+
duration,
|
|
13384
|
+
error: error?.message || error?.toString() || "Unknown error",
|
|
13385
|
+
stack: error?.stack
|
|
13386
|
+
});
|
|
13387
|
+
}
|
|
13388
|
+
function logConnectionAttempt(network, attempt, maxAttempts) {
|
|
13389
|
+
debugInfo("CONNECTION", `\u{1F517} Connecting to ${network} (attempt ${attempt}/${maxAttempts})`);
|
|
13390
|
+
}
|
|
13391
|
+
function logConnectionSuccess(network, latency) {
|
|
13392
|
+
debugInfo("CONNECTION", `\u2705 Connected to ${network} (${latency}ms)`);
|
|
13393
|
+
exports.networkMetrics.recordRequest(`connection-${network}`, true, latency);
|
|
13394
|
+
}
|
|
13395
|
+
function logConnectionFailure(network, error, attempt) {
|
|
13396
|
+
debugError("CONNECTION", `\u274C Connection failed to ${network} (attempt ${attempt})`, { error });
|
|
13397
|
+
exports.networkMetrics.recordRequest(`connection-${network}`, false, 0, error);
|
|
13398
|
+
}
|
|
13399
|
+
function logPkpOperation(operation, pkpId, details) {
|
|
13400
|
+
const pkpStr = pkpId ? ` (PKP: ${pkpId.slice(0, 8)}...)` : "";
|
|
13401
|
+
debugInfo("PKP", `\u{1F511} ${operation}${pkpStr}`, details);
|
|
13402
|
+
}
|
|
13403
|
+
function logSessionSignatures(count, expiration) {
|
|
13404
|
+
debugInfo("SESSION", `\u{1F510} Generated ${count} session signatures (expires: ${expiration})`);
|
|
13405
|
+
}
|
|
13406
|
+
function logLitActionExecution(cid, params) {
|
|
13407
|
+
debugInfo("LIT_ACTION", `\u26A1 Executing LIT Action: ${cid}`, {
|
|
13408
|
+
cid,
|
|
13409
|
+
params
|
|
13410
|
+
});
|
|
13411
|
+
}
|
|
13412
|
+
function logLitActionResult(cid, success2, duration, result) {
|
|
13413
|
+
const status = success2 ? "\u2705" : "\u274C";
|
|
13414
|
+
debugInfo("LIT_ACTION", `${status} LIT Action completed: ${cid} (${duration}ms)`, {
|
|
13415
|
+
cid,
|
|
13416
|
+
success: success2,
|
|
13417
|
+
duration,
|
|
13418
|
+
result: success2 && result ? JSON.stringify(result, null, 2) : void 0
|
|
13419
|
+
});
|
|
13420
|
+
}
|
|
13421
|
+
function logTestStart(testName) {
|
|
13422
|
+
debugInfo("TEST", `\u{1F9EA} Starting test: ${testName}`);
|
|
13423
|
+
return new PerformanceTracker(testName);
|
|
13424
|
+
}
|
|
13425
|
+
function logTestEnd(testName, success2, duration) {
|
|
13426
|
+
const status = success2 ? "\u2705" : "\u274C";
|
|
13427
|
+
debugInfo("TEST", `${status} Test completed: ${testName} (${duration}ms)`);
|
|
13428
|
+
exports.networkMetrics.printSummary();
|
|
13429
|
+
}
|
|
13430
|
+
}
|
|
13431
|
+
});
|
|
13432
|
+
|
|
13433
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/error-classification.js
|
|
13434
|
+
var require_error_classification = __commonJS({
|
|
13435
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/error-classification.js"(exports) {
|
|
13436
|
+
"use strict";
|
|
13437
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13438
|
+
exports.litProtocolErrors = exports.RetryStrategy = exports.ErrorCategory = void 0;
|
|
13439
|
+
exports.classifyError = classifyError;
|
|
13440
|
+
exports.getRetryConfigFromClassification = getRetryConfigFromClassification;
|
|
13441
|
+
exports.analyzeError = analyzeError;
|
|
13442
|
+
exports.createErrorReport = createErrorReport;
|
|
13443
|
+
var ErrorCategory2;
|
|
13444
|
+
(function(ErrorCategory3) {
|
|
13445
|
+
ErrorCategory3["NETWORK"] = "network";
|
|
13446
|
+
ErrorCategory3["PROTOCOL"] = "protocol";
|
|
13447
|
+
ErrorCategory3["AUTHENTICATION"] = "authentication";
|
|
13448
|
+
ErrorCategory3["RESOURCE"] = "resource";
|
|
13449
|
+
ErrorCategory3["VALIDATION"] = "validation";
|
|
13450
|
+
ErrorCategory3["TIMEOUT"] = "timeout";
|
|
13451
|
+
ErrorCategory3["RATE_LIMIT"] = "rate_limit";
|
|
13452
|
+
ErrorCategory3["CONFIGURATION"] = "configuration";
|
|
13453
|
+
ErrorCategory3["UNKNOWN"] = "unknown";
|
|
13454
|
+
})(ErrorCategory2 || (exports.ErrorCategory = ErrorCategory2 = {}));
|
|
13455
|
+
var RetryStrategy;
|
|
13456
|
+
(function(RetryStrategy2) {
|
|
13457
|
+
RetryStrategy2["AGGRESSIVE"] = "aggressive";
|
|
13458
|
+
RetryStrategy2["CONSERVATIVE"] = "conservative";
|
|
13459
|
+
RetryStrategy2["EXPONENTIAL"] = "exponential";
|
|
13460
|
+
RetryStrategy2["LINEAR"] = "linear";
|
|
13461
|
+
RetryStrategy2["NONE"] = "none";
|
|
13462
|
+
})(RetryStrategy || (exports.RetryStrategy = RetryStrategy = {}));
|
|
13463
|
+
var LIT_ERROR_PATTERNS = {
|
|
13464
|
+
// Network and connection errors
|
|
13465
|
+
network: [
|
|
13466
|
+
/network error/i,
|
|
13467
|
+
/connection failed/i,
|
|
13468
|
+
/connection refused/i,
|
|
13469
|
+
/connection timeout/i,
|
|
13470
|
+
/socket hang up/i,
|
|
13471
|
+
/enotfound/i,
|
|
13472
|
+
/econnrefused/i,
|
|
13473
|
+
/etimedout/i,
|
|
13474
|
+
/dns resolution failed/i,
|
|
13475
|
+
/request failed/i
|
|
13476
|
+
],
|
|
13477
|
+
// Protocol specific errors
|
|
13478
|
+
protocol: [
|
|
13479
|
+
/lit protocol/i,
|
|
13480
|
+
/lit node/i,
|
|
13481
|
+
/signing shares/i,
|
|
13482
|
+
/node communication/i,
|
|
13483
|
+
/consensus/i,
|
|
13484
|
+
/threshold/i,
|
|
13485
|
+
/decryption/i,
|
|
13486
|
+
/signature verification/i,
|
|
13487
|
+
/There was an error getting the signing shares/i,
|
|
13488
|
+
/Response from the nodes/i,
|
|
13489
|
+
/NodeError/i,
|
|
13490
|
+
/PKP validation/i,
|
|
13491
|
+
/pkp validation failed/i
|
|
13492
|
+
],
|
|
13493
|
+
// Authentication and authorization errors
|
|
13494
|
+
authentication: [
|
|
13495
|
+
/authentication/i,
|
|
13496
|
+
/authorization/i,
|
|
13497
|
+
/session.*expired/i,
|
|
13498
|
+
/invalid.*signature/i,
|
|
13499
|
+
/unauthorized/i,
|
|
13500
|
+
/access.*denied/i,
|
|
13501
|
+
/permission/i,
|
|
13502
|
+
/auth.*failed/i,
|
|
13503
|
+
/siwe/i,
|
|
13504
|
+
/session.*sig/i
|
|
13505
|
+
],
|
|
13506
|
+
// Resource and validation errors
|
|
13507
|
+
resource: [
|
|
13508
|
+
/resource.*not.*found/i,
|
|
13509
|
+
/ipfs.*not.*found/i,
|
|
13510
|
+
/cid.*invalid/i,
|
|
13511
|
+
/pkp.*not.*found/i,
|
|
13512
|
+
/pkp.*validation/i,
|
|
13513
|
+
/resource.*validation/i,
|
|
13514
|
+
/action.*not.*permitted/i,
|
|
13515
|
+
/lit.*action.*not.*found/i
|
|
13516
|
+
],
|
|
13517
|
+
// Validation errors
|
|
13518
|
+
validation: [
|
|
13519
|
+
/validation.*failed/i,
|
|
13520
|
+
/invalid.*input/i,
|
|
13521
|
+
/invalid.*parameter/i,
|
|
13522
|
+
/malformed/i,
|
|
13523
|
+
/schema.*validation/i,
|
|
13524
|
+
/type.*error/i,
|
|
13525
|
+
/missing.*required/i
|
|
13526
|
+
],
|
|
13527
|
+
// Timeout specific errors
|
|
13528
|
+
timeout: [
|
|
13529
|
+
/timeout/i,
|
|
13530
|
+
/request.*timed.*out/i,
|
|
13531
|
+
/operation.*timed.*out/i,
|
|
13532
|
+
/deadline.*exceeded/i,
|
|
13533
|
+
/time.*limit.*exceeded/i
|
|
13534
|
+
],
|
|
13535
|
+
// Rate limiting errors
|
|
13536
|
+
rateLimit: [
|
|
13537
|
+
/rate.*limit/i,
|
|
13538
|
+
/too.*many.*requests/i,
|
|
13539
|
+
/quota.*exceeded/i,
|
|
13540
|
+
/throttled/i,
|
|
13541
|
+
/429/,
|
|
13542
|
+
/rate.*exceeded/i
|
|
13543
|
+
],
|
|
13544
|
+
// Configuration errors
|
|
13545
|
+
configuration: [
|
|
13546
|
+
/configuration/i,
|
|
13547
|
+
/config.*error/i,
|
|
13548
|
+
/environment/i,
|
|
13549
|
+
/missing.*env/i,
|
|
13550
|
+
/invalid.*config/i,
|
|
13551
|
+
/setup.*error/i
|
|
13552
|
+
]
|
|
13553
|
+
};
|
|
13554
|
+
var RETRY_STRATEGIES = {
|
|
13555
|
+
[RetryStrategy.AGGRESSIVE]: {
|
|
13556
|
+
maxAttempts: 5,
|
|
13557
|
+
baseDelayMs: 500,
|
|
13558
|
+
maxDelayMs: 5e3,
|
|
13559
|
+
multiplier: 1.5
|
|
13560
|
+
},
|
|
13561
|
+
[RetryStrategy.CONSERVATIVE]: {
|
|
13562
|
+
maxAttempts: 3,
|
|
13563
|
+
baseDelayMs: 3e3,
|
|
13564
|
+
maxDelayMs: 3e4,
|
|
13565
|
+
multiplier: 2.5
|
|
13566
|
+
},
|
|
13567
|
+
[RetryStrategy.EXPONENTIAL]: {
|
|
13568
|
+
maxAttempts: 4,
|
|
13569
|
+
baseDelayMs: 1e3,
|
|
13570
|
+
maxDelayMs: 15e3,
|
|
13571
|
+
multiplier: 2
|
|
13572
|
+
},
|
|
13573
|
+
[RetryStrategy.LINEAR]: {
|
|
13574
|
+
maxAttempts: 3,
|
|
13575
|
+
baseDelayMs: 2e3,
|
|
13576
|
+
maxDelayMs: 1e4,
|
|
13577
|
+
multiplier: 1
|
|
13578
|
+
},
|
|
13579
|
+
[RetryStrategy.NONE]: {
|
|
13580
|
+
maxAttempts: 1,
|
|
13581
|
+
baseDelayMs: 0,
|
|
13582
|
+
maxDelayMs: 0,
|
|
13583
|
+
multiplier: 1
|
|
13584
|
+
}
|
|
13585
|
+
};
|
|
13586
|
+
var CLASSIFICATION_RULES = {
|
|
13587
|
+
[ErrorCategory2.NETWORK]: {
|
|
13588
|
+
category: ErrorCategory2.NETWORK,
|
|
13589
|
+
retryStrategy: RetryStrategy.AGGRESSIVE,
|
|
13590
|
+
isRetryable: true,
|
|
13591
|
+
...RETRY_STRATEGIES[RetryStrategy.AGGRESSIVE],
|
|
13592
|
+
description: "Network connectivity or communication error",
|
|
13593
|
+
troubleshooting: [
|
|
13594
|
+
"Check internet connection",
|
|
13595
|
+
"Verify LIT Protocol network status",
|
|
13596
|
+
"Check firewall and proxy settings",
|
|
13597
|
+
"Try connecting to different node endpoints"
|
|
13598
|
+
]
|
|
13599
|
+
},
|
|
13600
|
+
[ErrorCategory2.PROTOCOL]: {
|
|
13601
|
+
category: ErrorCategory2.PROTOCOL,
|
|
13602
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
13603
|
+
isRetryable: true,
|
|
13604
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
13605
|
+
description: "LIT Protocol specific operational error",
|
|
13606
|
+
troubleshooting: [
|
|
13607
|
+
"Check LIT Protocol network status",
|
|
13608
|
+
"Verify PKP configuration",
|
|
13609
|
+
"Check signing shares availability",
|
|
13610
|
+
"Wait for network consensus"
|
|
13611
|
+
]
|
|
13612
|
+
},
|
|
13613
|
+
[ErrorCategory2.AUTHENTICATION]: {
|
|
13614
|
+
category: ErrorCategory2.AUTHENTICATION,
|
|
13615
|
+
retryStrategy: RetryStrategy.EXPONENTIAL,
|
|
13616
|
+
isRetryable: true,
|
|
13617
|
+
...RETRY_STRATEGIES[RetryStrategy.EXPONENTIAL],
|
|
13618
|
+
maxAttempts: 2,
|
|
13619
|
+
// Override: limited retries for auth issues
|
|
13620
|
+
description: "Authentication or authorization error",
|
|
13621
|
+
troubleshooting: [
|
|
13622
|
+
"Check session signatures validity",
|
|
13623
|
+
"Regenerate authentication tokens",
|
|
13624
|
+
"Verify wallet permissions",
|
|
13625
|
+
"Check PKP authorization status"
|
|
13626
|
+
]
|
|
13627
|
+
},
|
|
13628
|
+
[ErrorCategory2.RESOURCE]: {
|
|
13629
|
+
category: ErrorCategory2.RESOURCE,
|
|
13630
|
+
retryStrategy: RetryStrategy.LINEAR,
|
|
13631
|
+
isRetryable: true,
|
|
13632
|
+
...RETRY_STRATEGIES[RetryStrategy.LINEAR],
|
|
13633
|
+
maxAttempts: 2,
|
|
13634
|
+
// Override: limited retries for resource issues
|
|
13635
|
+
description: "Resource not found or validation error",
|
|
13636
|
+
troubleshooting: [
|
|
13637
|
+
"Verify resource CIDs are correct",
|
|
13638
|
+
"Check IPFS availability",
|
|
13639
|
+
"Confirm PKP exists and is accessible",
|
|
13640
|
+
"Wait for resource propagation"
|
|
13641
|
+
]
|
|
13642
|
+
},
|
|
13643
|
+
[ErrorCategory2.VALIDATION]: {
|
|
13644
|
+
category: ErrorCategory2.VALIDATION,
|
|
13645
|
+
retryStrategy: RetryStrategy.NONE,
|
|
13646
|
+
isRetryable: false,
|
|
13647
|
+
...RETRY_STRATEGIES[RetryStrategy.NONE],
|
|
13648
|
+
description: "Input validation or schema error",
|
|
13649
|
+
troubleshooting: [
|
|
13650
|
+
"Check input parameters format",
|
|
13651
|
+
"Verify required fields are provided",
|
|
13652
|
+
"Validate data types and ranges",
|
|
13653
|
+
"Review API documentation"
|
|
13654
|
+
]
|
|
13655
|
+
},
|
|
13656
|
+
[ErrorCategory2.TIMEOUT]: {
|
|
13657
|
+
category: ErrorCategory2.TIMEOUT,
|
|
13658
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
13659
|
+
isRetryable: true,
|
|
13660
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
13661
|
+
description: "Operation timeout error",
|
|
13662
|
+
troubleshooting: [
|
|
13663
|
+
"Increase timeout values",
|
|
13664
|
+
"Check network latency",
|
|
13665
|
+
"Verify system resources",
|
|
13666
|
+
"Split operations into smaller chunks"
|
|
13667
|
+
]
|
|
13668
|
+
},
|
|
13669
|
+
[ErrorCategory2.RATE_LIMIT]: {
|
|
13670
|
+
category: ErrorCategory2.RATE_LIMIT,
|
|
13671
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
13672
|
+
isRetryable: true,
|
|
13673
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
13674
|
+
maxAttempts: 2,
|
|
13675
|
+
// Override: limited retries to avoid further rate limiting
|
|
13676
|
+
baseDelayMs: 5e3,
|
|
13677
|
+
// Override: longer delays for rate limits
|
|
13678
|
+
description: "Rate limit or quota exceeded",
|
|
13679
|
+
troubleshooting: [
|
|
13680
|
+
"Reduce request frequency",
|
|
13681
|
+
"Implement request batching",
|
|
13682
|
+
"Check rate limit headers",
|
|
13683
|
+
"Wait for quota reset"
|
|
13684
|
+
]
|
|
13685
|
+
},
|
|
13686
|
+
[ErrorCategory2.CONFIGURATION]: {
|
|
13687
|
+
category: ErrorCategory2.CONFIGURATION,
|
|
13688
|
+
retryStrategy: RetryStrategy.NONE,
|
|
13689
|
+
isRetryable: false,
|
|
13690
|
+
...RETRY_STRATEGIES[RetryStrategy.NONE],
|
|
13691
|
+
description: "Configuration or setup error",
|
|
13692
|
+
troubleshooting: [
|
|
13693
|
+
"Check environment variables",
|
|
13694
|
+
"Verify configuration files",
|
|
13695
|
+
"Review setup documentation",
|
|
13696
|
+
"Check required dependencies"
|
|
13697
|
+
]
|
|
13698
|
+
},
|
|
13699
|
+
[ErrorCategory2.UNKNOWN]: {
|
|
13700
|
+
category: ErrorCategory2.UNKNOWN,
|
|
13701
|
+
retryStrategy: RetryStrategy.EXPONENTIAL,
|
|
13702
|
+
isRetryable: true,
|
|
13703
|
+
...RETRY_STRATEGIES[RetryStrategy.EXPONENTIAL],
|
|
13704
|
+
maxAttempts: 2,
|
|
13705
|
+
// Override: conservative retries for unknown errors
|
|
13706
|
+
description: "Unknown or unclassified error",
|
|
13707
|
+
troubleshooting: [
|
|
13708
|
+
"Check logs for more details",
|
|
13709
|
+
"Verify system status",
|
|
13710
|
+
"Try again with debug logging",
|
|
13711
|
+
"Contact support if persists"
|
|
13712
|
+
]
|
|
13713
|
+
}
|
|
13714
|
+
};
|
|
13715
|
+
function classifyError(error) {
|
|
13716
|
+
const errorMessage = error?.message || error?.toString() || "";
|
|
13717
|
+
const errorLower = errorMessage.toLowerCase();
|
|
13718
|
+
for (const [category, patterns] of Object.entries(LIT_ERROR_PATTERNS)) {
|
|
13719
|
+
for (const pattern of patterns) {
|
|
13720
|
+
if (pattern.test(errorMessage) || pattern.test(errorLower)) {
|
|
13721
|
+
const classification = CLASSIFICATION_RULES[category];
|
|
13722
|
+
return {
|
|
13723
|
+
...classification,
|
|
13724
|
+
description: `${classification.description}: ${errorMessage.slice(0, 100)}`
|
|
13725
|
+
};
|
|
13726
|
+
}
|
|
13727
|
+
}
|
|
13728
|
+
}
|
|
13729
|
+
const unknownClassification = CLASSIFICATION_RULES[ErrorCategory2.UNKNOWN];
|
|
13730
|
+
return {
|
|
13731
|
+
...unknownClassification,
|
|
13732
|
+
description: `${unknownClassification.description}: ${errorMessage.slice(0, 100)}`
|
|
13733
|
+
};
|
|
13734
|
+
}
|
|
13735
|
+
function getRetryConfigFromClassification(classification) {
|
|
13736
|
+
return {
|
|
13737
|
+
maxAttempts: classification.maxAttempts,
|
|
13738
|
+
initialDelayMs: classification.baseDelayMs,
|
|
13739
|
+
maxDelayMs: classification.maxDelayMs,
|
|
13740
|
+
backoffMultiplier: RETRY_STRATEGIES[classification.retryStrategy].multiplier,
|
|
13741
|
+
retryableErrors: ["*"]
|
|
13742
|
+
// Classification already determined retryability
|
|
13743
|
+
};
|
|
13744
|
+
}
|
|
13745
|
+
function analyzeError(error) {
|
|
13746
|
+
const classification = classifyError(error);
|
|
13747
|
+
return {
|
|
13748
|
+
...classification,
|
|
13749
|
+
originalError: error,
|
|
13750
|
+
errorMessage: error?.message || error?.toString() || "Unknown error",
|
|
13751
|
+
errorStack: error?.stack,
|
|
13752
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
13753
|
+
retryConfig: getRetryConfigFromClassification(classification)
|
|
13754
|
+
};
|
|
13755
|
+
}
|
|
13756
|
+
function createErrorReport(error) {
|
|
13757
|
+
const analysis = analyzeError(error);
|
|
13758
|
+
const report = [
|
|
13759
|
+
`\u{1F50D} Error Analysis Report`,
|
|
13760
|
+
`=====================================`,
|
|
13761
|
+
`Category: ${analysis.category.toUpperCase()}`,
|
|
13762
|
+
`Retryable: ${analysis.isRetryable ? "\u2705 Yes" : "\u274C No"}`,
|
|
13763
|
+
`Strategy: ${analysis.retryStrategy}`,
|
|
13764
|
+
`Max Attempts: ${analysis.maxAttempts}`,
|
|
13765
|
+
`Description: ${analysis.description}`,
|
|
13766
|
+
`Timestamp: ${analysis.timestamp}`,
|
|
13767
|
+
``,
|
|
13768
|
+
`Original Error: ${analysis.errorMessage}`,
|
|
13769
|
+
``
|
|
13770
|
+
];
|
|
13771
|
+
if (analysis.troubleshooting && analysis.troubleshooting.length > 0) {
|
|
13772
|
+
report.push(`\u{1F6E0}\uFE0F Troubleshooting Steps:`);
|
|
13773
|
+
analysis.troubleshooting.forEach((step, index) => {
|
|
13774
|
+
report.push(` ${index + 1}. ${step}`);
|
|
13775
|
+
});
|
|
13776
|
+
report.push("");
|
|
13777
|
+
}
|
|
13778
|
+
return report.join("\n");
|
|
13779
|
+
}
|
|
13780
|
+
exports.litProtocolErrors = {
|
|
13781
|
+
isNetworkError: (error) => classifyError(error).category === ErrorCategory2.NETWORK,
|
|
13782
|
+
isProtocolError: (error) => classifyError(error).category === ErrorCategory2.PROTOCOL,
|
|
13783
|
+
isAuthenticationError: (error) => classifyError(error).category === ErrorCategory2.AUTHENTICATION,
|
|
13784
|
+
isResourceError: (error) => classifyError(error).category === ErrorCategory2.RESOURCE,
|
|
13785
|
+
isTimeoutError: (error) => classifyError(error).category === ErrorCategory2.TIMEOUT,
|
|
13786
|
+
isRateLimitError: (error) => classifyError(error).category === ErrorCategory2.RATE_LIMIT,
|
|
13787
|
+
isConfigurationError: (error) => classifyError(error).category === ErrorCategory2.CONFIGURATION,
|
|
13788
|
+
isRetryable: (error) => classifyError(error).isRetryable
|
|
13789
|
+
};
|
|
13790
|
+
}
|
|
13791
|
+
});
|
|
13792
|
+
|
|
13793
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/session-signature-cache.js
|
|
13794
|
+
var require_session_signature_cache = __commonJS({
|
|
13795
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/session-signature-cache.js"(exports) {
|
|
13796
|
+
"use strict";
|
|
13797
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13798
|
+
exports.sessionSignatureCache = exports.DEFAULT_CACHE_CONFIG = void 0;
|
|
13799
|
+
exports.generateSessionSignaturesWithCache = generateSessionSignaturesWithCache;
|
|
13800
|
+
exports.configureSessionSignatureCache = configureSessionSignatureCache;
|
|
13801
|
+
exports.clearSessionSignatureCache = clearSessionSignatureCache;
|
|
13802
|
+
exports.getSessionSignatureCacheStats = getSessionSignatureCacheStats;
|
|
13803
|
+
var debug_logger_1 = require_debug_logger();
|
|
13804
|
+
exports.DEFAULT_CACHE_CONFIG = {
|
|
13805
|
+
maxEntries: 50,
|
|
13806
|
+
bufferTimeMs: 6e4,
|
|
13807
|
+
// 1 minute buffer before expiration
|
|
13808
|
+
enableLogging: true
|
|
13809
|
+
};
|
|
13810
|
+
var SessionSignatureCache = class {
|
|
13811
|
+
constructor(config = {}) {
|
|
13812
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
13813
|
+
this.config = { ...exports.DEFAULT_CACHE_CONFIG, ...config };
|
|
13814
|
+
}
|
|
13815
|
+
/**
|
|
13816
|
+
* Generate cache key from PKP and context
|
|
13817
|
+
*/
|
|
13818
|
+
generateCacheKey(pkpTokenId, litActionCid, signerAddress, network) {
|
|
13819
|
+
return `${signerAddress}-${network}-${pkpTokenId}-${litActionCid}`;
|
|
13820
|
+
}
|
|
13821
|
+
/**
|
|
13822
|
+
* Check if cache entry is still valid
|
|
13823
|
+
*/
|
|
13824
|
+
isEntryValid(entry) {
|
|
13825
|
+
const now2 = /* @__PURE__ */ new Date();
|
|
13826
|
+
const expirationWithBuffer = new Date(entry.expiration.getTime() - this.config.bufferTimeMs);
|
|
13827
|
+
return now2 < expirationWithBuffer;
|
|
13828
|
+
}
|
|
13829
|
+
/**
|
|
13830
|
+
* Clean expired entries from cache
|
|
13831
|
+
*/
|
|
13832
|
+
cleanExpiredEntries() {
|
|
13833
|
+
const now2 = /* @__PURE__ */ new Date();
|
|
13834
|
+
let cleanedCount = 0;
|
|
13835
|
+
for (const [key2, entry] of this.cache.entries()) {
|
|
13836
|
+
if (now2 >= entry.expiration) {
|
|
13837
|
+
this.cache.delete(key2);
|
|
13838
|
+
cleanedCount++;
|
|
13839
|
+
}
|
|
13840
|
+
}
|
|
13841
|
+
if (cleanedCount > 0 && this.config.enableLogging) {
|
|
13842
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F9F9} Cleaned ${cleanedCount} expired session signature entries`);
|
|
13843
|
+
}
|
|
13844
|
+
}
|
|
13845
|
+
/**
|
|
13846
|
+
* Enforce cache size limits
|
|
13847
|
+
*/
|
|
13848
|
+
enforceCacheSize() {
|
|
13849
|
+
if (this.cache.size <= this.config.maxEntries) {
|
|
13850
|
+
return;
|
|
13851
|
+
}
|
|
13852
|
+
const entries = Array.from(this.cache.entries()).sort(([, a], [, b]) => a.createdAt.getTime() - b.createdAt.getTime());
|
|
13853
|
+
const toRemove = entries.slice(0, this.cache.size - this.config.maxEntries);
|
|
13854
|
+
for (const [key2] of toRemove) {
|
|
13855
|
+
this.cache.delete(key2);
|
|
13856
|
+
}
|
|
13857
|
+
if (this.config.enableLogging) {
|
|
13858
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F4E6} Removed ${toRemove.length} oldest cache entries to maintain size limit`);
|
|
13859
|
+
}
|
|
13860
|
+
}
|
|
13861
|
+
/**
|
|
13862
|
+
* Get cached session signatures if valid
|
|
13863
|
+
*/
|
|
13864
|
+
get(pkpTokenId, litActionCid, signerAddress, network) {
|
|
13865
|
+
this.cleanExpiredEntries();
|
|
13866
|
+
const cacheKey = this.generateCacheKey(pkpTokenId, litActionCid, signerAddress, network);
|
|
13867
|
+
const entry = this.cache.get(cacheKey);
|
|
13868
|
+
if (!entry) {
|
|
13869
|
+
if (this.config.enableLogging) {
|
|
13870
|
+
(0, debug_logger_1.debugLog)("CACHE", `\u274C Session signatures cache miss: ${cacheKey}`);
|
|
13871
|
+
}
|
|
13872
|
+
return null;
|
|
13873
|
+
}
|
|
13874
|
+
if (!this.isEntryValid(entry)) {
|
|
13875
|
+
this.cache.delete(cacheKey);
|
|
13876
|
+
if (this.config.enableLogging) {
|
|
13877
|
+
(0, debug_logger_1.debugWarn)("CACHE", `\u23F0 Session signatures expired: ${cacheKey}`);
|
|
13878
|
+
}
|
|
13879
|
+
return null;
|
|
13880
|
+
}
|
|
13881
|
+
if (this.config.enableLogging) {
|
|
13882
|
+
const timeUntilExpiry = entry.expiration.getTime() - Date.now();
|
|
13883
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u2705 Session signatures cache hit: ${cacheKey} (expires in ${Math.round(timeUntilExpiry / 1e3)}s)`);
|
|
13884
|
+
}
|
|
13885
|
+
return entry.sessionSigs;
|
|
13886
|
+
}
|
|
13887
|
+
/**
|
|
13888
|
+
* Cache session signatures
|
|
13889
|
+
*/
|
|
13890
|
+
set(pkpTokenId, litActionCid, signerAddress, network, sessionSigs, expiration) {
|
|
13891
|
+
const cacheKey = this.generateCacheKey(pkpTokenId, litActionCid, signerAddress, network);
|
|
13892
|
+
const entry = {
|
|
13893
|
+
sessionSigs,
|
|
13894
|
+
expiration,
|
|
13895
|
+
pkpTokenId,
|
|
13896
|
+
litActionCid,
|
|
13897
|
+
signerAddress,
|
|
13898
|
+
network,
|
|
13899
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
13900
|
+
};
|
|
13901
|
+
this.cache.set(cacheKey, entry);
|
|
13902
|
+
if (this.config.enableLogging) {
|
|
13903
|
+
const timeUntilExpiry = expiration.getTime() - Date.now();
|
|
13904
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F4BE} Cached session signatures: ${cacheKey} (expires in ${Math.round(timeUntilExpiry / 1e3)}s)`);
|
|
13905
|
+
}
|
|
13906
|
+
this.enforceCacheSize();
|
|
13907
|
+
}
|
|
13908
|
+
/**
|
|
13909
|
+
* Clear all cached session signatures
|
|
13910
|
+
*/
|
|
13911
|
+
clear() {
|
|
13912
|
+
const size = this.cache.size;
|
|
13913
|
+
this.cache.clear();
|
|
13914
|
+
if (this.config.enableLogging) {
|
|
13915
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F5D1}\uFE0F Cleared ${size} cached session signature entries`);
|
|
13916
|
+
}
|
|
13917
|
+
}
|
|
13918
|
+
/**
|
|
13919
|
+
* Get cache statistics
|
|
13920
|
+
*/
|
|
13921
|
+
getStats() {
|
|
13922
|
+
this.cleanExpiredEntries();
|
|
13923
|
+
return {
|
|
13924
|
+
size: this.cache.size,
|
|
13925
|
+
maxEntries: this.config.maxEntries,
|
|
13926
|
+
utilizationPercent: Math.round(this.cache.size / this.config.maxEntries * 100)
|
|
13927
|
+
};
|
|
13928
|
+
}
|
|
13929
|
+
/**
|
|
13930
|
+
* Remove specific cache entry
|
|
13931
|
+
*/
|
|
13932
|
+
delete(pkpTokenId, litActionCid, signerAddress, network) {
|
|
13933
|
+
const cacheKey = this.generateCacheKey(pkpTokenId, litActionCid, signerAddress, network);
|
|
13934
|
+
const deleted = this.cache.delete(cacheKey);
|
|
13935
|
+
if (deleted && this.config.enableLogging) {
|
|
13936
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F5D1}\uFE0F Removed session signatures from cache: ${cacheKey}`);
|
|
13937
|
+
}
|
|
13938
|
+
return deleted;
|
|
13939
|
+
}
|
|
13940
|
+
};
|
|
13941
|
+
exports.sessionSignatureCache = new SessionSignatureCache();
|
|
13942
|
+
async function generateSessionSignaturesWithCache(litNodeClient, sessionConfig, pkpTokenId, litActionCid, signerAddress, network = "chipotle") {
|
|
13943
|
+
const cached = exports.sessionSignatureCache.get(pkpTokenId, litActionCid, signerAddress, network);
|
|
13944
|
+
if (cached) {
|
|
13945
|
+
return cached;
|
|
13946
|
+
}
|
|
13947
|
+
(0, debug_logger_1.debugInfo)("CACHE", "\u{1F510} Generating new session signatures (cache miss)...");
|
|
13948
|
+
const sessionSigs = await litNodeClient.getSessionSigs(sessionConfig);
|
|
13949
|
+
const expiration = new Date(sessionConfig.expiration);
|
|
13950
|
+
exports.sessionSignatureCache.set(pkpTokenId, litActionCid, signerAddress, network, sessionSigs, expiration);
|
|
13951
|
+
const sigCount = Object.keys(sessionSigs).length;
|
|
13952
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u2705 Generated and cached ${sigCount} session signatures`);
|
|
13953
|
+
return sessionSigs;
|
|
13954
|
+
}
|
|
13955
|
+
function configureSessionSignatureCache(config) {
|
|
13956
|
+
Object.assign(exports.sessionSignatureCache["config"], config);
|
|
13957
|
+
}
|
|
13958
|
+
function clearSessionSignatureCache() {
|
|
13959
|
+
exports.sessionSignatureCache.clear();
|
|
13960
|
+
}
|
|
13961
|
+
function getSessionSignatureCacheStats() {
|
|
13962
|
+
return exports.sessionSignatureCache.getStats();
|
|
13963
|
+
}
|
|
13964
|
+
}
|
|
13965
|
+
});
|
|
13966
|
+
|
|
13967
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/connection-helpers.js
|
|
13968
|
+
var require_connection_helpers = __commonJS({
|
|
13969
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/connection-helpers.js"(exports) {
|
|
13970
|
+
"use strict";
|
|
13971
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
13972
|
+
if (k2 === void 0)
|
|
13973
|
+
k2 = k;
|
|
13974
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13975
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13976
|
+
desc = { enumerable: true, get: function() {
|
|
13977
|
+
return m[k];
|
|
13978
|
+
} };
|
|
13979
|
+
}
|
|
13980
|
+
Object.defineProperty(o, k2, desc);
|
|
13981
|
+
} : function(o, m, k, k2) {
|
|
13982
|
+
if (k2 === void 0)
|
|
13983
|
+
k2 = k;
|
|
13984
|
+
o[k2] = m[k];
|
|
13985
|
+
});
|
|
13986
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
13987
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
13988
|
+
} : function(o, v) {
|
|
13989
|
+
o["default"] = v;
|
|
13990
|
+
});
|
|
13991
|
+
var __importStar = exports && exports.__importStar || function() {
|
|
13992
|
+
var ownKeys = function(o) {
|
|
13993
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
13994
|
+
var ar = [];
|
|
13995
|
+
for (var k in o2)
|
|
13996
|
+
if (Object.prototype.hasOwnProperty.call(o2, k))
|
|
13997
|
+
ar[ar.length] = k;
|
|
13998
|
+
return ar;
|
|
13999
|
+
};
|
|
14000
|
+
return ownKeys(o);
|
|
14001
|
+
};
|
|
14002
|
+
return function(mod) {
|
|
14003
|
+
if (mod && mod.__esModule)
|
|
14004
|
+
return mod;
|
|
14005
|
+
var result = {};
|
|
14006
|
+
if (mod != null) {
|
|
14007
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
14008
|
+
if (k[i] !== "default")
|
|
14009
|
+
__createBinding(result, mod, k[i]);
|
|
14010
|
+
}
|
|
14011
|
+
__setModuleDefault(result, mod);
|
|
14012
|
+
return result;
|
|
14013
|
+
};
|
|
14014
|
+
}();
|
|
14015
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14016
|
+
exports.NETWORK_TIMEOUTS = exports.DEFAULT_RETRY_CONFIG = void 0;
|
|
14017
|
+
exports.sleep = sleep;
|
|
14018
|
+
exports.isRetryableError = isRetryableError;
|
|
14019
|
+
exports.calculateDelay = calculateDelay;
|
|
14020
|
+
exports.withRetry = withRetry;
|
|
14021
|
+
exports.connectLitNodeClient = connectLitNodeClient;
|
|
14022
|
+
exports.connectLitContracts = connectLitContracts;
|
|
14023
|
+
exports.validateLitNodeConnection = validateLitNodeConnection;
|
|
14024
|
+
exports.generateSessionSignatures = generateSessionSignatures;
|
|
14025
|
+
exports.validateLitNodeReadiness = validateLitNodeReadiness;
|
|
14026
|
+
exports.executeLitAction = executeLitAction;
|
|
14027
|
+
exports.executePkpOperation = executePkpOperation;
|
|
14028
|
+
exports.getNetworkTimeouts = getNetworkTimeouts;
|
|
14029
|
+
var debug_logger_1 = require_debug_logger();
|
|
14030
|
+
var error_classification_1 = require_error_classification();
|
|
14031
|
+
exports.DEFAULT_RETRY_CONFIG = {
|
|
14032
|
+
maxAttempts: 5,
|
|
14033
|
+
// Increased from 3 for PKP operations
|
|
14034
|
+
initialDelayMs: 2e3,
|
|
14035
|
+
// Increased from 1000ms for PKP operations
|
|
14036
|
+
maxDelayMs: 6e4,
|
|
14037
|
+
// Increased from 30000ms for PKP operations
|
|
14038
|
+
backoffMultiplier: 2,
|
|
14039
|
+
retryableErrors: [
|
|
14040
|
+
"request_timeout",
|
|
14041
|
+
"network error",
|
|
14042
|
+
"connection failed",
|
|
14043
|
+
"ENOTFOUND",
|
|
14044
|
+
"ECONNREFUSED",
|
|
14045
|
+
"ETIMEDOUT",
|
|
14046
|
+
"socket hang up",
|
|
14047
|
+
"timeout",
|
|
14048
|
+
// PKP-specific errors
|
|
14049
|
+
"signing shares",
|
|
14050
|
+
"There was an error getting the signing shares",
|
|
14051
|
+
"PKP validation",
|
|
14052
|
+
"pkp validation failed",
|
|
14053
|
+
"resource validation",
|
|
14054
|
+
"ipfs propagation",
|
|
14055
|
+
"session.*expired",
|
|
14056
|
+
"NodeError",
|
|
14057
|
+
"Response from the nodes",
|
|
14058
|
+
"consensus",
|
|
14059
|
+
"threshold"
|
|
14060
|
+
]
|
|
14061
|
+
};
|
|
14062
|
+
function sleep(ms) {
|
|
14063
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
14064
|
+
}
|
|
14065
|
+
function isRetryableError(error, retryableErrors = exports.DEFAULT_RETRY_CONFIG.retryableErrors) {
|
|
14066
|
+
if (!error)
|
|
14067
|
+
return false;
|
|
14068
|
+
const classification = (0, error_classification_1.classifyError)(error);
|
|
14069
|
+
if (classification.isRetryable !== void 0) {
|
|
14070
|
+
(0, debug_logger_1.debugInfo)("ERROR_CLASSIFICATION", `Error classified as: ${classification.category} (retryable: ${classification.isRetryable})`);
|
|
14071
|
+
return classification.isRetryable;
|
|
14072
|
+
}
|
|
14073
|
+
const errorMessage = error.message || error.toString() || "";
|
|
14074
|
+
const errorLower = errorMessage.toLowerCase();
|
|
14075
|
+
return retryableErrors.some((pattern) => errorLower.includes(pattern.toLowerCase()));
|
|
14076
|
+
}
|
|
14077
|
+
function calculateDelay(attempt, config) {
|
|
14078
|
+
const exponentialDelay = Math.min(config.initialDelayMs * Math.pow(config.backoffMultiplier, attempt - 1), config.maxDelayMs);
|
|
14079
|
+
const jitter = exponentialDelay * 0.25 * (Math.random() - 0.5);
|
|
14080
|
+
return Math.max(100, exponentialDelay + jitter);
|
|
14081
|
+
}
|
|
14082
|
+
async function withRetry(operation, config = {}, operationName = "operation") {
|
|
14083
|
+
let finalConfig = { ...exports.DEFAULT_RETRY_CONFIG, ...config };
|
|
14084
|
+
const tracker = new debug_logger_1.PerformanceTracker(`Retry ${operationName}`);
|
|
14085
|
+
let lastError;
|
|
14086
|
+
let errorClassification = null;
|
|
14087
|
+
for (let attempt = 1; attempt <= finalConfig.maxAttempts; attempt++) {
|
|
14088
|
+
try {
|
|
14089
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u{1F504} [${operationName}] Attempt ${attempt}/${finalConfig.maxAttempts}`);
|
|
14090
|
+
const startTime = Date.now();
|
|
14091
|
+
const result = await operation();
|
|
14092
|
+
const duration = Date.now() - startTime;
|
|
14093
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u2705 [${operationName}] Success after ${duration}ms (attempt ${attempt})`);
|
|
14094
|
+
debug_logger_1.networkMetrics.recordRequest(operationName, true, duration);
|
|
14095
|
+
tracker.end(true);
|
|
14096
|
+
return result;
|
|
14097
|
+
} catch (error) {
|
|
14098
|
+
lastError = error;
|
|
14099
|
+
const errorMessage = error?.message || error?.toString() || "Unknown error";
|
|
14100
|
+
errorClassification = (0, error_classification_1.classifyError)(error);
|
|
14101
|
+
if (attempt === 1 && errorClassification) {
|
|
14102
|
+
const intelligentConfig = (0, error_classification_1.getRetryConfigFromClassification)(errorClassification);
|
|
14103
|
+
finalConfig = {
|
|
14104
|
+
...finalConfig,
|
|
14105
|
+
...intelligentConfig,
|
|
14106
|
+
maxAttempts: Math.min(finalConfig.maxAttempts, intelligentConfig.maxAttempts)
|
|
14107
|
+
};
|
|
14108
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u{1F9E0} Intelligent retry strategy applied: ${errorClassification.category} (${errorClassification.retryStrategy})`);
|
|
14109
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u{1F4CA} Adjusted config: max=${finalConfig.maxAttempts}, delay=${finalConfig.initialDelayMs}ms`);
|
|
14110
|
+
}
|
|
14111
|
+
(0, debug_logger_1.debugWarn)("RETRY", `\u26A0\uFE0F [${operationName}] Attempt ${attempt} failed:`, {
|
|
14112
|
+
error: errorMessage,
|
|
14113
|
+
attempt,
|
|
14114
|
+
category: errorClassification.category,
|
|
14115
|
+
retryable: errorClassification.isRetryable
|
|
14116
|
+
});
|
|
14117
|
+
debug_logger_1.networkMetrics.recordRequest(operationName, false, 0, errorMessage);
|
|
14118
|
+
if (attempt >= finalConfig.maxAttempts) {
|
|
14119
|
+
(0, debug_logger_1.debugError)("RETRY", `\u274C [${operationName}] All attempts failed. Last error:`, { error: errorMessage });
|
|
14120
|
+
if (errorClassification) {
|
|
14121
|
+
const errorReport = (0, error_classification_1.createErrorReport)(error);
|
|
14122
|
+
(0, debug_logger_1.debugError)("RETRY", `\u{1F4CB} Error Analysis Report:
|
|
14123
|
+
${errorReport}`);
|
|
14124
|
+
}
|
|
14125
|
+
tracker.end(false);
|
|
14126
|
+
break;
|
|
14127
|
+
}
|
|
14128
|
+
if (!errorClassification.isRetryable) {
|
|
14129
|
+
(0, debug_logger_1.debugError)("RETRY", `\u{1F6AB} [${operationName}] Non-retryable error (${errorClassification.category}):`, { error: errorMessage });
|
|
14130
|
+
if (errorClassification.troubleshooting) {
|
|
14131
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u{1F4A1} Troubleshooting suggestions:
|
|
14132
|
+
${errorClassification.troubleshooting.join("\n ")}`);
|
|
14133
|
+
}
|
|
14134
|
+
tracker.end(false);
|
|
14135
|
+
break;
|
|
14136
|
+
}
|
|
14137
|
+
const delayMs = calculateDelay(attempt, finalConfig);
|
|
14138
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u23F3 [${operationName}] Waiting ${delayMs}ms before retry... (${errorClassification.retryStrategy} strategy)`);
|
|
14139
|
+
await sleep(delayMs);
|
|
14140
|
+
}
|
|
14141
|
+
}
|
|
14142
|
+
throw lastError;
|
|
14143
|
+
}
|
|
14144
|
+
async function connectLitNodeClient(litNodeClient, config = {}) {
|
|
14145
|
+
const network = litNodeClient?.config?.litNetwork || "unknown";
|
|
14146
|
+
return withRetry(async () => {
|
|
14147
|
+
if (!litNodeClient) {
|
|
14148
|
+
throw new Error("LIT Node Client is null or undefined");
|
|
14149
|
+
}
|
|
14150
|
+
const startTime = Date.now();
|
|
14151
|
+
(0, debug_logger_1.logConnectionAttempt)(network, 1, config.maxAttempts || exports.DEFAULT_RETRY_CONFIG.maxAttempts);
|
|
14152
|
+
await litNodeClient.connect();
|
|
14153
|
+
(0, debug_logger_1.debugInfo)("CONNECTION", `\u23F3 Waiting for LIT Node Client to be ready...`);
|
|
14154
|
+
const readyTimeout = 3e4;
|
|
14155
|
+
const readyStartTime = Date.now();
|
|
14156
|
+
while (!litNodeClient.ready && Date.now() - readyStartTime < readyTimeout) {
|
|
14157
|
+
await sleep(500);
|
|
14158
|
+
}
|
|
14159
|
+
if (!litNodeClient.ready) {
|
|
14160
|
+
throw new Error(`LIT Node Client failed to become ready within ${readyTimeout}ms`);
|
|
14161
|
+
}
|
|
14162
|
+
const latency = Date.now() - startTime;
|
|
14163
|
+
(0, debug_logger_1.debugInfo)("CONNECTION", `\u2705 LIT Node Client is ready (${litNodeClient.ready})`);
|
|
14164
|
+
(0, debug_logger_1.logConnectionSuccess)(network, latency);
|
|
14165
|
+
}, config, "LIT Node Client Connection");
|
|
14166
|
+
}
|
|
14167
|
+
async function connectLitContracts(litContracts, config = {}) {
|
|
14168
|
+
return withRetry(async () => {
|
|
14169
|
+
if (!litContracts) {
|
|
14170
|
+
throw new Error("LIT Contracts is null or undefined");
|
|
14171
|
+
}
|
|
14172
|
+
console.log(`\u{1F517} Connecting to LIT Contracts: ${litContracts.network || "unknown"}`);
|
|
14173
|
+
await litContracts.connect();
|
|
14174
|
+
console.log("\u2705 LIT Contracts connected successfully");
|
|
14175
|
+
}, config, "LIT Contracts Connection");
|
|
14176
|
+
}
|
|
14177
|
+
async function validateLitNodeConnection(litNodeClient) {
|
|
14178
|
+
try {
|
|
14179
|
+
const startTime = Date.now();
|
|
14180
|
+
if (!litNodeClient) {
|
|
14181
|
+
return { isValid: false, error: "LIT Node Client is null or undefined" };
|
|
14182
|
+
}
|
|
14183
|
+
await litNodeClient.getLatestBlockhash();
|
|
14184
|
+
const latencyMs = Date.now() - startTime;
|
|
14185
|
+
return { isValid: true, latencyMs };
|
|
14186
|
+
} catch (error) {
|
|
14187
|
+
return {
|
|
14188
|
+
isValid: false,
|
|
14189
|
+
error: error?.message || error?.toString() || "Unknown validation error"
|
|
14190
|
+
};
|
|
14191
|
+
}
|
|
14192
|
+
}
|
|
14193
|
+
async function generateSessionSignatures(litNodeClient, sessionConfig, config = {}, pkpTokenId, litActionCid, signerAddress, network = "chipotle") {
|
|
14194
|
+
if (pkpTokenId && litActionCid && signerAddress) {
|
|
14195
|
+
const { sessionSignatureCache } = await Promise.resolve().then(() => __importStar(require_session_signature_cache()));
|
|
14196
|
+
const cached = sessionSignatureCache.get(pkpTokenId, litActionCid, signerAddress, network);
|
|
14197
|
+
if (cached) {
|
|
14198
|
+
const sigCount = Object.keys(cached).length;
|
|
14199
|
+
(0, debug_logger_1.debugInfo)("SESSION", `\u{1F504} Using cached session signatures (${sigCount} sigs)`);
|
|
14200
|
+
return cached;
|
|
14201
|
+
}
|
|
14202
|
+
}
|
|
14203
|
+
return withRetry(async () => {
|
|
14204
|
+
(0, debug_logger_1.debugInfo)("SESSION", "\u{1F510} Generating new session signatures...");
|
|
14205
|
+
const sessionSigs = await litNodeClient.getSessionSigs(sessionConfig);
|
|
14206
|
+
const sigCount = Object.keys(sessionSigs).length;
|
|
14207
|
+
if (pkpTokenId && litActionCid && signerAddress) {
|
|
14208
|
+
const { sessionSignatureCache } = await Promise.resolve().then(() => __importStar(require_session_signature_cache()));
|
|
14209
|
+
const expiration = new Date(sessionConfig.expiration);
|
|
14210
|
+
sessionSignatureCache.set(pkpTokenId, litActionCid, signerAddress, network, sessionSigs, expiration);
|
|
14211
|
+
}
|
|
14212
|
+
(0, debug_logger_1.debugInfo)("SESSION", `\u2705 Generated ${sigCount} session signatures`);
|
|
14213
|
+
return sessionSigs;
|
|
14214
|
+
}, config, "Session Signature Generation");
|
|
14215
|
+
}
|
|
14216
|
+
async function validateLitNodeReadiness(litNodeClient) {
|
|
14217
|
+
if (!litNodeClient) {
|
|
14218
|
+
throw new Error("LIT Node Client is null or undefined");
|
|
14219
|
+
}
|
|
14220
|
+
if (!litNodeClient.ready) {
|
|
14221
|
+
(0, debug_logger_1.debugWarn)("CONNECTION", "\u26A0\uFE0F LIT Node Client not ready, attempting to reconnect...");
|
|
14222
|
+
await litNodeClient.connect();
|
|
14223
|
+
const readyTimeout = 15e3;
|
|
14224
|
+
const startTime = Date.now();
|
|
14225
|
+
while (!litNodeClient.ready && Date.now() - startTime < readyTimeout) {
|
|
14226
|
+
await sleep(500);
|
|
14227
|
+
}
|
|
14228
|
+
if (!litNodeClient.ready) {
|
|
14229
|
+
throw new Error("LIT Node Client is not ready for operations");
|
|
14230
|
+
}
|
|
14231
|
+
}
|
|
14232
|
+
(0, debug_logger_1.debugInfo)("CONNECTION", "\u2705 LIT Node Client readiness validated");
|
|
14233
|
+
}
|
|
14234
|
+
async function executeLitAction(litNodeClient, executionConfig, config = {}) {
|
|
14235
|
+
const cid = executionConfig.ipfsId;
|
|
14236
|
+
return withRetry(async () => {
|
|
14237
|
+
const startTime = Date.now();
|
|
14238
|
+
await validateLitNodeReadiness(litNodeClient);
|
|
14239
|
+
(0, debug_logger_1.logLitActionExecution)(cid, executionConfig.jsParams);
|
|
14240
|
+
(0, debug_logger_1.logRequest)("LIT_ACTION", "executeJs", executionConfig);
|
|
14241
|
+
const result = await litNodeClient.executeJs(executionConfig);
|
|
14242
|
+
const duration = Date.now() - startTime;
|
|
14243
|
+
if (!result.response) {
|
|
14244
|
+
(0, debug_logger_1.logError)("LIT_ACTION", "executeJs", new Error("No response from LIT Action"), duration);
|
|
14245
|
+
throw new Error("No response from LIT Action");
|
|
14246
|
+
}
|
|
14247
|
+
(0, debug_logger_1.logResponse)("LIT_ACTION", "executeJs", result, duration);
|
|
14248
|
+
(0, debug_logger_1.logLitActionResult)(cid, true, duration, result);
|
|
14249
|
+
return result;
|
|
14250
|
+
}, config, "LIT Action Execution");
|
|
14251
|
+
}
|
|
14252
|
+
async function executePkpOperation(operation, operationName, config = {}) {
|
|
14253
|
+
const pkpConfig = {
|
|
14254
|
+
...exports.DEFAULT_RETRY_CONFIG,
|
|
14255
|
+
...config,
|
|
14256
|
+
retryableErrors: [
|
|
14257
|
+
...exports.DEFAULT_RETRY_CONFIG.retryableErrors,
|
|
14258
|
+
"pkp validation",
|
|
14259
|
+
"signing shares",
|
|
14260
|
+
"resource validation",
|
|
14261
|
+
"ipfs propagation"
|
|
14262
|
+
]
|
|
14263
|
+
};
|
|
14264
|
+
return withRetry(operation, pkpConfig, `PKP ${operationName}`);
|
|
14265
|
+
}
|
|
14266
|
+
exports.NETWORK_TIMEOUTS = {
|
|
14267
|
+
chipotle: {
|
|
14268
|
+
connection: 6e4,
|
|
14269
|
+
operation: 12e4,
|
|
14270
|
+
pkpValidation: 18e4
|
|
14271
|
+
}
|
|
14272
|
+
};
|
|
14273
|
+
function getNetworkTimeouts(network) {
|
|
14274
|
+
return exports.NETWORK_TIMEOUTS[network] || exports.NETWORK_TIMEOUTS["chipotle"];
|
|
14275
|
+
}
|
|
14276
|
+
}
|
|
14277
|
+
});
|
|
14278
|
+
|
|
14279
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/index.js
|
|
14280
|
+
var require_utils4 = __commonJS({
|
|
14281
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/index.js"(exports) {
|
|
14282
|
+
"use strict";
|
|
14283
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
14284
|
+
if (k2 === void 0)
|
|
14285
|
+
k2 = k;
|
|
14286
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14287
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14288
|
+
desc = { enumerable: true, get: function() {
|
|
14289
|
+
return m[k];
|
|
14290
|
+
} };
|
|
14291
|
+
}
|
|
14292
|
+
Object.defineProperty(o, k2, desc);
|
|
14293
|
+
} : function(o, m, k, k2) {
|
|
14294
|
+
if (k2 === void 0)
|
|
14295
|
+
k2 = k;
|
|
14296
|
+
o[k2] = m[k];
|
|
14297
|
+
});
|
|
14298
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
14299
|
+
for (var p in m)
|
|
14300
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
14301
|
+
__createBinding(exports2, m, p);
|
|
14302
|
+
};
|
|
14303
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14304
|
+
__exportStar(require_lit_action_helpers(), exports);
|
|
14305
|
+
__exportStar(require_pkp_setup(), exports);
|
|
14306
|
+
__exportStar(require_cid_utils(), exports);
|
|
14307
|
+
__exportStar(require_connection_helpers(), exports);
|
|
14308
|
+
__exportStar(require_debug_logger(), exports);
|
|
14309
|
+
__exportStar(require_error_classification(), exports);
|
|
14310
|
+
__exportStar(require_session_signature_cache(), exports);
|
|
14311
|
+
}
|
|
14312
|
+
});
|
|
14313
|
+
|
|
14314
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/index.js
|
|
14315
|
+
var require_pkg_src = __commonJS({
|
|
14316
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/index.js"(exports) {
|
|
14317
|
+
"use strict";
|
|
14318
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
14319
|
+
if (k2 === void 0)
|
|
14320
|
+
k2 = k;
|
|
14321
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14322
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14323
|
+
desc = { enumerable: true, get: function() {
|
|
14324
|
+
return m[k];
|
|
14325
|
+
} };
|
|
14326
|
+
}
|
|
14327
|
+
Object.defineProperty(o, k2, desc);
|
|
14328
|
+
} : function(o, m, k, k2) {
|
|
14329
|
+
if (k2 === void 0)
|
|
14330
|
+
k2 = k;
|
|
14331
|
+
o[k2] = m[k];
|
|
14332
|
+
});
|
|
14333
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
14334
|
+
for (var p in m)
|
|
14335
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
14336
|
+
__createBinding(exports2, m, p);
|
|
14337
|
+
};
|
|
14338
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14339
|
+
exports.CHIPOTLE_DEPLOYMENTS = exports.DH_LIT_ACTIONS_CHIPOTLE = void 0;
|
|
14340
|
+
__exportStar(require_interfaces(), exports);
|
|
14341
|
+
__exportStar(require_lit_actions_registry(), exports);
|
|
14342
|
+
__exportStar(require_utils4(), exports);
|
|
14343
|
+
var lit_actions_registry_1 = require_lit_actions_registry();
|
|
14344
|
+
Object.defineProperty(exports, "DH_LIT_ACTIONS_CHIPOTLE", { enumerable: true, get: function() {
|
|
14345
|
+
return lit_actions_registry_1.DH_LIT_ACTIONS_CHIPOTLE;
|
|
14346
|
+
} });
|
|
14347
|
+
Object.defineProperty(exports, "CHIPOTLE_DEPLOYMENTS", { enumerable: true, get: function() {
|
|
14348
|
+
return lit_actions_registry_1.CHIPOTLE_DEPLOYMENTS;
|
|
14349
|
+
} });
|
|
14350
|
+
}
|
|
14351
|
+
});
|
|
14352
|
+
|
|
12688
14353
|
// src/constants/chunks/deployment-addresses.ts
|
|
12689
14354
|
var deployment_addresses_exports = {};
|
|
12690
14355
|
__export(deployment_addresses_exports, {
|
|
@@ -13424,10 +15089,10 @@ __export(ethers_exports, {
|
|
|
13424
15089
|
constants: () => lib_exports2,
|
|
13425
15090
|
errors: () => ErrorCode,
|
|
13426
15091
|
getDefaultProvider: () => getDefaultProvider,
|
|
13427
|
-
logger: () =>
|
|
15092
|
+
logger: () => logger47,
|
|
13428
15093
|
providers: () => lib_exports4,
|
|
13429
15094
|
utils: () => utils_exports,
|
|
13430
|
-
version: () =>
|
|
15095
|
+
version: () => version26,
|
|
13431
15096
|
wordlists: () => wordlists
|
|
13432
15097
|
});
|
|
13433
15098
|
|
|
@@ -13500,10 +15165,10 @@ var ErrorCode;
|
|
|
13500
15165
|
})(ErrorCode || (ErrorCode = {}));
|
|
13501
15166
|
var HEX = "0123456789abcdef";
|
|
13502
15167
|
var Logger = class _Logger {
|
|
13503
|
-
constructor(
|
|
15168
|
+
constructor(version27) {
|
|
13504
15169
|
Object.defineProperty(this, "version", {
|
|
13505
15170
|
enumerable: true,
|
|
13506
|
-
value:
|
|
15171
|
+
value: version27,
|
|
13507
15172
|
writable: false
|
|
13508
15173
|
});
|
|
13509
15174
|
}
|
|
@@ -13718,8 +15383,8 @@ var Logger = class _Logger {
|
|
|
13718
15383
|
}
|
|
13719
15384
|
_logLevel = level;
|
|
13720
15385
|
}
|
|
13721
|
-
static from(
|
|
13722
|
-
return new _Logger(
|
|
15386
|
+
static from(version27) {
|
|
15387
|
+
return new _Logger(version27);
|
|
13723
15388
|
}
|
|
13724
15389
|
};
|
|
13725
15390
|
Logger.errors = ErrorCode;
|
|
@@ -18383,10 +20048,10 @@ var Interface = class {
|
|
|
18383
20048
|
}
|
|
18384
20049
|
};
|
|
18385
20050
|
|
|
18386
|
-
// node_modules
|
|
20051
|
+
// node_modules/@ethersproject/abstract-provider/lib.esm/_version.js
|
|
18387
20052
|
var version10 = "abstract-provider/5.8.0";
|
|
18388
20053
|
|
|
18389
|
-
// node_modules
|
|
20054
|
+
// node_modules/@ethersproject/abstract-provider/lib.esm/index.js
|
|
18390
20055
|
var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
18391
20056
|
function adopt(value) {
|
|
18392
20057
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -21109,10 +22774,10 @@ function parse(rawTransaction) {
|
|
|
21109
22774
|
});
|
|
21110
22775
|
}
|
|
21111
22776
|
|
|
21112
|
-
// node_modules
|
|
22777
|
+
// node_modules/@ethersproject/contracts/lib.esm/_version.js
|
|
21113
22778
|
var version14 = "contracts/5.8.0";
|
|
21114
22779
|
|
|
21115
|
-
// node_modules
|
|
22780
|
+
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
21116
22781
|
var __awaiter5 = function(thisArg, _arguments, P, generator) {
|
|
21117
22782
|
function adopt(value) {
|
|
21118
22783
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -22047,73 +23712,6 @@ var ContractFactory = class {
|
|
|
22047
23712
|
}
|
|
22048
23713
|
};
|
|
22049
23714
|
|
|
22050
|
-
// node_modules/@ethersproject/wallet/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js
|
|
22051
|
-
var version15 = "abstract-provider/5.8.0";
|
|
22052
|
-
|
|
22053
|
-
// node_modules/@ethersproject/wallet/node_modules/@ethersproject/abstract-provider/lib.esm/index.js
|
|
22054
|
-
var __awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
22055
|
-
function adopt(value) {
|
|
22056
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
22057
|
-
resolve(value);
|
|
22058
|
-
});
|
|
22059
|
-
}
|
|
22060
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
22061
|
-
function fulfilled(value) {
|
|
22062
|
-
try {
|
|
22063
|
-
step(generator.next(value));
|
|
22064
|
-
} catch (e) {
|
|
22065
|
-
reject(e);
|
|
22066
|
-
}
|
|
22067
|
-
}
|
|
22068
|
-
function rejected(value) {
|
|
22069
|
-
try {
|
|
22070
|
-
step(generator["throw"](value));
|
|
22071
|
-
} catch (e) {
|
|
22072
|
-
reject(e);
|
|
22073
|
-
}
|
|
22074
|
-
}
|
|
22075
|
-
function step(result) {
|
|
22076
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
22077
|
-
}
|
|
22078
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22079
|
-
});
|
|
22080
|
-
};
|
|
22081
|
-
var logger20 = new Logger(version15);
|
|
22082
|
-
var Provider2 = class _Provider {
|
|
22083
|
-
constructor() {
|
|
22084
|
-
logger20.checkAbstract(new.target, _Provider);
|
|
22085
|
-
defineReadOnly(this, "_isProvider", true);
|
|
22086
|
-
}
|
|
22087
|
-
getFeeData() {
|
|
22088
|
-
return __awaiter6(this, void 0, void 0, function* () {
|
|
22089
|
-
const { block, gasPrice } = yield resolveProperties({
|
|
22090
|
-
block: this.getBlock("latest"),
|
|
22091
|
-
gasPrice: this.getGasPrice().catch((error) => {
|
|
22092
|
-
return null;
|
|
22093
|
-
})
|
|
22094
|
-
});
|
|
22095
|
-
let lastBaseFeePerGas = null, maxFeePerGas = null, maxPriorityFeePerGas = null;
|
|
22096
|
-
if (block && block.baseFeePerGas) {
|
|
22097
|
-
lastBaseFeePerGas = block.baseFeePerGas;
|
|
22098
|
-
maxPriorityFeePerGas = BigNumber.from("1500000000");
|
|
22099
|
-
maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas);
|
|
22100
|
-
}
|
|
22101
|
-
return { lastBaseFeePerGas, maxFeePerGas, maxPriorityFeePerGas, gasPrice };
|
|
22102
|
-
});
|
|
22103
|
-
}
|
|
22104
|
-
// Alias for "on"
|
|
22105
|
-
addListener(eventName, listener) {
|
|
22106
|
-
return this.on(eventName, listener);
|
|
22107
|
-
}
|
|
22108
|
-
// Alias for "off"
|
|
22109
|
-
removeListener(eventName, listener) {
|
|
22110
|
-
return this.off(eventName, listener);
|
|
22111
|
-
}
|
|
22112
|
-
static isProvider(value) {
|
|
22113
|
-
return !!(value && value._isProvider);
|
|
22114
|
-
}
|
|
22115
|
-
};
|
|
22116
|
-
|
|
22117
23715
|
// node_modules/@ethersproject/basex/lib.esm/index.js
|
|
22118
23716
|
var BaseX = class {
|
|
22119
23717
|
constructor(alphabet) {
|
|
@@ -22197,10 +23795,10 @@ var SupportedAlgorithm;
|
|
|
22197
23795
|
})(SupportedAlgorithm || (SupportedAlgorithm = {}));
|
|
22198
23796
|
|
|
22199
23797
|
// node_modules/@ethersproject/sha2/lib.esm/_version.js
|
|
22200
|
-
var
|
|
23798
|
+
var version15 = "sha2/5.8.0";
|
|
22201
23799
|
|
|
22202
23800
|
// node_modules/@ethersproject/sha2/lib.esm/sha2.js
|
|
22203
|
-
var
|
|
23801
|
+
var logger20 = new Logger(version15);
|
|
22204
23802
|
function ripemd160(data) {
|
|
22205
23803
|
return "0x" + import_hash3.default.ripemd160().update(arrayify(data)).digest("hex");
|
|
22206
23804
|
}
|
|
@@ -22212,7 +23810,7 @@ function sha512(data) {
|
|
|
22212
23810
|
}
|
|
22213
23811
|
function computeHmac(algorithm, key2, data) {
|
|
22214
23812
|
if (!SupportedAlgorithm[algorithm]) {
|
|
22215
|
-
|
|
23813
|
+
logger20.throwError("unsupported algorithm " + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
22216
23814
|
operation: "hmac",
|
|
22217
23815
|
algorithm
|
|
22218
23816
|
});
|
|
@@ -22257,14 +23855,14 @@ function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {
|
|
|
22257
23855
|
}
|
|
22258
23856
|
|
|
22259
23857
|
// node_modules/@ethersproject/wordlists/lib.esm/_version.js
|
|
22260
|
-
var
|
|
23858
|
+
var version16 = "wordlists/5.8.0";
|
|
22261
23859
|
|
|
22262
23860
|
// node_modules/@ethersproject/wordlists/lib.esm/wordlist.js
|
|
22263
23861
|
var exportWordlist = false;
|
|
22264
|
-
var
|
|
23862
|
+
var logger21 = new Logger(version16);
|
|
22265
23863
|
var Wordlist = class _Wordlist {
|
|
22266
23864
|
constructor(locale) {
|
|
22267
|
-
|
|
23865
|
+
logger21.checkAbstract(new.target, _Wordlist);
|
|
22268
23866
|
defineReadOnly(this, "locale", locale);
|
|
22269
23867
|
}
|
|
22270
23868
|
// Subclasses may override this
|
|
@@ -22339,10 +23937,10 @@ var wordlists = {
|
|
|
22339
23937
|
};
|
|
22340
23938
|
|
|
22341
23939
|
// node_modules/@ethersproject/hdnode/lib.esm/_version.js
|
|
22342
|
-
var
|
|
23940
|
+
var version17 = "hdnode/5.8.0";
|
|
22343
23941
|
|
|
22344
23942
|
// node_modules/@ethersproject/hdnode/lib.esm/index.js
|
|
22345
|
-
var
|
|
23943
|
+
var logger22 = new Logger(version17);
|
|
22346
23944
|
var N = BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
|
|
22347
23945
|
var MasterSecret = toUtf8Bytes("Bitcoin seed");
|
|
22348
23946
|
var HardenedBit = 2147483648;
|
|
@@ -22365,7 +23963,7 @@ function getWordlist(wordlist2) {
|
|
|
22365
23963
|
if (typeof wordlist2 === "string") {
|
|
22366
23964
|
const words2 = wordlists[wordlist2];
|
|
22367
23965
|
if (words2 == null) {
|
|
22368
|
-
|
|
23966
|
+
logger22.throwArgumentError("unknown locale", "wordlist", wordlist2);
|
|
22369
23967
|
}
|
|
22370
23968
|
return words2;
|
|
22371
23969
|
}
|
|
@@ -22523,7 +24121,7 @@ var HDNode = class _HDNode {
|
|
|
22523
24121
|
static fromExtendedKey(extendedKey) {
|
|
22524
24122
|
const bytes = Base58.decode(extendedKey);
|
|
22525
24123
|
if (bytes.length !== 82 || base58check(bytes.slice(0, 78)) !== extendedKey) {
|
|
22526
|
-
|
|
24124
|
+
logger22.throwArgumentError("invalid extended key", "extendedKey", "[REDACTED]");
|
|
22527
24125
|
}
|
|
22528
24126
|
const depth = bytes[4];
|
|
22529
24127
|
const parentFingerprint = hexlify(bytes.slice(5, 9));
|
|
@@ -22541,7 +24139,7 @@ var HDNode = class _HDNode {
|
|
|
22541
24139
|
}
|
|
22542
24140
|
return new _HDNode(_constructorGuard4, hexlify(key2.slice(1)), null, parentFingerprint, chainCode, index, depth, null);
|
|
22543
24141
|
}
|
|
22544
|
-
return
|
|
24142
|
+
return logger22.throwArgumentError("invalid extended key", "extendedKey", "[REDACTED]");
|
|
22545
24143
|
}
|
|
22546
24144
|
};
|
|
22547
24145
|
function mnemonicToSeed(mnemonic, password) {
|
|
@@ -22553,7 +24151,7 @@ function mnemonicToSeed(mnemonic, password) {
|
|
|
22553
24151
|
}
|
|
22554
24152
|
function mnemonicToEntropy(mnemonic, wordlist2) {
|
|
22555
24153
|
wordlist2 = getWordlist(wordlist2);
|
|
22556
|
-
|
|
24154
|
+
logger22.checkNormalize();
|
|
22557
24155
|
const words2 = wordlist2.split(mnemonic);
|
|
22558
24156
|
if (words2.length % 3 !== 0) {
|
|
22559
24157
|
throw new Error("invalid mnemonic");
|
|
@@ -22617,16 +24215,16 @@ function isValidMnemonic(mnemonic, wordlist2) {
|
|
|
22617
24215
|
}
|
|
22618
24216
|
function getAccountPath(index) {
|
|
22619
24217
|
if (typeof index !== "number" || index < 0 || index >= HardenedBit || index % 1) {
|
|
22620
|
-
|
|
24218
|
+
logger22.throwArgumentError("invalid account index", "index", index);
|
|
22621
24219
|
}
|
|
22622
24220
|
return `m/44'/60'/${index}'/0/0`;
|
|
22623
24221
|
}
|
|
22624
24222
|
|
|
22625
24223
|
// node_modules/@ethersproject/random/lib.esm/_version.js
|
|
22626
|
-
var
|
|
24224
|
+
var version18 = "random/5.8.0";
|
|
22627
24225
|
|
|
22628
24226
|
// node_modules/@ethersproject/random/lib.esm/random.js
|
|
22629
|
-
var
|
|
24227
|
+
var logger23 = new Logger(version18);
|
|
22630
24228
|
function getGlobal() {
|
|
22631
24229
|
if (typeof self !== "undefined") {
|
|
22632
24230
|
return self;
|
|
@@ -22642,10 +24240,10 @@ function getGlobal() {
|
|
|
22642
24240
|
var anyGlobal = getGlobal();
|
|
22643
24241
|
var crypto = anyGlobal.crypto || anyGlobal.msCrypto;
|
|
22644
24242
|
if (!crypto || !crypto.getRandomValues) {
|
|
22645
|
-
|
|
24243
|
+
logger23.warn("WARNING: Missing strong random number source");
|
|
22646
24244
|
crypto = {
|
|
22647
24245
|
getRandomValues: function(buffer) {
|
|
22648
|
-
return
|
|
24246
|
+
return logger23.throwError("no secure random source avaialble", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
22649
24247
|
operation: "crypto.getRandomValues"
|
|
22650
24248
|
});
|
|
22651
24249
|
}
|
|
@@ -22653,7 +24251,7 @@ if (!crypto || !crypto.getRandomValues) {
|
|
|
22653
24251
|
}
|
|
22654
24252
|
function randomBytes(length) {
|
|
22655
24253
|
if (length <= 0 || length > 1024 || length % 1 || length != length) {
|
|
22656
|
-
|
|
24254
|
+
logger23.throwArgumentError("invalid length", "length", length);
|
|
22657
24255
|
}
|
|
22658
24256
|
const result = new Uint8Array(length);
|
|
22659
24257
|
crypto.getRandomValues(result);
|
|
@@ -22676,7 +24274,7 @@ function shuffled(array) {
|
|
|
22676
24274
|
var import_aes_js = __toESM(require_aes_js());
|
|
22677
24275
|
|
|
22678
24276
|
// node_modules/@ethersproject/json-wallets/lib.esm/_version.js
|
|
22679
|
-
var
|
|
24277
|
+
var version19 = "json-wallets/5.8.0";
|
|
22680
24278
|
|
|
22681
24279
|
// node_modules/@ethersproject/json-wallets/lib.esm/utils.js
|
|
22682
24280
|
function looseArrayify(hexString) {
|
|
@@ -22731,7 +24329,7 @@ function uuidV4(randomBytes2) {
|
|
|
22731
24329
|
}
|
|
22732
24330
|
|
|
22733
24331
|
// node_modules/@ethersproject/json-wallets/lib.esm/crowdsale.js
|
|
22734
|
-
var
|
|
24332
|
+
var logger24 = new Logger(version19);
|
|
22735
24333
|
var CrowdsaleAccount = class extends Description {
|
|
22736
24334
|
isCrowdsaleAccount(value) {
|
|
22737
24335
|
return !!(value && value._isCrowdsaleAccount);
|
|
@@ -22743,7 +24341,7 @@ function decrypt(json, password) {
|
|
|
22743
24341
|
const ethaddr = getAddress(searchPath(data, "ethaddr"));
|
|
22744
24342
|
const encseed = looseArrayify(searchPath(data, "encseed"));
|
|
22745
24343
|
if (!encseed || encseed.length % 16 !== 0) {
|
|
22746
|
-
|
|
24344
|
+
logger24.throwArgumentError("invalid encseed", "json", json);
|
|
22747
24345
|
}
|
|
22748
24346
|
const key2 = arrayify(pbkdf2(password, password, 2e3, 32, "sha256")).slice(0, 16);
|
|
22749
24347
|
const iv = encseed.slice(0, 16);
|
|
@@ -22806,7 +24404,7 @@ function getJsonWalletAddress(json) {
|
|
|
22806
24404
|
// node_modules/@ethersproject/json-wallets/lib.esm/keystore.js
|
|
22807
24405
|
var import_aes_js2 = __toESM(require_aes_js());
|
|
22808
24406
|
var import_scrypt_js = __toESM(require_scrypt());
|
|
22809
|
-
var
|
|
24407
|
+
var __awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
22810
24408
|
function adopt(value) {
|
|
22811
24409
|
return value instanceof P ? value : new P(function(resolve) {
|
|
22812
24410
|
resolve(value);
|
|
@@ -22833,7 +24431,7 @@ var __awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
|
22833
24431
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22834
24432
|
});
|
|
22835
24433
|
};
|
|
22836
|
-
var
|
|
24434
|
+
var logger25 = new Logger(version19);
|
|
22837
24435
|
function hasMnemonic(value) {
|
|
22838
24436
|
return value != null && value.mnemonic && value.mnemonic.phrase;
|
|
22839
24437
|
}
|
|
@@ -22860,7 +24458,7 @@ function _getAccount(data, key2) {
|
|
|
22860
24458
|
}
|
|
22861
24459
|
const privateKey = _decrypt(data, key2.slice(0, 16), ciphertext);
|
|
22862
24460
|
if (!privateKey) {
|
|
22863
|
-
|
|
24461
|
+
logger25.throwError("unsupported cipher", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
22864
24462
|
operation: "decrypt"
|
|
22865
24463
|
});
|
|
22866
24464
|
}
|
|
@@ -22914,7 +24512,7 @@ function _computeKdfKey(data, password, pbkdf2Func, scryptFunc, progressCallback
|
|
|
22914
24512
|
const kdf = searchPath(data, "crypto/kdf");
|
|
22915
24513
|
if (kdf && typeof kdf === "string") {
|
|
22916
24514
|
const throwError = function(name, value) {
|
|
22917
|
-
return
|
|
24515
|
+
return logger25.throwArgumentError("invalid key-derivation function parameters", name, value);
|
|
22918
24516
|
};
|
|
22919
24517
|
if (kdf.toLowerCase() === "scrypt") {
|
|
22920
24518
|
const salt = looseArrayify(searchPath(data, "crypto/kdfparams/salt"));
|
|
@@ -22951,7 +24549,7 @@ function _computeKdfKey(data, password, pbkdf2Func, scryptFunc, progressCallback
|
|
|
22951
24549
|
return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc);
|
|
22952
24550
|
}
|
|
22953
24551
|
}
|
|
22954
|
-
return
|
|
24552
|
+
return logger25.throwArgumentError("unsupported key-derivation function", "kdf", kdf);
|
|
22955
24553
|
}
|
|
22956
24554
|
function decryptSync(json, password) {
|
|
22957
24555
|
const data = JSON.parse(json);
|
|
@@ -22959,7 +24557,7 @@ function decryptSync(json, password) {
|
|
|
22959
24557
|
return _getAccount(data, key2);
|
|
22960
24558
|
}
|
|
22961
24559
|
function decrypt2(json, password, progressCallback) {
|
|
22962
|
-
return
|
|
24560
|
+
return __awaiter6(this, void 0, void 0, function* () {
|
|
22963
24561
|
const data = JSON.parse(json);
|
|
22964
24562
|
const key2 = yield _computeKdfKey(data, password, pbkdf22, import_scrypt_js.default.scrypt, progressCallback);
|
|
22965
24563
|
return _getAccount(data, key2);
|
|
@@ -23118,10 +24716,10 @@ function decryptJsonWalletSync(json, password) {
|
|
|
23118
24716
|
}
|
|
23119
24717
|
|
|
23120
24718
|
// node_modules/@ethersproject/wallet/lib.esm/_version.js
|
|
23121
|
-
var
|
|
24719
|
+
var version20 = "wallet/5.8.0";
|
|
23122
24720
|
|
|
23123
24721
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
23124
|
-
var
|
|
24722
|
+
var __awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
23125
24723
|
function adopt(value) {
|
|
23126
24724
|
return value instanceof P ? value : new P(function(resolve) {
|
|
23127
24725
|
resolve(value);
|
|
@@ -23148,7 +24746,7 @@ var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
|
23148
24746
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23149
24747
|
});
|
|
23150
24748
|
};
|
|
23151
|
-
var
|
|
24749
|
+
var logger26 = new Logger(version20);
|
|
23152
24750
|
function isAccount(value) {
|
|
23153
24751
|
return value != null && isHexString(value.privateKey, 32) && value.address != null;
|
|
23154
24752
|
}
|
|
@@ -23164,7 +24762,7 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23164
24762
|
defineReadOnly(this, "_signingKey", () => signingKey);
|
|
23165
24763
|
defineReadOnly(this, "address", computeAddress(this.publicKey));
|
|
23166
24764
|
if (this.address !== getAddress(privateKey.address)) {
|
|
23167
|
-
|
|
24765
|
+
logger26.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
23168
24766
|
}
|
|
23169
24767
|
if (hasMnemonic2(privateKey)) {
|
|
23170
24768
|
const srcMnemonic = privateKey.mnemonic;
|
|
@@ -23176,7 +24774,7 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23176
24774
|
const mnemonic = this.mnemonic;
|
|
23177
24775
|
const node = HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
|
23178
24776
|
if (computeAddress(node.privateKey) !== this.address) {
|
|
23179
|
-
|
|
24777
|
+
logger26.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
|
23180
24778
|
}
|
|
23181
24779
|
} else {
|
|
23182
24780
|
defineReadOnly(this, "_mnemonic", () => null);
|
|
@@ -23184,7 +24782,7 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23184
24782
|
} else {
|
|
23185
24783
|
if (SigningKey.isSigningKey(privateKey)) {
|
|
23186
24784
|
if (privateKey.curve !== "secp256k1") {
|
|
23187
|
-
|
|
24785
|
+
logger26.throwArgumentError("unsupported curve; must be secp256k1", "privateKey", "[REDACTED]");
|
|
23188
24786
|
}
|
|
23189
24787
|
defineReadOnly(this, "_signingKey", () => privateKey);
|
|
23190
24788
|
} else {
|
|
@@ -23199,8 +24797,8 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23199
24797
|
defineReadOnly(this, "_mnemonic", () => null);
|
|
23200
24798
|
defineReadOnly(this, "address", computeAddress(this.publicKey));
|
|
23201
24799
|
}
|
|
23202
|
-
if (provider && !
|
|
23203
|
-
|
|
24800
|
+
if (provider && !Provider.isProvider(provider)) {
|
|
24801
|
+
logger26.throwArgumentError("invalid provider", "provider", provider);
|
|
23204
24802
|
}
|
|
23205
24803
|
defineReadOnly(this, "provider", provider || null);
|
|
23206
24804
|
}
|
|
@@ -23223,7 +24821,7 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23223
24821
|
return resolveProperties(transaction).then((tx) => {
|
|
23224
24822
|
if (tx.from != null) {
|
|
23225
24823
|
if (getAddress(tx.from) !== this.address) {
|
|
23226
|
-
|
|
24824
|
+
logger26.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
23227
24825
|
}
|
|
23228
24826
|
delete tx.from;
|
|
23229
24827
|
}
|
|
@@ -23232,15 +24830,15 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23232
24830
|
});
|
|
23233
24831
|
}
|
|
23234
24832
|
signMessage(message) {
|
|
23235
|
-
return
|
|
24833
|
+
return __awaiter7(this, void 0, void 0, function* () {
|
|
23236
24834
|
return joinSignature(this._signingKey().signDigest(hashMessage(message)));
|
|
23237
24835
|
});
|
|
23238
24836
|
}
|
|
23239
24837
|
_signTypedData(domain, types, value) {
|
|
23240
|
-
return
|
|
24838
|
+
return __awaiter7(this, void 0, void 0, function* () {
|
|
23241
24839
|
const populated = yield TypedDataEncoder.resolveNames(domain, types, value, (name) => {
|
|
23242
24840
|
if (this.provider == null) {
|
|
23243
|
-
|
|
24841
|
+
logger26.throwError("cannot resolve ENS names without a provider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
23244
24842
|
operation: "resolveName",
|
|
23245
24843
|
value: name
|
|
23246
24844
|
});
|
|
@@ -23299,7 +24897,7 @@ function verifyTypedData(domain, types, value, signature2) {
|
|
|
23299
24897
|
return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature2);
|
|
23300
24898
|
}
|
|
23301
24899
|
|
|
23302
|
-
// node_modules
|
|
24900
|
+
// node_modules/@ethersproject/providers/lib.esm/index.js
|
|
23303
24901
|
var lib_exports4 = {};
|
|
23304
24902
|
__export(lib_exports4, {
|
|
23305
24903
|
AlchemyProvider: () => AlchemyProvider,
|
|
@@ -23333,10 +24931,10 @@ __export(lib_exports4, {
|
|
|
23333
24931
|
});
|
|
23334
24932
|
|
|
23335
24933
|
// node_modules/@ethersproject/networks/lib.esm/_version.js
|
|
23336
|
-
var
|
|
24934
|
+
var version21 = "networks/5.8.0";
|
|
23337
24935
|
|
|
23338
24936
|
// node_modules/@ethersproject/networks/lib.esm/index.js
|
|
23339
|
-
var
|
|
24937
|
+
var logger27 = new Logger(version21);
|
|
23340
24938
|
function isRenetworkable(value) {
|
|
23341
24939
|
return value && typeof value.renetwork === "function";
|
|
23342
24940
|
}
|
|
@@ -23556,12 +25154,12 @@ function getNetwork(network) {
|
|
|
23556
25154
|
const standard = networks[network.name];
|
|
23557
25155
|
if (!standard) {
|
|
23558
25156
|
if (typeof network.chainId !== "number") {
|
|
23559
|
-
|
|
25157
|
+
logger27.throwArgumentError("invalid network chainId", "network", network);
|
|
23560
25158
|
}
|
|
23561
25159
|
return network;
|
|
23562
25160
|
}
|
|
23563
25161
|
if (network.chainId !== 0 && network.chainId !== standard.chainId) {
|
|
23564
|
-
|
|
25162
|
+
logger27.throwArgumentError("network chainId mismatch", "network", network);
|
|
23565
25163
|
}
|
|
23566
25164
|
let defaultProvider = network._defaultProvider || null;
|
|
23567
25165
|
if (defaultProvider == null && standard._defaultProvider) {
|
|
@@ -23580,10 +25178,10 @@ function getNetwork(network) {
|
|
|
23580
25178
|
}
|
|
23581
25179
|
|
|
23582
25180
|
// node_modules/@ethersproject/web/lib.esm/_version.js
|
|
23583
|
-
var
|
|
25181
|
+
var version22 = "web/5.8.0";
|
|
23584
25182
|
|
|
23585
25183
|
// node_modules/@ethersproject/web/lib.esm/geturl.js
|
|
23586
|
-
var
|
|
25184
|
+
var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
23587
25185
|
function adopt(value) {
|
|
23588
25186
|
return value instanceof P ? value : new P(function(resolve) {
|
|
23589
25187
|
resolve(value);
|
|
@@ -23611,7 +25209,7 @@ var __awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
|
23611
25209
|
});
|
|
23612
25210
|
};
|
|
23613
25211
|
function getUrl(href, options) {
|
|
23614
|
-
return
|
|
25212
|
+
return __awaiter8(this, void 0, void 0, function* () {
|
|
23615
25213
|
if (options == null) {
|
|
23616
25214
|
options = {};
|
|
23617
25215
|
}
|
|
@@ -23668,7 +25266,7 @@ function getUrl(href, options) {
|
|
|
23668
25266
|
}
|
|
23669
25267
|
|
|
23670
25268
|
// node_modules/@ethersproject/web/lib.esm/index.js
|
|
23671
|
-
var
|
|
25269
|
+
var __awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
23672
25270
|
function adopt(value) {
|
|
23673
25271
|
return value instanceof P ? value : new P(function(resolve) {
|
|
23674
25272
|
resolve(value);
|
|
@@ -23695,7 +25293,7 @@ var __awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
|
23695
25293
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23696
25294
|
});
|
|
23697
25295
|
};
|
|
23698
|
-
var
|
|
25296
|
+
var logger28 = new Logger(version22);
|
|
23699
25297
|
function staller(duration) {
|
|
23700
25298
|
return new Promise((resolve) => {
|
|
23701
25299
|
setTimeout(resolve, duration);
|
|
@@ -23727,10 +25325,10 @@ function unpercent(value) {
|
|
|
23727
25325
|
}
|
|
23728
25326
|
function _fetchData(connection, body, processFunc) {
|
|
23729
25327
|
const attemptLimit = typeof connection === "object" && connection.throttleLimit != null ? connection.throttleLimit : 12;
|
|
23730
|
-
|
|
25328
|
+
logger28.assertArgument(attemptLimit > 0 && attemptLimit % 1 === 0, "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
23731
25329
|
const throttleCallback = typeof connection === "object" ? connection.throttleCallback : null;
|
|
23732
25330
|
const throttleSlotInterval = typeof connection === "object" && typeof connection.throttleSlotInterval === "number" ? connection.throttleSlotInterval : 100;
|
|
23733
|
-
|
|
25331
|
+
logger28.assertArgument(throttleSlotInterval > 0 && throttleSlotInterval % 1 === 0, "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
23734
25332
|
const errorPassThrough = typeof connection === "object" ? !!connection.errorPassThrough : false;
|
|
23735
25333
|
const headers = {};
|
|
23736
25334
|
let url = null;
|
|
@@ -23743,7 +25341,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23743
25341
|
url = connection;
|
|
23744
25342
|
} else if (typeof connection === "object") {
|
|
23745
25343
|
if (connection == null || connection.url == null) {
|
|
23746
|
-
|
|
25344
|
+
logger28.throwArgumentError("missing URL", "connection.url", connection);
|
|
23747
25345
|
}
|
|
23748
25346
|
url = connection.url;
|
|
23749
25347
|
if (typeof connection.timeout === "number" && connection.timeout > 0) {
|
|
@@ -23760,7 +25358,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23760
25358
|
options.allowGzip = !!connection.allowGzip;
|
|
23761
25359
|
if (connection.user != null && connection.password != null) {
|
|
23762
25360
|
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
23763
|
-
|
|
25361
|
+
logger28.throwError("basic authentication requires a secure https url", Logger.errors.INVALID_ARGUMENT, { argument: "url", url, user: connection.user, password: "[REDACTED]" });
|
|
23764
25362
|
}
|
|
23765
25363
|
const authorization = connection.user + ":" + connection.password;
|
|
23766
25364
|
headers["authorization"] = {
|
|
@@ -23791,7 +25389,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23791
25389
|
}
|
|
23792
25390
|
return Promise.resolve(result);
|
|
23793
25391
|
} catch (error) {
|
|
23794
|
-
|
|
25392
|
+
logger28.throwError("processing response error", Logger.errors.SERVER_ERROR, {
|
|
23795
25393
|
body: bodyify(dataMatch[1], dataMatch[2]),
|
|
23796
25394
|
error,
|
|
23797
25395
|
requestBody: null,
|
|
@@ -23825,7 +25423,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23825
25423
|
return;
|
|
23826
25424
|
}
|
|
23827
25425
|
timer2 = null;
|
|
23828
|
-
reject(
|
|
25426
|
+
reject(logger28.makeError("timeout", Logger.errors.TIMEOUT, {
|
|
23829
25427
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
23830
25428
|
requestMethod: options.method,
|
|
23831
25429
|
timeout,
|
|
@@ -23844,7 +25442,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23844
25442
|
return { promise, cancel };
|
|
23845
25443
|
}();
|
|
23846
25444
|
const runningFetch = function() {
|
|
23847
|
-
return
|
|
25445
|
+
return __awaiter9(this, void 0, void 0, function* () {
|
|
23848
25446
|
for (let attempt = 0; attempt < attemptLimit; attempt++) {
|
|
23849
25447
|
let response = null;
|
|
23850
25448
|
try {
|
|
@@ -23878,7 +25476,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23878
25476
|
response = error.response;
|
|
23879
25477
|
if (response == null) {
|
|
23880
25478
|
runningTimeout.cancel();
|
|
23881
|
-
|
|
25479
|
+
logger28.throwError("missing response", Logger.errors.SERVER_ERROR, {
|
|
23882
25480
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
23883
25481
|
requestMethod: options.method,
|
|
23884
25482
|
serverError: error,
|
|
@@ -23891,7 +25489,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23891
25489
|
body2 = null;
|
|
23892
25490
|
} else if (!errorPassThrough && (response.statusCode < 200 || response.statusCode >= 300)) {
|
|
23893
25491
|
runningTimeout.cancel();
|
|
23894
|
-
|
|
25492
|
+
logger28.throwError("bad response", Logger.errors.SERVER_ERROR, {
|
|
23895
25493
|
status: response.statusCode,
|
|
23896
25494
|
headers: response.headers,
|
|
23897
25495
|
body: bodyify(body2, response.headers ? response.headers["content-type"] : null),
|
|
@@ -23918,7 +25516,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23918
25516
|
}
|
|
23919
25517
|
}
|
|
23920
25518
|
runningTimeout.cancel();
|
|
23921
|
-
|
|
25519
|
+
logger28.throwError("processing response error", Logger.errors.SERVER_ERROR, {
|
|
23922
25520
|
body: bodyify(body2, response.headers ? response.headers["content-type"] : null),
|
|
23923
25521
|
error,
|
|
23924
25522
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
@@ -23930,7 +25528,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23930
25528
|
runningTimeout.cancel();
|
|
23931
25529
|
return body2;
|
|
23932
25530
|
}
|
|
23933
|
-
return
|
|
25531
|
+
return logger28.throwError("failed response", Logger.errors.SERVER_ERROR, {
|
|
23934
25532
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
23935
25533
|
requestMethod: options.method,
|
|
23936
25534
|
url
|
|
@@ -23946,7 +25544,7 @@ function fetchJson(connection, json, processFunc) {
|
|
|
23946
25544
|
try {
|
|
23947
25545
|
result = JSON.parse(toUtf8String(value));
|
|
23948
25546
|
} catch (error) {
|
|
23949
|
-
|
|
25547
|
+
logger28.throwError("invalid JSON", Logger.errors.SERVER_ERROR, {
|
|
23950
25548
|
body: value,
|
|
23951
25549
|
error
|
|
23952
25550
|
});
|
|
@@ -24048,14 +25646,14 @@ function poll(func, options) {
|
|
|
24048
25646
|
});
|
|
24049
25647
|
}
|
|
24050
25648
|
|
|
24051
|
-
// node_modules
|
|
25649
|
+
// node_modules/@ethersproject/providers/lib.esm/base-provider.js
|
|
24052
25650
|
var import_bech32 = __toESM(require("bech32"));
|
|
24053
25651
|
|
|
24054
|
-
// node_modules
|
|
24055
|
-
var
|
|
25652
|
+
// node_modules/@ethersproject/providers/lib.esm/_version.js
|
|
25653
|
+
var version23 = "providers/5.8.0";
|
|
24056
25654
|
|
|
24057
|
-
// node_modules
|
|
24058
|
-
var
|
|
25655
|
+
// node_modules/@ethersproject/providers/lib.esm/formatter.js
|
|
25656
|
+
var logger29 = new Logger(version23);
|
|
24059
25657
|
var Formatter = class _Formatter {
|
|
24060
25658
|
constructor() {
|
|
24061
25659
|
this.formats = this.getDefaultFormats();
|
|
@@ -24222,7 +25820,7 @@ var Formatter = class _Formatter {
|
|
|
24222
25820
|
return value.toLowerCase();
|
|
24223
25821
|
}
|
|
24224
25822
|
}
|
|
24225
|
-
return
|
|
25823
|
+
return logger29.throwArgumentError("invalid hash", "value", value);
|
|
24226
25824
|
}
|
|
24227
25825
|
data(value, strict) {
|
|
24228
25826
|
const result = this.hex(value, strict);
|
|
@@ -24272,7 +25870,7 @@ var Formatter = class _Formatter {
|
|
|
24272
25870
|
hash(value, strict) {
|
|
24273
25871
|
const result = this.hex(value, strict);
|
|
24274
25872
|
if (hexDataLength(result) !== 32) {
|
|
24275
|
-
return
|
|
25873
|
+
return logger29.throwArgumentError("invalid hash", "value", value);
|
|
24276
25874
|
}
|
|
24277
25875
|
return result;
|
|
24278
25876
|
}
|
|
@@ -24374,15 +25972,15 @@ var Formatter = class _Formatter {
|
|
|
24374
25972
|
const value2 = BigNumber.from(result.root).toNumber();
|
|
24375
25973
|
if (value2 === 0 || value2 === 1) {
|
|
24376
25974
|
if (result.status != null && result.status !== value2) {
|
|
24377
|
-
|
|
25975
|
+
logger29.throwArgumentError("alt-root-status/status mismatch", "value", { root: result.root, status: result.status });
|
|
24378
25976
|
}
|
|
24379
25977
|
result.status = value2;
|
|
24380
25978
|
delete result.root;
|
|
24381
25979
|
} else {
|
|
24382
|
-
|
|
25980
|
+
logger29.throwArgumentError("invalid alt-root-status", "value.root", result.root);
|
|
24383
25981
|
}
|
|
24384
25982
|
} else if (result.root.length !== 66) {
|
|
24385
|
-
|
|
25983
|
+
logger29.throwArgumentError("invalid root hash", "value.root", result.root);
|
|
24386
25984
|
}
|
|
24387
25985
|
}
|
|
24388
25986
|
if (result.status != null) {
|
|
@@ -24478,8 +26076,8 @@ function showThrottleMessage() {
|
|
|
24478
26076
|
console.log("==========================");
|
|
24479
26077
|
}
|
|
24480
26078
|
|
|
24481
|
-
// node_modules
|
|
24482
|
-
var
|
|
26079
|
+
// node_modules/@ethersproject/providers/lib.esm/base-provider.js
|
|
26080
|
+
var __awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
24483
26081
|
function adopt(value) {
|
|
24484
26082
|
return value instanceof P ? value : new P(function(resolve) {
|
|
24485
26083
|
resolve(value);
|
|
@@ -24506,14 +26104,14 @@ var __awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
|
24506
26104
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24507
26105
|
});
|
|
24508
26106
|
};
|
|
24509
|
-
var
|
|
26107
|
+
var logger30 = new Logger(version23);
|
|
24510
26108
|
var MAX_CCIP_REDIRECTS = 10;
|
|
24511
26109
|
function checkTopic(topic) {
|
|
24512
26110
|
if (topic == null) {
|
|
24513
26111
|
return "null";
|
|
24514
26112
|
}
|
|
24515
26113
|
if (hexDataLength(topic) !== 32) {
|
|
24516
|
-
|
|
26114
|
+
logger30.throwArgumentError("invalid topic", "topic", topic);
|
|
24517
26115
|
}
|
|
24518
26116
|
return topic.toLowerCase();
|
|
24519
26117
|
}
|
|
@@ -24562,7 +26160,7 @@ function getEventTag2(eventName) {
|
|
|
24562
26160
|
} else if (Array.isArray(eventName)) {
|
|
24563
26161
|
return "filter:*:" + serializeTopics(eventName);
|
|
24564
26162
|
} else if (ForkEvent.isForkEvent(eventName)) {
|
|
24565
|
-
|
|
26163
|
+
logger30.warn("not implemented");
|
|
24566
26164
|
throw new Error("not implemented");
|
|
24567
26165
|
} else if (eventName && typeof eventName === "object") {
|
|
24568
26166
|
return "filter:" + (eventName.address || "*") + ":" + serializeTopics(eventName.topics || []);
|
|
@@ -24667,7 +26265,7 @@ function getIpfsLink(link) {
|
|
|
24667
26265
|
} else if (link.match(/^ipfs:\/\//i)) {
|
|
24668
26266
|
link = link.substring(7);
|
|
24669
26267
|
} else {
|
|
24670
|
-
|
|
26268
|
+
logger30.throwArgumentError("unsupported IPFS format", "link", link);
|
|
24671
26269
|
}
|
|
24672
26270
|
return `https://gateway.ipfs.io/ipfs/${link}`;
|
|
24673
26271
|
}
|
|
@@ -24730,7 +26328,7 @@ var Resolver = class {
|
|
|
24730
26328
|
return this._supportsEip2544;
|
|
24731
26329
|
}
|
|
24732
26330
|
_fetch(selector, parameters) {
|
|
24733
|
-
return
|
|
26331
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24734
26332
|
const tx = {
|
|
24735
26333
|
to: this.address,
|
|
24736
26334
|
ccipReadEnabled: true,
|
|
@@ -24744,7 +26342,7 @@ var Resolver = class {
|
|
|
24744
26342
|
try {
|
|
24745
26343
|
let result = yield this.provider.call(tx);
|
|
24746
26344
|
if (arrayify(result).length % 32 === 4) {
|
|
24747
|
-
|
|
26345
|
+
logger30.throwError("resolver threw error", Logger.errors.CALL_EXCEPTION, {
|
|
24748
26346
|
transaction: tx,
|
|
24749
26347
|
data: result
|
|
24750
26348
|
});
|
|
@@ -24762,7 +26360,7 @@ var Resolver = class {
|
|
|
24762
26360
|
});
|
|
24763
26361
|
}
|
|
24764
26362
|
_fetchBytes(selector, parameters) {
|
|
24765
|
-
return
|
|
26363
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24766
26364
|
const result = yield this._fetch(selector, parameters);
|
|
24767
26365
|
if (result != null) {
|
|
24768
26366
|
return _parseBytes(result, 0);
|
|
@@ -24773,7 +26371,7 @@ var Resolver = class {
|
|
|
24773
26371
|
_getAddress(coinType, hexBytes) {
|
|
24774
26372
|
const coinInfo = coinInfos[String(coinType)];
|
|
24775
26373
|
if (coinInfo == null) {
|
|
24776
|
-
|
|
26374
|
+
logger30.throwError(`unsupported coin type: ${coinType}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
24777
26375
|
operation: `getAddress(${coinType})`
|
|
24778
26376
|
});
|
|
24779
26377
|
}
|
|
@@ -24801,24 +26399,24 @@ var Resolver = class {
|
|
|
24801
26399
|
}
|
|
24802
26400
|
if (coinInfo.prefix != null) {
|
|
24803
26401
|
const length = bytes[1];
|
|
24804
|
-
let
|
|
24805
|
-
if (
|
|
26402
|
+
let version27 = bytes[0];
|
|
26403
|
+
if (version27 === 0) {
|
|
24806
26404
|
if (length !== 20 && length !== 32) {
|
|
24807
|
-
|
|
26405
|
+
version27 = -1;
|
|
24808
26406
|
}
|
|
24809
26407
|
} else {
|
|
24810
|
-
|
|
26408
|
+
version27 = -1;
|
|
24811
26409
|
}
|
|
24812
|
-
if (
|
|
26410
|
+
if (version27 >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
|
|
24813
26411
|
const words2 = import_bech32.default.toWords(bytes.slice(2));
|
|
24814
|
-
words2.unshift(
|
|
26412
|
+
words2.unshift(version27);
|
|
24815
26413
|
return import_bech32.default.encode(coinInfo.prefix, words2);
|
|
24816
26414
|
}
|
|
24817
26415
|
}
|
|
24818
26416
|
return null;
|
|
24819
26417
|
}
|
|
24820
26418
|
getAddress(coinType) {
|
|
24821
|
-
return
|
|
26419
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24822
26420
|
if (coinType == null) {
|
|
24823
26421
|
coinType = 60;
|
|
24824
26422
|
}
|
|
@@ -24842,7 +26440,7 @@ var Resolver = class {
|
|
|
24842
26440
|
}
|
|
24843
26441
|
const address = this._getAddress(coinType, hexBytes);
|
|
24844
26442
|
if (address == null) {
|
|
24845
|
-
|
|
26443
|
+
logger30.throwError(`invalid or unsupported coin data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
24846
26444
|
operation: `getAddress(${coinType})`,
|
|
24847
26445
|
coinType,
|
|
24848
26446
|
data: hexBytes
|
|
@@ -24852,7 +26450,7 @@ var Resolver = class {
|
|
|
24852
26450
|
});
|
|
24853
26451
|
}
|
|
24854
26452
|
getAvatar() {
|
|
24855
|
-
return
|
|
26453
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24856
26454
|
const linkage = [{ type: "name", content: this.name }];
|
|
24857
26455
|
try {
|
|
24858
26456
|
const avatar = yield this.getText("avatar");
|
|
@@ -24951,7 +26549,7 @@ var Resolver = class {
|
|
|
24951
26549
|
});
|
|
24952
26550
|
}
|
|
24953
26551
|
getContentHash() {
|
|
24954
|
-
return
|
|
26552
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24955
26553
|
const hexBytes = yield this._fetchBytes("0xbc1c58d1");
|
|
24956
26554
|
if (hexBytes == null || hexBytes === "0x") {
|
|
24957
26555
|
return null;
|
|
@@ -24984,14 +26582,14 @@ var Resolver = class {
|
|
|
24984
26582
|
return "sia://" + hash3;
|
|
24985
26583
|
}
|
|
24986
26584
|
}
|
|
24987
|
-
return
|
|
26585
|
+
return logger30.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
24988
26586
|
operation: "getContentHash()",
|
|
24989
26587
|
data: hexBytes
|
|
24990
26588
|
});
|
|
24991
26589
|
});
|
|
24992
26590
|
}
|
|
24993
26591
|
getText(key2) {
|
|
24994
|
-
return
|
|
26592
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24995
26593
|
let keyBytes = toUtf8Bytes(key2);
|
|
24996
26594
|
keyBytes = concat([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);
|
|
24997
26595
|
if (keyBytes.length % 32 !== 0) {
|
|
@@ -25039,7 +26637,7 @@ var BaseProvider = class extends Provider {
|
|
|
25039
26637
|
defineReadOnly(this, "_network", knownNetwork);
|
|
25040
26638
|
this.emit("network", knownNetwork, null);
|
|
25041
26639
|
} else {
|
|
25042
|
-
|
|
26640
|
+
logger30.throwArgumentError("invalid network", "network", network);
|
|
25043
26641
|
}
|
|
25044
26642
|
}
|
|
25045
26643
|
this._maxInternalBlockNumber = -1024;
|
|
@@ -25049,7 +26647,7 @@ var BaseProvider = class extends Provider {
|
|
|
25049
26647
|
this._fastQueryDate = 0;
|
|
25050
26648
|
}
|
|
25051
26649
|
_ready() {
|
|
25052
|
-
return
|
|
26650
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25053
26651
|
if (this._network == null) {
|
|
25054
26652
|
let network = null;
|
|
25055
26653
|
if (this._networkPromise) {
|
|
@@ -25062,7 +26660,7 @@ var BaseProvider = class extends Provider {
|
|
|
25062
26660
|
network = yield this.detectNetwork();
|
|
25063
26661
|
}
|
|
25064
26662
|
if (!network) {
|
|
25065
|
-
|
|
26663
|
+
logger30.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
25066
26664
|
}
|
|
25067
26665
|
if (this._network == null) {
|
|
25068
26666
|
if (this.anyNetwork) {
|
|
@@ -25103,7 +26701,7 @@ var BaseProvider = class extends Provider {
|
|
|
25103
26701
|
return getNetwork(network == null ? "homestead" : network);
|
|
25104
26702
|
}
|
|
25105
26703
|
ccipReadFetch(tx, calldata, urls) {
|
|
25106
|
-
return
|
|
26704
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25107
26705
|
if (this.disableCcipRead || urls.length === 0) {
|
|
25108
26706
|
return null;
|
|
25109
26707
|
}
|
|
@@ -25123,11 +26721,11 @@ var BaseProvider = class extends Provider {
|
|
|
25123
26721
|
}
|
|
25124
26722
|
const errorMessage = result.message || "unknown error";
|
|
25125
26723
|
if (result.status >= 400 && result.status < 500) {
|
|
25126
|
-
return
|
|
26724
|
+
return logger30.throwError(`response not found during CCIP fetch: ${errorMessage}`, Logger.errors.SERVER_ERROR, { url, errorMessage });
|
|
25127
26725
|
}
|
|
25128
26726
|
errorMessages.push(errorMessage);
|
|
25129
26727
|
}
|
|
25130
|
-
return
|
|
26728
|
+
return logger30.throwError(`error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, Logger.errors.SERVER_ERROR, {
|
|
25131
26729
|
urls,
|
|
25132
26730
|
errorMessages
|
|
25133
26731
|
});
|
|
@@ -25136,7 +26734,7 @@ var BaseProvider = class extends Provider {
|
|
|
25136
26734
|
// Fetches the blockNumber, but will reuse any result that is less
|
|
25137
26735
|
// than maxAge old or has been requested since the last request
|
|
25138
26736
|
_getInternalBlockNumber(maxAge) {
|
|
25139
|
-
return
|
|
26737
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25140
26738
|
yield this._ready();
|
|
25141
26739
|
if (maxAge > 0) {
|
|
25142
26740
|
while (this._internalBlockNumber) {
|
|
@@ -25184,7 +26782,7 @@ var BaseProvider = class extends Provider {
|
|
|
25184
26782
|
});
|
|
25185
26783
|
}
|
|
25186
26784
|
poll() {
|
|
25187
|
-
return
|
|
26785
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25188
26786
|
const pollId = nextPollId++;
|
|
25189
26787
|
const runners = [];
|
|
25190
26788
|
let blockNumber = null;
|
|
@@ -25204,8 +26802,8 @@ var BaseProvider = class extends Provider {
|
|
|
25204
26802
|
this._emitted.block = blockNumber - 1;
|
|
25205
26803
|
}
|
|
25206
26804
|
if (Math.abs(this._emitted.block - blockNumber) > 1e3) {
|
|
25207
|
-
|
|
25208
|
-
this.emit("error",
|
|
26805
|
+
logger30.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);
|
|
26806
|
+
this.emit("error", logger30.makeError("network block skew detected", Logger.errors.NETWORK_ERROR, {
|
|
25209
26807
|
blockNumber,
|
|
25210
26808
|
event: "blockSkew",
|
|
25211
26809
|
previousBlockNumber: this._emitted.block
|
|
@@ -25312,14 +26910,14 @@ var BaseProvider = class extends Provider {
|
|
|
25312
26910
|
// This method should query the network if the underlying network
|
|
25313
26911
|
// can change, such as when connected to a JSON-RPC backend
|
|
25314
26912
|
detectNetwork() {
|
|
25315
|
-
return
|
|
25316
|
-
return
|
|
26913
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26914
|
+
return logger30.throwError("provider does not support network detection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
25317
26915
|
operation: "provider.detectNetwork"
|
|
25318
26916
|
});
|
|
25319
26917
|
});
|
|
25320
26918
|
}
|
|
25321
26919
|
getNetwork() {
|
|
25322
|
-
return
|
|
26920
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25323
26921
|
const network = yield this._ready();
|
|
25324
26922
|
const currentNetwork = yield this.detectNetwork();
|
|
25325
26923
|
if (network.chainId !== currentNetwork.chainId) {
|
|
@@ -25336,7 +26934,7 @@ var BaseProvider = class extends Provider {
|
|
|
25336
26934
|
yield stall(0);
|
|
25337
26935
|
return this._network;
|
|
25338
26936
|
}
|
|
25339
|
-
const error =
|
|
26937
|
+
const error = logger30.makeError("underlying network changed", Logger.errors.NETWORK_ERROR, {
|
|
25340
26938
|
event: "changed",
|
|
25341
26939
|
network,
|
|
25342
26940
|
detectedNetwork: currentNetwork
|
|
@@ -25417,12 +27015,12 @@ var BaseProvider = class extends Provider {
|
|
|
25417
27015
|
}
|
|
25418
27016
|
}
|
|
25419
27017
|
waitForTransaction(transactionHash, confirmations, timeout) {
|
|
25420
|
-
return
|
|
27018
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25421
27019
|
return this._waitForTransaction(transactionHash, confirmations == null ? 1 : confirmations, timeout || 0, null);
|
|
25422
27020
|
});
|
|
25423
27021
|
}
|
|
25424
27022
|
_waitForTransaction(transactionHash, confirmations, timeout, replaceable) {
|
|
25425
|
-
return
|
|
27023
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25426
27024
|
const receipt = yield this.getTransactionReceipt(transactionHash);
|
|
25427
27025
|
if ((receipt ? receipt.confirmations : 0) >= confirmations) {
|
|
25428
27026
|
return receipt;
|
|
@@ -25456,12 +27054,12 @@ var BaseProvider = class extends Provider {
|
|
|
25456
27054
|
if (replaceable) {
|
|
25457
27055
|
let lastBlockNumber = replaceable.startBlock;
|
|
25458
27056
|
let scannedBlock = null;
|
|
25459
|
-
const replaceHandler = (blockNumber) =>
|
|
27057
|
+
const replaceHandler = (blockNumber) => __awaiter10(this, void 0, void 0, function* () {
|
|
25460
27058
|
if (done) {
|
|
25461
27059
|
return;
|
|
25462
27060
|
}
|
|
25463
27061
|
yield stall(1e3);
|
|
25464
|
-
this.getTransactionCount(replaceable.from).then((nonce) =>
|
|
27062
|
+
this.getTransactionCount(replaceable.from).then((nonce) => __awaiter10(this, void 0, void 0, function* () {
|
|
25465
27063
|
if (done) {
|
|
25466
27064
|
return;
|
|
25467
27065
|
}
|
|
@@ -25504,7 +27102,7 @@ var BaseProvider = class extends Provider {
|
|
|
25504
27102
|
} else if (tx.data === "0x" && tx.from === tx.to && tx.value.isZero()) {
|
|
25505
27103
|
reason = "cancelled";
|
|
25506
27104
|
}
|
|
25507
|
-
reject(
|
|
27105
|
+
reject(logger30.makeError("transaction was replaced", Logger.errors.TRANSACTION_REPLACED, {
|
|
25508
27106
|
cancelled: reason === "replaced" || reason === "cancelled",
|
|
25509
27107
|
reason,
|
|
25510
27108
|
replacement: this._wrapTransaction(tx),
|
|
@@ -25541,7 +27139,7 @@ var BaseProvider = class extends Provider {
|
|
|
25541
27139
|
if (alreadyDone()) {
|
|
25542
27140
|
return;
|
|
25543
27141
|
}
|
|
25544
|
-
reject(
|
|
27142
|
+
reject(logger30.makeError("timeout exceeded", Logger.errors.TIMEOUT, { timeout }));
|
|
25545
27143
|
}, timeout);
|
|
25546
27144
|
if (timer2.unref) {
|
|
25547
27145
|
timer2.unref();
|
|
@@ -25554,18 +27152,18 @@ var BaseProvider = class extends Provider {
|
|
|
25554
27152
|
});
|
|
25555
27153
|
}
|
|
25556
27154
|
getBlockNumber() {
|
|
25557
|
-
return
|
|
27155
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25558
27156
|
return this._getInternalBlockNumber(0);
|
|
25559
27157
|
});
|
|
25560
27158
|
}
|
|
25561
27159
|
getGasPrice() {
|
|
25562
|
-
return
|
|
27160
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25563
27161
|
yield this.getNetwork();
|
|
25564
27162
|
const result = yield this.perform("getGasPrice", {});
|
|
25565
27163
|
try {
|
|
25566
27164
|
return BigNumber.from(result);
|
|
25567
27165
|
} catch (error) {
|
|
25568
|
-
return
|
|
27166
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25569
27167
|
method: "getGasPrice",
|
|
25570
27168
|
result,
|
|
25571
27169
|
error
|
|
@@ -25574,7 +27172,7 @@ var BaseProvider = class extends Provider {
|
|
|
25574
27172
|
});
|
|
25575
27173
|
}
|
|
25576
27174
|
getBalance(addressOrName, blockTag) {
|
|
25577
|
-
return
|
|
27175
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25578
27176
|
yield this.getNetwork();
|
|
25579
27177
|
const params = yield resolveProperties({
|
|
25580
27178
|
address: this._getAddress(addressOrName),
|
|
@@ -25584,7 +27182,7 @@ var BaseProvider = class extends Provider {
|
|
|
25584
27182
|
try {
|
|
25585
27183
|
return BigNumber.from(result);
|
|
25586
27184
|
} catch (error) {
|
|
25587
|
-
return
|
|
27185
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25588
27186
|
method: "getBalance",
|
|
25589
27187
|
params,
|
|
25590
27188
|
result,
|
|
@@ -25594,7 +27192,7 @@ var BaseProvider = class extends Provider {
|
|
|
25594
27192
|
});
|
|
25595
27193
|
}
|
|
25596
27194
|
getTransactionCount(addressOrName, blockTag) {
|
|
25597
|
-
return
|
|
27195
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25598
27196
|
yield this.getNetwork();
|
|
25599
27197
|
const params = yield resolveProperties({
|
|
25600
27198
|
address: this._getAddress(addressOrName),
|
|
@@ -25604,7 +27202,7 @@ var BaseProvider = class extends Provider {
|
|
|
25604
27202
|
try {
|
|
25605
27203
|
return BigNumber.from(result).toNumber();
|
|
25606
27204
|
} catch (error) {
|
|
25607
|
-
return
|
|
27205
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25608
27206
|
method: "getTransactionCount",
|
|
25609
27207
|
params,
|
|
25610
27208
|
result,
|
|
@@ -25614,7 +27212,7 @@ var BaseProvider = class extends Provider {
|
|
|
25614
27212
|
});
|
|
25615
27213
|
}
|
|
25616
27214
|
getCode(addressOrName, blockTag) {
|
|
25617
|
-
return
|
|
27215
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25618
27216
|
yield this.getNetwork();
|
|
25619
27217
|
const params = yield resolveProperties({
|
|
25620
27218
|
address: this._getAddress(addressOrName),
|
|
@@ -25624,7 +27222,7 @@ var BaseProvider = class extends Provider {
|
|
|
25624
27222
|
try {
|
|
25625
27223
|
return hexlify(result);
|
|
25626
27224
|
} catch (error) {
|
|
25627
|
-
return
|
|
27225
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25628
27226
|
method: "getCode",
|
|
25629
27227
|
params,
|
|
25630
27228
|
result,
|
|
@@ -25634,7 +27232,7 @@ var BaseProvider = class extends Provider {
|
|
|
25634
27232
|
});
|
|
25635
27233
|
}
|
|
25636
27234
|
getStorageAt(addressOrName, position, blockTag) {
|
|
25637
|
-
return
|
|
27235
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25638
27236
|
yield this.getNetwork();
|
|
25639
27237
|
const params = yield resolveProperties({
|
|
25640
27238
|
address: this._getAddress(addressOrName),
|
|
@@ -25645,7 +27243,7 @@ var BaseProvider = class extends Provider {
|
|
|
25645
27243
|
try {
|
|
25646
27244
|
return hexlify(result);
|
|
25647
27245
|
} catch (error) {
|
|
25648
|
-
return
|
|
27246
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25649
27247
|
method: "getStorageAt",
|
|
25650
27248
|
params,
|
|
25651
27249
|
result,
|
|
@@ -25661,9 +27259,9 @@ var BaseProvider = class extends Provider {
|
|
|
25661
27259
|
}
|
|
25662
27260
|
const result = tx;
|
|
25663
27261
|
if (hash3 != null && tx.hash !== hash3) {
|
|
25664
|
-
|
|
27262
|
+
logger30.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash3 });
|
|
25665
27263
|
}
|
|
25666
|
-
result.wait = (confirms, timeout) =>
|
|
27264
|
+
result.wait = (confirms, timeout) => __awaiter10(this, void 0, void 0, function* () {
|
|
25667
27265
|
if (confirms == null) {
|
|
25668
27266
|
confirms = 1;
|
|
25669
27267
|
}
|
|
@@ -25687,7 +27285,7 @@ var BaseProvider = class extends Provider {
|
|
|
25687
27285
|
}
|
|
25688
27286
|
this._emitted["t:" + tx.hash] = receipt.blockNumber;
|
|
25689
27287
|
if (receipt.status === 0) {
|
|
25690
|
-
|
|
27288
|
+
logger30.throwError("transaction failed", Logger.errors.CALL_EXCEPTION, {
|
|
25691
27289
|
transactionHash: tx.hash,
|
|
25692
27290
|
transaction: tx,
|
|
25693
27291
|
receipt
|
|
@@ -25698,7 +27296,7 @@ var BaseProvider = class extends Provider {
|
|
|
25698
27296
|
return result;
|
|
25699
27297
|
}
|
|
25700
27298
|
sendTransaction(signedTransaction) {
|
|
25701
|
-
return
|
|
27299
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25702
27300
|
yield this.getNetwork();
|
|
25703
27301
|
const hexTx = yield Promise.resolve(signedTransaction).then((t) => hexlify(t));
|
|
25704
27302
|
const tx = this.formatter.transaction(signedTransaction);
|
|
@@ -25717,7 +27315,7 @@ var BaseProvider = class extends Provider {
|
|
|
25717
27315
|
});
|
|
25718
27316
|
}
|
|
25719
27317
|
_getTransactionRequest(transaction) {
|
|
25720
|
-
return
|
|
27318
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25721
27319
|
const values = yield transaction;
|
|
25722
27320
|
const tx = {};
|
|
25723
27321
|
["from", "to"].forEach((key2) => {
|
|
@@ -25751,7 +27349,7 @@ var BaseProvider = class extends Provider {
|
|
|
25751
27349
|
});
|
|
25752
27350
|
}
|
|
25753
27351
|
_getFilter(filter) {
|
|
25754
|
-
return
|
|
27352
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25755
27353
|
filter = yield filter;
|
|
25756
27354
|
const result = {};
|
|
25757
27355
|
if (filter.address != null) {
|
|
@@ -25773,9 +27371,9 @@ var BaseProvider = class extends Provider {
|
|
|
25773
27371
|
});
|
|
25774
27372
|
}
|
|
25775
27373
|
_call(transaction, blockTag, attempt) {
|
|
25776
|
-
return
|
|
27374
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25777
27375
|
if (attempt >= MAX_CCIP_REDIRECTS) {
|
|
25778
|
-
|
|
27376
|
+
logger30.throwError("CCIP read exceeded maximum redirections", Logger.errors.SERVER_ERROR, {
|
|
25779
27377
|
redirects: attempt,
|
|
25780
27378
|
transaction
|
|
25781
27379
|
});
|
|
@@ -25787,7 +27385,7 @@ var BaseProvider = class extends Provider {
|
|
|
25787
27385
|
const data = hexDataSlice(result, 4);
|
|
25788
27386
|
const sender = hexDataSlice(data, 0, 32);
|
|
25789
27387
|
if (!BigNumber.from(sender).eq(txSender)) {
|
|
25790
|
-
|
|
27388
|
+
logger30.throwError("CCIP Read sender did not match", Logger.errors.CALL_EXCEPTION, {
|
|
25791
27389
|
name: "OffchainLookup",
|
|
25792
27390
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
25793
27391
|
transaction,
|
|
@@ -25801,7 +27399,7 @@ var BaseProvider = class extends Provider {
|
|
|
25801
27399
|
for (let u = 0; u < urlsLength; u++) {
|
|
25802
27400
|
const url = _parseString(urlsData, u * 32);
|
|
25803
27401
|
if (url == null) {
|
|
25804
|
-
|
|
27402
|
+
logger30.throwError("CCIP Read contained corrupt URL string", Logger.errors.CALL_EXCEPTION, {
|
|
25805
27403
|
name: "OffchainLookup",
|
|
25806
27404
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
25807
27405
|
transaction,
|
|
@@ -25812,7 +27410,7 @@ var BaseProvider = class extends Provider {
|
|
|
25812
27410
|
}
|
|
25813
27411
|
const calldata = _parseBytes(data, 64);
|
|
25814
27412
|
if (!BigNumber.from(hexDataSlice(data, 100, 128)).isZero()) {
|
|
25815
|
-
|
|
27413
|
+
logger30.throwError("CCIP Read callback selector included junk", Logger.errors.CALL_EXCEPTION, {
|
|
25816
27414
|
name: "OffchainLookup",
|
|
25817
27415
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
25818
27416
|
transaction,
|
|
@@ -25823,7 +27421,7 @@ var BaseProvider = class extends Provider {
|
|
|
25823
27421
|
const extraData = _parseBytes(data, 128);
|
|
25824
27422
|
const ccipResult = yield this.ccipReadFetch(transaction, calldata, urls);
|
|
25825
27423
|
if (ccipResult == null) {
|
|
25826
|
-
|
|
27424
|
+
logger30.throwError("CCIP Read disabled or provided no URLs", Logger.errors.CALL_EXCEPTION, {
|
|
25827
27425
|
name: "OffchainLookup",
|
|
25828
27426
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
25829
27427
|
transaction,
|
|
@@ -25844,7 +27442,7 @@ var BaseProvider = class extends Provider {
|
|
|
25844
27442
|
try {
|
|
25845
27443
|
return hexlify(result);
|
|
25846
27444
|
} catch (error) {
|
|
25847
|
-
return
|
|
27445
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25848
27446
|
method: "call",
|
|
25849
27447
|
params: { transaction, blockTag },
|
|
25850
27448
|
result,
|
|
@@ -25854,7 +27452,7 @@ var BaseProvider = class extends Provider {
|
|
|
25854
27452
|
});
|
|
25855
27453
|
}
|
|
25856
27454
|
call(transaction, blockTag) {
|
|
25857
|
-
return
|
|
27455
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25858
27456
|
yield this.getNetwork();
|
|
25859
27457
|
const resolved = yield resolveProperties({
|
|
25860
27458
|
transaction: this._getTransactionRequest(transaction),
|
|
@@ -25865,7 +27463,7 @@ var BaseProvider = class extends Provider {
|
|
|
25865
27463
|
});
|
|
25866
27464
|
}
|
|
25867
27465
|
estimateGas(transaction) {
|
|
25868
|
-
return
|
|
27466
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25869
27467
|
yield this.getNetwork();
|
|
25870
27468
|
const params = yield resolveProperties({
|
|
25871
27469
|
transaction: this._getTransactionRequest(transaction)
|
|
@@ -25874,7 +27472,7 @@ var BaseProvider = class extends Provider {
|
|
|
25874
27472
|
try {
|
|
25875
27473
|
return BigNumber.from(result);
|
|
25876
27474
|
} catch (error) {
|
|
25877
|
-
return
|
|
27475
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25878
27476
|
method: "estimateGas",
|
|
25879
27477
|
params,
|
|
25880
27478
|
result,
|
|
@@ -25884,14 +27482,14 @@ var BaseProvider = class extends Provider {
|
|
|
25884
27482
|
});
|
|
25885
27483
|
}
|
|
25886
27484
|
_getAddress(addressOrName) {
|
|
25887
|
-
return
|
|
27485
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25888
27486
|
addressOrName = yield addressOrName;
|
|
25889
27487
|
if (typeof addressOrName !== "string") {
|
|
25890
|
-
|
|
27488
|
+
logger30.throwArgumentError("invalid address or ENS name", "name", addressOrName);
|
|
25891
27489
|
}
|
|
25892
27490
|
const address = yield this.resolveName(addressOrName);
|
|
25893
27491
|
if (address == null) {
|
|
25894
|
-
|
|
27492
|
+
logger30.throwError("ENS name not configured", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
25895
27493
|
operation: `resolveName(${JSON.stringify(addressOrName)})`
|
|
25896
27494
|
});
|
|
25897
27495
|
}
|
|
@@ -25899,7 +27497,7 @@ var BaseProvider = class extends Provider {
|
|
|
25899
27497
|
});
|
|
25900
27498
|
}
|
|
25901
27499
|
_getBlock(blockHashOrBlockTag, includeTransactions) {
|
|
25902
|
-
return
|
|
27500
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25903
27501
|
yield this.getNetwork();
|
|
25904
27502
|
blockHashOrBlockTag = yield blockHashOrBlockTag;
|
|
25905
27503
|
let blockNumber = -128;
|
|
@@ -25915,10 +27513,10 @@ var BaseProvider = class extends Provider {
|
|
|
25915
27513
|
blockNumber = parseInt(params.blockTag.substring(2), 16);
|
|
25916
27514
|
}
|
|
25917
27515
|
} catch (error) {
|
|
25918
|
-
|
|
27516
|
+
logger30.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
|
|
25919
27517
|
}
|
|
25920
27518
|
}
|
|
25921
|
-
return poll(() =>
|
|
27519
|
+
return poll(() => __awaiter10(this, void 0, void 0, function* () {
|
|
25922
27520
|
const block = yield this.perform("getBlock", params);
|
|
25923
27521
|
if (block == null) {
|
|
25924
27522
|
if (params.blockHash != null) {
|
|
@@ -25965,11 +27563,11 @@ var BaseProvider = class extends Provider {
|
|
|
25965
27563
|
return this._getBlock(blockHashOrBlockTag, true);
|
|
25966
27564
|
}
|
|
25967
27565
|
getTransaction(transactionHash) {
|
|
25968
|
-
return
|
|
27566
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25969
27567
|
yield this.getNetwork();
|
|
25970
27568
|
transactionHash = yield transactionHash;
|
|
25971
27569
|
const params = { transactionHash: this.formatter.hash(transactionHash, true) };
|
|
25972
|
-
return poll(() =>
|
|
27570
|
+
return poll(() => __awaiter10(this, void 0, void 0, function* () {
|
|
25973
27571
|
const result = yield this.perform("getTransaction", params);
|
|
25974
27572
|
if (result == null) {
|
|
25975
27573
|
if (this._emitted["t:" + transactionHash] == null) {
|
|
@@ -25993,11 +27591,11 @@ var BaseProvider = class extends Provider {
|
|
|
25993
27591
|
});
|
|
25994
27592
|
}
|
|
25995
27593
|
getTransactionReceipt(transactionHash) {
|
|
25996
|
-
return
|
|
27594
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25997
27595
|
yield this.getNetwork();
|
|
25998
27596
|
transactionHash = yield transactionHash;
|
|
25999
27597
|
const params = { transactionHash: this.formatter.hash(transactionHash, true) };
|
|
26000
|
-
return poll(() =>
|
|
27598
|
+
return poll(() => __awaiter10(this, void 0, void 0, function* () {
|
|
26001
27599
|
const result = yield this.perform("getTransactionReceipt", params);
|
|
26002
27600
|
if (result == null) {
|
|
26003
27601
|
if (this._emitted["t:" + transactionHash] == null) {
|
|
@@ -26024,7 +27622,7 @@ var BaseProvider = class extends Provider {
|
|
|
26024
27622
|
});
|
|
26025
27623
|
}
|
|
26026
27624
|
getLogs(filter) {
|
|
26027
|
-
return
|
|
27625
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26028
27626
|
yield this.getNetwork();
|
|
26029
27627
|
const params = yield resolveProperties({ filter: this._getFilter(filter) });
|
|
26030
27628
|
const logs = yield this.perform("getLogs", params);
|
|
@@ -26037,17 +27635,17 @@ var BaseProvider = class extends Provider {
|
|
|
26037
27635
|
});
|
|
26038
27636
|
}
|
|
26039
27637
|
getEtherPrice() {
|
|
26040
|
-
return
|
|
27638
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26041
27639
|
yield this.getNetwork();
|
|
26042
27640
|
return this.perform("getEtherPrice", {});
|
|
26043
27641
|
});
|
|
26044
27642
|
}
|
|
26045
27643
|
_getBlockTag(blockTag) {
|
|
26046
|
-
return
|
|
27644
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26047
27645
|
blockTag = yield blockTag;
|
|
26048
27646
|
if (typeof blockTag === "number" && blockTag < 0) {
|
|
26049
27647
|
if (blockTag % 1) {
|
|
26050
|
-
|
|
27648
|
+
logger30.throwArgumentError("invalid BlockTag", "blockTag", blockTag);
|
|
26051
27649
|
}
|
|
26052
27650
|
let blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
|
|
26053
27651
|
blockNumber += blockTag;
|
|
@@ -26060,7 +27658,7 @@ var BaseProvider = class extends Provider {
|
|
|
26060
27658
|
});
|
|
26061
27659
|
}
|
|
26062
27660
|
getResolver(name) {
|
|
26063
|
-
return
|
|
27661
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26064
27662
|
let currentName = name;
|
|
26065
27663
|
while (true) {
|
|
26066
27664
|
if (currentName === "" || currentName === ".") {
|
|
@@ -26082,13 +27680,13 @@ var BaseProvider = class extends Provider {
|
|
|
26082
27680
|
});
|
|
26083
27681
|
}
|
|
26084
27682
|
_getResolver(name, operation) {
|
|
26085
|
-
return
|
|
27683
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26086
27684
|
if (operation == null) {
|
|
26087
27685
|
operation = "ENS";
|
|
26088
27686
|
}
|
|
26089
27687
|
const network = yield this.getNetwork();
|
|
26090
27688
|
if (!network.ensAddress) {
|
|
26091
|
-
|
|
27689
|
+
logger30.throwError("network does not support ENS", Logger.errors.UNSUPPORTED_OPERATION, { operation, network: network.name });
|
|
26092
27690
|
}
|
|
26093
27691
|
try {
|
|
26094
27692
|
const addrData = yield this.call({
|
|
@@ -26102,7 +27700,7 @@ var BaseProvider = class extends Provider {
|
|
|
26102
27700
|
});
|
|
26103
27701
|
}
|
|
26104
27702
|
resolveName(name) {
|
|
26105
|
-
return
|
|
27703
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26106
27704
|
name = yield name;
|
|
26107
27705
|
try {
|
|
26108
27706
|
return Promise.resolve(this.formatter.address(name));
|
|
@@ -26112,7 +27710,7 @@ var BaseProvider = class extends Provider {
|
|
|
26112
27710
|
}
|
|
26113
27711
|
}
|
|
26114
27712
|
if (typeof name !== "string") {
|
|
26115
|
-
|
|
27713
|
+
logger30.throwArgumentError("invalid ENS name", "name", name);
|
|
26116
27714
|
}
|
|
26117
27715
|
const resolver = yield this.getResolver(name);
|
|
26118
27716
|
if (!resolver) {
|
|
@@ -26122,7 +27720,7 @@ var BaseProvider = class extends Provider {
|
|
|
26122
27720
|
});
|
|
26123
27721
|
}
|
|
26124
27722
|
lookupAddress(address) {
|
|
26125
|
-
return
|
|
27723
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26126
27724
|
address = yield address;
|
|
26127
27725
|
address = this.formatter.address(address);
|
|
26128
27726
|
const node = address.substring(2).toLowerCase() + ".addr.reverse";
|
|
@@ -26142,7 +27740,7 @@ var BaseProvider = class extends Provider {
|
|
|
26142
27740
|
});
|
|
26143
27741
|
}
|
|
26144
27742
|
getAvatar(nameOrAddress) {
|
|
26145
|
-
return
|
|
27743
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26146
27744
|
let resolver = null;
|
|
26147
27745
|
if (isHexString(nameOrAddress)) {
|
|
26148
27746
|
const address = this.formatter.address(nameOrAddress);
|
|
@@ -26188,7 +27786,7 @@ var BaseProvider = class extends Provider {
|
|
|
26188
27786
|
});
|
|
26189
27787
|
}
|
|
26190
27788
|
perform(method, params) {
|
|
26191
|
-
return
|
|
27789
|
+
return logger30.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
26192
27790
|
}
|
|
26193
27791
|
_startEvent(event) {
|
|
26194
27792
|
this.polling = this._events.filter((e) => e.pollable()).length > 0;
|
|
@@ -26292,8 +27890,8 @@ var BaseProvider = class extends Provider {
|
|
|
26292
27890
|
}
|
|
26293
27891
|
};
|
|
26294
27892
|
|
|
26295
|
-
// node_modules
|
|
26296
|
-
var
|
|
27893
|
+
// node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js
|
|
27894
|
+
var __awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
26297
27895
|
function adopt(value) {
|
|
26298
27896
|
return value instanceof P ? value : new P(function(resolve) {
|
|
26299
27897
|
resolve(value);
|
|
@@ -26320,7 +27918,7 @@ var __awaiter12 = function(thisArg, _arguments, P, generator) {
|
|
|
26320
27918
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26321
27919
|
});
|
|
26322
27920
|
};
|
|
26323
|
-
var
|
|
27921
|
+
var logger31 = new Logger(version23);
|
|
26324
27922
|
var errorGas = ["call", "estimateGas"];
|
|
26325
27923
|
function spelunk(value, requireData) {
|
|
26326
27924
|
if (value == null) {
|
|
@@ -26356,7 +27954,7 @@ function checkError(method, error, params) {
|
|
|
26356
27954
|
if (result) {
|
|
26357
27955
|
return result.data;
|
|
26358
27956
|
}
|
|
26359
|
-
|
|
27957
|
+
logger31.throwError("missing revert data in call exception; Transaction reverted without a reason string", Logger.errors.CALL_EXCEPTION, {
|
|
26360
27958
|
data: "0x",
|
|
26361
27959
|
transaction,
|
|
26362
27960
|
error
|
|
@@ -26368,7 +27966,7 @@ function checkError(method, error, params) {
|
|
|
26368
27966
|
result = spelunk(error, false);
|
|
26369
27967
|
}
|
|
26370
27968
|
if (result) {
|
|
26371
|
-
|
|
27969
|
+
logger31.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
26372
27970
|
reason: result.message,
|
|
26373
27971
|
method,
|
|
26374
27972
|
transaction,
|
|
@@ -26386,35 +27984,35 @@ function checkError(method, error, params) {
|
|
|
26386
27984
|
}
|
|
26387
27985
|
message = (message || "").toLowerCase();
|
|
26388
27986
|
if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
|
|
26389
|
-
|
|
27987
|
+
logger31.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
26390
27988
|
error,
|
|
26391
27989
|
method,
|
|
26392
27990
|
transaction
|
|
26393
27991
|
});
|
|
26394
27992
|
}
|
|
26395
27993
|
if (message.match(/nonce (is )?too low/i)) {
|
|
26396
|
-
|
|
27994
|
+
logger31.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
26397
27995
|
error,
|
|
26398
27996
|
method,
|
|
26399
27997
|
transaction
|
|
26400
27998
|
});
|
|
26401
27999
|
}
|
|
26402
28000
|
if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {
|
|
26403
|
-
|
|
28001
|
+
logger31.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
26404
28002
|
error,
|
|
26405
28003
|
method,
|
|
26406
28004
|
transaction
|
|
26407
28005
|
});
|
|
26408
28006
|
}
|
|
26409
28007
|
if (message.match(/only replay-protected/i)) {
|
|
26410
|
-
|
|
28008
|
+
logger31.throwError("legacy pre-eip-155 transactions not supported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26411
28009
|
error,
|
|
26412
28010
|
method,
|
|
26413
28011
|
transaction
|
|
26414
28012
|
});
|
|
26415
28013
|
}
|
|
26416
28014
|
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
|
|
26417
|
-
|
|
28015
|
+
logger31.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
26418
28016
|
error,
|
|
26419
28017
|
method,
|
|
26420
28018
|
transaction
|
|
@@ -26460,11 +28058,11 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26460
28058
|
defineReadOnly(this, "_index", addressOrIndex);
|
|
26461
28059
|
defineReadOnly(this, "_address", null);
|
|
26462
28060
|
} else {
|
|
26463
|
-
|
|
28061
|
+
logger31.throwArgumentError("invalid address or index", "addressOrIndex", addressOrIndex);
|
|
26464
28062
|
}
|
|
26465
28063
|
}
|
|
26466
28064
|
connect(provider) {
|
|
26467
|
-
return
|
|
28065
|
+
return logger31.throwError("cannot alter JSON-RPC Signer connection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26468
28066
|
operation: "connect"
|
|
26469
28067
|
});
|
|
26470
28068
|
}
|
|
@@ -26477,7 +28075,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26477
28075
|
}
|
|
26478
28076
|
return this.provider.send("eth_accounts", []).then((accounts) => {
|
|
26479
28077
|
if (accounts.length <= this._index) {
|
|
26480
|
-
|
|
28078
|
+
logger31.throwError("unknown account #" + this._index, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26481
28079
|
operation: "getAddress"
|
|
26482
28080
|
});
|
|
26483
28081
|
}
|
|
@@ -26498,13 +28096,13 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26498
28096
|
transaction.gasLimit = this.provider.estimateGas(estimate);
|
|
26499
28097
|
}
|
|
26500
28098
|
if (transaction.to != null) {
|
|
26501
|
-
transaction.to = Promise.resolve(transaction.to).then((to) =>
|
|
28099
|
+
transaction.to = Promise.resolve(transaction.to).then((to) => __awaiter11(this, void 0, void 0, function* () {
|
|
26502
28100
|
if (to == null) {
|
|
26503
28101
|
return null;
|
|
26504
28102
|
}
|
|
26505
28103
|
const address = yield this.provider.resolveName(to);
|
|
26506
28104
|
if (address == null) {
|
|
26507
|
-
|
|
28105
|
+
logger31.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
26508
28106
|
}
|
|
26509
28107
|
return address;
|
|
26510
28108
|
}));
|
|
@@ -26515,7 +28113,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26515
28113
|
}).then(({ tx, sender }) => {
|
|
26516
28114
|
if (tx.from != null) {
|
|
26517
28115
|
if (tx.from.toLowerCase() !== sender) {
|
|
26518
|
-
|
|
28116
|
+
logger31.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
26519
28117
|
}
|
|
26520
28118
|
} else {
|
|
26521
28119
|
tx.from = sender;
|
|
@@ -26525,7 +28123,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26525
28123
|
return hash3;
|
|
26526
28124
|
}, (error) => {
|
|
26527
28125
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
26528
|
-
|
|
28126
|
+
logger31.throwError("user rejected transaction", Logger.errors.ACTION_REJECTED, {
|
|
26529
28127
|
action: "sendTransaction",
|
|
26530
28128
|
transaction: tx
|
|
26531
28129
|
});
|
|
@@ -26535,16 +28133,16 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26535
28133
|
});
|
|
26536
28134
|
}
|
|
26537
28135
|
signTransaction(transaction) {
|
|
26538
|
-
return
|
|
28136
|
+
return logger31.throwError("signing transactions is unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26539
28137
|
operation: "signTransaction"
|
|
26540
28138
|
});
|
|
26541
28139
|
}
|
|
26542
28140
|
sendTransaction(transaction) {
|
|
26543
|
-
return
|
|
28141
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26544
28142
|
const blockNumber = yield this.provider._getInternalBlockNumber(100 + 2 * this.provider.pollingInterval);
|
|
26545
28143
|
const hash3 = yield this.sendUncheckedTransaction(transaction);
|
|
26546
28144
|
try {
|
|
26547
|
-
return yield poll(() =>
|
|
28145
|
+
return yield poll(() => __awaiter11(this, void 0, void 0, function* () {
|
|
26548
28146
|
const tx = yield this.provider.getTransaction(hash3);
|
|
26549
28147
|
if (tx === null) {
|
|
26550
28148
|
return void 0;
|
|
@@ -26558,14 +28156,14 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26558
28156
|
});
|
|
26559
28157
|
}
|
|
26560
28158
|
signMessage(message) {
|
|
26561
|
-
return
|
|
28159
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26562
28160
|
const data = typeof message === "string" ? toUtf8Bytes(message) : message;
|
|
26563
28161
|
const address = yield this.getAddress();
|
|
26564
28162
|
try {
|
|
26565
28163
|
return yield this.provider.send("personal_sign", [hexlify(data), address.toLowerCase()]);
|
|
26566
28164
|
} catch (error) {
|
|
26567
28165
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
26568
|
-
|
|
28166
|
+
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
26569
28167
|
action: "signMessage",
|
|
26570
28168
|
from: address,
|
|
26571
28169
|
messageData: message
|
|
@@ -26576,14 +28174,14 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26576
28174
|
});
|
|
26577
28175
|
}
|
|
26578
28176
|
_legacySignMessage(message) {
|
|
26579
|
-
return
|
|
28177
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26580
28178
|
const data = typeof message === "string" ? toUtf8Bytes(message) : message;
|
|
26581
28179
|
const address = yield this.getAddress();
|
|
26582
28180
|
try {
|
|
26583
28181
|
return yield this.provider.send("eth_sign", [address.toLowerCase(), hexlify(data)]);
|
|
26584
28182
|
} catch (error) {
|
|
26585
28183
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
26586
|
-
|
|
28184
|
+
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
26587
28185
|
action: "_legacySignMessage",
|
|
26588
28186
|
from: address,
|
|
26589
28187
|
messageData: message
|
|
@@ -26594,7 +28192,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26594
28192
|
});
|
|
26595
28193
|
}
|
|
26596
28194
|
_signTypedData(domain, types, value) {
|
|
26597
|
-
return
|
|
28195
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26598
28196
|
const populated = yield TypedDataEncoder.resolveNames(domain, types, value, (name) => {
|
|
26599
28197
|
return this.provider.resolveName(name);
|
|
26600
28198
|
});
|
|
@@ -26606,7 +28204,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26606
28204
|
]);
|
|
26607
28205
|
} catch (error) {
|
|
26608
28206
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
26609
|
-
|
|
28207
|
+
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
26610
28208
|
action: "_signTypedData",
|
|
26611
28209
|
from: address,
|
|
26612
28210
|
messageData: { domain: populated.domain, types, value: populated.value }
|
|
@@ -26617,7 +28215,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26617
28215
|
});
|
|
26618
28216
|
}
|
|
26619
28217
|
unlock(password) {
|
|
26620
|
-
return
|
|
28218
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26621
28219
|
const provider = this.provider;
|
|
26622
28220
|
const address = yield this.getAddress();
|
|
26623
28221
|
return provider.send("personal_unlockAccount", [address.toLowerCase(), password, null]);
|
|
@@ -26703,7 +28301,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26703
28301
|
return this._cache["detectNetwork"];
|
|
26704
28302
|
}
|
|
26705
28303
|
_uncachedDetectNetwork() {
|
|
26706
|
-
return
|
|
28304
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26707
28305
|
yield timer(0);
|
|
26708
28306
|
let chainId = null;
|
|
26709
28307
|
try {
|
|
@@ -26719,14 +28317,14 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26719
28317
|
try {
|
|
26720
28318
|
return getNetwork2(BigNumber.from(chainId).toNumber());
|
|
26721
28319
|
} catch (error) {
|
|
26722
|
-
return
|
|
28320
|
+
return logger31.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
26723
28321
|
chainId,
|
|
26724
28322
|
event: "invalidNetwork",
|
|
26725
28323
|
serverError: error
|
|
26726
28324
|
});
|
|
26727
28325
|
}
|
|
26728
28326
|
}
|
|
26729
|
-
return
|
|
28327
|
+
return logger31.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
26730
28328
|
event: "noNetwork"
|
|
26731
28329
|
});
|
|
26732
28330
|
});
|
|
@@ -26829,7 +28427,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26829
28427
|
return null;
|
|
26830
28428
|
}
|
|
26831
28429
|
perform(method, params) {
|
|
26832
|
-
return
|
|
28430
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26833
28431
|
if (method === "call" || method === "estimateGas") {
|
|
26834
28432
|
const tx = params.transaction;
|
|
26835
28433
|
if (tx && tx.type != null && BigNumber.from(tx.type).isZero()) {
|
|
@@ -26845,7 +28443,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26845
28443
|
}
|
|
26846
28444
|
const args = this.prepareRequest(method, params);
|
|
26847
28445
|
if (args == null) {
|
|
26848
|
-
|
|
28446
|
+
logger31.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
26849
28447
|
}
|
|
26850
28448
|
try {
|
|
26851
28449
|
return yield this.send(args[0], args[1]);
|
|
@@ -26952,7 +28550,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26952
28550
|
}
|
|
26953
28551
|
};
|
|
26954
28552
|
|
|
26955
|
-
// node_modules
|
|
28553
|
+
// node_modules/@ethersproject/providers/lib.esm/ws.js
|
|
26956
28554
|
var WS = null;
|
|
26957
28555
|
try {
|
|
26958
28556
|
WS = WebSocket;
|
|
@@ -26960,16 +28558,16 @@ try {
|
|
|
26960
28558
|
throw new Error("inject please");
|
|
26961
28559
|
}
|
|
26962
28560
|
} catch (error) {
|
|
26963
|
-
const
|
|
28561
|
+
const logger48 = new Logger(version23);
|
|
26964
28562
|
WS = function() {
|
|
26965
|
-
|
|
28563
|
+
logger48.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26966
28564
|
operation: "new WebSocket()"
|
|
26967
28565
|
});
|
|
26968
28566
|
};
|
|
26969
28567
|
}
|
|
26970
28568
|
|
|
26971
|
-
// node_modules
|
|
26972
|
-
var
|
|
28569
|
+
// node_modules/@ethersproject/providers/lib.esm/websocket-provider.js
|
|
28570
|
+
var __awaiter12 = function(thisArg, _arguments, P, generator) {
|
|
26973
28571
|
function adopt(value) {
|
|
26974
28572
|
return value instanceof P ? value : new P(function(resolve) {
|
|
26975
28573
|
resolve(value);
|
|
@@ -26996,12 +28594,12 @@ var __awaiter13 = function(thisArg, _arguments, P, generator) {
|
|
|
26996
28594
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26997
28595
|
});
|
|
26998
28596
|
};
|
|
26999
|
-
var
|
|
28597
|
+
var logger32 = new Logger(version23);
|
|
27000
28598
|
var NextId = 1;
|
|
27001
28599
|
var WebSocketProvider = class extends JsonRpcProvider {
|
|
27002
28600
|
constructor(url, network) {
|
|
27003
28601
|
if (network === "any") {
|
|
27004
|
-
|
|
28602
|
+
logger32.throwError("WebSocketProvider does not support 'any' network yet", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
27005
28603
|
operation: "network:any"
|
|
27006
28604
|
});
|
|
27007
28605
|
}
|
|
@@ -27087,17 +28685,17 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27087
28685
|
return 0;
|
|
27088
28686
|
}
|
|
27089
28687
|
resetEventsBlock(blockNumber) {
|
|
27090
|
-
|
|
28688
|
+
logger32.throwError("cannot reset events block on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
27091
28689
|
operation: "resetEventBlock"
|
|
27092
28690
|
});
|
|
27093
28691
|
}
|
|
27094
28692
|
set pollingInterval(value) {
|
|
27095
|
-
|
|
28693
|
+
logger32.throwError("cannot set polling interval on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
27096
28694
|
operation: "setPollingInterval"
|
|
27097
28695
|
});
|
|
27098
28696
|
}
|
|
27099
28697
|
poll() {
|
|
27100
|
-
return
|
|
28698
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
27101
28699
|
return null;
|
|
27102
28700
|
});
|
|
27103
28701
|
}
|
|
@@ -27105,7 +28703,7 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27105
28703
|
if (!value) {
|
|
27106
28704
|
return;
|
|
27107
28705
|
}
|
|
27108
|
-
|
|
28706
|
+
logger32.throwError("cannot set polling on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
27109
28707
|
operation: "setPolling"
|
|
27110
28708
|
});
|
|
27111
28709
|
}
|
|
@@ -27139,7 +28737,7 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27139
28737
|
return "ws://localhost:8546";
|
|
27140
28738
|
}
|
|
27141
28739
|
_subscribe(tag, param, processFunc) {
|
|
27142
|
-
return
|
|
28740
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
27143
28741
|
let subIdPromise = this._subIds[tag];
|
|
27144
28742
|
if (subIdPromise == null) {
|
|
27145
28743
|
subIdPromise = Promise.all(param).then((param2) => {
|
|
@@ -27224,7 +28822,7 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27224
28822
|
});
|
|
27225
28823
|
}
|
|
27226
28824
|
destroy() {
|
|
27227
|
-
return
|
|
28825
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
27228
28826
|
if (this.websocket.readyState === WS.CONNECTING) {
|
|
27229
28827
|
yield new Promise((resolve) => {
|
|
27230
28828
|
this.websocket.onopen = function() {
|
|
@@ -27240,8 +28838,8 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27240
28838
|
}
|
|
27241
28839
|
};
|
|
27242
28840
|
|
|
27243
|
-
// node_modules
|
|
27244
|
-
var
|
|
28841
|
+
// node_modules/@ethersproject/providers/lib.esm/url-json-rpc-provider.js
|
|
28842
|
+
var __awaiter13 = function(thisArg, _arguments, P, generator) {
|
|
27245
28843
|
function adopt(value) {
|
|
27246
28844
|
return value instanceof P ? value : new P(function(resolve) {
|
|
27247
28845
|
resolve(value);
|
|
@@ -27268,18 +28866,18 @@ var __awaiter14 = function(thisArg, _arguments, P, generator) {
|
|
|
27268
28866
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27269
28867
|
});
|
|
27270
28868
|
};
|
|
27271
|
-
var
|
|
28869
|
+
var logger33 = new Logger(version23);
|
|
27272
28870
|
var StaticJsonRpcProvider = class extends JsonRpcProvider {
|
|
27273
28871
|
detectNetwork() {
|
|
27274
28872
|
const _super = Object.create(null, {
|
|
27275
28873
|
detectNetwork: { get: () => super.detectNetwork }
|
|
27276
28874
|
});
|
|
27277
|
-
return
|
|
28875
|
+
return __awaiter13(this, void 0, void 0, function* () {
|
|
27278
28876
|
let network = this.network;
|
|
27279
28877
|
if (network == null) {
|
|
27280
28878
|
network = yield _super.detectNetwork.call(this);
|
|
27281
28879
|
if (!network) {
|
|
27282
|
-
|
|
28880
|
+
logger33.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
27283
28881
|
}
|
|
27284
28882
|
if (this._network == null) {
|
|
27285
28883
|
defineReadOnly(this, "_network", network);
|
|
@@ -27292,7 +28890,7 @@ var StaticJsonRpcProvider = class extends JsonRpcProvider {
|
|
|
27292
28890
|
};
|
|
27293
28891
|
var UrlJsonRpcProvider = class _UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
27294
28892
|
constructor(network, apiKey) {
|
|
27295
|
-
|
|
28893
|
+
logger33.checkAbstract(new.target, _UrlJsonRpcProvider);
|
|
27296
28894
|
network = getStatic(new.target, "getNetwork")(network);
|
|
27297
28895
|
apiKey = getStatic(new.target, "getApiKey")(apiKey);
|
|
27298
28896
|
const connection = getStatic(new.target, "getUrl")(network, apiKey);
|
|
@@ -27306,13 +28904,13 @@ var UrlJsonRpcProvider = class _UrlJsonRpcProvider extends StaticJsonRpcProvider
|
|
|
27306
28904
|
}
|
|
27307
28905
|
}
|
|
27308
28906
|
_startPending() {
|
|
27309
|
-
|
|
28907
|
+
logger33.warn("WARNING: API provider does not support pending filters");
|
|
27310
28908
|
}
|
|
27311
28909
|
isCommunityResource() {
|
|
27312
28910
|
return false;
|
|
27313
28911
|
}
|
|
27314
28912
|
getSigner(address) {
|
|
27315
|
-
return
|
|
28913
|
+
return logger33.throwError("API provider does not support signing", Logger.errors.UNSUPPORTED_OPERATION, { operation: "getSigner" });
|
|
27316
28914
|
}
|
|
27317
28915
|
listAccounts() {
|
|
27318
28916
|
return Promise.resolve([]);
|
|
@@ -27325,14 +28923,14 @@ var UrlJsonRpcProvider = class _UrlJsonRpcProvider extends StaticJsonRpcProvider
|
|
|
27325
28923
|
// API key will have been sanitized by the getApiKey first, so any validation
|
|
27326
28924
|
// or transformations can be done there.
|
|
27327
28925
|
static getUrl(network, apiKey) {
|
|
27328
|
-
return
|
|
28926
|
+
return logger33.throwError("not implemented; sub-classes must override getUrl", Logger.errors.NOT_IMPLEMENTED, {
|
|
27329
28927
|
operation: "getUrl"
|
|
27330
28928
|
});
|
|
27331
28929
|
}
|
|
27332
28930
|
};
|
|
27333
28931
|
|
|
27334
|
-
// node_modules
|
|
27335
|
-
var
|
|
28932
|
+
// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js
|
|
28933
|
+
var logger34 = new Logger(version23);
|
|
27336
28934
|
var defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
|
|
27337
28935
|
var AlchemyWebSocketProvider = class extends WebSocketProvider {
|
|
27338
28936
|
constructor(network, apiKey) {
|
|
@@ -27354,7 +28952,7 @@ var AlchemyProvider = class extends UrlJsonRpcProvider {
|
|
|
27354
28952
|
return defaultApiKey;
|
|
27355
28953
|
}
|
|
27356
28954
|
if (apiKey && typeof apiKey !== "string") {
|
|
27357
|
-
|
|
28955
|
+
logger34.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
27358
28956
|
}
|
|
27359
28957
|
return apiKey;
|
|
27360
28958
|
}
|
|
@@ -27395,7 +28993,7 @@ var AlchemyProvider = class extends UrlJsonRpcProvider {
|
|
|
27395
28993
|
host = "opt-sepolia.g.alchemy.com/v2/";
|
|
27396
28994
|
break;
|
|
27397
28995
|
default:
|
|
27398
|
-
|
|
28996
|
+
logger34.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
27399
28997
|
}
|
|
27400
28998
|
return {
|
|
27401
28999
|
allowGzip: true,
|
|
@@ -27413,8 +29011,8 @@ var AlchemyProvider = class extends UrlJsonRpcProvider {
|
|
|
27413
29011
|
}
|
|
27414
29012
|
};
|
|
27415
29013
|
|
|
27416
|
-
// node_modules
|
|
27417
|
-
var
|
|
29014
|
+
// node_modules/@ethersproject/providers/lib.esm/ankr-provider.js
|
|
29015
|
+
var logger35 = new Logger(version23);
|
|
27418
29016
|
var defaultApiKey2 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
|
|
27419
29017
|
function getHost(name) {
|
|
27420
29018
|
switch (name) {
|
|
@@ -27441,7 +29039,7 @@ function getHost(name) {
|
|
|
27441
29039
|
case "arbitrum":
|
|
27442
29040
|
return "rpc.ankr.com/arbitrum/";
|
|
27443
29041
|
}
|
|
27444
|
-
return
|
|
29042
|
+
return logger35.throwArgumentError("unsupported network", "name", name);
|
|
27445
29043
|
}
|
|
27446
29044
|
var AnkrProvider = class extends UrlJsonRpcProvider {
|
|
27447
29045
|
isCommunityResource() {
|
|
@@ -27475,8 +29073,8 @@ var AnkrProvider = class extends UrlJsonRpcProvider {
|
|
|
27475
29073
|
}
|
|
27476
29074
|
};
|
|
27477
29075
|
|
|
27478
|
-
// node_modules
|
|
27479
|
-
var
|
|
29076
|
+
// node_modules/@ethersproject/providers/lib.esm/cloudflare-provider.js
|
|
29077
|
+
var __awaiter14 = function(thisArg, _arguments, P, generator) {
|
|
27480
29078
|
function adopt(value) {
|
|
27481
29079
|
return value instanceof P ? value : new P(function(resolve) {
|
|
27482
29080
|
resolve(value);
|
|
@@ -27503,11 +29101,11 @@ var __awaiter15 = function(thisArg, _arguments, P, generator) {
|
|
|
27503
29101
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27504
29102
|
});
|
|
27505
29103
|
};
|
|
27506
|
-
var
|
|
29104
|
+
var logger36 = new Logger(version23);
|
|
27507
29105
|
var CloudflareProvider = class extends UrlJsonRpcProvider {
|
|
27508
29106
|
static getApiKey(apiKey) {
|
|
27509
29107
|
if (apiKey != null) {
|
|
27510
|
-
|
|
29108
|
+
logger36.throwArgumentError("apiKey not supported for cloudflare", "apiKey", apiKey);
|
|
27511
29109
|
}
|
|
27512
29110
|
return null;
|
|
27513
29111
|
}
|
|
@@ -27518,7 +29116,7 @@ var CloudflareProvider = class extends UrlJsonRpcProvider {
|
|
|
27518
29116
|
host = "https://cloudflare-eth.com/";
|
|
27519
29117
|
break;
|
|
27520
29118
|
default:
|
|
27521
|
-
|
|
29119
|
+
logger36.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
27522
29120
|
}
|
|
27523
29121
|
return host;
|
|
27524
29122
|
}
|
|
@@ -27526,7 +29124,7 @@ var CloudflareProvider = class extends UrlJsonRpcProvider {
|
|
|
27526
29124
|
const _super = Object.create(null, {
|
|
27527
29125
|
perform: { get: () => super.perform }
|
|
27528
29126
|
});
|
|
27529
|
-
return
|
|
29127
|
+
return __awaiter14(this, void 0, void 0, function* () {
|
|
27530
29128
|
if (method === "getBlockNumber") {
|
|
27531
29129
|
const block = yield _super.perform.call(this, "getBlock", { blockTag: "latest" });
|
|
27532
29130
|
return block.number;
|
|
@@ -27536,8 +29134,8 @@ var CloudflareProvider = class extends UrlJsonRpcProvider {
|
|
|
27536
29134
|
}
|
|
27537
29135
|
};
|
|
27538
29136
|
|
|
27539
|
-
// node_modules
|
|
27540
|
-
var
|
|
29137
|
+
// node_modules/@ethersproject/providers/lib.esm/etherscan-provider.js
|
|
29138
|
+
var __awaiter15 = function(thisArg, _arguments, P, generator) {
|
|
27541
29139
|
function adopt(value) {
|
|
27542
29140
|
return value instanceof P ? value : new P(function(resolve) {
|
|
27543
29141
|
resolve(value);
|
|
@@ -27564,7 +29162,7 @@ var __awaiter16 = function(thisArg, _arguments, P, generator) {
|
|
|
27564
29162
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27565
29163
|
});
|
|
27566
29164
|
};
|
|
27567
|
-
var
|
|
29165
|
+
var logger37 = new Logger(version23);
|
|
27568
29166
|
function getTransactionPostData(transaction) {
|
|
27569
29167
|
const result = {};
|
|
27570
29168
|
for (let key2 in transaction) {
|
|
@@ -27646,7 +29244,7 @@ function checkError2(method, error, transaction) {
|
|
|
27646
29244
|
if (isHexString(data)) {
|
|
27647
29245
|
return data;
|
|
27648
29246
|
}
|
|
27649
|
-
|
|
29247
|
+
logger37.throwError("missing revert data in call exception", Logger.errors.CALL_EXCEPTION, {
|
|
27650
29248
|
error,
|
|
27651
29249
|
data: "0x"
|
|
27652
29250
|
});
|
|
@@ -27664,28 +29262,28 @@ function checkError2(method, error, transaction) {
|
|
|
27664
29262
|
}
|
|
27665
29263
|
message = (message || "").toLowerCase();
|
|
27666
29264
|
if (message.match(/insufficient funds/)) {
|
|
27667
|
-
|
|
29265
|
+
logger37.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
27668
29266
|
error,
|
|
27669
29267
|
method,
|
|
27670
29268
|
transaction
|
|
27671
29269
|
});
|
|
27672
29270
|
}
|
|
27673
29271
|
if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {
|
|
27674
|
-
|
|
29272
|
+
logger37.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
27675
29273
|
error,
|
|
27676
29274
|
method,
|
|
27677
29275
|
transaction
|
|
27678
29276
|
});
|
|
27679
29277
|
}
|
|
27680
29278
|
if (message.match(/another transaction with same nonce/)) {
|
|
27681
|
-
|
|
29279
|
+
logger37.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
27682
29280
|
error,
|
|
27683
29281
|
method,
|
|
27684
29282
|
transaction
|
|
27685
29283
|
});
|
|
27686
29284
|
}
|
|
27687
29285
|
if (message.match(/execution failed due to an exception|execution reverted/)) {
|
|
27688
|
-
|
|
29286
|
+
logger37.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
27689
29287
|
error,
|
|
27690
29288
|
method,
|
|
27691
29289
|
transaction
|
|
@@ -27721,7 +29319,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27721
29319
|
return "https://api-goerli-optimistic.etherscan.io";
|
|
27722
29320
|
default:
|
|
27723
29321
|
}
|
|
27724
|
-
return
|
|
29322
|
+
return logger37.throwArgumentError("unsupported network", "network", this.network.name);
|
|
27725
29323
|
}
|
|
27726
29324
|
getUrl(module2, params) {
|
|
27727
29325
|
const query = Object.keys(params).reduce((accum, key2) => {
|
|
@@ -27743,7 +29341,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27743
29341
|
return params;
|
|
27744
29342
|
}
|
|
27745
29343
|
fetch(module2, params, post) {
|
|
27746
|
-
return
|
|
29344
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
27747
29345
|
const url = post ? this.getPostUrl() : this.getUrl(module2, params);
|
|
27748
29346
|
const payload = post ? this.getPostData(module2, params) : null;
|
|
27749
29347
|
const procFunc = module2 === "proxy" ? getJsonResult : getResult2;
|
|
@@ -27780,7 +29378,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27780
29378
|
});
|
|
27781
29379
|
}
|
|
27782
29380
|
detectNetwork() {
|
|
27783
|
-
return
|
|
29381
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
27784
29382
|
return this.network;
|
|
27785
29383
|
});
|
|
27786
29384
|
}
|
|
@@ -27788,7 +29386,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27788
29386
|
const _super = Object.create(null, {
|
|
27789
29387
|
perform: { get: () => super.perform }
|
|
27790
29388
|
});
|
|
27791
|
-
return
|
|
29389
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
27792
29390
|
switch (method) {
|
|
27793
29391
|
case "getBlockNumber":
|
|
27794
29392
|
return this.fetch("proxy", { action: "eth_blockNumber" });
|
|
@@ -27881,12 +29479,12 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27881
29479
|
}
|
|
27882
29480
|
if (params.filter.topics && params.filter.topics.length > 0) {
|
|
27883
29481
|
if (params.filter.topics.length > 1) {
|
|
27884
|
-
|
|
29482
|
+
logger37.throwError("unsupported topic count", Logger.errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });
|
|
27885
29483
|
}
|
|
27886
29484
|
if (params.filter.topics.length === 1) {
|
|
27887
29485
|
const topic0 = params.filter.topics[0];
|
|
27888
29486
|
if (typeof topic0 !== "string" || topic0.length !== 66) {
|
|
27889
|
-
|
|
29487
|
+
logger37.throwError("unsupported topic format", Logger.errors.UNSUPPORTED_OPERATION, { topic0 });
|
|
27890
29488
|
}
|
|
27891
29489
|
args.topic0 = topic0;
|
|
27892
29490
|
}
|
|
@@ -27924,7 +29522,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27924
29522
|
// Error: Result window is too large, PageNo x Offset size must
|
|
27925
29523
|
// be less than or equal to 10000
|
|
27926
29524
|
getHistory(addressOrName, startBlock, endBlock) {
|
|
27927
|
-
return
|
|
29525
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
27928
29526
|
const params = {
|
|
27929
29527
|
action: "txlist",
|
|
27930
29528
|
address: yield this.resolveName(addressOrName),
|
|
@@ -27955,8 +29553,8 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27955
29553
|
}
|
|
27956
29554
|
};
|
|
27957
29555
|
|
|
27958
|
-
// node_modules
|
|
27959
|
-
var
|
|
29556
|
+
// node_modules/@ethersproject/providers/lib.esm/fallback-provider.js
|
|
29557
|
+
var __awaiter16 = function(thisArg, _arguments, P, generator) {
|
|
27960
29558
|
function adopt(value) {
|
|
27961
29559
|
return value instanceof P ? value : new P(function(resolve) {
|
|
27962
29560
|
resolve(value);
|
|
@@ -27983,7 +29581,7 @@ var __awaiter17 = function(thisArg, _arguments, P, generator) {
|
|
|
27983
29581
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27984
29582
|
});
|
|
27985
29583
|
};
|
|
27986
|
-
var
|
|
29584
|
+
var logger38 = new Logger(version23);
|
|
27987
29585
|
function now() {
|
|
27988
29586
|
return (/* @__PURE__ */ new Date()).getTime();
|
|
27989
29587
|
}
|
|
@@ -27996,7 +29594,7 @@ function checkNetworks(networks2) {
|
|
|
27996
29594
|
}
|
|
27997
29595
|
if (result) {
|
|
27998
29596
|
if (!(result.name === network.name && result.chainId === network.chainId && (result.ensAddress === network.ensAddress || result.ensAddress == null && network.ensAddress == null))) {
|
|
27999
|
-
|
|
29597
|
+
logger38.throwArgumentError("provider mismatch", "networks", networks2);
|
|
28000
29598
|
}
|
|
28001
29599
|
} else {
|
|
28002
29600
|
result = network;
|
|
@@ -28197,7 +29795,7 @@ function getProcessFunc(provider, method, params) {
|
|
|
28197
29795
|
return normalizedTally(normalize2, provider.quorum);
|
|
28198
29796
|
}
|
|
28199
29797
|
function waitForSync(config, blockNumber) {
|
|
28200
|
-
return
|
|
29798
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
28201
29799
|
const provider = config.provider;
|
|
28202
29800
|
if (provider.blockNumber != null && provider.blockNumber >= blockNumber || blockNumber === -1) {
|
|
28203
29801
|
return provider;
|
|
@@ -28218,7 +29816,7 @@ function waitForSync(config, blockNumber) {
|
|
|
28218
29816
|
});
|
|
28219
29817
|
}
|
|
28220
29818
|
function getRunner(config, currentBlockNumber, method, params) {
|
|
28221
|
-
return
|
|
29819
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
28222
29820
|
let provider = config.provider;
|
|
28223
29821
|
switch (method) {
|
|
28224
29822
|
case "getBlockNumber":
|
|
@@ -28266,7 +29864,7 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
28266
29864
|
return provider.getLogs(filter);
|
|
28267
29865
|
}
|
|
28268
29866
|
}
|
|
28269
|
-
return
|
|
29867
|
+
return logger38.throwError("unknown method error", Logger.errors.UNKNOWN_ERROR, {
|
|
28270
29868
|
method,
|
|
28271
29869
|
params
|
|
28272
29870
|
});
|
|
@@ -28275,7 +29873,7 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
28275
29873
|
var FallbackProvider = class extends BaseProvider {
|
|
28276
29874
|
constructor(providers, quorum) {
|
|
28277
29875
|
if (providers.length === 0) {
|
|
28278
|
-
|
|
29876
|
+
logger38.throwArgumentError("missing providers", "providers", providers);
|
|
28279
29877
|
}
|
|
28280
29878
|
const providerConfigs = providers.map((configOrProvider, index) => {
|
|
28281
29879
|
if (Provider.isProvider(configOrProvider)) {
|
|
@@ -28295,7 +29893,7 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28295
29893
|
}
|
|
28296
29894
|
const weight = config.weight;
|
|
28297
29895
|
if (weight % 1 || weight > 512 || weight < 1) {
|
|
28298
|
-
|
|
29896
|
+
logger38.throwArgumentError("invalid weight; must be integer in [1, 512]", `providers[${index}].weight`, weight);
|
|
28299
29897
|
}
|
|
28300
29898
|
return Object.freeze(config);
|
|
28301
29899
|
});
|
|
@@ -28303,7 +29901,7 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28303
29901
|
if (quorum == null) {
|
|
28304
29902
|
quorum = total / 2;
|
|
28305
29903
|
} else if (quorum > total) {
|
|
28306
|
-
|
|
29904
|
+
logger38.throwArgumentError("quorum will always fail; larger than total weight", "quorum", quorum);
|
|
28307
29905
|
}
|
|
28308
29906
|
let networkOrReady = checkNetworks(providerConfigs.map((c) => c.provider.network));
|
|
28309
29907
|
if (networkOrReady == null) {
|
|
@@ -28319,13 +29917,13 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28319
29917
|
this._highestBlockNumber = -1;
|
|
28320
29918
|
}
|
|
28321
29919
|
detectNetwork() {
|
|
28322
|
-
return
|
|
29920
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
28323
29921
|
const networks2 = yield Promise.all(this.providerConfigs.map((c) => c.provider.getNetwork()));
|
|
28324
29922
|
return checkNetworks(networks2);
|
|
28325
29923
|
});
|
|
28326
29924
|
}
|
|
28327
29925
|
perform(method, params) {
|
|
28328
|
-
return
|
|
29926
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
28329
29927
|
if (method === "sendTransaction") {
|
|
28330
29928
|
const results = yield Promise.all(this.providerConfigs.map((c) => {
|
|
28331
29929
|
return c.provider.sendTransaction(params.signedTransaction).then((result) => {
|
|
@@ -28460,7 +30058,7 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28460
30058
|
}
|
|
28461
30059
|
props[name] = e[name];
|
|
28462
30060
|
});
|
|
28463
|
-
|
|
30061
|
+
logger38.throwError(e.reason || e.message, errorCode, props);
|
|
28464
30062
|
});
|
|
28465
30063
|
if (configs.filter((c) => !c.done).length === 0) {
|
|
28466
30064
|
break;
|
|
@@ -28472,7 +30070,7 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28472
30070
|
}
|
|
28473
30071
|
c.cancelled = true;
|
|
28474
30072
|
});
|
|
28475
|
-
return
|
|
30073
|
+
return logger38.throwError("failed to meet quorum", Logger.errors.SERVER_ERROR, {
|
|
28476
30074
|
method,
|
|
28477
30075
|
params,
|
|
28478
30076
|
//results: configs.map((c) => c.result),
|
|
@@ -28484,18 +30082,18 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28484
30082
|
}
|
|
28485
30083
|
};
|
|
28486
30084
|
|
|
28487
|
-
// node_modules
|
|
30085
|
+
// node_modules/@ethersproject/providers/lib.esm/ipc-provider.js
|
|
28488
30086
|
var IpcProvider = null;
|
|
28489
30087
|
|
|
28490
|
-
// node_modules
|
|
28491
|
-
var
|
|
30088
|
+
// node_modules/@ethersproject/providers/lib.esm/infura-provider.js
|
|
30089
|
+
var logger39 = new Logger(version23);
|
|
28492
30090
|
var defaultProjectId = "84842078b09946638c03157f83405213";
|
|
28493
30091
|
var InfuraWebSocketProvider = class extends WebSocketProvider {
|
|
28494
30092
|
constructor(network, apiKey) {
|
|
28495
30093
|
const provider = new InfuraProvider(network, apiKey);
|
|
28496
30094
|
const connection = provider.connection;
|
|
28497
30095
|
if (connection.password) {
|
|
28498
|
-
|
|
30096
|
+
logger39.throwError("INFURA WebSocket project secrets unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
28499
30097
|
operation: "InfuraProvider.getWebSocketProvider()"
|
|
28500
30098
|
});
|
|
28501
30099
|
}
|
|
@@ -28525,8 +30123,8 @@ var InfuraProvider = class extends UrlJsonRpcProvider {
|
|
|
28525
30123
|
if (typeof apiKey === "string") {
|
|
28526
30124
|
apiKeyObj.projectId = apiKey;
|
|
28527
30125
|
} else if (apiKey.projectSecret != null) {
|
|
28528
|
-
|
|
28529
|
-
|
|
30126
|
+
logger39.assertArgument(typeof apiKey.projectId === "string", "projectSecret requires a projectId", "projectId", apiKey.projectId);
|
|
30127
|
+
logger39.assertArgument(typeof apiKey.projectSecret === "string", "invalid projectSecret", "projectSecret", "[REDACTED]");
|
|
28530
30128
|
apiKeyObj.projectId = apiKey.projectId;
|
|
28531
30129
|
apiKeyObj.projectSecret = apiKey.projectSecret;
|
|
28532
30130
|
} else if (apiKey.projectId) {
|
|
@@ -28572,7 +30170,7 @@ var InfuraProvider = class extends UrlJsonRpcProvider {
|
|
|
28572
30170
|
host = "arbitrum-sepolia.infura.io";
|
|
28573
30171
|
break;
|
|
28574
30172
|
default:
|
|
28575
|
-
|
|
30173
|
+
logger39.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
28576
30174
|
argument: "network",
|
|
28577
30175
|
value: network
|
|
28578
30176
|
});
|
|
@@ -28598,7 +30196,7 @@ var InfuraProvider = class extends UrlJsonRpcProvider {
|
|
|
28598
30196
|
}
|
|
28599
30197
|
};
|
|
28600
30198
|
|
|
28601
|
-
// node_modules
|
|
30199
|
+
// node_modules/@ethersproject/providers/lib.esm/json-rpc-batch-provider.js
|
|
28602
30200
|
var JsonRpcBatchProvider = class extends JsonRpcProvider {
|
|
28603
30201
|
send(method, params) {
|
|
28604
30202
|
const request = {
|
|
@@ -28662,18 +30260,18 @@ var JsonRpcBatchProvider = class extends JsonRpcProvider {
|
|
|
28662
30260
|
}
|
|
28663
30261
|
};
|
|
28664
30262
|
|
|
28665
|
-
// node_modules
|
|
28666
|
-
var
|
|
30263
|
+
// node_modules/@ethersproject/providers/lib.esm/nodesmith-provider.js
|
|
30264
|
+
var logger40 = new Logger(version23);
|
|
28667
30265
|
var defaultApiKey3 = "ETHERS_JS_SHARED";
|
|
28668
30266
|
var NodesmithProvider = class extends UrlJsonRpcProvider {
|
|
28669
30267
|
static getApiKey(apiKey) {
|
|
28670
30268
|
if (apiKey && typeof apiKey !== "string") {
|
|
28671
|
-
|
|
30269
|
+
logger40.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
28672
30270
|
}
|
|
28673
30271
|
return apiKey || defaultApiKey3;
|
|
28674
30272
|
}
|
|
28675
30273
|
static getUrl(network, apiKey) {
|
|
28676
|
-
|
|
30274
|
+
logger40.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");
|
|
28677
30275
|
let host = null;
|
|
28678
30276
|
switch (network.name) {
|
|
28679
30277
|
case "homestead":
|
|
@@ -28692,14 +30290,14 @@ var NodesmithProvider = class extends UrlJsonRpcProvider {
|
|
|
28692
30290
|
host = "https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";
|
|
28693
30291
|
break;
|
|
28694
30292
|
default:
|
|
28695
|
-
|
|
30293
|
+
logger40.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
28696
30294
|
}
|
|
28697
30295
|
return host + "?apiKey=" + apiKey;
|
|
28698
30296
|
}
|
|
28699
30297
|
};
|
|
28700
30298
|
|
|
28701
|
-
// node_modules
|
|
28702
|
-
var
|
|
30299
|
+
// node_modules/@ethersproject/providers/lib.esm/pocket-provider.js
|
|
30300
|
+
var logger41 = new Logger(version23);
|
|
28703
30301
|
var defaultApplicationId = "62e1ad51b37b8e00394bda3b";
|
|
28704
30302
|
var PocketProvider = class extends UrlJsonRpcProvider {
|
|
28705
30303
|
static getApiKey(apiKey) {
|
|
@@ -28718,7 +30316,7 @@ var PocketProvider = class extends UrlJsonRpcProvider {
|
|
|
28718
30316
|
} else if (apiKey.applicationId) {
|
|
28719
30317
|
apiKeyObj.applicationId = apiKey.applicationId;
|
|
28720
30318
|
} else {
|
|
28721
|
-
|
|
30319
|
+
logger41.throwArgumentError("unsupported PocketProvider apiKey", "apiKey", apiKey);
|
|
28722
30320
|
}
|
|
28723
30321
|
return apiKeyObj;
|
|
28724
30322
|
}
|
|
@@ -28747,7 +30345,7 @@ var PocketProvider = class extends UrlJsonRpcProvider {
|
|
|
28747
30345
|
host = "eth-ropsten.gateway.pokt.network";
|
|
28748
30346
|
break;
|
|
28749
30347
|
default:
|
|
28750
|
-
|
|
30348
|
+
logger41.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
28751
30349
|
argument: "network",
|
|
28752
30350
|
value: network
|
|
28753
30351
|
});
|
|
@@ -28765,13 +30363,13 @@ var PocketProvider = class extends UrlJsonRpcProvider {
|
|
|
28765
30363
|
}
|
|
28766
30364
|
};
|
|
28767
30365
|
|
|
28768
|
-
// node_modules
|
|
28769
|
-
var
|
|
30366
|
+
// node_modules/@ethersproject/providers/lib.esm/quicknode-provider.js
|
|
30367
|
+
var logger42 = new Logger(version23);
|
|
28770
30368
|
var defaultApiKey4 = "919b412a057b5e9c9b6dce193c5a60242d6efadb";
|
|
28771
30369
|
var QuickNodeProvider = class extends UrlJsonRpcProvider {
|
|
28772
30370
|
static getApiKey(apiKey) {
|
|
28773
30371
|
if (apiKey && typeof apiKey !== "string") {
|
|
28774
|
-
|
|
30372
|
+
logger42.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
28775
30373
|
}
|
|
28776
30374
|
return apiKey || defaultApiKey4;
|
|
28777
30375
|
}
|
|
@@ -28833,14 +30431,14 @@ var QuickNodeProvider = class extends UrlJsonRpcProvider {
|
|
|
28833
30431
|
host = "ethers.xdai.quiknode.pro";
|
|
28834
30432
|
break;
|
|
28835
30433
|
default:
|
|
28836
|
-
|
|
30434
|
+
logger42.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
28837
30435
|
}
|
|
28838
30436
|
return "https://" + host + "/" + apiKey;
|
|
28839
30437
|
}
|
|
28840
30438
|
};
|
|
28841
30439
|
|
|
28842
|
-
// node_modules
|
|
28843
|
-
var
|
|
30440
|
+
// node_modules/@ethersproject/providers/lib.esm/web3-provider.js
|
|
30441
|
+
var logger43 = new Logger(version23);
|
|
28844
30442
|
var _nextId = 1;
|
|
28845
30443
|
function buildWeb3LegacyFetcher(provider, sendFunc) {
|
|
28846
30444
|
const fetcher = "Web3LegacyFetcher";
|
|
@@ -28923,7 +30521,7 @@ function buildEip1193Fetcher(provider) {
|
|
|
28923
30521
|
var Web3Provider = class extends JsonRpcProvider {
|
|
28924
30522
|
constructor(provider, network) {
|
|
28925
30523
|
if (provider == null) {
|
|
28926
|
-
|
|
30524
|
+
logger43.throwArgumentError("missing provider", "provider", provider);
|
|
28927
30525
|
}
|
|
28928
30526
|
let path2 = null;
|
|
28929
30527
|
let jsonRpcFetchFunc = null;
|
|
@@ -28947,7 +30545,7 @@ var Web3Provider = class extends JsonRpcProvider {
|
|
|
28947
30545
|
} else if (provider.send) {
|
|
28948
30546
|
jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));
|
|
28949
30547
|
} else {
|
|
28950
|
-
|
|
30548
|
+
logger43.throwArgumentError("unsupported provider", "provider", provider);
|
|
28951
30549
|
}
|
|
28952
30550
|
if (!path2) {
|
|
28953
30551
|
path2 = "unknown:";
|
|
@@ -28962,8 +30560,8 @@ var Web3Provider = class extends JsonRpcProvider {
|
|
|
28962
30560
|
}
|
|
28963
30561
|
};
|
|
28964
30562
|
|
|
28965
|
-
// node_modules
|
|
28966
|
-
var
|
|
30563
|
+
// node_modules/@ethersproject/providers/lib.esm/index.js
|
|
30564
|
+
var logger44 = new Logger(version23);
|
|
28967
30565
|
function getDefaultProvider(network, options) {
|
|
28968
30566
|
if (network == null) {
|
|
28969
30567
|
network = "homestead";
|
|
@@ -28979,13 +30577,13 @@ function getDefaultProvider(network, options) {
|
|
|
28979
30577
|
case "wss":
|
|
28980
30578
|
return new WebSocketProvider(network);
|
|
28981
30579
|
default:
|
|
28982
|
-
|
|
30580
|
+
logger44.throwArgumentError("unsupported URL scheme", "network", network);
|
|
28983
30581
|
}
|
|
28984
30582
|
}
|
|
28985
30583
|
}
|
|
28986
30584
|
const n = getNetwork(network);
|
|
28987
30585
|
if (!n || !n._defaultProvider) {
|
|
28988
|
-
|
|
30586
|
+
logger44.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
|
|
28989
30587
|
operation: "getDefaultProvider",
|
|
28990
30588
|
network
|
|
28991
30589
|
});
|
|
@@ -29111,14 +30709,14 @@ __export(utils_exports, {
|
|
|
29111
30709
|
});
|
|
29112
30710
|
|
|
29113
30711
|
// node_modules/@ethersproject/solidity/lib.esm/_version.js
|
|
29114
|
-
var
|
|
30712
|
+
var version24 = "solidity/5.8.0";
|
|
29115
30713
|
|
|
29116
30714
|
// node_modules/@ethersproject/solidity/lib.esm/index.js
|
|
29117
30715
|
var regexBytes = new RegExp("^bytes([0-9]+)$");
|
|
29118
30716
|
var regexNumber = new RegExp("^(u?int)([0-9]*)$");
|
|
29119
30717
|
var regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$");
|
|
29120
30718
|
var Zeros2 = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
29121
|
-
var
|
|
30719
|
+
var logger45 = new Logger(version24);
|
|
29122
30720
|
function _pack(type, value, isArray) {
|
|
29123
30721
|
switch (type) {
|
|
29124
30722
|
case "address":
|
|
@@ -29141,7 +30739,7 @@ function _pack(type, value, isArray) {
|
|
|
29141
30739
|
if (match2) {
|
|
29142
30740
|
let size = parseInt(match2[2] || "256");
|
|
29143
30741
|
if (match2[2] && String(size) !== match2[2] || size % 8 !== 0 || size === 0 || size > 256) {
|
|
29144
|
-
|
|
30742
|
+
logger45.throwArgumentError("invalid number type", "type", type);
|
|
29145
30743
|
}
|
|
29146
30744
|
if (isArray) {
|
|
29147
30745
|
size = 256;
|
|
@@ -29153,10 +30751,10 @@ function _pack(type, value, isArray) {
|
|
|
29153
30751
|
if (match2) {
|
|
29154
30752
|
const size = parseInt(match2[1]);
|
|
29155
30753
|
if (String(size) !== match2[1] || size === 0 || size > 32) {
|
|
29156
|
-
|
|
30754
|
+
logger45.throwArgumentError("invalid bytes type", "type", type);
|
|
29157
30755
|
}
|
|
29158
30756
|
if (arrayify(value).byteLength !== size) {
|
|
29159
|
-
|
|
30757
|
+
logger45.throwArgumentError(`invalid value for ${type}`, "value", value);
|
|
29160
30758
|
}
|
|
29161
30759
|
if (isArray) {
|
|
29162
30760
|
return arrayify((value + Zeros2).substring(0, 66));
|
|
@@ -29168,7 +30766,7 @@ function _pack(type, value, isArray) {
|
|
|
29168
30766
|
const baseType = match2[1];
|
|
29169
30767
|
const count = parseInt(match2[2] || String(value.length));
|
|
29170
30768
|
if (count != value.length) {
|
|
29171
|
-
|
|
30769
|
+
logger45.throwArgumentError(`invalid array length for ${type}`, "value", value);
|
|
29172
30770
|
}
|
|
29173
30771
|
const result = [];
|
|
29174
30772
|
value.forEach(function(value2) {
|
|
@@ -29176,11 +30774,11 @@ function _pack(type, value, isArray) {
|
|
|
29176
30774
|
});
|
|
29177
30775
|
return concat(result);
|
|
29178
30776
|
}
|
|
29179
|
-
return
|
|
30777
|
+
return logger45.throwArgumentError("invalid type", "type", type);
|
|
29180
30778
|
}
|
|
29181
30779
|
function pack2(types, values) {
|
|
29182
30780
|
if (types.length != values.length) {
|
|
29183
|
-
|
|
30781
|
+
logger45.throwArgumentError("wrong number of values; expected ${ types.length }", "values", values);
|
|
29184
30782
|
}
|
|
29185
30783
|
const tight = [];
|
|
29186
30784
|
types.forEach(function(type, index) {
|
|
@@ -29196,10 +30794,10 @@ function sha2562(types, values) {
|
|
|
29196
30794
|
}
|
|
29197
30795
|
|
|
29198
30796
|
// node_modules/@ethersproject/units/lib.esm/_version.js
|
|
29199
|
-
var
|
|
30797
|
+
var version25 = "units/5.8.0";
|
|
29200
30798
|
|
|
29201
30799
|
// node_modules/@ethersproject/units/lib.esm/index.js
|
|
29202
|
-
var
|
|
30800
|
+
var logger46 = new Logger(version25);
|
|
29203
30801
|
var names = [
|
|
29204
30802
|
"wei",
|
|
29205
30803
|
"kwei",
|
|
@@ -29212,7 +30810,7 @@ var names = [
|
|
|
29212
30810
|
function commify(value) {
|
|
29213
30811
|
const comps = String(value).split(".");
|
|
29214
30812
|
if (comps.length > 2 || !comps[0].match(/^-?[0-9]*$/) || comps[1] && !comps[1].match(/^[0-9]*$/) || value === "." || value === "-.") {
|
|
29215
|
-
|
|
30813
|
+
logger46.throwArgumentError("invalid value", "value", value);
|
|
29216
30814
|
}
|
|
29217
30815
|
let whole = comps[0];
|
|
29218
30816
|
let negative = "";
|
|
@@ -29257,7 +30855,7 @@ function formatUnits(value, unitName) {
|
|
|
29257
30855
|
}
|
|
29258
30856
|
function parseUnits(value, unitName) {
|
|
29259
30857
|
if (typeof value !== "string") {
|
|
29260
|
-
|
|
30858
|
+
logger46.throwArgumentError("value must be a string", "value", value);
|
|
29261
30859
|
}
|
|
29262
30860
|
if (typeof unitName === "string") {
|
|
29263
30861
|
const index = names.indexOf(unitName);
|
|
@@ -29275,10 +30873,10 @@ function parseEther(ether) {
|
|
|
29275
30873
|
}
|
|
29276
30874
|
|
|
29277
30875
|
// node_modules/ethers/lib.esm/_version.js
|
|
29278
|
-
var
|
|
30876
|
+
var version26 = "ethers/5.8.0";
|
|
29279
30877
|
|
|
29280
30878
|
// node_modules/ethers/lib.esm/ethers.js
|
|
29281
|
-
var
|
|
30879
|
+
var logger47 = new Logger(version26);
|
|
29282
30880
|
|
|
29283
30881
|
// node_modules/ethers/lib.esm/index.js
|
|
29284
30882
|
try {
|
|
@@ -31259,6 +32857,7 @@ function createPKPManager(config) {
|
|
|
31259
32857
|
}
|
|
31260
32858
|
|
|
31261
32859
|
// src/modules/loan/loan-creator.module.ts
|
|
32860
|
+
var import_dh_lit_actions = __toESM(require_pkg_src());
|
|
31262
32861
|
var LoanCreator = class {
|
|
31263
32862
|
config;
|
|
31264
32863
|
transactionTimeoutMs;
|
|
@@ -31355,10 +32954,9 @@ var LoanCreator = class {
|
|
|
31355
32954
|
} else if (this.config.litOps.config && pkpValidationRegistryAddress && pkpValidationRegistryAddress !== "0x0000000000000000000000000000000000000000") {
|
|
31356
32955
|
this.config.litOps.config.pkpValidationRegistryAddress = pkpValidationRegistryAddress;
|
|
31357
32956
|
}
|
|
31358
|
-
const { DH_LIT_ACTIONS_CHIPOTLE: DH_LIT_ACTIONS_CHIPOTLE2 } = await import("@gvnrdao/dh-lit-actions");
|
|
31359
32957
|
let certificationCid;
|
|
31360
32958
|
if (isChipotleNetwork) {
|
|
31361
|
-
if (!
|
|
32959
|
+
if (!import_dh_lit_actions.DH_LIT_ACTIONS_CHIPOTLE.btcTransactionSigner?.authorizedCidHex) {
|
|
31362
32960
|
return failure(
|
|
31363
32961
|
new SDKError({
|
|
31364
32962
|
message: "DH_LIT_ACTIONS_CHIPOTLE.btcTransactionSigner.authorizedCidHex is required for loan creation (must match PKPValidation.getCid on-chain).",
|
|
@@ -31367,7 +32965,7 @@ var LoanCreator = class {
|
|
|
31367
32965
|
})
|
|
31368
32966
|
);
|
|
31369
32967
|
}
|
|
31370
|
-
certificationCid =
|
|
32968
|
+
certificationCid = import_dh_lit_actions.DH_LIT_ACTIONS_CHIPOTLE.btcTransactionSigner.authorizedCidHex.toLowerCase();
|
|
31371
32969
|
} else {
|
|
31372
32970
|
throw new SDKError({
|
|
31373
32971
|
message: `Unsupported litNetwork '${litNetwork}' for loan creation. Only the chipotle network is supported.`,
|
|
@@ -34964,7 +36562,7 @@ function createMockTokenManager(config) {
|
|
|
34964
36562
|
|
|
34965
36563
|
// src/modules/diamond-hands-sdk.ts
|
|
34966
36564
|
var import_dh_lit_ops = require("@gvnrdao/dh-lit-ops");
|
|
34967
|
-
var
|
|
36565
|
+
var import_dh_lit_actions2 = __toESM(require_pkg_src());
|
|
34968
36566
|
|
|
34969
36567
|
// src/utils/telegram-messaging.utils.ts
|
|
34970
36568
|
var TelegramBot = null;
|
|
@@ -35293,7 +36891,6 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
35293
36891
|
network: config.litNetwork || DEFAULT_LIT_NETWORK,
|
|
35294
36892
|
signer: config.mode === "standalone" ? config.litOpsSigner : void 0,
|
|
35295
36893
|
serviceEndpoint: isServiceModeConfig(config) ? config.serviceEndpoint : void 0,
|
|
35296
|
-
serviceAuthToken: isServiceModeConfig(config) ? config.serviceAuthToken : void 0,
|
|
35297
36894
|
debug: config.debug,
|
|
35298
36895
|
litNodeConnectTimeoutMs: config.litNodeConnectTimeoutMs
|
|
35299
36896
|
// TODO Round 2: Add litActionExecution config when added to config.i.ts interface
|
|
@@ -36072,7 +37669,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
36072
37669
|
}
|
|
36073
37670
|
} else {
|
|
36074
37671
|
try {
|
|
36075
|
-
const nagaPkpNftAddress =
|
|
37672
|
+
const nagaPkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
36076
37673
|
pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
36077
37674
|
position2.pkpId,
|
|
36078
37675
|
this.getProviderOrThrow(),
|
|
@@ -37175,7 +38772,7 @@ Error data: ${errorData || "none"}`
|
|
|
37175
38772
|
wasLiquidated: false
|
|
37176
38773
|
};
|
|
37177
38774
|
}
|
|
37178
|
-
const nagaPkpNftAddressLiq =
|
|
38775
|
+
const nagaPkpNftAddressLiq = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
37179
38776
|
const pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
37180
38777
|
position.pkpId,
|
|
37181
38778
|
this.getProviderOrThrow(),
|
|
@@ -39256,7 +40853,7 @@ Error data: ${errorData || "none"}`
|
|
|
39256
40853
|
}
|
|
39257
40854
|
} else {
|
|
39258
40855
|
try {
|
|
39259
|
-
const nagaPkpNftAddress =
|
|
40856
|
+
const nagaPkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
39260
40857
|
pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
39261
40858
|
position.pkpId,
|
|
39262
40859
|
this.getProviderOrThrow(),
|
|
@@ -39887,7 +41484,7 @@ Error data: ${errorData || "none"}`
|
|
|
39887
41484
|
} else {
|
|
39888
41485
|
try {
|
|
39889
41486
|
const pkpId = position.pkpId;
|
|
39890
|
-
const nagaPkpNftAddress =
|
|
41487
|
+
const nagaPkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
39891
41488
|
pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
39892
41489
|
pkpId,
|
|
39893
41490
|
this.getProviderOrThrow(),
|