@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.mjs
CHANGED
|
@@ -12691,6 +12691,1671 @@ var require_elliptic = __commonJS({
|
|
|
12691
12691
|
}
|
|
12692
12692
|
});
|
|
12693
12693
|
|
|
12694
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/pkp-info.i.js
|
|
12695
|
+
var require_pkp_info_i = __commonJS({
|
|
12696
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/pkp-info.i.js"(exports) {
|
|
12697
|
+
"use strict";
|
|
12698
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12699
|
+
}
|
|
12700
|
+
});
|
|
12701
|
+
|
|
12702
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/lit-action-config.i.js
|
|
12703
|
+
var require_lit_action_config_i = __commonJS({
|
|
12704
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/lit-action-config.i.js"(exports) {
|
|
12705
|
+
"use strict";
|
|
12706
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12707
|
+
}
|
|
12708
|
+
});
|
|
12709
|
+
|
|
12710
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/diamond-hands-lit-actions.i.js
|
|
12711
|
+
var require_diamond_hands_lit_actions_i = __commonJS({
|
|
12712
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/diamond-hands-lit-actions.i.js"(exports) {
|
|
12713
|
+
"use strict";
|
|
12714
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12715
|
+
}
|
|
12716
|
+
});
|
|
12717
|
+
|
|
12718
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/lit-action-registry.i.js
|
|
12719
|
+
var require_lit_action_registry_i = __commonJS({
|
|
12720
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/chunks/lit-action-registry.i.js"(exports) {
|
|
12721
|
+
"use strict";
|
|
12722
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12723
|
+
}
|
|
12724
|
+
});
|
|
12725
|
+
|
|
12726
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/index.js
|
|
12727
|
+
var require_interfaces = __commonJS({
|
|
12728
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/interfaces/index.js"(exports) {
|
|
12729
|
+
"use strict";
|
|
12730
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
12731
|
+
if (k2 === void 0)
|
|
12732
|
+
k2 = k;
|
|
12733
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12734
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12735
|
+
desc = { enumerable: true, get: function() {
|
|
12736
|
+
return m[k];
|
|
12737
|
+
} };
|
|
12738
|
+
}
|
|
12739
|
+
Object.defineProperty(o, k2, desc);
|
|
12740
|
+
} : function(o, m, k, k2) {
|
|
12741
|
+
if (k2 === void 0)
|
|
12742
|
+
k2 = k;
|
|
12743
|
+
o[k2] = m[k];
|
|
12744
|
+
});
|
|
12745
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
12746
|
+
for (var p in m)
|
|
12747
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
12748
|
+
__createBinding(exports2, m, p);
|
|
12749
|
+
};
|
|
12750
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12751
|
+
__exportStar(require_pkp_info_i(), exports);
|
|
12752
|
+
__exportStar(require_lit_action_config_i(), exports);
|
|
12753
|
+
__exportStar(require_diamond_hands_lit_actions_i(), exports);
|
|
12754
|
+
__exportStar(require_lit_action_registry_i(), exports);
|
|
12755
|
+
}
|
|
12756
|
+
});
|
|
12757
|
+
|
|
12758
|
+
// node_modules/base-x/src/cjs/index.cjs
|
|
12759
|
+
var require_cjs = __commonJS({
|
|
12760
|
+
"node_modules/base-x/src/cjs/index.cjs"(exports) {
|
|
12761
|
+
"use strict";
|
|
12762
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12763
|
+
function base2(ALPHABET) {
|
|
12764
|
+
if (ALPHABET.length >= 255) {
|
|
12765
|
+
throw new TypeError("Alphabet too long");
|
|
12766
|
+
}
|
|
12767
|
+
const BASE_MAP = new Uint8Array(256);
|
|
12768
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
12769
|
+
BASE_MAP[j] = 255;
|
|
12770
|
+
}
|
|
12771
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
12772
|
+
const x = ALPHABET.charAt(i);
|
|
12773
|
+
const xc = x.charCodeAt(0);
|
|
12774
|
+
if (BASE_MAP[xc] !== 255) {
|
|
12775
|
+
throw new TypeError(x + " is ambiguous");
|
|
12776
|
+
}
|
|
12777
|
+
BASE_MAP[xc] = i;
|
|
12778
|
+
}
|
|
12779
|
+
const BASE = ALPHABET.length;
|
|
12780
|
+
const LEADER = ALPHABET.charAt(0);
|
|
12781
|
+
const FACTOR = Math.log(BASE) / Math.log(256);
|
|
12782
|
+
const iFACTOR = Math.log(256) / Math.log(BASE);
|
|
12783
|
+
function encode4(source) {
|
|
12784
|
+
if (source instanceof Uint8Array) {
|
|
12785
|
+
} else if (ArrayBuffer.isView(source)) {
|
|
12786
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
12787
|
+
} else if (Array.isArray(source)) {
|
|
12788
|
+
source = Uint8Array.from(source);
|
|
12789
|
+
}
|
|
12790
|
+
if (!(source instanceof Uint8Array)) {
|
|
12791
|
+
throw new TypeError("Expected Uint8Array");
|
|
12792
|
+
}
|
|
12793
|
+
if (source.length === 0) {
|
|
12794
|
+
return "";
|
|
12795
|
+
}
|
|
12796
|
+
let zeroes = 0;
|
|
12797
|
+
let length = 0;
|
|
12798
|
+
let pbegin = 0;
|
|
12799
|
+
const pend = source.length;
|
|
12800
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
12801
|
+
pbegin++;
|
|
12802
|
+
zeroes++;
|
|
12803
|
+
}
|
|
12804
|
+
const size = (pend - pbegin) * iFACTOR + 1 >>> 0;
|
|
12805
|
+
const b58 = new Uint8Array(size);
|
|
12806
|
+
while (pbegin !== pend) {
|
|
12807
|
+
let carry = source[pbegin];
|
|
12808
|
+
let i = 0;
|
|
12809
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
|
|
12810
|
+
carry += 256 * b58[it1] >>> 0;
|
|
12811
|
+
b58[it1] = carry % BASE >>> 0;
|
|
12812
|
+
carry = carry / BASE >>> 0;
|
|
12813
|
+
}
|
|
12814
|
+
if (carry !== 0) {
|
|
12815
|
+
throw new Error("Non-zero carry");
|
|
12816
|
+
}
|
|
12817
|
+
length = i;
|
|
12818
|
+
pbegin++;
|
|
12819
|
+
}
|
|
12820
|
+
let it2 = size - length;
|
|
12821
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
12822
|
+
it2++;
|
|
12823
|
+
}
|
|
12824
|
+
let str = LEADER.repeat(zeroes);
|
|
12825
|
+
for (; it2 < size; ++it2) {
|
|
12826
|
+
str += ALPHABET.charAt(b58[it2]);
|
|
12827
|
+
}
|
|
12828
|
+
return str;
|
|
12829
|
+
}
|
|
12830
|
+
function decodeUnsafe(source) {
|
|
12831
|
+
if (typeof source !== "string") {
|
|
12832
|
+
throw new TypeError("Expected String");
|
|
12833
|
+
}
|
|
12834
|
+
if (source.length === 0) {
|
|
12835
|
+
return new Uint8Array();
|
|
12836
|
+
}
|
|
12837
|
+
let psz = 0;
|
|
12838
|
+
let zeroes = 0;
|
|
12839
|
+
let length = 0;
|
|
12840
|
+
while (source[psz] === LEADER) {
|
|
12841
|
+
zeroes++;
|
|
12842
|
+
psz++;
|
|
12843
|
+
}
|
|
12844
|
+
const size = (source.length - psz) * FACTOR + 1 >>> 0;
|
|
12845
|
+
const b256 = new Uint8Array(size);
|
|
12846
|
+
while (psz < source.length) {
|
|
12847
|
+
const charCode = source.charCodeAt(psz);
|
|
12848
|
+
if (charCode > 255) {
|
|
12849
|
+
return;
|
|
12850
|
+
}
|
|
12851
|
+
let carry = BASE_MAP[charCode];
|
|
12852
|
+
if (carry === 255) {
|
|
12853
|
+
return;
|
|
12854
|
+
}
|
|
12855
|
+
let i = 0;
|
|
12856
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
|
|
12857
|
+
carry += BASE * b256[it3] >>> 0;
|
|
12858
|
+
b256[it3] = carry % 256 >>> 0;
|
|
12859
|
+
carry = carry / 256 >>> 0;
|
|
12860
|
+
}
|
|
12861
|
+
if (carry !== 0) {
|
|
12862
|
+
throw new Error("Non-zero carry");
|
|
12863
|
+
}
|
|
12864
|
+
length = i;
|
|
12865
|
+
psz++;
|
|
12866
|
+
}
|
|
12867
|
+
let it4 = size - length;
|
|
12868
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
12869
|
+
it4++;
|
|
12870
|
+
}
|
|
12871
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
12872
|
+
let j = zeroes;
|
|
12873
|
+
while (it4 !== size) {
|
|
12874
|
+
vch[j++] = b256[it4++];
|
|
12875
|
+
}
|
|
12876
|
+
return vch;
|
|
12877
|
+
}
|
|
12878
|
+
function decode3(string) {
|
|
12879
|
+
const buffer = decodeUnsafe(string);
|
|
12880
|
+
if (buffer) {
|
|
12881
|
+
return buffer;
|
|
12882
|
+
}
|
|
12883
|
+
throw new Error("Non-base" + BASE + " character");
|
|
12884
|
+
}
|
|
12885
|
+
return {
|
|
12886
|
+
encode: encode4,
|
|
12887
|
+
decodeUnsafe,
|
|
12888
|
+
decode: decode3
|
|
12889
|
+
};
|
|
12890
|
+
}
|
|
12891
|
+
exports.default = base2;
|
|
12892
|
+
}
|
|
12893
|
+
});
|
|
12894
|
+
|
|
12895
|
+
// node_modules/bs58/src/cjs/index.cjs
|
|
12896
|
+
var require_cjs2 = __commonJS({
|
|
12897
|
+
"node_modules/bs58/src/cjs/index.cjs"(exports) {
|
|
12898
|
+
"use strict";
|
|
12899
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
12900
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12901
|
+
};
|
|
12902
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12903
|
+
var base_x_1 = __importDefault(require_cjs());
|
|
12904
|
+
var ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
12905
|
+
exports.default = (0, base_x_1.default)(ALPHABET);
|
|
12906
|
+
}
|
|
12907
|
+
});
|
|
12908
|
+
|
|
12909
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/cid-utils.js
|
|
12910
|
+
var require_cid_utils = __commonJS({
|
|
12911
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/cid-utils.js"(exports) {
|
|
12912
|
+
"use strict";
|
|
12913
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
12914
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
12915
|
+
};
|
|
12916
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12917
|
+
exports.cidToHex = cidToHex;
|
|
12918
|
+
var bs58_1 = __importDefault(require_cjs2());
|
|
12919
|
+
function cidToHex(cid) {
|
|
12920
|
+
try {
|
|
12921
|
+
if (cid.startsWith("Qm")) {
|
|
12922
|
+
const bytes = bs58_1.default.decode(cid);
|
|
12923
|
+
return "0x" + Buffer.from(bytes).toString("hex");
|
|
12924
|
+
} else if (cid.startsWith("0x")) {
|
|
12925
|
+
return cid;
|
|
12926
|
+
} else {
|
|
12927
|
+
throw new Error(`Unsupported CID format: ${cid}. Only CIDv0 (Qm...) and hex (0x...) formats are supported.`);
|
|
12928
|
+
}
|
|
12929
|
+
} catch (error) {
|
|
12930
|
+
if (error instanceof Error && error.message.includes("Unsupported CID format")) {
|
|
12931
|
+
throw error;
|
|
12932
|
+
}
|
|
12933
|
+
throw new Error(`Failed to convert CID ${cid} to hex: ${error instanceof Error ? error.message : String(error)}`);
|
|
12934
|
+
}
|
|
12935
|
+
}
|
|
12936
|
+
}
|
|
12937
|
+
});
|
|
12938
|
+
|
|
12939
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.js
|
|
12940
|
+
var require_lit_actions_registry = __commonJS({
|
|
12941
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.js"(exports) {
|
|
12942
|
+
"use strict";
|
|
12943
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12944
|
+
exports.CHIPOTLE_DEPLOYMENTS = exports.DH_LIT_ACTIONS_CHIPOTLE = void 0;
|
|
12945
|
+
exports.getDeploymentsForNetwork = getDeploymentsForNetwork;
|
|
12946
|
+
var cid_utils_1 = require_cid_utils();
|
|
12947
|
+
exports.DH_LIT_ACTIONS_CHIPOTLE = {
|
|
12948
|
+
authorizationDummy: {
|
|
12949
|
+
cid: "QmXPh5RTReLqjqZDRNhgVKi1TWMJK2vS9QSRPkWPhLBQJN",
|
|
12950
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmXPh5RTReLqjqZDRNhgVKi1TWMJK2vS9QSRPkWPhLBQJN"),
|
|
12951
|
+
name: "Authorization Dummy",
|
|
12952
|
+
description: "Production Authorization Dummy",
|
|
12953
|
+
version: "1.0.0",
|
|
12954
|
+
deployed: true,
|
|
12955
|
+
deployedAt: 1776707622939,
|
|
12956
|
+
size: 2026,
|
|
12957
|
+
hash: "349d51aa096d56b394f82de75ed34cd4eef72719969f7e5fe584f4582b2745fa"
|
|
12958
|
+
},
|
|
12959
|
+
authorizationDummyB: {
|
|
12960
|
+
cid: "QmQXTcAU9tr4YAVrzHujEJw9moJgM1o5gnJU2ojcvhigua",
|
|
12961
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmQXTcAU9tr4YAVrzHujEJw9moJgM1o5gnJU2ojcvhigua"),
|
|
12962
|
+
name: "Authorization Dummy B",
|
|
12963
|
+
description: "Production Authorization Dummy B",
|
|
12964
|
+
version: "1.0.0",
|
|
12965
|
+
deployed: true,
|
|
12966
|
+
deployedAt: 1776707632987,
|
|
12967
|
+
size: 1695,
|
|
12968
|
+
hash: "def4576ba6c382d145f996c4f950b5e39e58792415ee7fdd749e0d2bc61e8f0b"
|
|
12969
|
+
},
|
|
12970
|
+
pkpValidator: {
|
|
12971
|
+
cid: "QmSo9fkRJA5rS2AnkpKyFgE7ADdGRC2mXvcXVUPaSBRxv1",
|
|
12972
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmSo9fkRJA5rS2AnkpKyFgE7ADdGRC2mXvcXVUPaSBRxv1"),
|
|
12973
|
+
name: "Pkp Validator",
|
|
12974
|
+
description: "Production Pkp Validator",
|
|
12975
|
+
version: "1.0.0",
|
|
12976
|
+
deployed: true,
|
|
12977
|
+
deployedAt: 1776315028869,
|
|
12978
|
+
size: 4030,
|
|
12979
|
+
hash: "f57523311d2f1f1f1fae5a1bbdcd877582e64268c1cb90396c0d1dc26ab9a1fb",
|
|
12980
|
+
validatorWalletAddress: "0x9ee56687f7a984d5df7ab79330271a619ef56ddd",
|
|
12981
|
+
pkp: {
|
|
12982
|
+
publicKey: "0x04ec0e3acc40884e3f366ca469d08899eb640ad5259fa196b0238075086208a9f8732a3175704f35f0bcc28e07406cfb24c254efd1e7355640577330f0d2dd755f",
|
|
12983
|
+
ethAddress: "0x9eE56687F7a984D5DF7aB79330271a619ef56DdD"
|
|
12984
|
+
}
|
|
12985
|
+
},
|
|
12986
|
+
btcTransactionSigner: {
|
|
12987
|
+
cid: "QmYSvuDcn2EPjRoDsPBLK2e3PGYEUHtWAPxwB51s4unkaG",
|
|
12988
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmYSvuDcn2EPjRoDsPBLK2e3PGYEUHtWAPxwB51s4unkaG"),
|
|
12989
|
+
name: "Btc Transaction Signer",
|
|
12990
|
+
description: "Production Btc Transaction Signer",
|
|
12991
|
+
version: "1.0.0",
|
|
12992
|
+
deployed: true,
|
|
12993
|
+
deployedAt: 1776767100453,
|
|
12994
|
+
size: 25657,
|
|
12995
|
+
hash: "422311d10447a806bf435a1df440ff00d4eee986c019ccdb4af15bdbfd8019cf"
|
|
12996
|
+
},
|
|
12997
|
+
ucdMintValidator: {
|
|
12998
|
+
cid: "QmRrL2oTyEyAsTNQQDbq7LpMtU6EJJCbmnLGKGJM4ULr1h",
|
|
12999
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmRrL2oTyEyAsTNQQDbq7LpMtU6EJJCbmnLGKGJM4ULr1h"),
|
|
13000
|
+
name: "Ucd Mint Validator",
|
|
13001
|
+
description: "Production Ucd Mint Validator",
|
|
13002
|
+
version: "1.0.0",
|
|
13003
|
+
deployed: true,
|
|
13004
|
+
deployedAt: 1776782297891,
|
|
13005
|
+
size: 64983,
|
|
13006
|
+
hash: "001bbe2c2ba746daf2a29653c053fbe3ac84312df45dada048e18947fa3cc05b",
|
|
13007
|
+
validatorWalletAddress: "0x36f3dd61c4c08a56d29ed2fd6d5f111b67b6a7a1",
|
|
13008
|
+
pkp: {
|
|
13009
|
+
publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
|
|
13010
|
+
ethAddress: "0x4D9299055093938d0CD2F26C42A87260CB50adD8"
|
|
13011
|
+
}
|
|
13012
|
+
},
|
|
13013
|
+
processPaymentValidator: {
|
|
13014
|
+
cid: "QmR7rT7iG74YeSVoavTSTgBtZqcmCKG3Tf3hmzQ3zTFUb3",
|
|
13015
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmR7rT7iG74YeSVoavTSTgBtZqcmCKG3Tf3hmzQ3zTFUb3"),
|
|
13016
|
+
name: "Process Payment Validator",
|
|
13017
|
+
description: "Production Process Payment Validator",
|
|
13018
|
+
version: "1.0.0",
|
|
13019
|
+
deployed: true,
|
|
13020
|
+
deployedAt: 1776782306970,
|
|
13021
|
+
size: 60889,
|
|
13022
|
+
hash: "2153e187d2bbd713d41a87d1dac2199ab879590761becf55c708e5fb970bf941",
|
|
13023
|
+
validatorWalletAddress: "0xc2ed5a59bd81eb4d1a19a0147b86ab69aa4c28ba",
|
|
13024
|
+
pkp: {
|
|
13025
|
+
publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
|
|
13026
|
+
ethAddress: "0x440Fd7B157766b95eb551825C06DF4f92E41D55b"
|
|
13027
|
+
}
|
|
13028
|
+
},
|
|
13029
|
+
extendPositionValidator: {
|
|
13030
|
+
cid: "QmZGWWnjVcfHzSBQzgXfMmxQJUYXKt9jsCXrCPZXzuPxPv",
|
|
13031
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmZGWWnjVcfHzSBQzgXfMmxQJUYXKt9jsCXrCPZXzuPxPv"),
|
|
13032
|
+
name: "Extend Position Validator",
|
|
13033
|
+
description: "Production Extend Position Validator",
|
|
13034
|
+
version: "1.0.0",
|
|
13035
|
+
deployed: true,
|
|
13036
|
+
deployedAt: 1776782316021,
|
|
13037
|
+
size: 60346,
|
|
13038
|
+
hash: "630dacf25495e39a4011c5e28a74a5d9f09e9b89eb0d701868e8881e28609269",
|
|
13039
|
+
validatorWalletAddress: "0xb3f4271c475887a86a2f21446f0968c30cc74c97",
|
|
13040
|
+
pkp: {
|
|
13041
|
+
publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
|
|
13042
|
+
ethAddress: "0x4cb7651Ba27610991A5775486B5F4487F3Dd7cDA"
|
|
13043
|
+
}
|
|
13044
|
+
},
|
|
13045
|
+
btcWithdrawal: {
|
|
13046
|
+
cid: "QmX9HxZsogBTBSurQPnopMtGDQRXtd3HynHxkqgq23u3rm",
|
|
13047
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmX9HxZsogBTBSurQPnopMtGDQRXtd3HynHxkqgq23u3rm"),
|
|
13048
|
+
name: "Btc Withdrawal",
|
|
13049
|
+
description: "Production Btc Withdrawal",
|
|
13050
|
+
version: "1.0.0",
|
|
13051
|
+
deployed: true,
|
|
13052
|
+
deployedAt: 1776782325228,
|
|
13053
|
+
size: 69488,
|
|
13054
|
+
hash: "361055707df1851003f867635bb8c29eaaef6ced2e57c9d0250b8739d01e6b13",
|
|
13055
|
+
validatorWalletAddress: "0xbb137fbda353199e9419b698c57a742124d4987d",
|
|
13056
|
+
pkp: {
|
|
13057
|
+
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
13058
|
+
ethAddress: "0x7b9316cAA00B257F7CE30F7F6979bd6867BA9eE2"
|
|
13059
|
+
}
|
|
13060
|
+
},
|
|
13061
|
+
liquidationValidator: {
|
|
13062
|
+
cid: "QmbufZa57vL7k3eeeFs9vy6LPry5XMYjJrYw7wCHzc3TWH",
|
|
13063
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmbufZa57vL7k3eeeFs9vy6LPry5XMYjJrYw7wCHzc3TWH"),
|
|
13064
|
+
name: "Liquidation Validator",
|
|
13065
|
+
description: "Production Liquidation Validator",
|
|
13066
|
+
version: "1.0.0",
|
|
13067
|
+
deployed: true,
|
|
13068
|
+
deployedAt: 1776782332379,
|
|
13069
|
+
size: 54383,
|
|
13070
|
+
hash: "a2acf645716ed249b62ecc2069609eb53b17fe60c41d3027f0c3e98c3bffb4ca",
|
|
13071
|
+
validatorWalletAddress: "0x1542f863ee0340f6a067573e80ae66dd9b3838fa",
|
|
13072
|
+
pkp: {
|
|
13073
|
+
publicKey: "0x041a241de58976c13e3d7ca5a18e494f7330151e3818706135d50176e78ffb673e58b11f0b67a87c73fade6c6b27d6e7a7377ea9f4c10bf31880f1d725f18cc6f8",
|
|
13074
|
+
ethAddress: "0x8770470620Db25bBf2BFBca1eF7Bdd6CF91ab1b5"
|
|
13075
|
+
}
|
|
13076
|
+
},
|
|
13077
|
+
priceOracle: {
|
|
13078
|
+
cid: "QmXKfK7JJFixFPvm48uwgVVW7s3eoE3sEyFEbZZ3dfNK1e",
|
|
13079
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmXKfK7JJFixFPvm48uwgVVW7s3eoE3sEyFEbZZ3dfNK1e"),
|
|
13080
|
+
name: "Price Oracle",
|
|
13081
|
+
description: "Production Price Oracle (Chipotle main+getPrivateKey)",
|
|
13082
|
+
version: "1.1.0",
|
|
13083
|
+
deployed: true,
|
|
13084
|
+
deployedAt: 1776708126597,
|
|
13085
|
+
size: 11644,
|
|
13086
|
+
hash: "d175d8571aa4337d465115f9939a2d72965255c7c7a64c33e546ffff141e7a09",
|
|
13087
|
+
validatorWalletAddress: "0x831ddf3048547b983efe3ccbbb35a45a53191651",
|
|
13088
|
+
pkp: {
|
|
13089
|
+
publicKey: "0x043beaa1da47875601a8d6f430b1438ee2d4732eefd06e5c63a474bbdaf9e7df1797b1b951e041b627c2bf839788164825324c9cbd1e2d6f740fdd4bff69b1900b",
|
|
13090
|
+
ethAddress: "0x831DdF3048547B983EFE3ccBBB35a45a53191651"
|
|
13091
|
+
}
|
|
13092
|
+
},
|
|
13093
|
+
loanVaultBtcBalance: {
|
|
13094
|
+
cid: "QmUdw25GDYMY6gm7nChBxpHtkwtoSEMjf66QWJ1dCikWkt",
|
|
13095
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmUdw25GDYMY6gm7nChBxpHtkwtoSEMjf66QWJ1dCikWkt"),
|
|
13096
|
+
name: "Loan Vault Btc Balance",
|
|
13097
|
+
description: "Production Loan Vault Btc Balance",
|
|
13098
|
+
version: "1.0.0",
|
|
13099
|
+
deployed: true,
|
|
13100
|
+
deployedAt: 1776782341246,
|
|
13101
|
+
size: 43769,
|
|
13102
|
+
hash: "780ea6731fa48e0b15e1666ab1c6aa91471dbf748d36fa1e93f74614047bacb7",
|
|
13103
|
+
validatorWalletAddress: "0x47feea74c8739d24b44faa67217f2f99970e15e7",
|
|
13104
|
+
pkp: {
|
|
13105
|
+
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
13106
|
+
ethAddress: "0x7b9316cAA00B257F7CE30F7F6979bd6867BA9eE2"
|
|
13107
|
+
}
|
|
13108
|
+
},
|
|
13109
|
+
adminLiquidationValidator: {
|
|
13110
|
+
cid: "QmYBpkLWKZbEBgdZnfFMabszmPYQJsfdVsqwVyJqdrMnP4",
|
|
13111
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmYBpkLWKZbEBgdZnfFMabszmPYQJsfdVsqwVyJqdrMnP4"),
|
|
13112
|
+
name: "Admin Liquidation Validator",
|
|
13113
|
+
description: "Production Admin Liquidation Validator",
|
|
13114
|
+
version: "1.0.0",
|
|
13115
|
+
deployed: true,
|
|
13116
|
+
deployedAt: 1776782348498,
|
|
13117
|
+
size: 51032,
|
|
13118
|
+
hash: "b3af59aab3d71841e2b06e11da7c1664e451e636ead6ee746604be82ff472a13",
|
|
13119
|
+
validatorWalletAddress: "0x2a83b78842d75358877deb8854ccc5bbbaa5012e",
|
|
13120
|
+
pkp: {
|
|
13121
|
+
publicKey: "0x04ee4316afb8538280ede6c56def9cbe791f18f96ccba97768b28e2966d9c46a9493a6b81f4571495c3ce56c2d0b33fe8cf63726cd12d395832ea54162b5c67801",
|
|
13122
|
+
ethAddress: "0x038B7a1918ae9121bC641236b7946a069BE21591"
|
|
13123
|
+
}
|
|
13124
|
+
},
|
|
13125
|
+
alwaysSigner: {
|
|
13126
|
+
cid: "QmXQjybSsdE19Da66to9Hh7X2dLFwpZPhjoqojxbpk7Nvs",
|
|
13127
|
+
authorizedCidHex: (0, cid_utils_1.cidToHex)("QmXQjybSsdE19Da66to9Hh7X2dLFwpZPhjoqojxbpk7Nvs"),
|
|
13128
|
+
name: "Always Signer",
|
|
13129
|
+
description: "Production Always Signer",
|
|
13130
|
+
version: "1.0.0",
|
|
13131
|
+
deployed: true,
|
|
13132
|
+
deployedAt: 1776708176283,
|
|
13133
|
+
size: 4143,
|
|
13134
|
+
hash: "25007f80b4ed3169470bf617d403971136be431eb29dfb09f78afe2494bf0138"
|
|
13135
|
+
}
|
|
13136
|
+
};
|
|
13137
|
+
function getDeploymentsForNetwork(network) {
|
|
13138
|
+
if (network === "chipotle")
|
|
13139
|
+
return exports.DH_LIT_ACTIONS_CHIPOTLE;
|
|
13140
|
+
throw new Error(`Unsupported LIT network: ${network}`);
|
|
13141
|
+
}
|
|
13142
|
+
exports.CHIPOTLE_DEPLOYMENTS = exports.DH_LIT_ACTIONS_CHIPOTLE;
|
|
13143
|
+
}
|
|
13144
|
+
});
|
|
13145
|
+
|
|
13146
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.js
|
|
13147
|
+
var require_lit_action_helpers = __commonJS({
|
|
13148
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.js"(exports) {
|
|
13149
|
+
"use strict";
|
|
13150
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13151
|
+
exports.getLitActionCID = getLitActionCID;
|
|
13152
|
+
exports.getLitActionConfig = getLitActionConfig;
|
|
13153
|
+
exports.isLitActionDeployed = isLitActionDeployed;
|
|
13154
|
+
exports.validateDeployedActions = validateDeployedActions;
|
|
13155
|
+
exports.getDeployedActions = getDeployedActions;
|
|
13156
|
+
var lit_actions_registry_1 = require_lit_actions_registry();
|
|
13157
|
+
function getLitActionCID(litNetwork = "chipotle", actionName) {
|
|
13158
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13159
|
+
const action = deployments[actionName];
|
|
13160
|
+
if (!action || !action.deployed || !action.cid) {
|
|
13161
|
+
throw new Error(`LIT Action '${actionName}' not deployed on network '${litNetwork}'. Check deployment status.`);
|
|
13162
|
+
}
|
|
13163
|
+
return action.cid;
|
|
13164
|
+
}
|
|
13165
|
+
function getLitActionConfig(actionName, litNetwork = "chipotle") {
|
|
13166
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13167
|
+
const action = deployments[actionName];
|
|
13168
|
+
if (!action) {
|
|
13169
|
+
throw new Error(`LIT Action '${actionName}' not found in registry for network '${litNetwork}'.`);
|
|
13170
|
+
}
|
|
13171
|
+
return action;
|
|
13172
|
+
}
|
|
13173
|
+
function isLitActionDeployed(actionName, litNetwork = "chipotle") {
|
|
13174
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13175
|
+
const action = deployments[actionName];
|
|
13176
|
+
return !!(action && action.deployed && action.cid);
|
|
13177
|
+
}
|
|
13178
|
+
function validateDeployedActions(requiredActions, litNetwork = "chipotle") {
|
|
13179
|
+
return requiredActions.every((actionName) => isLitActionDeployed(actionName, litNetwork));
|
|
13180
|
+
}
|
|
13181
|
+
function getDeployedActions(litNetwork = "chipotle") {
|
|
13182
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13183
|
+
return Object.values(deployments).filter((action) => action && action.deployed);
|
|
13184
|
+
}
|
|
13185
|
+
}
|
|
13186
|
+
});
|
|
13187
|
+
|
|
13188
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/pkp-setup.js
|
|
13189
|
+
var require_pkp_setup = __commonJS({
|
|
13190
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/pkp-setup.js"(exports) {
|
|
13191
|
+
"use strict";
|
|
13192
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13193
|
+
exports.getPKPValidatorSetup = getPKPValidatorSetup;
|
|
13194
|
+
var lit_actions_registry_1 = require_lit_actions_registry();
|
|
13195
|
+
function getPKPValidatorSetup(litNetwork = "chipotle") {
|
|
13196
|
+
const deployments = (0, lit_actions_registry_1.getDeploymentsForNetwork)(litNetwork);
|
|
13197
|
+
const litAction = deployments.pkpValidator;
|
|
13198
|
+
if (!litAction || !litAction.pkp) {
|
|
13199
|
+
throw new Error(`PKP validator setup is not available for litNetwork='${litNetwork}'. Ensure the pkpValidator action (with pkp attached) is defined in the registry.`);
|
|
13200
|
+
}
|
|
13201
|
+
return {
|
|
13202
|
+
litAction,
|
|
13203
|
+
pkp: litAction.pkp
|
|
13204
|
+
};
|
|
13205
|
+
}
|
|
13206
|
+
}
|
|
13207
|
+
});
|
|
13208
|
+
|
|
13209
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/debug-logger.js
|
|
13210
|
+
var require_debug_logger = __commonJS({
|
|
13211
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/debug-logger.js"(exports) {
|
|
13212
|
+
"use strict";
|
|
13213
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13214
|
+
exports.networkMetrics = exports.PerformanceTracker = exports.DEFAULT_DEBUG_CONFIG = exports.LogLevel = void 0;
|
|
13215
|
+
exports.configureDebugLogging = configureDebugLogging;
|
|
13216
|
+
exports.debugError = debugError;
|
|
13217
|
+
exports.debugWarn = debugWarn;
|
|
13218
|
+
exports.debugInfo = debugInfo;
|
|
13219
|
+
exports.debugLog = debugLog;
|
|
13220
|
+
exports.debugTrace = debugTrace;
|
|
13221
|
+
exports.logRequest = logRequest;
|
|
13222
|
+
exports.logResponse = logResponse;
|
|
13223
|
+
exports.logError = logError;
|
|
13224
|
+
exports.logConnectionAttempt = logConnectionAttempt;
|
|
13225
|
+
exports.logConnectionSuccess = logConnectionSuccess;
|
|
13226
|
+
exports.logConnectionFailure = logConnectionFailure;
|
|
13227
|
+
exports.logPkpOperation = logPkpOperation;
|
|
13228
|
+
exports.logSessionSignatures = logSessionSignatures;
|
|
13229
|
+
exports.logLitActionExecution = logLitActionExecution;
|
|
13230
|
+
exports.logLitActionResult = logLitActionResult;
|
|
13231
|
+
exports.logTestStart = logTestStart;
|
|
13232
|
+
exports.logTestEnd = logTestEnd;
|
|
13233
|
+
var LogLevel2;
|
|
13234
|
+
(function(LogLevel3) {
|
|
13235
|
+
LogLevel3[LogLevel3["ERROR"] = 0] = "ERROR";
|
|
13236
|
+
LogLevel3[LogLevel3["WARN"] = 1] = "WARN";
|
|
13237
|
+
LogLevel3[LogLevel3["INFO"] = 2] = "INFO";
|
|
13238
|
+
LogLevel3[LogLevel3["DEBUG"] = 3] = "DEBUG";
|
|
13239
|
+
LogLevel3[LogLevel3["TRACE"] = 4] = "TRACE";
|
|
13240
|
+
})(LogLevel2 || (exports.LogLevel = LogLevel2 = {}));
|
|
13241
|
+
exports.DEFAULT_DEBUG_CONFIG = {
|
|
13242
|
+
level: LogLevel2.INFO,
|
|
13243
|
+
enableTimestamps: true,
|
|
13244
|
+
enablePerformanceMetrics: true,
|
|
13245
|
+
enableRequestLogging: true,
|
|
13246
|
+
enableNetworkMetrics: true
|
|
13247
|
+
};
|
|
13248
|
+
var debugConfig = { ...exports.DEFAULT_DEBUG_CONFIG };
|
|
13249
|
+
function configureDebugLogging(config) {
|
|
13250
|
+
debugConfig = { ...debugConfig, ...config };
|
|
13251
|
+
}
|
|
13252
|
+
function getTimestamp() {
|
|
13253
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
13254
|
+
}
|
|
13255
|
+
function formatMessage(level, component, message, metadata) {
|
|
13256
|
+
const timestamp = debugConfig.enableTimestamps ? `[${getTimestamp()}] ` : "";
|
|
13257
|
+
const metadataStr = metadata ? ` ${JSON.stringify(metadata)}` : "";
|
|
13258
|
+
return `${timestamp}[${level}] [${component}] ${message}${metadataStr}`;
|
|
13259
|
+
}
|
|
13260
|
+
var PerformanceTracker = class {
|
|
13261
|
+
constructor(operationName) {
|
|
13262
|
+
this.operationName = operationName;
|
|
13263
|
+
this.markers = /* @__PURE__ */ new Map();
|
|
13264
|
+
this.startTime = Date.now();
|
|
13265
|
+
this.log("PERF", `Started: ${operationName}`);
|
|
13266
|
+
}
|
|
13267
|
+
mark(label) {
|
|
13268
|
+
const elapsed = Date.now() - this.startTime;
|
|
13269
|
+
this.markers.set(label, elapsed);
|
|
13270
|
+
this.log("PERF", `${this.operationName} - ${label}: ${elapsed}ms`);
|
|
13271
|
+
}
|
|
13272
|
+
end(success2 = true) {
|
|
13273
|
+
const totalTime = Date.now() - this.startTime;
|
|
13274
|
+
const status = success2 ? "SUCCESS" : "FAILED";
|
|
13275
|
+
this.log("PERF", `${this.operationName} - ${status}: ${totalTime}ms`);
|
|
13276
|
+
if (debugConfig.enablePerformanceMetrics && this.markers.size > 0) {
|
|
13277
|
+
console.log(`\u{1F4CA} Performance Breakdown for ${this.operationName}:`);
|
|
13278
|
+
for (const [label, time] of this.markers) {
|
|
13279
|
+
console.log(` ${label}: ${time}ms`);
|
|
13280
|
+
}
|
|
13281
|
+
console.log(` Total: ${totalTime}ms`);
|
|
13282
|
+
}
|
|
13283
|
+
return totalTime;
|
|
13284
|
+
}
|
|
13285
|
+
log(level, message) {
|
|
13286
|
+
if (debugConfig.enablePerformanceMetrics) {
|
|
13287
|
+
console.log(formatMessage(level, "PERFORMANCE", message));
|
|
13288
|
+
}
|
|
13289
|
+
}
|
|
13290
|
+
};
|
|
13291
|
+
exports.PerformanceTracker = PerformanceTracker;
|
|
13292
|
+
var NetworkMetricsCollector = class {
|
|
13293
|
+
constructor() {
|
|
13294
|
+
this.metrics = /* @__PURE__ */ new Map();
|
|
13295
|
+
}
|
|
13296
|
+
getMetrics(operation) {
|
|
13297
|
+
if (!this.metrics.has(operation)) {
|
|
13298
|
+
this.metrics.set(operation, {
|
|
13299
|
+
requestCount: 0,
|
|
13300
|
+
successCount: 0,
|
|
13301
|
+
failureCount: 0,
|
|
13302
|
+
averageLatency: 0,
|
|
13303
|
+
startTime: Date.now()
|
|
13304
|
+
});
|
|
13305
|
+
}
|
|
13306
|
+
return this.metrics.get(operation);
|
|
13307
|
+
}
|
|
13308
|
+
recordRequest(operation, success2, latency, error) {
|
|
13309
|
+
const metrics = this.getMetrics(operation);
|
|
13310
|
+
metrics.requestCount++;
|
|
13311
|
+
if (success2) {
|
|
13312
|
+
metrics.successCount++;
|
|
13313
|
+
metrics.averageLatency = (metrics.averageLatency * (metrics.successCount - 1) + latency) / metrics.successCount;
|
|
13314
|
+
} else {
|
|
13315
|
+
metrics.failureCount++;
|
|
13316
|
+
if (error)
|
|
13317
|
+
metrics.lastError = error;
|
|
13318
|
+
}
|
|
13319
|
+
if (debugConfig.enableNetworkMetrics) {
|
|
13320
|
+
const successRate = (metrics.successCount / metrics.requestCount * 100).toFixed(1);
|
|
13321
|
+
debugLog("NETWORK", `${operation} - Success: ${success2}, Latency: ${latency}ms, Success Rate: ${successRate}%`);
|
|
13322
|
+
}
|
|
13323
|
+
}
|
|
13324
|
+
printSummary() {
|
|
13325
|
+
if (!debugConfig.enableNetworkMetrics)
|
|
13326
|
+
return;
|
|
13327
|
+
console.log("\n\u{1F4C8} Network Metrics Summary:");
|
|
13328
|
+
for (const [operation, metrics] of this.metrics) {
|
|
13329
|
+
const successRate = (metrics.successCount / metrics.requestCount * 100).toFixed(1);
|
|
13330
|
+
const runtime = Date.now() - metrics.startTime;
|
|
13331
|
+
console.log(` ${operation}:`);
|
|
13332
|
+
console.log(` Requests: ${metrics.requestCount}`);
|
|
13333
|
+
console.log(` Success Rate: ${successRate}%`);
|
|
13334
|
+
console.log(` Avg Latency: ${metrics.averageLatency.toFixed(0)}ms`);
|
|
13335
|
+
console.log(` Runtime: ${runtime}ms`);
|
|
13336
|
+
if (metrics.lastError) {
|
|
13337
|
+
console.log(` Last Error: ${metrics.lastError}`);
|
|
13338
|
+
}
|
|
13339
|
+
}
|
|
13340
|
+
}
|
|
13341
|
+
};
|
|
13342
|
+
exports.networkMetrics = new NetworkMetricsCollector();
|
|
13343
|
+
function debugError(component, message, metadata) {
|
|
13344
|
+
if (debugConfig.level >= LogLevel2.ERROR) {
|
|
13345
|
+
console.error(formatMessage("ERROR", component, message, metadata));
|
|
13346
|
+
}
|
|
13347
|
+
}
|
|
13348
|
+
function debugWarn(component, message, metadata) {
|
|
13349
|
+
if (debugConfig.level >= LogLevel2.WARN) {
|
|
13350
|
+
console.warn(formatMessage("WARN", component, message, metadata));
|
|
13351
|
+
}
|
|
13352
|
+
}
|
|
13353
|
+
function debugInfo(component, message, metadata) {
|
|
13354
|
+
if (debugConfig.level >= LogLevel2.INFO) {
|
|
13355
|
+
console.log(formatMessage("INFO", component, message, metadata));
|
|
13356
|
+
}
|
|
13357
|
+
}
|
|
13358
|
+
function debugLog(component, message, metadata) {
|
|
13359
|
+
if (debugConfig.level >= LogLevel2.DEBUG) {
|
|
13360
|
+
console.log(formatMessage("DEBUG", component, message, metadata));
|
|
13361
|
+
}
|
|
13362
|
+
}
|
|
13363
|
+
function debugTrace(component, message, metadata) {
|
|
13364
|
+
if (debugConfig.level >= LogLevel2.TRACE) {
|
|
13365
|
+
console.log(formatMessage("TRACE", component, message, metadata));
|
|
13366
|
+
}
|
|
13367
|
+
}
|
|
13368
|
+
function logRequest(component, operation, params) {
|
|
13369
|
+
if (!debugConfig.enableRequestLogging)
|
|
13370
|
+
return;
|
|
13371
|
+
debugLog(component, `\u{1F504} Request: ${operation}`, {
|
|
13372
|
+
operation,
|
|
13373
|
+
params: JSON.stringify(params, null, 2)
|
|
13374
|
+
});
|
|
13375
|
+
}
|
|
13376
|
+
function logResponse(component, operation, response, duration) {
|
|
13377
|
+
if (!debugConfig.enableRequestLogging)
|
|
13378
|
+
return;
|
|
13379
|
+
debugLog(component, `\u2705 Response: ${operation} (${duration}ms)`, {
|
|
13380
|
+
operation,
|
|
13381
|
+
duration,
|
|
13382
|
+
response: typeof response === "object" ? JSON.stringify(response, null, 2) : response
|
|
13383
|
+
});
|
|
13384
|
+
}
|
|
13385
|
+
function logError(component, operation, error, duration) {
|
|
13386
|
+
const durationStr = duration ? ` (${duration}ms)` : "";
|
|
13387
|
+
debugError(component, `\u274C Error: ${operation}${durationStr}`, {
|
|
13388
|
+
operation,
|
|
13389
|
+
duration,
|
|
13390
|
+
error: error?.message || error?.toString() || "Unknown error",
|
|
13391
|
+
stack: error?.stack
|
|
13392
|
+
});
|
|
13393
|
+
}
|
|
13394
|
+
function logConnectionAttempt(network, attempt, maxAttempts) {
|
|
13395
|
+
debugInfo("CONNECTION", `\u{1F517} Connecting to ${network} (attempt ${attempt}/${maxAttempts})`);
|
|
13396
|
+
}
|
|
13397
|
+
function logConnectionSuccess(network, latency) {
|
|
13398
|
+
debugInfo("CONNECTION", `\u2705 Connected to ${network} (${latency}ms)`);
|
|
13399
|
+
exports.networkMetrics.recordRequest(`connection-${network}`, true, latency);
|
|
13400
|
+
}
|
|
13401
|
+
function logConnectionFailure(network, error, attempt) {
|
|
13402
|
+
debugError("CONNECTION", `\u274C Connection failed to ${network} (attempt ${attempt})`, { error });
|
|
13403
|
+
exports.networkMetrics.recordRequest(`connection-${network}`, false, 0, error);
|
|
13404
|
+
}
|
|
13405
|
+
function logPkpOperation(operation, pkpId, details) {
|
|
13406
|
+
const pkpStr = pkpId ? ` (PKP: ${pkpId.slice(0, 8)}...)` : "";
|
|
13407
|
+
debugInfo("PKP", `\u{1F511} ${operation}${pkpStr}`, details);
|
|
13408
|
+
}
|
|
13409
|
+
function logSessionSignatures(count, expiration) {
|
|
13410
|
+
debugInfo("SESSION", `\u{1F510} Generated ${count} session signatures (expires: ${expiration})`);
|
|
13411
|
+
}
|
|
13412
|
+
function logLitActionExecution(cid, params) {
|
|
13413
|
+
debugInfo("LIT_ACTION", `\u26A1 Executing LIT Action: ${cid}`, {
|
|
13414
|
+
cid,
|
|
13415
|
+
params
|
|
13416
|
+
});
|
|
13417
|
+
}
|
|
13418
|
+
function logLitActionResult(cid, success2, duration, result) {
|
|
13419
|
+
const status = success2 ? "\u2705" : "\u274C";
|
|
13420
|
+
debugInfo("LIT_ACTION", `${status} LIT Action completed: ${cid} (${duration}ms)`, {
|
|
13421
|
+
cid,
|
|
13422
|
+
success: success2,
|
|
13423
|
+
duration,
|
|
13424
|
+
result: success2 && result ? JSON.stringify(result, null, 2) : void 0
|
|
13425
|
+
});
|
|
13426
|
+
}
|
|
13427
|
+
function logTestStart(testName) {
|
|
13428
|
+
debugInfo("TEST", `\u{1F9EA} Starting test: ${testName}`);
|
|
13429
|
+
return new PerformanceTracker(testName);
|
|
13430
|
+
}
|
|
13431
|
+
function logTestEnd(testName, success2, duration) {
|
|
13432
|
+
const status = success2 ? "\u2705" : "\u274C";
|
|
13433
|
+
debugInfo("TEST", `${status} Test completed: ${testName} (${duration}ms)`);
|
|
13434
|
+
exports.networkMetrics.printSummary();
|
|
13435
|
+
}
|
|
13436
|
+
}
|
|
13437
|
+
});
|
|
13438
|
+
|
|
13439
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/error-classification.js
|
|
13440
|
+
var require_error_classification = __commonJS({
|
|
13441
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/error-classification.js"(exports) {
|
|
13442
|
+
"use strict";
|
|
13443
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13444
|
+
exports.litProtocolErrors = exports.RetryStrategy = exports.ErrorCategory = void 0;
|
|
13445
|
+
exports.classifyError = classifyError;
|
|
13446
|
+
exports.getRetryConfigFromClassification = getRetryConfigFromClassification;
|
|
13447
|
+
exports.analyzeError = analyzeError;
|
|
13448
|
+
exports.createErrorReport = createErrorReport;
|
|
13449
|
+
var ErrorCategory2;
|
|
13450
|
+
(function(ErrorCategory3) {
|
|
13451
|
+
ErrorCategory3["NETWORK"] = "network";
|
|
13452
|
+
ErrorCategory3["PROTOCOL"] = "protocol";
|
|
13453
|
+
ErrorCategory3["AUTHENTICATION"] = "authentication";
|
|
13454
|
+
ErrorCategory3["RESOURCE"] = "resource";
|
|
13455
|
+
ErrorCategory3["VALIDATION"] = "validation";
|
|
13456
|
+
ErrorCategory3["TIMEOUT"] = "timeout";
|
|
13457
|
+
ErrorCategory3["RATE_LIMIT"] = "rate_limit";
|
|
13458
|
+
ErrorCategory3["CONFIGURATION"] = "configuration";
|
|
13459
|
+
ErrorCategory3["UNKNOWN"] = "unknown";
|
|
13460
|
+
})(ErrorCategory2 || (exports.ErrorCategory = ErrorCategory2 = {}));
|
|
13461
|
+
var RetryStrategy;
|
|
13462
|
+
(function(RetryStrategy2) {
|
|
13463
|
+
RetryStrategy2["AGGRESSIVE"] = "aggressive";
|
|
13464
|
+
RetryStrategy2["CONSERVATIVE"] = "conservative";
|
|
13465
|
+
RetryStrategy2["EXPONENTIAL"] = "exponential";
|
|
13466
|
+
RetryStrategy2["LINEAR"] = "linear";
|
|
13467
|
+
RetryStrategy2["NONE"] = "none";
|
|
13468
|
+
})(RetryStrategy || (exports.RetryStrategy = RetryStrategy = {}));
|
|
13469
|
+
var LIT_ERROR_PATTERNS = {
|
|
13470
|
+
// Network and connection errors
|
|
13471
|
+
network: [
|
|
13472
|
+
/network error/i,
|
|
13473
|
+
/connection failed/i,
|
|
13474
|
+
/connection refused/i,
|
|
13475
|
+
/connection timeout/i,
|
|
13476
|
+
/socket hang up/i,
|
|
13477
|
+
/enotfound/i,
|
|
13478
|
+
/econnrefused/i,
|
|
13479
|
+
/etimedout/i,
|
|
13480
|
+
/dns resolution failed/i,
|
|
13481
|
+
/request failed/i
|
|
13482
|
+
],
|
|
13483
|
+
// Protocol specific errors
|
|
13484
|
+
protocol: [
|
|
13485
|
+
/lit protocol/i,
|
|
13486
|
+
/lit node/i,
|
|
13487
|
+
/signing shares/i,
|
|
13488
|
+
/node communication/i,
|
|
13489
|
+
/consensus/i,
|
|
13490
|
+
/threshold/i,
|
|
13491
|
+
/decryption/i,
|
|
13492
|
+
/signature verification/i,
|
|
13493
|
+
/There was an error getting the signing shares/i,
|
|
13494
|
+
/Response from the nodes/i,
|
|
13495
|
+
/NodeError/i,
|
|
13496
|
+
/PKP validation/i,
|
|
13497
|
+
/pkp validation failed/i
|
|
13498
|
+
],
|
|
13499
|
+
// Authentication and authorization errors
|
|
13500
|
+
authentication: [
|
|
13501
|
+
/authentication/i,
|
|
13502
|
+
/authorization/i,
|
|
13503
|
+
/session.*expired/i,
|
|
13504
|
+
/invalid.*signature/i,
|
|
13505
|
+
/unauthorized/i,
|
|
13506
|
+
/access.*denied/i,
|
|
13507
|
+
/permission/i,
|
|
13508
|
+
/auth.*failed/i,
|
|
13509
|
+
/siwe/i,
|
|
13510
|
+
/session.*sig/i
|
|
13511
|
+
],
|
|
13512
|
+
// Resource and validation errors
|
|
13513
|
+
resource: [
|
|
13514
|
+
/resource.*not.*found/i,
|
|
13515
|
+
/ipfs.*not.*found/i,
|
|
13516
|
+
/cid.*invalid/i,
|
|
13517
|
+
/pkp.*not.*found/i,
|
|
13518
|
+
/pkp.*validation/i,
|
|
13519
|
+
/resource.*validation/i,
|
|
13520
|
+
/action.*not.*permitted/i,
|
|
13521
|
+
/lit.*action.*not.*found/i
|
|
13522
|
+
],
|
|
13523
|
+
// Validation errors
|
|
13524
|
+
validation: [
|
|
13525
|
+
/validation.*failed/i,
|
|
13526
|
+
/invalid.*input/i,
|
|
13527
|
+
/invalid.*parameter/i,
|
|
13528
|
+
/malformed/i,
|
|
13529
|
+
/schema.*validation/i,
|
|
13530
|
+
/type.*error/i,
|
|
13531
|
+
/missing.*required/i
|
|
13532
|
+
],
|
|
13533
|
+
// Timeout specific errors
|
|
13534
|
+
timeout: [
|
|
13535
|
+
/timeout/i,
|
|
13536
|
+
/request.*timed.*out/i,
|
|
13537
|
+
/operation.*timed.*out/i,
|
|
13538
|
+
/deadline.*exceeded/i,
|
|
13539
|
+
/time.*limit.*exceeded/i
|
|
13540
|
+
],
|
|
13541
|
+
// Rate limiting errors
|
|
13542
|
+
rateLimit: [
|
|
13543
|
+
/rate.*limit/i,
|
|
13544
|
+
/too.*many.*requests/i,
|
|
13545
|
+
/quota.*exceeded/i,
|
|
13546
|
+
/throttled/i,
|
|
13547
|
+
/429/,
|
|
13548
|
+
/rate.*exceeded/i
|
|
13549
|
+
],
|
|
13550
|
+
// Configuration errors
|
|
13551
|
+
configuration: [
|
|
13552
|
+
/configuration/i,
|
|
13553
|
+
/config.*error/i,
|
|
13554
|
+
/environment/i,
|
|
13555
|
+
/missing.*env/i,
|
|
13556
|
+
/invalid.*config/i,
|
|
13557
|
+
/setup.*error/i
|
|
13558
|
+
]
|
|
13559
|
+
};
|
|
13560
|
+
var RETRY_STRATEGIES = {
|
|
13561
|
+
[RetryStrategy.AGGRESSIVE]: {
|
|
13562
|
+
maxAttempts: 5,
|
|
13563
|
+
baseDelayMs: 500,
|
|
13564
|
+
maxDelayMs: 5e3,
|
|
13565
|
+
multiplier: 1.5
|
|
13566
|
+
},
|
|
13567
|
+
[RetryStrategy.CONSERVATIVE]: {
|
|
13568
|
+
maxAttempts: 3,
|
|
13569
|
+
baseDelayMs: 3e3,
|
|
13570
|
+
maxDelayMs: 3e4,
|
|
13571
|
+
multiplier: 2.5
|
|
13572
|
+
},
|
|
13573
|
+
[RetryStrategy.EXPONENTIAL]: {
|
|
13574
|
+
maxAttempts: 4,
|
|
13575
|
+
baseDelayMs: 1e3,
|
|
13576
|
+
maxDelayMs: 15e3,
|
|
13577
|
+
multiplier: 2
|
|
13578
|
+
},
|
|
13579
|
+
[RetryStrategy.LINEAR]: {
|
|
13580
|
+
maxAttempts: 3,
|
|
13581
|
+
baseDelayMs: 2e3,
|
|
13582
|
+
maxDelayMs: 1e4,
|
|
13583
|
+
multiplier: 1
|
|
13584
|
+
},
|
|
13585
|
+
[RetryStrategy.NONE]: {
|
|
13586
|
+
maxAttempts: 1,
|
|
13587
|
+
baseDelayMs: 0,
|
|
13588
|
+
maxDelayMs: 0,
|
|
13589
|
+
multiplier: 1
|
|
13590
|
+
}
|
|
13591
|
+
};
|
|
13592
|
+
var CLASSIFICATION_RULES = {
|
|
13593
|
+
[ErrorCategory2.NETWORK]: {
|
|
13594
|
+
category: ErrorCategory2.NETWORK,
|
|
13595
|
+
retryStrategy: RetryStrategy.AGGRESSIVE,
|
|
13596
|
+
isRetryable: true,
|
|
13597
|
+
...RETRY_STRATEGIES[RetryStrategy.AGGRESSIVE],
|
|
13598
|
+
description: "Network connectivity or communication error",
|
|
13599
|
+
troubleshooting: [
|
|
13600
|
+
"Check internet connection",
|
|
13601
|
+
"Verify LIT Protocol network status",
|
|
13602
|
+
"Check firewall and proxy settings",
|
|
13603
|
+
"Try connecting to different node endpoints"
|
|
13604
|
+
]
|
|
13605
|
+
},
|
|
13606
|
+
[ErrorCategory2.PROTOCOL]: {
|
|
13607
|
+
category: ErrorCategory2.PROTOCOL,
|
|
13608
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
13609
|
+
isRetryable: true,
|
|
13610
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
13611
|
+
description: "LIT Protocol specific operational error",
|
|
13612
|
+
troubleshooting: [
|
|
13613
|
+
"Check LIT Protocol network status",
|
|
13614
|
+
"Verify PKP configuration",
|
|
13615
|
+
"Check signing shares availability",
|
|
13616
|
+
"Wait for network consensus"
|
|
13617
|
+
]
|
|
13618
|
+
},
|
|
13619
|
+
[ErrorCategory2.AUTHENTICATION]: {
|
|
13620
|
+
category: ErrorCategory2.AUTHENTICATION,
|
|
13621
|
+
retryStrategy: RetryStrategy.EXPONENTIAL,
|
|
13622
|
+
isRetryable: true,
|
|
13623
|
+
...RETRY_STRATEGIES[RetryStrategy.EXPONENTIAL],
|
|
13624
|
+
maxAttempts: 2,
|
|
13625
|
+
// Override: limited retries for auth issues
|
|
13626
|
+
description: "Authentication or authorization error",
|
|
13627
|
+
troubleshooting: [
|
|
13628
|
+
"Check session signatures validity",
|
|
13629
|
+
"Regenerate authentication tokens",
|
|
13630
|
+
"Verify wallet permissions",
|
|
13631
|
+
"Check PKP authorization status"
|
|
13632
|
+
]
|
|
13633
|
+
},
|
|
13634
|
+
[ErrorCategory2.RESOURCE]: {
|
|
13635
|
+
category: ErrorCategory2.RESOURCE,
|
|
13636
|
+
retryStrategy: RetryStrategy.LINEAR,
|
|
13637
|
+
isRetryable: true,
|
|
13638
|
+
...RETRY_STRATEGIES[RetryStrategy.LINEAR],
|
|
13639
|
+
maxAttempts: 2,
|
|
13640
|
+
// Override: limited retries for resource issues
|
|
13641
|
+
description: "Resource not found or validation error",
|
|
13642
|
+
troubleshooting: [
|
|
13643
|
+
"Verify resource CIDs are correct",
|
|
13644
|
+
"Check IPFS availability",
|
|
13645
|
+
"Confirm PKP exists and is accessible",
|
|
13646
|
+
"Wait for resource propagation"
|
|
13647
|
+
]
|
|
13648
|
+
},
|
|
13649
|
+
[ErrorCategory2.VALIDATION]: {
|
|
13650
|
+
category: ErrorCategory2.VALIDATION,
|
|
13651
|
+
retryStrategy: RetryStrategy.NONE,
|
|
13652
|
+
isRetryable: false,
|
|
13653
|
+
...RETRY_STRATEGIES[RetryStrategy.NONE],
|
|
13654
|
+
description: "Input validation or schema error",
|
|
13655
|
+
troubleshooting: [
|
|
13656
|
+
"Check input parameters format",
|
|
13657
|
+
"Verify required fields are provided",
|
|
13658
|
+
"Validate data types and ranges",
|
|
13659
|
+
"Review API documentation"
|
|
13660
|
+
]
|
|
13661
|
+
},
|
|
13662
|
+
[ErrorCategory2.TIMEOUT]: {
|
|
13663
|
+
category: ErrorCategory2.TIMEOUT,
|
|
13664
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
13665
|
+
isRetryable: true,
|
|
13666
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
13667
|
+
description: "Operation timeout error",
|
|
13668
|
+
troubleshooting: [
|
|
13669
|
+
"Increase timeout values",
|
|
13670
|
+
"Check network latency",
|
|
13671
|
+
"Verify system resources",
|
|
13672
|
+
"Split operations into smaller chunks"
|
|
13673
|
+
]
|
|
13674
|
+
},
|
|
13675
|
+
[ErrorCategory2.RATE_LIMIT]: {
|
|
13676
|
+
category: ErrorCategory2.RATE_LIMIT,
|
|
13677
|
+
retryStrategy: RetryStrategy.CONSERVATIVE,
|
|
13678
|
+
isRetryable: true,
|
|
13679
|
+
...RETRY_STRATEGIES[RetryStrategy.CONSERVATIVE],
|
|
13680
|
+
maxAttempts: 2,
|
|
13681
|
+
// Override: limited retries to avoid further rate limiting
|
|
13682
|
+
baseDelayMs: 5e3,
|
|
13683
|
+
// Override: longer delays for rate limits
|
|
13684
|
+
description: "Rate limit or quota exceeded",
|
|
13685
|
+
troubleshooting: [
|
|
13686
|
+
"Reduce request frequency",
|
|
13687
|
+
"Implement request batching",
|
|
13688
|
+
"Check rate limit headers",
|
|
13689
|
+
"Wait for quota reset"
|
|
13690
|
+
]
|
|
13691
|
+
},
|
|
13692
|
+
[ErrorCategory2.CONFIGURATION]: {
|
|
13693
|
+
category: ErrorCategory2.CONFIGURATION,
|
|
13694
|
+
retryStrategy: RetryStrategy.NONE,
|
|
13695
|
+
isRetryable: false,
|
|
13696
|
+
...RETRY_STRATEGIES[RetryStrategy.NONE],
|
|
13697
|
+
description: "Configuration or setup error",
|
|
13698
|
+
troubleshooting: [
|
|
13699
|
+
"Check environment variables",
|
|
13700
|
+
"Verify configuration files",
|
|
13701
|
+
"Review setup documentation",
|
|
13702
|
+
"Check required dependencies"
|
|
13703
|
+
]
|
|
13704
|
+
},
|
|
13705
|
+
[ErrorCategory2.UNKNOWN]: {
|
|
13706
|
+
category: ErrorCategory2.UNKNOWN,
|
|
13707
|
+
retryStrategy: RetryStrategy.EXPONENTIAL,
|
|
13708
|
+
isRetryable: true,
|
|
13709
|
+
...RETRY_STRATEGIES[RetryStrategy.EXPONENTIAL],
|
|
13710
|
+
maxAttempts: 2,
|
|
13711
|
+
// Override: conservative retries for unknown errors
|
|
13712
|
+
description: "Unknown or unclassified error",
|
|
13713
|
+
troubleshooting: [
|
|
13714
|
+
"Check logs for more details",
|
|
13715
|
+
"Verify system status",
|
|
13716
|
+
"Try again with debug logging",
|
|
13717
|
+
"Contact support if persists"
|
|
13718
|
+
]
|
|
13719
|
+
}
|
|
13720
|
+
};
|
|
13721
|
+
function classifyError(error) {
|
|
13722
|
+
const errorMessage = error?.message || error?.toString() || "";
|
|
13723
|
+
const errorLower = errorMessage.toLowerCase();
|
|
13724
|
+
for (const [category, patterns] of Object.entries(LIT_ERROR_PATTERNS)) {
|
|
13725
|
+
for (const pattern of patterns) {
|
|
13726
|
+
if (pattern.test(errorMessage) || pattern.test(errorLower)) {
|
|
13727
|
+
const classification = CLASSIFICATION_RULES[category];
|
|
13728
|
+
return {
|
|
13729
|
+
...classification,
|
|
13730
|
+
description: `${classification.description}: ${errorMessage.slice(0, 100)}`
|
|
13731
|
+
};
|
|
13732
|
+
}
|
|
13733
|
+
}
|
|
13734
|
+
}
|
|
13735
|
+
const unknownClassification = CLASSIFICATION_RULES[ErrorCategory2.UNKNOWN];
|
|
13736
|
+
return {
|
|
13737
|
+
...unknownClassification,
|
|
13738
|
+
description: `${unknownClassification.description}: ${errorMessage.slice(0, 100)}`
|
|
13739
|
+
};
|
|
13740
|
+
}
|
|
13741
|
+
function getRetryConfigFromClassification(classification) {
|
|
13742
|
+
return {
|
|
13743
|
+
maxAttempts: classification.maxAttempts,
|
|
13744
|
+
initialDelayMs: classification.baseDelayMs,
|
|
13745
|
+
maxDelayMs: classification.maxDelayMs,
|
|
13746
|
+
backoffMultiplier: RETRY_STRATEGIES[classification.retryStrategy].multiplier,
|
|
13747
|
+
retryableErrors: ["*"]
|
|
13748
|
+
// Classification already determined retryability
|
|
13749
|
+
};
|
|
13750
|
+
}
|
|
13751
|
+
function analyzeError(error) {
|
|
13752
|
+
const classification = classifyError(error);
|
|
13753
|
+
return {
|
|
13754
|
+
...classification,
|
|
13755
|
+
originalError: error,
|
|
13756
|
+
errorMessage: error?.message || error?.toString() || "Unknown error",
|
|
13757
|
+
errorStack: error?.stack,
|
|
13758
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
13759
|
+
retryConfig: getRetryConfigFromClassification(classification)
|
|
13760
|
+
};
|
|
13761
|
+
}
|
|
13762
|
+
function createErrorReport(error) {
|
|
13763
|
+
const analysis = analyzeError(error);
|
|
13764
|
+
const report = [
|
|
13765
|
+
`\u{1F50D} Error Analysis Report`,
|
|
13766
|
+
`=====================================`,
|
|
13767
|
+
`Category: ${analysis.category.toUpperCase()}`,
|
|
13768
|
+
`Retryable: ${analysis.isRetryable ? "\u2705 Yes" : "\u274C No"}`,
|
|
13769
|
+
`Strategy: ${analysis.retryStrategy}`,
|
|
13770
|
+
`Max Attempts: ${analysis.maxAttempts}`,
|
|
13771
|
+
`Description: ${analysis.description}`,
|
|
13772
|
+
`Timestamp: ${analysis.timestamp}`,
|
|
13773
|
+
``,
|
|
13774
|
+
`Original Error: ${analysis.errorMessage}`,
|
|
13775
|
+
``
|
|
13776
|
+
];
|
|
13777
|
+
if (analysis.troubleshooting && analysis.troubleshooting.length > 0) {
|
|
13778
|
+
report.push(`\u{1F6E0}\uFE0F Troubleshooting Steps:`);
|
|
13779
|
+
analysis.troubleshooting.forEach((step, index) => {
|
|
13780
|
+
report.push(` ${index + 1}. ${step}`);
|
|
13781
|
+
});
|
|
13782
|
+
report.push("");
|
|
13783
|
+
}
|
|
13784
|
+
return report.join("\n");
|
|
13785
|
+
}
|
|
13786
|
+
exports.litProtocolErrors = {
|
|
13787
|
+
isNetworkError: (error) => classifyError(error).category === ErrorCategory2.NETWORK,
|
|
13788
|
+
isProtocolError: (error) => classifyError(error).category === ErrorCategory2.PROTOCOL,
|
|
13789
|
+
isAuthenticationError: (error) => classifyError(error).category === ErrorCategory2.AUTHENTICATION,
|
|
13790
|
+
isResourceError: (error) => classifyError(error).category === ErrorCategory2.RESOURCE,
|
|
13791
|
+
isTimeoutError: (error) => classifyError(error).category === ErrorCategory2.TIMEOUT,
|
|
13792
|
+
isRateLimitError: (error) => classifyError(error).category === ErrorCategory2.RATE_LIMIT,
|
|
13793
|
+
isConfigurationError: (error) => classifyError(error).category === ErrorCategory2.CONFIGURATION,
|
|
13794
|
+
isRetryable: (error) => classifyError(error).isRetryable
|
|
13795
|
+
};
|
|
13796
|
+
}
|
|
13797
|
+
});
|
|
13798
|
+
|
|
13799
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/session-signature-cache.js
|
|
13800
|
+
var require_session_signature_cache = __commonJS({
|
|
13801
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/session-signature-cache.js"(exports) {
|
|
13802
|
+
"use strict";
|
|
13803
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13804
|
+
exports.sessionSignatureCache = exports.DEFAULT_CACHE_CONFIG = void 0;
|
|
13805
|
+
exports.generateSessionSignaturesWithCache = generateSessionSignaturesWithCache;
|
|
13806
|
+
exports.configureSessionSignatureCache = configureSessionSignatureCache;
|
|
13807
|
+
exports.clearSessionSignatureCache = clearSessionSignatureCache;
|
|
13808
|
+
exports.getSessionSignatureCacheStats = getSessionSignatureCacheStats;
|
|
13809
|
+
var debug_logger_1 = require_debug_logger();
|
|
13810
|
+
exports.DEFAULT_CACHE_CONFIG = {
|
|
13811
|
+
maxEntries: 50,
|
|
13812
|
+
bufferTimeMs: 6e4,
|
|
13813
|
+
// 1 minute buffer before expiration
|
|
13814
|
+
enableLogging: true
|
|
13815
|
+
};
|
|
13816
|
+
var SessionSignatureCache = class {
|
|
13817
|
+
constructor(config = {}) {
|
|
13818
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
13819
|
+
this.config = { ...exports.DEFAULT_CACHE_CONFIG, ...config };
|
|
13820
|
+
}
|
|
13821
|
+
/**
|
|
13822
|
+
* Generate cache key from PKP and context
|
|
13823
|
+
*/
|
|
13824
|
+
generateCacheKey(pkpTokenId, litActionCid, signerAddress, network) {
|
|
13825
|
+
return `${signerAddress}-${network}-${pkpTokenId}-${litActionCid}`;
|
|
13826
|
+
}
|
|
13827
|
+
/**
|
|
13828
|
+
* Check if cache entry is still valid
|
|
13829
|
+
*/
|
|
13830
|
+
isEntryValid(entry) {
|
|
13831
|
+
const now2 = /* @__PURE__ */ new Date();
|
|
13832
|
+
const expirationWithBuffer = new Date(entry.expiration.getTime() - this.config.bufferTimeMs);
|
|
13833
|
+
return now2 < expirationWithBuffer;
|
|
13834
|
+
}
|
|
13835
|
+
/**
|
|
13836
|
+
* Clean expired entries from cache
|
|
13837
|
+
*/
|
|
13838
|
+
cleanExpiredEntries() {
|
|
13839
|
+
const now2 = /* @__PURE__ */ new Date();
|
|
13840
|
+
let cleanedCount = 0;
|
|
13841
|
+
for (const [key2, entry] of this.cache.entries()) {
|
|
13842
|
+
if (now2 >= entry.expiration) {
|
|
13843
|
+
this.cache.delete(key2);
|
|
13844
|
+
cleanedCount++;
|
|
13845
|
+
}
|
|
13846
|
+
}
|
|
13847
|
+
if (cleanedCount > 0 && this.config.enableLogging) {
|
|
13848
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F9F9} Cleaned ${cleanedCount} expired session signature entries`);
|
|
13849
|
+
}
|
|
13850
|
+
}
|
|
13851
|
+
/**
|
|
13852
|
+
* Enforce cache size limits
|
|
13853
|
+
*/
|
|
13854
|
+
enforceCacheSize() {
|
|
13855
|
+
if (this.cache.size <= this.config.maxEntries) {
|
|
13856
|
+
return;
|
|
13857
|
+
}
|
|
13858
|
+
const entries = Array.from(this.cache.entries()).sort(([, a], [, b]) => a.createdAt.getTime() - b.createdAt.getTime());
|
|
13859
|
+
const toRemove = entries.slice(0, this.cache.size - this.config.maxEntries);
|
|
13860
|
+
for (const [key2] of toRemove) {
|
|
13861
|
+
this.cache.delete(key2);
|
|
13862
|
+
}
|
|
13863
|
+
if (this.config.enableLogging) {
|
|
13864
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F4E6} Removed ${toRemove.length} oldest cache entries to maintain size limit`);
|
|
13865
|
+
}
|
|
13866
|
+
}
|
|
13867
|
+
/**
|
|
13868
|
+
* Get cached session signatures if valid
|
|
13869
|
+
*/
|
|
13870
|
+
get(pkpTokenId, litActionCid, signerAddress, network) {
|
|
13871
|
+
this.cleanExpiredEntries();
|
|
13872
|
+
const cacheKey = this.generateCacheKey(pkpTokenId, litActionCid, signerAddress, network);
|
|
13873
|
+
const entry = this.cache.get(cacheKey);
|
|
13874
|
+
if (!entry) {
|
|
13875
|
+
if (this.config.enableLogging) {
|
|
13876
|
+
(0, debug_logger_1.debugLog)("CACHE", `\u274C Session signatures cache miss: ${cacheKey}`);
|
|
13877
|
+
}
|
|
13878
|
+
return null;
|
|
13879
|
+
}
|
|
13880
|
+
if (!this.isEntryValid(entry)) {
|
|
13881
|
+
this.cache.delete(cacheKey);
|
|
13882
|
+
if (this.config.enableLogging) {
|
|
13883
|
+
(0, debug_logger_1.debugWarn)("CACHE", `\u23F0 Session signatures expired: ${cacheKey}`);
|
|
13884
|
+
}
|
|
13885
|
+
return null;
|
|
13886
|
+
}
|
|
13887
|
+
if (this.config.enableLogging) {
|
|
13888
|
+
const timeUntilExpiry = entry.expiration.getTime() - Date.now();
|
|
13889
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u2705 Session signatures cache hit: ${cacheKey} (expires in ${Math.round(timeUntilExpiry / 1e3)}s)`);
|
|
13890
|
+
}
|
|
13891
|
+
return entry.sessionSigs;
|
|
13892
|
+
}
|
|
13893
|
+
/**
|
|
13894
|
+
* Cache session signatures
|
|
13895
|
+
*/
|
|
13896
|
+
set(pkpTokenId, litActionCid, signerAddress, network, sessionSigs, expiration) {
|
|
13897
|
+
const cacheKey = this.generateCacheKey(pkpTokenId, litActionCid, signerAddress, network);
|
|
13898
|
+
const entry = {
|
|
13899
|
+
sessionSigs,
|
|
13900
|
+
expiration,
|
|
13901
|
+
pkpTokenId,
|
|
13902
|
+
litActionCid,
|
|
13903
|
+
signerAddress,
|
|
13904
|
+
network,
|
|
13905
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
13906
|
+
};
|
|
13907
|
+
this.cache.set(cacheKey, entry);
|
|
13908
|
+
if (this.config.enableLogging) {
|
|
13909
|
+
const timeUntilExpiry = expiration.getTime() - Date.now();
|
|
13910
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F4BE} Cached session signatures: ${cacheKey} (expires in ${Math.round(timeUntilExpiry / 1e3)}s)`);
|
|
13911
|
+
}
|
|
13912
|
+
this.enforceCacheSize();
|
|
13913
|
+
}
|
|
13914
|
+
/**
|
|
13915
|
+
* Clear all cached session signatures
|
|
13916
|
+
*/
|
|
13917
|
+
clear() {
|
|
13918
|
+
const size = this.cache.size;
|
|
13919
|
+
this.cache.clear();
|
|
13920
|
+
if (this.config.enableLogging) {
|
|
13921
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F5D1}\uFE0F Cleared ${size} cached session signature entries`);
|
|
13922
|
+
}
|
|
13923
|
+
}
|
|
13924
|
+
/**
|
|
13925
|
+
* Get cache statistics
|
|
13926
|
+
*/
|
|
13927
|
+
getStats() {
|
|
13928
|
+
this.cleanExpiredEntries();
|
|
13929
|
+
return {
|
|
13930
|
+
size: this.cache.size,
|
|
13931
|
+
maxEntries: this.config.maxEntries,
|
|
13932
|
+
utilizationPercent: Math.round(this.cache.size / this.config.maxEntries * 100)
|
|
13933
|
+
};
|
|
13934
|
+
}
|
|
13935
|
+
/**
|
|
13936
|
+
* Remove specific cache entry
|
|
13937
|
+
*/
|
|
13938
|
+
delete(pkpTokenId, litActionCid, signerAddress, network) {
|
|
13939
|
+
const cacheKey = this.generateCacheKey(pkpTokenId, litActionCid, signerAddress, network);
|
|
13940
|
+
const deleted = this.cache.delete(cacheKey);
|
|
13941
|
+
if (deleted && this.config.enableLogging) {
|
|
13942
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u{1F5D1}\uFE0F Removed session signatures from cache: ${cacheKey}`);
|
|
13943
|
+
}
|
|
13944
|
+
return deleted;
|
|
13945
|
+
}
|
|
13946
|
+
};
|
|
13947
|
+
exports.sessionSignatureCache = new SessionSignatureCache();
|
|
13948
|
+
async function generateSessionSignaturesWithCache(litNodeClient, sessionConfig, pkpTokenId, litActionCid, signerAddress, network = "chipotle") {
|
|
13949
|
+
const cached = exports.sessionSignatureCache.get(pkpTokenId, litActionCid, signerAddress, network);
|
|
13950
|
+
if (cached) {
|
|
13951
|
+
return cached;
|
|
13952
|
+
}
|
|
13953
|
+
(0, debug_logger_1.debugInfo)("CACHE", "\u{1F510} Generating new session signatures (cache miss)...");
|
|
13954
|
+
const sessionSigs = await litNodeClient.getSessionSigs(sessionConfig);
|
|
13955
|
+
const expiration = new Date(sessionConfig.expiration);
|
|
13956
|
+
exports.sessionSignatureCache.set(pkpTokenId, litActionCid, signerAddress, network, sessionSigs, expiration);
|
|
13957
|
+
const sigCount = Object.keys(sessionSigs).length;
|
|
13958
|
+
(0, debug_logger_1.debugInfo)("CACHE", `\u2705 Generated and cached ${sigCount} session signatures`);
|
|
13959
|
+
return sessionSigs;
|
|
13960
|
+
}
|
|
13961
|
+
function configureSessionSignatureCache(config) {
|
|
13962
|
+
Object.assign(exports.sessionSignatureCache["config"], config);
|
|
13963
|
+
}
|
|
13964
|
+
function clearSessionSignatureCache() {
|
|
13965
|
+
exports.sessionSignatureCache.clear();
|
|
13966
|
+
}
|
|
13967
|
+
function getSessionSignatureCacheStats() {
|
|
13968
|
+
return exports.sessionSignatureCache.getStats();
|
|
13969
|
+
}
|
|
13970
|
+
}
|
|
13971
|
+
});
|
|
13972
|
+
|
|
13973
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/connection-helpers.js
|
|
13974
|
+
var require_connection_helpers = __commonJS({
|
|
13975
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/chunks/connection-helpers.js"(exports) {
|
|
13976
|
+
"use strict";
|
|
13977
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
13978
|
+
if (k2 === void 0)
|
|
13979
|
+
k2 = k;
|
|
13980
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13981
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13982
|
+
desc = { enumerable: true, get: function() {
|
|
13983
|
+
return m[k];
|
|
13984
|
+
} };
|
|
13985
|
+
}
|
|
13986
|
+
Object.defineProperty(o, k2, desc);
|
|
13987
|
+
} : function(o, m, k, k2) {
|
|
13988
|
+
if (k2 === void 0)
|
|
13989
|
+
k2 = k;
|
|
13990
|
+
o[k2] = m[k];
|
|
13991
|
+
});
|
|
13992
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
13993
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
13994
|
+
} : function(o, v) {
|
|
13995
|
+
o["default"] = v;
|
|
13996
|
+
});
|
|
13997
|
+
var __importStar = exports && exports.__importStar || function() {
|
|
13998
|
+
var ownKeys = function(o) {
|
|
13999
|
+
ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
14000
|
+
var ar = [];
|
|
14001
|
+
for (var k in o2)
|
|
14002
|
+
if (Object.prototype.hasOwnProperty.call(o2, k))
|
|
14003
|
+
ar[ar.length] = k;
|
|
14004
|
+
return ar;
|
|
14005
|
+
};
|
|
14006
|
+
return ownKeys(o);
|
|
14007
|
+
};
|
|
14008
|
+
return function(mod) {
|
|
14009
|
+
if (mod && mod.__esModule)
|
|
14010
|
+
return mod;
|
|
14011
|
+
var result = {};
|
|
14012
|
+
if (mod != null) {
|
|
14013
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
14014
|
+
if (k[i] !== "default")
|
|
14015
|
+
__createBinding(result, mod, k[i]);
|
|
14016
|
+
}
|
|
14017
|
+
__setModuleDefault(result, mod);
|
|
14018
|
+
return result;
|
|
14019
|
+
};
|
|
14020
|
+
}();
|
|
14021
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14022
|
+
exports.NETWORK_TIMEOUTS = exports.DEFAULT_RETRY_CONFIG = void 0;
|
|
14023
|
+
exports.sleep = sleep;
|
|
14024
|
+
exports.isRetryableError = isRetryableError;
|
|
14025
|
+
exports.calculateDelay = calculateDelay;
|
|
14026
|
+
exports.withRetry = withRetry;
|
|
14027
|
+
exports.connectLitNodeClient = connectLitNodeClient;
|
|
14028
|
+
exports.connectLitContracts = connectLitContracts;
|
|
14029
|
+
exports.validateLitNodeConnection = validateLitNodeConnection;
|
|
14030
|
+
exports.generateSessionSignatures = generateSessionSignatures;
|
|
14031
|
+
exports.validateLitNodeReadiness = validateLitNodeReadiness;
|
|
14032
|
+
exports.executeLitAction = executeLitAction;
|
|
14033
|
+
exports.executePkpOperation = executePkpOperation;
|
|
14034
|
+
exports.getNetworkTimeouts = getNetworkTimeouts;
|
|
14035
|
+
var debug_logger_1 = require_debug_logger();
|
|
14036
|
+
var error_classification_1 = require_error_classification();
|
|
14037
|
+
exports.DEFAULT_RETRY_CONFIG = {
|
|
14038
|
+
maxAttempts: 5,
|
|
14039
|
+
// Increased from 3 for PKP operations
|
|
14040
|
+
initialDelayMs: 2e3,
|
|
14041
|
+
// Increased from 1000ms for PKP operations
|
|
14042
|
+
maxDelayMs: 6e4,
|
|
14043
|
+
// Increased from 30000ms for PKP operations
|
|
14044
|
+
backoffMultiplier: 2,
|
|
14045
|
+
retryableErrors: [
|
|
14046
|
+
"request_timeout",
|
|
14047
|
+
"network error",
|
|
14048
|
+
"connection failed",
|
|
14049
|
+
"ENOTFOUND",
|
|
14050
|
+
"ECONNREFUSED",
|
|
14051
|
+
"ETIMEDOUT",
|
|
14052
|
+
"socket hang up",
|
|
14053
|
+
"timeout",
|
|
14054
|
+
// PKP-specific errors
|
|
14055
|
+
"signing shares",
|
|
14056
|
+
"There was an error getting the signing shares",
|
|
14057
|
+
"PKP validation",
|
|
14058
|
+
"pkp validation failed",
|
|
14059
|
+
"resource validation",
|
|
14060
|
+
"ipfs propagation",
|
|
14061
|
+
"session.*expired",
|
|
14062
|
+
"NodeError",
|
|
14063
|
+
"Response from the nodes",
|
|
14064
|
+
"consensus",
|
|
14065
|
+
"threshold"
|
|
14066
|
+
]
|
|
14067
|
+
};
|
|
14068
|
+
function sleep(ms) {
|
|
14069
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
14070
|
+
}
|
|
14071
|
+
function isRetryableError(error, retryableErrors = exports.DEFAULT_RETRY_CONFIG.retryableErrors) {
|
|
14072
|
+
if (!error)
|
|
14073
|
+
return false;
|
|
14074
|
+
const classification = (0, error_classification_1.classifyError)(error);
|
|
14075
|
+
if (classification.isRetryable !== void 0) {
|
|
14076
|
+
(0, debug_logger_1.debugInfo)("ERROR_CLASSIFICATION", `Error classified as: ${classification.category} (retryable: ${classification.isRetryable})`);
|
|
14077
|
+
return classification.isRetryable;
|
|
14078
|
+
}
|
|
14079
|
+
const errorMessage = error.message || error.toString() || "";
|
|
14080
|
+
const errorLower = errorMessage.toLowerCase();
|
|
14081
|
+
return retryableErrors.some((pattern) => errorLower.includes(pattern.toLowerCase()));
|
|
14082
|
+
}
|
|
14083
|
+
function calculateDelay(attempt, config) {
|
|
14084
|
+
const exponentialDelay = Math.min(config.initialDelayMs * Math.pow(config.backoffMultiplier, attempt - 1), config.maxDelayMs);
|
|
14085
|
+
const jitter = exponentialDelay * 0.25 * (Math.random() - 0.5);
|
|
14086
|
+
return Math.max(100, exponentialDelay + jitter);
|
|
14087
|
+
}
|
|
14088
|
+
async function withRetry(operation, config = {}, operationName = "operation") {
|
|
14089
|
+
let finalConfig = { ...exports.DEFAULT_RETRY_CONFIG, ...config };
|
|
14090
|
+
const tracker = new debug_logger_1.PerformanceTracker(`Retry ${operationName}`);
|
|
14091
|
+
let lastError;
|
|
14092
|
+
let errorClassification = null;
|
|
14093
|
+
for (let attempt = 1; attempt <= finalConfig.maxAttempts; attempt++) {
|
|
14094
|
+
try {
|
|
14095
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u{1F504} [${operationName}] Attempt ${attempt}/${finalConfig.maxAttempts}`);
|
|
14096
|
+
const startTime = Date.now();
|
|
14097
|
+
const result = await operation();
|
|
14098
|
+
const duration = Date.now() - startTime;
|
|
14099
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u2705 [${operationName}] Success after ${duration}ms (attempt ${attempt})`);
|
|
14100
|
+
debug_logger_1.networkMetrics.recordRequest(operationName, true, duration);
|
|
14101
|
+
tracker.end(true);
|
|
14102
|
+
return result;
|
|
14103
|
+
} catch (error) {
|
|
14104
|
+
lastError = error;
|
|
14105
|
+
const errorMessage = error?.message || error?.toString() || "Unknown error";
|
|
14106
|
+
errorClassification = (0, error_classification_1.classifyError)(error);
|
|
14107
|
+
if (attempt === 1 && errorClassification) {
|
|
14108
|
+
const intelligentConfig = (0, error_classification_1.getRetryConfigFromClassification)(errorClassification);
|
|
14109
|
+
finalConfig = {
|
|
14110
|
+
...finalConfig,
|
|
14111
|
+
...intelligentConfig,
|
|
14112
|
+
maxAttempts: Math.min(finalConfig.maxAttempts, intelligentConfig.maxAttempts)
|
|
14113
|
+
};
|
|
14114
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u{1F9E0} Intelligent retry strategy applied: ${errorClassification.category} (${errorClassification.retryStrategy})`);
|
|
14115
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u{1F4CA} Adjusted config: max=${finalConfig.maxAttempts}, delay=${finalConfig.initialDelayMs}ms`);
|
|
14116
|
+
}
|
|
14117
|
+
(0, debug_logger_1.debugWarn)("RETRY", `\u26A0\uFE0F [${operationName}] Attempt ${attempt} failed:`, {
|
|
14118
|
+
error: errorMessage,
|
|
14119
|
+
attempt,
|
|
14120
|
+
category: errorClassification.category,
|
|
14121
|
+
retryable: errorClassification.isRetryable
|
|
14122
|
+
});
|
|
14123
|
+
debug_logger_1.networkMetrics.recordRequest(operationName, false, 0, errorMessage);
|
|
14124
|
+
if (attempt >= finalConfig.maxAttempts) {
|
|
14125
|
+
(0, debug_logger_1.debugError)("RETRY", `\u274C [${operationName}] All attempts failed. Last error:`, { error: errorMessage });
|
|
14126
|
+
if (errorClassification) {
|
|
14127
|
+
const errorReport = (0, error_classification_1.createErrorReport)(error);
|
|
14128
|
+
(0, debug_logger_1.debugError)("RETRY", `\u{1F4CB} Error Analysis Report:
|
|
14129
|
+
${errorReport}`);
|
|
14130
|
+
}
|
|
14131
|
+
tracker.end(false);
|
|
14132
|
+
break;
|
|
14133
|
+
}
|
|
14134
|
+
if (!errorClassification.isRetryable) {
|
|
14135
|
+
(0, debug_logger_1.debugError)("RETRY", `\u{1F6AB} [${operationName}] Non-retryable error (${errorClassification.category}):`, { error: errorMessage });
|
|
14136
|
+
if (errorClassification.troubleshooting) {
|
|
14137
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u{1F4A1} Troubleshooting suggestions:
|
|
14138
|
+
${errorClassification.troubleshooting.join("\n ")}`);
|
|
14139
|
+
}
|
|
14140
|
+
tracker.end(false);
|
|
14141
|
+
break;
|
|
14142
|
+
}
|
|
14143
|
+
const delayMs = calculateDelay(attempt, finalConfig);
|
|
14144
|
+
(0, debug_logger_1.debugInfo)("RETRY", `\u23F3 [${operationName}] Waiting ${delayMs}ms before retry... (${errorClassification.retryStrategy} strategy)`);
|
|
14145
|
+
await sleep(delayMs);
|
|
14146
|
+
}
|
|
14147
|
+
}
|
|
14148
|
+
throw lastError;
|
|
14149
|
+
}
|
|
14150
|
+
async function connectLitNodeClient(litNodeClient, config = {}) {
|
|
14151
|
+
const network = litNodeClient?.config?.litNetwork || "unknown";
|
|
14152
|
+
return withRetry(async () => {
|
|
14153
|
+
if (!litNodeClient) {
|
|
14154
|
+
throw new Error("LIT Node Client is null or undefined");
|
|
14155
|
+
}
|
|
14156
|
+
const startTime = Date.now();
|
|
14157
|
+
(0, debug_logger_1.logConnectionAttempt)(network, 1, config.maxAttempts || exports.DEFAULT_RETRY_CONFIG.maxAttempts);
|
|
14158
|
+
await litNodeClient.connect();
|
|
14159
|
+
(0, debug_logger_1.debugInfo)("CONNECTION", `\u23F3 Waiting for LIT Node Client to be ready...`);
|
|
14160
|
+
const readyTimeout = 3e4;
|
|
14161
|
+
const readyStartTime = Date.now();
|
|
14162
|
+
while (!litNodeClient.ready && Date.now() - readyStartTime < readyTimeout) {
|
|
14163
|
+
await sleep(500);
|
|
14164
|
+
}
|
|
14165
|
+
if (!litNodeClient.ready) {
|
|
14166
|
+
throw new Error(`LIT Node Client failed to become ready within ${readyTimeout}ms`);
|
|
14167
|
+
}
|
|
14168
|
+
const latency = Date.now() - startTime;
|
|
14169
|
+
(0, debug_logger_1.debugInfo)("CONNECTION", `\u2705 LIT Node Client is ready (${litNodeClient.ready})`);
|
|
14170
|
+
(0, debug_logger_1.logConnectionSuccess)(network, latency);
|
|
14171
|
+
}, config, "LIT Node Client Connection");
|
|
14172
|
+
}
|
|
14173
|
+
async function connectLitContracts(litContracts, config = {}) {
|
|
14174
|
+
return withRetry(async () => {
|
|
14175
|
+
if (!litContracts) {
|
|
14176
|
+
throw new Error("LIT Contracts is null or undefined");
|
|
14177
|
+
}
|
|
14178
|
+
console.log(`\u{1F517} Connecting to LIT Contracts: ${litContracts.network || "unknown"}`);
|
|
14179
|
+
await litContracts.connect();
|
|
14180
|
+
console.log("\u2705 LIT Contracts connected successfully");
|
|
14181
|
+
}, config, "LIT Contracts Connection");
|
|
14182
|
+
}
|
|
14183
|
+
async function validateLitNodeConnection(litNodeClient) {
|
|
14184
|
+
try {
|
|
14185
|
+
const startTime = Date.now();
|
|
14186
|
+
if (!litNodeClient) {
|
|
14187
|
+
return { isValid: false, error: "LIT Node Client is null or undefined" };
|
|
14188
|
+
}
|
|
14189
|
+
await litNodeClient.getLatestBlockhash();
|
|
14190
|
+
const latencyMs = Date.now() - startTime;
|
|
14191
|
+
return { isValid: true, latencyMs };
|
|
14192
|
+
} catch (error) {
|
|
14193
|
+
return {
|
|
14194
|
+
isValid: false,
|
|
14195
|
+
error: error?.message || error?.toString() || "Unknown validation error"
|
|
14196
|
+
};
|
|
14197
|
+
}
|
|
14198
|
+
}
|
|
14199
|
+
async function generateSessionSignatures(litNodeClient, sessionConfig, config = {}, pkpTokenId, litActionCid, signerAddress, network = "chipotle") {
|
|
14200
|
+
if (pkpTokenId && litActionCid && signerAddress) {
|
|
14201
|
+
const { sessionSignatureCache } = await Promise.resolve().then(() => __importStar(require_session_signature_cache()));
|
|
14202
|
+
const cached = sessionSignatureCache.get(pkpTokenId, litActionCid, signerAddress, network);
|
|
14203
|
+
if (cached) {
|
|
14204
|
+
const sigCount = Object.keys(cached).length;
|
|
14205
|
+
(0, debug_logger_1.debugInfo)("SESSION", `\u{1F504} Using cached session signatures (${sigCount} sigs)`);
|
|
14206
|
+
return cached;
|
|
14207
|
+
}
|
|
14208
|
+
}
|
|
14209
|
+
return withRetry(async () => {
|
|
14210
|
+
(0, debug_logger_1.debugInfo)("SESSION", "\u{1F510} Generating new session signatures...");
|
|
14211
|
+
const sessionSigs = await litNodeClient.getSessionSigs(sessionConfig);
|
|
14212
|
+
const sigCount = Object.keys(sessionSigs).length;
|
|
14213
|
+
if (pkpTokenId && litActionCid && signerAddress) {
|
|
14214
|
+
const { sessionSignatureCache } = await Promise.resolve().then(() => __importStar(require_session_signature_cache()));
|
|
14215
|
+
const expiration = new Date(sessionConfig.expiration);
|
|
14216
|
+
sessionSignatureCache.set(pkpTokenId, litActionCid, signerAddress, network, sessionSigs, expiration);
|
|
14217
|
+
}
|
|
14218
|
+
(0, debug_logger_1.debugInfo)("SESSION", `\u2705 Generated ${sigCount} session signatures`);
|
|
14219
|
+
return sessionSigs;
|
|
14220
|
+
}, config, "Session Signature Generation");
|
|
14221
|
+
}
|
|
14222
|
+
async function validateLitNodeReadiness(litNodeClient) {
|
|
14223
|
+
if (!litNodeClient) {
|
|
14224
|
+
throw new Error("LIT Node Client is null or undefined");
|
|
14225
|
+
}
|
|
14226
|
+
if (!litNodeClient.ready) {
|
|
14227
|
+
(0, debug_logger_1.debugWarn)("CONNECTION", "\u26A0\uFE0F LIT Node Client not ready, attempting to reconnect...");
|
|
14228
|
+
await litNodeClient.connect();
|
|
14229
|
+
const readyTimeout = 15e3;
|
|
14230
|
+
const startTime = Date.now();
|
|
14231
|
+
while (!litNodeClient.ready && Date.now() - startTime < readyTimeout) {
|
|
14232
|
+
await sleep(500);
|
|
14233
|
+
}
|
|
14234
|
+
if (!litNodeClient.ready) {
|
|
14235
|
+
throw new Error("LIT Node Client is not ready for operations");
|
|
14236
|
+
}
|
|
14237
|
+
}
|
|
14238
|
+
(0, debug_logger_1.debugInfo)("CONNECTION", "\u2705 LIT Node Client readiness validated");
|
|
14239
|
+
}
|
|
14240
|
+
async function executeLitAction(litNodeClient, executionConfig, config = {}) {
|
|
14241
|
+
const cid = executionConfig.ipfsId;
|
|
14242
|
+
return withRetry(async () => {
|
|
14243
|
+
const startTime = Date.now();
|
|
14244
|
+
await validateLitNodeReadiness(litNodeClient);
|
|
14245
|
+
(0, debug_logger_1.logLitActionExecution)(cid, executionConfig.jsParams);
|
|
14246
|
+
(0, debug_logger_1.logRequest)("LIT_ACTION", "executeJs", executionConfig);
|
|
14247
|
+
const result = await litNodeClient.executeJs(executionConfig);
|
|
14248
|
+
const duration = Date.now() - startTime;
|
|
14249
|
+
if (!result.response) {
|
|
14250
|
+
(0, debug_logger_1.logError)("LIT_ACTION", "executeJs", new Error("No response from LIT Action"), duration);
|
|
14251
|
+
throw new Error("No response from LIT Action");
|
|
14252
|
+
}
|
|
14253
|
+
(0, debug_logger_1.logResponse)("LIT_ACTION", "executeJs", result, duration);
|
|
14254
|
+
(0, debug_logger_1.logLitActionResult)(cid, true, duration, result);
|
|
14255
|
+
return result;
|
|
14256
|
+
}, config, "LIT Action Execution");
|
|
14257
|
+
}
|
|
14258
|
+
async function executePkpOperation(operation, operationName, config = {}) {
|
|
14259
|
+
const pkpConfig = {
|
|
14260
|
+
...exports.DEFAULT_RETRY_CONFIG,
|
|
14261
|
+
...config,
|
|
14262
|
+
retryableErrors: [
|
|
14263
|
+
...exports.DEFAULT_RETRY_CONFIG.retryableErrors,
|
|
14264
|
+
"pkp validation",
|
|
14265
|
+
"signing shares",
|
|
14266
|
+
"resource validation",
|
|
14267
|
+
"ipfs propagation"
|
|
14268
|
+
]
|
|
14269
|
+
};
|
|
14270
|
+
return withRetry(operation, pkpConfig, `PKP ${operationName}`);
|
|
14271
|
+
}
|
|
14272
|
+
exports.NETWORK_TIMEOUTS = {
|
|
14273
|
+
chipotle: {
|
|
14274
|
+
connection: 6e4,
|
|
14275
|
+
operation: 12e4,
|
|
14276
|
+
pkpValidation: 18e4
|
|
14277
|
+
}
|
|
14278
|
+
};
|
|
14279
|
+
function getNetworkTimeouts(network) {
|
|
14280
|
+
return exports.NETWORK_TIMEOUTS[network] || exports.NETWORK_TIMEOUTS["chipotle"];
|
|
14281
|
+
}
|
|
14282
|
+
}
|
|
14283
|
+
});
|
|
14284
|
+
|
|
14285
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/index.js
|
|
14286
|
+
var require_utils4 = __commonJS({
|
|
14287
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/utils/index.js"(exports) {
|
|
14288
|
+
"use strict";
|
|
14289
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
14290
|
+
if (k2 === void 0)
|
|
14291
|
+
k2 = k;
|
|
14292
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14293
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14294
|
+
desc = { enumerable: true, get: function() {
|
|
14295
|
+
return m[k];
|
|
14296
|
+
} };
|
|
14297
|
+
}
|
|
14298
|
+
Object.defineProperty(o, k2, desc);
|
|
14299
|
+
} : function(o, m, k, k2) {
|
|
14300
|
+
if (k2 === void 0)
|
|
14301
|
+
k2 = k;
|
|
14302
|
+
o[k2] = m[k];
|
|
14303
|
+
});
|
|
14304
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
14305
|
+
for (var p in m)
|
|
14306
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
14307
|
+
__createBinding(exports2, m, p);
|
|
14308
|
+
};
|
|
14309
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14310
|
+
__exportStar(require_lit_action_helpers(), exports);
|
|
14311
|
+
__exportStar(require_pkp_setup(), exports);
|
|
14312
|
+
__exportStar(require_cid_utils(), exports);
|
|
14313
|
+
__exportStar(require_connection_helpers(), exports);
|
|
14314
|
+
__exportStar(require_debug_logger(), exports);
|
|
14315
|
+
__exportStar(require_error_classification(), exports);
|
|
14316
|
+
__exportStar(require_session_signature_cache(), exports);
|
|
14317
|
+
}
|
|
14318
|
+
});
|
|
14319
|
+
|
|
14320
|
+
// node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/index.js
|
|
14321
|
+
var require_pkg_src = __commonJS({
|
|
14322
|
+
"node_modules/@gvnrdao/dh-lit-actions/pkg-dist/pkg-src/index.js"(exports) {
|
|
14323
|
+
"use strict";
|
|
14324
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
14325
|
+
if (k2 === void 0)
|
|
14326
|
+
k2 = k;
|
|
14327
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14328
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14329
|
+
desc = { enumerable: true, get: function() {
|
|
14330
|
+
return m[k];
|
|
14331
|
+
} };
|
|
14332
|
+
}
|
|
14333
|
+
Object.defineProperty(o, k2, desc);
|
|
14334
|
+
} : function(o, m, k, k2) {
|
|
14335
|
+
if (k2 === void 0)
|
|
14336
|
+
k2 = k;
|
|
14337
|
+
o[k2] = m[k];
|
|
14338
|
+
});
|
|
14339
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
14340
|
+
for (var p in m)
|
|
14341
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
14342
|
+
__createBinding(exports2, m, p);
|
|
14343
|
+
};
|
|
14344
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14345
|
+
exports.CHIPOTLE_DEPLOYMENTS = exports.DH_LIT_ACTIONS_CHIPOTLE = void 0;
|
|
14346
|
+
__exportStar(require_interfaces(), exports);
|
|
14347
|
+
__exportStar(require_lit_actions_registry(), exports);
|
|
14348
|
+
__exportStar(require_utils4(), exports);
|
|
14349
|
+
var lit_actions_registry_1 = require_lit_actions_registry();
|
|
14350
|
+
Object.defineProperty(exports, "DH_LIT_ACTIONS_CHIPOTLE", { enumerable: true, get: function() {
|
|
14351
|
+
return lit_actions_registry_1.DH_LIT_ACTIONS_CHIPOTLE;
|
|
14352
|
+
} });
|
|
14353
|
+
Object.defineProperty(exports, "CHIPOTLE_DEPLOYMENTS", { enumerable: true, get: function() {
|
|
14354
|
+
return lit_actions_registry_1.CHIPOTLE_DEPLOYMENTS;
|
|
14355
|
+
} });
|
|
14356
|
+
}
|
|
14357
|
+
});
|
|
14358
|
+
|
|
12694
14359
|
// src/constants/chunks/deployment-addresses.ts
|
|
12695
14360
|
var deployment_addresses_exports = {};
|
|
12696
14361
|
__export(deployment_addresses_exports, {
|
|
@@ -13352,10 +15017,10 @@ __export(ethers_exports, {
|
|
|
13352
15017
|
constants: () => lib_exports2,
|
|
13353
15018
|
errors: () => ErrorCode,
|
|
13354
15019
|
getDefaultProvider: () => getDefaultProvider,
|
|
13355
|
-
logger: () =>
|
|
15020
|
+
logger: () => logger47,
|
|
13356
15021
|
providers: () => lib_exports4,
|
|
13357
15022
|
utils: () => utils_exports,
|
|
13358
|
-
version: () =>
|
|
15023
|
+
version: () => version26,
|
|
13359
15024
|
wordlists: () => wordlists
|
|
13360
15025
|
});
|
|
13361
15026
|
|
|
@@ -13428,10 +15093,10 @@ var ErrorCode;
|
|
|
13428
15093
|
})(ErrorCode || (ErrorCode = {}));
|
|
13429
15094
|
var HEX = "0123456789abcdef";
|
|
13430
15095
|
var Logger = class _Logger {
|
|
13431
|
-
constructor(
|
|
15096
|
+
constructor(version27) {
|
|
13432
15097
|
Object.defineProperty(this, "version", {
|
|
13433
15098
|
enumerable: true,
|
|
13434
|
-
value:
|
|
15099
|
+
value: version27,
|
|
13435
15100
|
writable: false
|
|
13436
15101
|
});
|
|
13437
15102
|
}
|
|
@@ -13646,8 +15311,8 @@ var Logger = class _Logger {
|
|
|
13646
15311
|
}
|
|
13647
15312
|
_logLevel = level;
|
|
13648
15313
|
}
|
|
13649
|
-
static from(
|
|
13650
|
-
return new _Logger(
|
|
15314
|
+
static from(version27) {
|
|
15315
|
+
return new _Logger(version27);
|
|
13651
15316
|
}
|
|
13652
15317
|
};
|
|
13653
15318
|
Logger.errors = ErrorCode;
|
|
@@ -18311,10 +19976,10 @@ var Interface = class {
|
|
|
18311
19976
|
}
|
|
18312
19977
|
};
|
|
18313
19978
|
|
|
18314
|
-
// node_modules
|
|
19979
|
+
// node_modules/@ethersproject/abstract-provider/lib.esm/_version.js
|
|
18315
19980
|
var version10 = "abstract-provider/5.8.0";
|
|
18316
19981
|
|
|
18317
|
-
// node_modules
|
|
19982
|
+
// node_modules/@ethersproject/abstract-provider/lib.esm/index.js
|
|
18318
19983
|
var __awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
18319
19984
|
function adopt(value) {
|
|
18320
19985
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -21037,10 +22702,10 @@ function parse(rawTransaction) {
|
|
|
21037
22702
|
});
|
|
21038
22703
|
}
|
|
21039
22704
|
|
|
21040
|
-
// node_modules
|
|
22705
|
+
// node_modules/@ethersproject/contracts/lib.esm/_version.js
|
|
21041
22706
|
var version14 = "contracts/5.8.0";
|
|
21042
22707
|
|
|
21043
|
-
// node_modules
|
|
22708
|
+
// node_modules/@ethersproject/contracts/lib.esm/index.js
|
|
21044
22709
|
var __awaiter5 = function(thisArg, _arguments, P, generator) {
|
|
21045
22710
|
function adopt(value) {
|
|
21046
22711
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -21975,73 +23640,6 @@ var ContractFactory = class {
|
|
|
21975
23640
|
}
|
|
21976
23641
|
};
|
|
21977
23642
|
|
|
21978
|
-
// node_modules/@ethersproject/wallet/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js
|
|
21979
|
-
var version15 = "abstract-provider/5.8.0";
|
|
21980
|
-
|
|
21981
|
-
// node_modules/@ethersproject/wallet/node_modules/@ethersproject/abstract-provider/lib.esm/index.js
|
|
21982
|
-
var __awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
21983
|
-
function adopt(value) {
|
|
21984
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
21985
|
-
resolve(value);
|
|
21986
|
-
});
|
|
21987
|
-
}
|
|
21988
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
21989
|
-
function fulfilled(value) {
|
|
21990
|
-
try {
|
|
21991
|
-
step(generator.next(value));
|
|
21992
|
-
} catch (e) {
|
|
21993
|
-
reject(e);
|
|
21994
|
-
}
|
|
21995
|
-
}
|
|
21996
|
-
function rejected(value) {
|
|
21997
|
-
try {
|
|
21998
|
-
step(generator["throw"](value));
|
|
21999
|
-
} catch (e) {
|
|
22000
|
-
reject(e);
|
|
22001
|
-
}
|
|
22002
|
-
}
|
|
22003
|
-
function step(result) {
|
|
22004
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
22005
|
-
}
|
|
22006
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22007
|
-
});
|
|
22008
|
-
};
|
|
22009
|
-
var logger20 = new Logger(version15);
|
|
22010
|
-
var Provider2 = class _Provider {
|
|
22011
|
-
constructor() {
|
|
22012
|
-
logger20.checkAbstract(new.target, _Provider);
|
|
22013
|
-
defineReadOnly(this, "_isProvider", true);
|
|
22014
|
-
}
|
|
22015
|
-
getFeeData() {
|
|
22016
|
-
return __awaiter6(this, void 0, void 0, function* () {
|
|
22017
|
-
const { block, gasPrice } = yield resolveProperties({
|
|
22018
|
-
block: this.getBlock("latest"),
|
|
22019
|
-
gasPrice: this.getGasPrice().catch((error) => {
|
|
22020
|
-
return null;
|
|
22021
|
-
})
|
|
22022
|
-
});
|
|
22023
|
-
let lastBaseFeePerGas = null, maxFeePerGas = null, maxPriorityFeePerGas = null;
|
|
22024
|
-
if (block && block.baseFeePerGas) {
|
|
22025
|
-
lastBaseFeePerGas = block.baseFeePerGas;
|
|
22026
|
-
maxPriorityFeePerGas = BigNumber.from("1500000000");
|
|
22027
|
-
maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas);
|
|
22028
|
-
}
|
|
22029
|
-
return { lastBaseFeePerGas, maxFeePerGas, maxPriorityFeePerGas, gasPrice };
|
|
22030
|
-
});
|
|
22031
|
-
}
|
|
22032
|
-
// Alias for "on"
|
|
22033
|
-
addListener(eventName, listener) {
|
|
22034
|
-
return this.on(eventName, listener);
|
|
22035
|
-
}
|
|
22036
|
-
// Alias for "off"
|
|
22037
|
-
removeListener(eventName, listener) {
|
|
22038
|
-
return this.off(eventName, listener);
|
|
22039
|
-
}
|
|
22040
|
-
static isProvider(value) {
|
|
22041
|
-
return !!(value && value._isProvider);
|
|
22042
|
-
}
|
|
22043
|
-
};
|
|
22044
|
-
|
|
22045
23643
|
// node_modules/@ethersproject/basex/lib.esm/index.js
|
|
22046
23644
|
var BaseX = class {
|
|
22047
23645
|
constructor(alphabet) {
|
|
@@ -22125,10 +23723,10 @@ var SupportedAlgorithm;
|
|
|
22125
23723
|
})(SupportedAlgorithm || (SupportedAlgorithm = {}));
|
|
22126
23724
|
|
|
22127
23725
|
// node_modules/@ethersproject/sha2/lib.esm/_version.js
|
|
22128
|
-
var
|
|
23726
|
+
var version15 = "sha2/5.8.0";
|
|
22129
23727
|
|
|
22130
23728
|
// node_modules/@ethersproject/sha2/lib.esm/sha2.js
|
|
22131
|
-
var
|
|
23729
|
+
var logger20 = new Logger(version15);
|
|
22132
23730
|
function ripemd160(data) {
|
|
22133
23731
|
return "0x" + import_hash3.default.ripemd160().update(arrayify(data)).digest("hex");
|
|
22134
23732
|
}
|
|
@@ -22140,7 +23738,7 @@ function sha512(data) {
|
|
|
22140
23738
|
}
|
|
22141
23739
|
function computeHmac(algorithm, key2, data) {
|
|
22142
23740
|
if (!SupportedAlgorithm[algorithm]) {
|
|
22143
|
-
|
|
23741
|
+
logger20.throwError("unsupported algorithm " + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
22144
23742
|
operation: "hmac",
|
|
22145
23743
|
algorithm
|
|
22146
23744
|
});
|
|
@@ -22185,14 +23783,14 @@ function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {
|
|
|
22185
23783
|
}
|
|
22186
23784
|
|
|
22187
23785
|
// node_modules/@ethersproject/wordlists/lib.esm/_version.js
|
|
22188
|
-
var
|
|
23786
|
+
var version16 = "wordlists/5.8.0";
|
|
22189
23787
|
|
|
22190
23788
|
// node_modules/@ethersproject/wordlists/lib.esm/wordlist.js
|
|
22191
23789
|
var exportWordlist = false;
|
|
22192
|
-
var
|
|
23790
|
+
var logger21 = new Logger(version16);
|
|
22193
23791
|
var Wordlist = class _Wordlist {
|
|
22194
23792
|
constructor(locale) {
|
|
22195
|
-
|
|
23793
|
+
logger21.checkAbstract(new.target, _Wordlist);
|
|
22196
23794
|
defineReadOnly(this, "locale", locale);
|
|
22197
23795
|
}
|
|
22198
23796
|
// Subclasses may override this
|
|
@@ -22267,10 +23865,10 @@ var wordlists = {
|
|
|
22267
23865
|
};
|
|
22268
23866
|
|
|
22269
23867
|
// node_modules/@ethersproject/hdnode/lib.esm/_version.js
|
|
22270
|
-
var
|
|
23868
|
+
var version17 = "hdnode/5.8.0";
|
|
22271
23869
|
|
|
22272
23870
|
// node_modules/@ethersproject/hdnode/lib.esm/index.js
|
|
22273
|
-
var
|
|
23871
|
+
var logger22 = new Logger(version17);
|
|
22274
23872
|
var N = BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
|
|
22275
23873
|
var MasterSecret = toUtf8Bytes("Bitcoin seed");
|
|
22276
23874
|
var HardenedBit = 2147483648;
|
|
@@ -22293,7 +23891,7 @@ function getWordlist(wordlist2) {
|
|
|
22293
23891
|
if (typeof wordlist2 === "string") {
|
|
22294
23892
|
const words2 = wordlists[wordlist2];
|
|
22295
23893
|
if (words2 == null) {
|
|
22296
|
-
|
|
23894
|
+
logger22.throwArgumentError("unknown locale", "wordlist", wordlist2);
|
|
22297
23895
|
}
|
|
22298
23896
|
return words2;
|
|
22299
23897
|
}
|
|
@@ -22451,7 +24049,7 @@ var HDNode = class _HDNode {
|
|
|
22451
24049
|
static fromExtendedKey(extendedKey) {
|
|
22452
24050
|
const bytes = Base58.decode(extendedKey);
|
|
22453
24051
|
if (bytes.length !== 82 || base58check(bytes.slice(0, 78)) !== extendedKey) {
|
|
22454
|
-
|
|
24052
|
+
logger22.throwArgumentError("invalid extended key", "extendedKey", "[REDACTED]");
|
|
22455
24053
|
}
|
|
22456
24054
|
const depth = bytes[4];
|
|
22457
24055
|
const parentFingerprint = hexlify(bytes.slice(5, 9));
|
|
@@ -22469,7 +24067,7 @@ var HDNode = class _HDNode {
|
|
|
22469
24067
|
}
|
|
22470
24068
|
return new _HDNode(_constructorGuard4, hexlify(key2.slice(1)), null, parentFingerprint, chainCode, index, depth, null);
|
|
22471
24069
|
}
|
|
22472
|
-
return
|
|
24070
|
+
return logger22.throwArgumentError("invalid extended key", "extendedKey", "[REDACTED]");
|
|
22473
24071
|
}
|
|
22474
24072
|
};
|
|
22475
24073
|
function mnemonicToSeed(mnemonic, password) {
|
|
@@ -22481,7 +24079,7 @@ function mnemonicToSeed(mnemonic, password) {
|
|
|
22481
24079
|
}
|
|
22482
24080
|
function mnemonicToEntropy(mnemonic, wordlist2) {
|
|
22483
24081
|
wordlist2 = getWordlist(wordlist2);
|
|
22484
|
-
|
|
24082
|
+
logger22.checkNormalize();
|
|
22485
24083
|
const words2 = wordlist2.split(mnemonic);
|
|
22486
24084
|
if (words2.length % 3 !== 0) {
|
|
22487
24085
|
throw new Error("invalid mnemonic");
|
|
@@ -22545,16 +24143,16 @@ function isValidMnemonic(mnemonic, wordlist2) {
|
|
|
22545
24143
|
}
|
|
22546
24144
|
function getAccountPath(index) {
|
|
22547
24145
|
if (typeof index !== "number" || index < 0 || index >= HardenedBit || index % 1) {
|
|
22548
|
-
|
|
24146
|
+
logger22.throwArgumentError("invalid account index", "index", index);
|
|
22549
24147
|
}
|
|
22550
24148
|
return `m/44'/60'/${index}'/0/0`;
|
|
22551
24149
|
}
|
|
22552
24150
|
|
|
22553
24151
|
// node_modules/@ethersproject/random/lib.esm/_version.js
|
|
22554
|
-
var
|
|
24152
|
+
var version18 = "random/5.8.0";
|
|
22555
24153
|
|
|
22556
24154
|
// node_modules/@ethersproject/random/lib.esm/random.js
|
|
22557
|
-
var
|
|
24155
|
+
var logger23 = new Logger(version18);
|
|
22558
24156
|
function getGlobal() {
|
|
22559
24157
|
if (typeof self !== "undefined") {
|
|
22560
24158
|
return self;
|
|
@@ -22570,10 +24168,10 @@ function getGlobal() {
|
|
|
22570
24168
|
var anyGlobal = getGlobal();
|
|
22571
24169
|
var crypto = anyGlobal.crypto || anyGlobal.msCrypto;
|
|
22572
24170
|
if (!crypto || !crypto.getRandomValues) {
|
|
22573
|
-
|
|
24171
|
+
logger23.warn("WARNING: Missing strong random number source");
|
|
22574
24172
|
crypto = {
|
|
22575
24173
|
getRandomValues: function(buffer) {
|
|
22576
|
-
return
|
|
24174
|
+
return logger23.throwError("no secure random source avaialble", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
22577
24175
|
operation: "crypto.getRandomValues"
|
|
22578
24176
|
});
|
|
22579
24177
|
}
|
|
@@ -22581,7 +24179,7 @@ if (!crypto || !crypto.getRandomValues) {
|
|
|
22581
24179
|
}
|
|
22582
24180
|
function randomBytes(length) {
|
|
22583
24181
|
if (length <= 0 || length > 1024 || length % 1 || length != length) {
|
|
22584
|
-
|
|
24182
|
+
logger23.throwArgumentError("invalid length", "length", length);
|
|
22585
24183
|
}
|
|
22586
24184
|
const result = new Uint8Array(length);
|
|
22587
24185
|
crypto.getRandomValues(result);
|
|
@@ -22604,7 +24202,7 @@ function shuffled(array) {
|
|
|
22604
24202
|
var import_aes_js = __toESM(require_aes_js());
|
|
22605
24203
|
|
|
22606
24204
|
// node_modules/@ethersproject/json-wallets/lib.esm/_version.js
|
|
22607
|
-
var
|
|
24205
|
+
var version19 = "json-wallets/5.8.0";
|
|
22608
24206
|
|
|
22609
24207
|
// node_modules/@ethersproject/json-wallets/lib.esm/utils.js
|
|
22610
24208
|
function looseArrayify(hexString) {
|
|
@@ -22659,7 +24257,7 @@ function uuidV4(randomBytes2) {
|
|
|
22659
24257
|
}
|
|
22660
24258
|
|
|
22661
24259
|
// node_modules/@ethersproject/json-wallets/lib.esm/crowdsale.js
|
|
22662
|
-
var
|
|
24260
|
+
var logger24 = new Logger(version19);
|
|
22663
24261
|
var CrowdsaleAccount = class extends Description {
|
|
22664
24262
|
isCrowdsaleAccount(value) {
|
|
22665
24263
|
return !!(value && value._isCrowdsaleAccount);
|
|
@@ -22671,7 +24269,7 @@ function decrypt(json, password) {
|
|
|
22671
24269
|
const ethaddr = getAddress(searchPath(data, "ethaddr"));
|
|
22672
24270
|
const encseed = looseArrayify(searchPath(data, "encseed"));
|
|
22673
24271
|
if (!encseed || encseed.length % 16 !== 0) {
|
|
22674
|
-
|
|
24272
|
+
logger24.throwArgumentError("invalid encseed", "json", json);
|
|
22675
24273
|
}
|
|
22676
24274
|
const key2 = arrayify(pbkdf2(password, password, 2e3, 32, "sha256")).slice(0, 16);
|
|
22677
24275
|
const iv = encseed.slice(0, 16);
|
|
@@ -22734,7 +24332,7 @@ function getJsonWalletAddress(json) {
|
|
|
22734
24332
|
// node_modules/@ethersproject/json-wallets/lib.esm/keystore.js
|
|
22735
24333
|
var import_aes_js2 = __toESM(require_aes_js());
|
|
22736
24334
|
var import_scrypt_js = __toESM(require_scrypt());
|
|
22737
|
-
var
|
|
24335
|
+
var __awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
22738
24336
|
function adopt(value) {
|
|
22739
24337
|
return value instanceof P ? value : new P(function(resolve) {
|
|
22740
24338
|
resolve(value);
|
|
@@ -22761,7 +24359,7 @@ var __awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
|
22761
24359
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22762
24360
|
});
|
|
22763
24361
|
};
|
|
22764
|
-
var
|
|
24362
|
+
var logger25 = new Logger(version19);
|
|
22765
24363
|
function hasMnemonic(value) {
|
|
22766
24364
|
return value != null && value.mnemonic && value.mnemonic.phrase;
|
|
22767
24365
|
}
|
|
@@ -22788,7 +24386,7 @@ function _getAccount(data, key2) {
|
|
|
22788
24386
|
}
|
|
22789
24387
|
const privateKey = _decrypt(data, key2.slice(0, 16), ciphertext);
|
|
22790
24388
|
if (!privateKey) {
|
|
22791
|
-
|
|
24389
|
+
logger25.throwError("unsupported cipher", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
22792
24390
|
operation: "decrypt"
|
|
22793
24391
|
});
|
|
22794
24392
|
}
|
|
@@ -22842,7 +24440,7 @@ function _computeKdfKey(data, password, pbkdf2Func, scryptFunc, progressCallback
|
|
|
22842
24440
|
const kdf = searchPath(data, "crypto/kdf");
|
|
22843
24441
|
if (kdf && typeof kdf === "string") {
|
|
22844
24442
|
const throwError = function(name, value) {
|
|
22845
|
-
return
|
|
24443
|
+
return logger25.throwArgumentError("invalid key-derivation function parameters", name, value);
|
|
22846
24444
|
};
|
|
22847
24445
|
if (kdf.toLowerCase() === "scrypt") {
|
|
22848
24446
|
const salt = looseArrayify(searchPath(data, "crypto/kdfparams/salt"));
|
|
@@ -22879,7 +24477,7 @@ function _computeKdfKey(data, password, pbkdf2Func, scryptFunc, progressCallback
|
|
|
22879
24477
|
return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc);
|
|
22880
24478
|
}
|
|
22881
24479
|
}
|
|
22882
|
-
return
|
|
24480
|
+
return logger25.throwArgumentError("unsupported key-derivation function", "kdf", kdf);
|
|
22883
24481
|
}
|
|
22884
24482
|
function decryptSync(json, password) {
|
|
22885
24483
|
const data = JSON.parse(json);
|
|
@@ -22887,7 +24485,7 @@ function decryptSync(json, password) {
|
|
|
22887
24485
|
return _getAccount(data, key2);
|
|
22888
24486
|
}
|
|
22889
24487
|
function decrypt2(json, password, progressCallback) {
|
|
22890
|
-
return
|
|
24488
|
+
return __awaiter6(this, void 0, void 0, function* () {
|
|
22891
24489
|
const data = JSON.parse(json);
|
|
22892
24490
|
const key2 = yield _computeKdfKey(data, password, pbkdf22, import_scrypt_js.default.scrypt, progressCallback);
|
|
22893
24491
|
return _getAccount(data, key2);
|
|
@@ -23046,10 +24644,10 @@ function decryptJsonWalletSync(json, password) {
|
|
|
23046
24644
|
}
|
|
23047
24645
|
|
|
23048
24646
|
// node_modules/@ethersproject/wallet/lib.esm/_version.js
|
|
23049
|
-
var
|
|
24647
|
+
var version20 = "wallet/5.8.0";
|
|
23050
24648
|
|
|
23051
24649
|
// node_modules/@ethersproject/wallet/lib.esm/index.js
|
|
23052
|
-
var
|
|
24650
|
+
var __awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
23053
24651
|
function adopt(value) {
|
|
23054
24652
|
return value instanceof P ? value : new P(function(resolve) {
|
|
23055
24653
|
resolve(value);
|
|
@@ -23076,7 +24674,7 @@ var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
|
23076
24674
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23077
24675
|
});
|
|
23078
24676
|
};
|
|
23079
|
-
var
|
|
24677
|
+
var logger26 = new Logger(version20);
|
|
23080
24678
|
function isAccount(value) {
|
|
23081
24679
|
return value != null && isHexString(value.privateKey, 32) && value.address != null;
|
|
23082
24680
|
}
|
|
@@ -23092,7 +24690,7 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23092
24690
|
defineReadOnly(this, "_signingKey", () => signingKey);
|
|
23093
24691
|
defineReadOnly(this, "address", computeAddress(this.publicKey));
|
|
23094
24692
|
if (this.address !== getAddress(privateKey.address)) {
|
|
23095
|
-
|
|
24693
|
+
logger26.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
23096
24694
|
}
|
|
23097
24695
|
if (hasMnemonic2(privateKey)) {
|
|
23098
24696
|
const srcMnemonic = privateKey.mnemonic;
|
|
@@ -23104,7 +24702,7 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23104
24702
|
const mnemonic = this.mnemonic;
|
|
23105
24703
|
const node = HDNode.fromMnemonic(mnemonic.phrase, null, mnemonic.locale).derivePath(mnemonic.path);
|
|
23106
24704
|
if (computeAddress(node.privateKey) !== this.address) {
|
|
23107
|
-
|
|
24705
|
+
logger26.throwArgumentError("mnemonic/address mismatch", "privateKey", "[REDACTED]");
|
|
23108
24706
|
}
|
|
23109
24707
|
} else {
|
|
23110
24708
|
defineReadOnly(this, "_mnemonic", () => null);
|
|
@@ -23112,7 +24710,7 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23112
24710
|
} else {
|
|
23113
24711
|
if (SigningKey.isSigningKey(privateKey)) {
|
|
23114
24712
|
if (privateKey.curve !== "secp256k1") {
|
|
23115
|
-
|
|
24713
|
+
logger26.throwArgumentError("unsupported curve; must be secp256k1", "privateKey", "[REDACTED]");
|
|
23116
24714
|
}
|
|
23117
24715
|
defineReadOnly(this, "_signingKey", () => privateKey);
|
|
23118
24716
|
} else {
|
|
@@ -23127,8 +24725,8 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23127
24725
|
defineReadOnly(this, "_mnemonic", () => null);
|
|
23128
24726
|
defineReadOnly(this, "address", computeAddress(this.publicKey));
|
|
23129
24727
|
}
|
|
23130
|
-
if (provider && !
|
|
23131
|
-
|
|
24728
|
+
if (provider && !Provider.isProvider(provider)) {
|
|
24729
|
+
logger26.throwArgumentError("invalid provider", "provider", provider);
|
|
23132
24730
|
}
|
|
23133
24731
|
defineReadOnly(this, "provider", provider || null);
|
|
23134
24732
|
}
|
|
@@ -23151,7 +24749,7 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23151
24749
|
return resolveProperties(transaction).then((tx) => {
|
|
23152
24750
|
if (tx.from != null) {
|
|
23153
24751
|
if (getAddress(tx.from) !== this.address) {
|
|
23154
|
-
|
|
24752
|
+
logger26.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
23155
24753
|
}
|
|
23156
24754
|
delete tx.from;
|
|
23157
24755
|
}
|
|
@@ -23160,15 +24758,15 @@ var Wallet = class _Wallet extends Signer {
|
|
|
23160
24758
|
});
|
|
23161
24759
|
}
|
|
23162
24760
|
signMessage(message) {
|
|
23163
|
-
return
|
|
24761
|
+
return __awaiter7(this, void 0, void 0, function* () {
|
|
23164
24762
|
return joinSignature(this._signingKey().signDigest(hashMessage(message)));
|
|
23165
24763
|
});
|
|
23166
24764
|
}
|
|
23167
24765
|
_signTypedData(domain, types, value) {
|
|
23168
|
-
return
|
|
24766
|
+
return __awaiter7(this, void 0, void 0, function* () {
|
|
23169
24767
|
const populated = yield TypedDataEncoder.resolveNames(domain, types, value, (name) => {
|
|
23170
24768
|
if (this.provider == null) {
|
|
23171
|
-
|
|
24769
|
+
logger26.throwError("cannot resolve ENS names without a provider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
23172
24770
|
operation: "resolveName",
|
|
23173
24771
|
value: name
|
|
23174
24772
|
});
|
|
@@ -23227,7 +24825,7 @@ function verifyTypedData(domain, types, value, signature2) {
|
|
|
23227
24825
|
return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature2);
|
|
23228
24826
|
}
|
|
23229
24827
|
|
|
23230
|
-
// node_modules
|
|
24828
|
+
// node_modules/@ethersproject/providers/lib.esm/index.js
|
|
23231
24829
|
var lib_exports4 = {};
|
|
23232
24830
|
__export(lib_exports4, {
|
|
23233
24831
|
AlchemyProvider: () => AlchemyProvider,
|
|
@@ -23261,10 +24859,10 @@ __export(lib_exports4, {
|
|
|
23261
24859
|
});
|
|
23262
24860
|
|
|
23263
24861
|
// node_modules/@ethersproject/networks/lib.esm/_version.js
|
|
23264
|
-
var
|
|
24862
|
+
var version21 = "networks/5.8.0";
|
|
23265
24863
|
|
|
23266
24864
|
// node_modules/@ethersproject/networks/lib.esm/index.js
|
|
23267
|
-
var
|
|
24865
|
+
var logger27 = new Logger(version21);
|
|
23268
24866
|
function isRenetworkable(value) {
|
|
23269
24867
|
return value && typeof value.renetwork === "function";
|
|
23270
24868
|
}
|
|
@@ -23484,12 +25082,12 @@ function getNetwork(network) {
|
|
|
23484
25082
|
const standard = networks[network.name];
|
|
23485
25083
|
if (!standard) {
|
|
23486
25084
|
if (typeof network.chainId !== "number") {
|
|
23487
|
-
|
|
25085
|
+
logger27.throwArgumentError("invalid network chainId", "network", network);
|
|
23488
25086
|
}
|
|
23489
25087
|
return network;
|
|
23490
25088
|
}
|
|
23491
25089
|
if (network.chainId !== 0 && network.chainId !== standard.chainId) {
|
|
23492
|
-
|
|
25090
|
+
logger27.throwArgumentError("network chainId mismatch", "network", network);
|
|
23493
25091
|
}
|
|
23494
25092
|
let defaultProvider = network._defaultProvider || null;
|
|
23495
25093
|
if (defaultProvider == null && standard._defaultProvider) {
|
|
@@ -23508,10 +25106,10 @@ function getNetwork(network) {
|
|
|
23508
25106
|
}
|
|
23509
25107
|
|
|
23510
25108
|
// node_modules/@ethersproject/web/lib.esm/_version.js
|
|
23511
|
-
var
|
|
25109
|
+
var version22 = "web/5.8.0";
|
|
23512
25110
|
|
|
23513
25111
|
// node_modules/@ethersproject/web/lib.esm/geturl.js
|
|
23514
|
-
var
|
|
25112
|
+
var __awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
23515
25113
|
function adopt(value) {
|
|
23516
25114
|
return value instanceof P ? value : new P(function(resolve) {
|
|
23517
25115
|
resolve(value);
|
|
@@ -23539,7 +25137,7 @@ var __awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
|
23539
25137
|
});
|
|
23540
25138
|
};
|
|
23541
25139
|
function getUrl(href, options) {
|
|
23542
|
-
return
|
|
25140
|
+
return __awaiter8(this, void 0, void 0, function* () {
|
|
23543
25141
|
if (options == null) {
|
|
23544
25142
|
options = {};
|
|
23545
25143
|
}
|
|
@@ -23596,7 +25194,7 @@ function getUrl(href, options) {
|
|
|
23596
25194
|
}
|
|
23597
25195
|
|
|
23598
25196
|
// node_modules/@ethersproject/web/lib.esm/index.js
|
|
23599
|
-
var
|
|
25197
|
+
var __awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
23600
25198
|
function adopt(value) {
|
|
23601
25199
|
return value instanceof P ? value : new P(function(resolve) {
|
|
23602
25200
|
resolve(value);
|
|
@@ -23623,7 +25221,7 @@ var __awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
|
23623
25221
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23624
25222
|
});
|
|
23625
25223
|
};
|
|
23626
|
-
var
|
|
25224
|
+
var logger28 = new Logger(version22);
|
|
23627
25225
|
function staller(duration) {
|
|
23628
25226
|
return new Promise((resolve) => {
|
|
23629
25227
|
setTimeout(resolve, duration);
|
|
@@ -23655,10 +25253,10 @@ function unpercent(value) {
|
|
|
23655
25253
|
}
|
|
23656
25254
|
function _fetchData(connection, body, processFunc) {
|
|
23657
25255
|
const attemptLimit = typeof connection === "object" && connection.throttleLimit != null ? connection.throttleLimit : 12;
|
|
23658
|
-
|
|
25256
|
+
logger28.assertArgument(attemptLimit > 0 && attemptLimit % 1 === 0, "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
|
|
23659
25257
|
const throttleCallback = typeof connection === "object" ? connection.throttleCallback : null;
|
|
23660
25258
|
const throttleSlotInterval = typeof connection === "object" && typeof connection.throttleSlotInterval === "number" ? connection.throttleSlotInterval : 100;
|
|
23661
|
-
|
|
25259
|
+
logger28.assertArgument(throttleSlotInterval > 0 && throttleSlotInterval % 1 === 0, "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
|
|
23662
25260
|
const errorPassThrough = typeof connection === "object" ? !!connection.errorPassThrough : false;
|
|
23663
25261
|
const headers = {};
|
|
23664
25262
|
let url = null;
|
|
@@ -23671,7 +25269,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23671
25269
|
url = connection;
|
|
23672
25270
|
} else if (typeof connection === "object") {
|
|
23673
25271
|
if (connection == null || connection.url == null) {
|
|
23674
|
-
|
|
25272
|
+
logger28.throwArgumentError("missing URL", "connection.url", connection);
|
|
23675
25273
|
}
|
|
23676
25274
|
url = connection.url;
|
|
23677
25275
|
if (typeof connection.timeout === "number" && connection.timeout > 0) {
|
|
@@ -23688,7 +25286,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23688
25286
|
options.allowGzip = !!connection.allowGzip;
|
|
23689
25287
|
if (connection.user != null && connection.password != null) {
|
|
23690
25288
|
if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
|
|
23691
|
-
|
|
25289
|
+
logger28.throwError("basic authentication requires a secure https url", Logger.errors.INVALID_ARGUMENT, { argument: "url", url, user: connection.user, password: "[REDACTED]" });
|
|
23692
25290
|
}
|
|
23693
25291
|
const authorization = connection.user + ":" + connection.password;
|
|
23694
25292
|
headers["authorization"] = {
|
|
@@ -23719,7 +25317,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23719
25317
|
}
|
|
23720
25318
|
return Promise.resolve(result);
|
|
23721
25319
|
} catch (error) {
|
|
23722
|
-
|
|
25320
|
+
logger28.throwError("processing response error", Logger.errors.SERVER_ERROR, {
|
|
23723
25321
|
body: bodyify(dataMatch[1], dataMatch[2]),
|
|
23724
25322
|
error,
|
|
23725
25323
|
requestBody: null,
|
|
@@ -23753,7 +25351,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23753
25351
|
return;
|
|
23754
25352
|
}
|
|
23755
25353
|
timer2 = null;
|
|
23756
|
-
reject(
|
|
25354
|
+
reject(logger28.makeError("timeout", Logger.errors.TIMEOUT, {
|
|
23757
25355
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
23758
25356
|
requestMethod: options.method,
|
|
23759
25357
|
timeout,
|
|
@@ -23772,7 +25370,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23772
25370
|
return { promise, cancel };
|
|
23773
25371
|
}();
|
|
23774
25372
|
const runningFetch = function() {
|
|
23775
|
-
return
|
|
25373
|
+
return __awaiter9(this, void 0, void 0, function* () {
|
|
23776
25374
|
for (let attempt = 0; attempt < attemptLimit; attempt++) {
|
|
23777
25375
|
let response = null;
|
|
23778
25376
|
try {
|
|
@@ -23806,7 +25404,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23806
25404
|
response = error.response;
|
|
23807
25405
|
if (response == null) {
|
|
23808
25406
|
runningTimeout.cancel();
|
|
23809
|
-
|
|
25407
|
+
logger28.throwError("missing response", Logger.errors.SERVER_ERROR, {
|
|
23810
25408
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
23811
25409
|
requestMethod: options.method,
|
|
23812
25410
|
serverError: error,
|
|
@@ -23819,7 +25417,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23819
25417
|
body2 = null;
|
|
23820
25418
|
} else if (!errorPassThrough && (response.statusCode < 200 || response.statusCode >= 300)) {
|
|
23821
25419
|
runningTimeout.cancel();
|
|
23822
|
-
|
|
25420
|
+
logger28.throwError("bad response", Logger.errors.SERVER_ERROR, {
|
|
23823
25421
|
status: response.statusCode,
|
|
23824
25422
|
headers: response.headers,
|
|
23825
25423
|
body: bodyify(body2, response.headers ? response.headers["content-type"] : null),
|
|
@@ -23846,7 +25444,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23846
25444
|
}
|
|
23847
25445
|
}
|
|
23848
25446
|
runningTimeout.cancel();
|
|
23849
|
-
|
|
25447
|
+
logger28.throwError("processing response error", Logger.errors.SERVER_ERROR, {
|
|
23850
25448
|
body: bodyify(body2, response.headers ? response.headers["content-type"] : null),
|
|
23851
25449
|
error,
|
|
23852
25450
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
@@ -23858,7 +25456,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
23858
25456
|
runningTimeout.cancel();
|
|
23859
25457
|
return body2;
|
|
23860
25458
|
}
|
|
23861
|
-
return
|
|
25459
|
+
return logger28.throwError("failed response", Logger.errors.SERVER_ERROR, {
|
|
23862
25460
|
requestBody: bodyify(options.body, flatHeaders["content-type"]),
|
|
23863
25461
|
requestMethod: options.method,
|
|
23864
25462
|
url
|
|
@@ -23874,7 +25472,7 @@ function fetchJson(connection, json, processFunc) {
|
|
|
23874
25472
|
try {
|
|
23875
25473
|
result = JSON.parse(toUtf8String(value));
|
|
23876
25474
|
} catch (error) {
|
|
23877
|
-
|
|
25475
|
+
logger28.throwError("invalid JSON", Logger.errors.SERVER_ERROR, {
|
|
23878
25476
|
body: value,
|
|
23879
25477
|
error
|
|
23880
25478
|
});
|
|
@@ -23976,14 +25574,14 @@ function poll(func, options) {
|
|
|
23976
25574
|
});
|
|
23977
25575
|
}
|
|
23978
25576
|
|
|
23979
|
-
// node_modules
|
|
25577
|
+
// node_modules/@ethersproject/providers/lib.esm/base-provider.js
|
|
23980
25578
|
import bech32 from "bech32";
|
|
23981
25579
|
|
|
23982
|
-
// node_modules
|
|
23983
|
-
var
|
|
25580
|
+
// node_modules/@ethersproject/providers/lib.esm/_version.js
|
|
25581
|
+
var version23 = "providers/5.8.0";
|
|
23984
25582
|
|
|
23985
|
-
// node_modules
|
|
23986
|
-
var
|
|
25583
|
+
// node_modules/@ethersproject/providers/lib.esm/formatter.js
|
|
25584
|
+
var logger29 = new Logger(version23);
|
|
23987
25585
|
var Formatter = class _Formatter {
|
|
23988
25586
|
constructor() {
|
|
23989
25587
|
this.formats = this.getDefaultFormats();
|
|
@@ -24150,7 +25748,7 @@ var Formatter = class _Formatter {
|
|
|
24150
25748
|
return value.toLowerCase();
|
|
24151
25749
|
}
|
|
24152
25750
|
}
|
|
24153
|
-
return
|
|
25751
|
+
return logger29.throwArgumentError("invalid hash", "value", value);
|
|
24154
25752
|
}
|
|
24155
25753
|
data(value, strict) {
|
|
24156
25754
|
const result = this.hex(value, strict);
|
|
@@ -24200,7 +25798,7 @@ var Formatter = class _Formatter {
|
|
|
24200
25798
|
hash(value, strict) {
|
|
24201
25799
|
const result = this.hex(value, strict);
|
|
24202
25800
|
if (hexDataLength(result) !== 32) {
|
|
24203
|
-
return
|
|
25801
|
+
return logger29.throwArgumentError("invalid hash", "value", value);
|
|
24204
25802
|
}
|
|
24205
25803
|
return result;
|
|
24206
25804
|
}
|
|
@@ -24302,15 +25900,15 @@ var Formatter = class _Formatter {
|
|
|
24302
25900
|
const value2 = BigNumber.from(result.root).toNumber();
|
|
24303
25901
|
if (value2 === 0 || value2 === 1) {
|
|
24304
25902
|
if (result.status != null && result.status !== value2) {
|
|
24305
|
-
|
|
25903
|
+
logger29.throwArgumentError("alt-root-status/status mismatch", "value", { root: result.root, status: result.status });
|
|
24306
25904
|
}
|
|
24307
25905
|
result.status = value2;
|
|
24308
25906
|
delete result.root;
|
|
24309
25907
|
} else {
|
|
24310
|
-
|
|
25908
|
+
logger29.throwArgumentError("invalid alt-root-status", "value.root", result.root);
|
|
24311
25909
|
}
|
|
24312
25910
|
} else if (result.root.length !== 66) {
|
|
24313
|
-
|
|
25911
|
+
logger29.throwArgumentError("invalid root hash", "value.root", result.root);
|
|
24314
25912
|
}
|
|
24315
25913
|
}
|
|
24316
25914
|
if (result.status != null) {
|
|
@@ -24406,8 +26004,8 @@ function showThrottleMessage() {
|
|
|
24406
26004
|
console.log("==========================");
|
|
24407
26005
|
}
|
|
24408
26006
|
|
|
24409
|
-
// node_modules
|
|
24410
|
-
var
|
|
26007
|
+
// node_modules/@ethersproject/providers/lib.esm/base-provider.js
|
|
26008
|
+
var __awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
24411
26009
|
function adopt(value) {
|
|
24412
26010
|
return value instanceof P ? value : new P(function(resolve) {
|
|
24413
26011
|
resolve(value);
|
|
@@ -24434,14 +26032,14 @@ var __awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
|
24434
26032
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24435
26033
|
});
|
|
24436
26034
|
};
|
|
24437
|
-
var
|
|
26035
|
+
var logger30 = new Logger(version23);
|
|
24438
26036
|
var MAX_CCIP_REDIRECTS = 10;
|
|
24439
26037
|
function checkTopic(topic) {
|
|
24440
26038
|
if (topic == null) {
|
|
24441
26039
|
return "null";
|
|
24442
26040
|
}
|
|
24443
26041
|
if (hexDataLength(topic) !== 32) {
|
|
24444
|
-
|
|
26042
|
+
logger30.throwArgumentError("invalid topic", "topic", topic);
|
|
24445
26043
|
}
|
|
24446
26044
|
return topic.toLowerCase();
|
|
24447
26045
|
}
|
|
@@ -24490,7 +26088,7 @@ function getEventTag2(eventName) {
|
|
|
24490
26088
|
} else if (Array.isArray(eventName)) {
|
|
24491
26089
|
return "filter:*:" + serializeTopics(eventName);
|
|
24492
26090
|
} else if (ForkEvent.isForkEvent(eventName)) {
|
|
24493
|
-
|
|
26091
|
+
logger30.warn("not implemented");
|
|
24494
26092
|
throw new Error("not implemented");
|
|
24495
26093
|
} else if (eventName && typeof eventName === "object") {
|
|
24496
26094
|
return "filter:" + (eventName.address || "*") + ":" + serializeTopics(eventName.topics || []);
|
|
@@ -24595,7 +26193,7 @@ function getIpfsLink(link) {
|
|
|
24595
26193
|
} else if (link.match(/^ipfs:\/\//i)) {
|
|
24596
26194
|
link = link.substring(7);
|
|
24597
26195
|
} else {
|
|
24598
|
-
|
|
26196
|
+
logger30.throwArgumentError("unsupported IPFS format", "link", link);
|
|
24599
26197
|
}
|
|
24600
26198
|
return `https://gateway.ipfs.io/ipfs/${link}`;
|
|
24601
26199
|
}
|
|
@@ -24658,7 +26256,7 @@ var Resolver = class {
|
|
|
24658
26256
|
return this._supportsEip2544;
|
|
24659
26257
|
}
|
|
24660
26258
|
_fetch(selector, parameters) {
|
|
24661
|
-
return
|
|
26259
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24662
26260
|
const tx = {
|
|
24663
26261
|
to: this.address,
|
|
24664
26262
|
ccipReadEnabled: true,
|
|
@@ -24672,7 +26270,7 @@ var Resolver = class {
|
|
|
24672
26270
|
try {
|
|
24673
26271
|
let result = yield this.provider.call(tx);
|
|
24674
26272
|
if (arrayify(result).length % 32 === 4) {
|
|
24675
|
-
|
|
26273
|
+
logger30.throwError("resolver threw error", Logger.errors.CALL_EXCEPTION, {
|
|
24676
26274
|
transaction: tx,
|
|
24677
26275
|
data: result
|
|
24678
26276
|
});
|
|
@@ -24690,7 +26288,7 @@ var Resolver = class {
|
|
|
24690
26288
|
});
|
|
24691
26289
|
}
|
|
24692
26290
|
_fetchBytes(selector, parameters) {
|
|
24693
|
-
return
|
|
26291
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24694
26292
|
const result = yield this._fetch(selector, parameters);
|
|
24695
26293
|
if (result != null) {
|
|
24696
26294
|
return _parseBytes(result, 0);
|
|
@@ -24701,7 +26299,7 @@ var Resolver = class {
|
|
|
24701
26299
|
_getAddress(coinType, hexBytes) {
|
|
24702
26300
|
const coinInfo = coinInfos[String(coinType)];
|
|
24703
26301
|
if (coinInfo == null) {
|
|
24704
|
-
|
|
26302
|
+
logger30.throwError(`unsupported coin type: ${coinType}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
24705
26303
|
operation: `getAddress(${coinType})`
|
|
24706
26304
|
});
|
|
24707
26305
|
}
|
|
@@ -24729,24 +26327,24 @@ var Resolver = class {
|
|
|
24729
26327
|
}
|
|
24730
26328
|
if (coinInfo.prefix != null) {
|
|
24731
26329
|
const length = bytes[1];
|
|
24732
|
-
let
|
|
24733
|
-
if (
|
|
26330
|
+
let version27 = bytes[0];
|
|
26331
|
+
if (version27 === 0) {
|
|
24734
26332
|
if (length !== 20 && length !== 32) {
|
|
24735
|
-
|
|
26333
|
+
version27 = -1;
|
|
24736
26334
|
}
|
|
24737
26335
|
} else {
|
|
24738
|
-
|
|
26336
|
+
version27 = -1;
|
|
24739
26337
|
}
|
|
24740
|
-
if (
|
|
26338
|
+
if (version27 >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
|
|
24741
26339
|
const words2 = bech32.toWords(bytes.slice(2));
|
|
24742
|
-
words2.unshift(
|
|
26340
|
+
words2.unshift(version27);
|
|
24743
26341
|
return bech32.encode(coinInfo.prefix, words2);
|
|
24744
26342
|
}
|
|
24745
26343
|
}
|
|
24746
26344
|
return null;
|
|
24747
26345
|
}
|
|
24748
26346
|
getAddress(coinType) {
|
|
24749
|
-
return
|
|
26347
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24750
26348
|
if (coinType == null) {
|
|
24751
26349
|
coinType = 60;
|
|
24752
26350
|
}
|
|
@@ -24770,7 +26368,7 @@ var Resolver = class {
|
|
|
24770
26368
|
}
|
|
24771
26369
|
const address = this._getAddress(coinType, hexBytes);
|
|
24772
26370
|
if (address == null) {
|
|
24773
|
-
|
|
26371
|
+
logger30.throwError(`invalid or unsupported coin data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
24774
26372
|
operation: `getAddress(${coinType})`,
|
|
24775
26373
|
coinType,
|
|
24776
26374
|
data: hexBytes
|
|
@@ -24780,7 +26378,7 @@ var Resolver = class {
|
|
|
24780
26378
|
});
|
|
24781
26379
|
}
|
|
24782
26380
|
getAvatar() {
|
|
24783
|
-
return
|
|
26381
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24784
26382
|
const linkage = [{ type: "name", content: this.name }];
|
|
24785
26383
|
try {
|
|
24786
26384
|
const avatar = yield this.getText("avatar");
|
|
@@ -24879,7 +26477,7 @@ var Resolver = class {
|
|
|
24879
26477
|
});
|
|
24880
26478
|
}
|
|
24881
26479
|
getContentHash() {
|
|
24882
|
-
return
|
|
26480
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24883
26481
|
const hexBytes = yield this._fetchBytes("0xbc1c58d1");
|
|
24884
26482
|
if (hexBytes == null || hexBytes === "0x") {
|
|
24885
26483
|
return null;
|
|
@@ -24912,14 +26510,14 @@ var Resolver = class {
|
|
|
24912
26510
|
return "sia://" + hash3;
|
|
24913
26511
|
}
|
|
24914
26512
|
}
|
|
24915
|
-
return
|
|
26513
|
+
return logger30.throwError(`invalid or unsupported content hash data`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
24916
26514
|
operation: "getContentHash()",
|
|
24917
26515
|
data: hexBytes
|
|
24918
26516
|
});
|
|
24919
26517
|
});
|
|
24920
26518
|
}
|
|
24921
26519
|
getText(key2) {
|
|
24922
|
-
return
|
|
26520
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24923
26521
|
let keyBytes = toUtf8Bytes(key2);
|
|
24924
26522
|
keyBytes = concat([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);
|
|
24925
26523
|
if (keyBytes.length % 32 !== 0) {
|
|
@@ -24967,7 +26565,7 @@ var BaseProvider = class extends Provider {
|
|
|
24967
26565
|
defineReadOnly(this, "_network", knownNetwork);
|
|
24968
26566
|
this.emit("network", knownNetwork, null);
|
|
24969
26567
|
} else {
|
|
24970
|
-
|
|
26568
|
+
logger30.throwArgumentError("invalid network", "network", network);
|
|
24971
26569
|
}
|
|
24972
26570
|
}
|
|
24973
26571
|
this._maxInternalBlockNumber = -1024;
|
|
@@ -24977,7 +26575,7 @@ var BaseProvider = class extends Provider {
|
|
|
24977
26575
|
this._fastQueryDate = 0;
|
|
24978
26576
|
}
|
|
24979
26577
|
_ready() {
|
|
24980
|
-
return
|
|
26578
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
24981
26579
|
if (this._network == null) {
|
|
24982
26580
|
let network = null;
|
|
24983
26581
|
if (this._networkPromise) {
|
|
@@ -24990,7 +26588,7 @@ var BaseProvider = class extends Provider {
|
|
|
24990
26588
|
network = yield this.detectNetwork();
|
|
24991
26589
|
}
|
|
24992
26590
|
if (!network) {
|
|
24993
|
-
|
|
26591
|
+
logger30.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
24994
26592
|
}
|
|
24995
26593
|
if (this._network == null) {
|
|
24996
26594
|
if (this.anyNetwork) {
|
|
@@ -25031,7 +26629,7 @@ var BaseProvider = class extends Provider {
|
|
|
25031
26629
|
return getNetwork(network == null ? "homestead" : network);
|
|
25032
26630
|
}
|
|
25033
26631
|
ccipReadFetch(tx, calldata, urls) {
|
|
25034
|
-
return
|
|
26632
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25035
26633
|
if (this.disableCcipRead || urls.length === 0) {
|
|
25036
26634
|
return null;
|
|
25037
26635
|
}
|
|
@@ -25051,11 +26649,11 @@ var BaseProvider = class extends Provider {
|
|
|
25051
26649
|
}
|
|
25052
26650
|
const errorMessage = result.message || "unknown error";
|
|
25053
26651
|
if (result.status >= 400 && result.status < 500) {
|
|
25054
|
-
return
|
|
26652
|
+
return logger30.throwError(`response not found during CCIP fetch: ${errorMessage}`, Logger.errors.SERVER_ERROR, { url, errorMessage });
|
|
25055
26653
|
}
|
|
25056
26654
|
errorMessages.push(errorMessage);
|
|
25057
26655
|
}
|
|
25058
|
-
return
|
|
26656
|
+
return logger30.throwError(`error encountered during CCIP fetch: ${errorMessages.map((m) => JSON.stringify(m)).join(", ")}`, Logger.errors.SERVER_ERROR, {
|
|
25059
26657
|
urls,
|
|
25060
26658
|
errorMessages
|
|
25061
26659
|
});
|
|
@@ -25064,7 +26662,7 @@ var BaseProvider = class extends Provider {
|
|
|
25064
26662
|
// Fetches the blockNumber, but will reuse any result that is less
|
|
25065
26663
|
// than maxAge old or has been requested since the last request
|
|
25066
26664
|
_getInternalBlockNumber(maxAge) {
|
|
25067
|
-
return
|
|
26665
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25068
26666
|
yield this._ready();
|
|
25069
26667
|
if (maxAge > 0) {
|
|
25070
26668
|
while (this._internalBlockNumber) {
|
|
@@ -25112,7 +26710,7 @@ var BaseProvider = class extends Provider {
|
|
|
25112
26710
|
});
|
|
25113
26711
|
}
|
|
25114
26712
|
poll() {
|
|
25115
|
-
return
|
|
26713
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25116
26714
|
const pollId = nextPollId++;
|
|
25117
26715
|
const runners = [];
|
|
25118
26716
|
let blockNumber = null;
|
|
@@ -25132,8 +26730,8 @@ var BaseProvider = class extends Provider {
|
|
|
25132
26730
|
this._emitted.block = blockNumber - 1;
|
|
25133
26731
|
}
|
|
25134
26732
|
if (Math.abs(this._emitted.block - blockNumber) > 1e3) {
|
|
25135
|
-
|
|
25136
|
-
this.emit("error",
|
|
26733
|
+
logger30.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);
|
|
26734
|
+
this.emit("error", logger30.makeError("network block skew detected", Logger.errors.NETWORK_ERROR, {
|
|
25137
26735
|
blockNumber,
|
|
25138
26736
|
event: "blockSkew",
|
|
25139
26737
|
previousBlockNumber: this._emitted.block
|
|
@@ -25240,14 +26838,14 @@ var BaseProvider = class extends Provider {
|
|
|
25240
26838
|
// This method should query the network if the underlying network
|
|
25241
26839
|
// can change, such as when connected to a JSON-RPC backend
|
|
25242
26840
|
detectNetwork() {
|
|
25243
|
-
return
|
|
25244
|
-
return
|
|
26841
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26842
|
+
return logger30.throwError("provider does not support network detection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
25245
26843
|
operation: "provider.detectNetwork"
|
|
25246
26844
|
});
|
|
25247
26845
|
});
|
|
25248
26846
|
}
|
|
25249
26847
|
getNetwork() {
|
|
25250
|
-
return
|
|
26848
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25251
26849
|
const network = yield this._ready();
|
|
25252
26850
|
const currentNetwork = yield this.detectNetwork();
|
|
25253
26851
|
if (network.chainId !== currentNetwork.chainId) {
|
|
@@ -25264,7 +26862,7 @@ var BaseProvider = class extends Provider {
|
|
|
25264
26862
|
yield stall(0);
|
|
25265
26863
|
return this._network;
|
|
25266
26864
|
}
|
|
25267
|
-
const error =
|
|
26865
|
+
const error = logger30.makeError("underlying network changed", Logger.errors.NETWORK_ERROR, {
|
|
25268
26866
|
event: "changed",
|
|
25269
26867
|
network,
|
|
25270
26868
|
detectedNetwork: currentNetwork
|
|
@@ -25345,12 +26943,12 @@ var BaseProvider = class extends Provider {
|
|
|
25345
26943
|
}
|
|
25346
26944
|
}
|
|
25347
26945
|
waitForTransaction(transactionHash, confirmations, timeout) {
|
|
25348
|
-
return
|
|
26946
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25349
26947
|
return this._waitForTransaction(transactionHash, confirmations == null ? 1 : confirmations, timeout || 0, null);
|
|
25350
26948
|
});
|
|
25351
26949
|
}
|
|
25352
26950
|
_waitForTransaction(transactionHash, confirmations, timeout, replaceable) {
|
|
25353
|
-
return
|
|
26951
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25354
26952
|
const receipt = yield this.getTransactionReceipt(transactionHash);
|
|
25355
26953
|
if ((receipt ? receipt.confirmations : 0) >= confirmations) {
|
|
25356
26954
|
return receipt;
|
|
@@ -25384,12 +26982,12 @@ var BaseProvider = class extends Provider {
|
|
|
25384
26982
|
if (replaceable) {
|
|
25385
26983
|
let lastBlockNumber = replaceable.startBlock;
|
|
25386
26984
|
let scannedBlock = null;
|
|
25387
|
-
const replaceHandler = (blockNumber) =>
|
|
26985
|
+
const replaceHandler = (blockNumber) => __awaiter10(this, void 0, void 0, function* () {
|
|
25388
26986
|
if (done) {
|
|
25389
26987
|
return;
|
|
25390
26988
|
}
|
|
25391
26989
|
yield stall(1e3);
|
|
25392
|
-
this.getTransactionCount(replaceable.from).then((nonce) =>
|
|
26990
|
+
this.getTransactionCount(replaceable.from).then((nonce) => __awaiter10(this, void 0, void 0, function* () {
|
|
25393
26991
|
if (done) {
|
|
25394
26992
|
return;
|
|
25395
26993
|
}
|
|
@@ -25432,7 +27030,7 @@ var BaseProvider = class extends Provider {
|
|
|
25432
27030
|
} else if (tx.data === "0x" && tx.from === tx.to && tx.value.isZero()) {
|
|
25433
27031
|
reason = "cancelled";
|
|
25434
27032
|
}
|
|
25435
|
-
reject(
|
|
27033
|
+
reject(logger30.makeError("transaction was replaced", Logger.errors.TRANSACTION_REPLACED, {
|
|
25436
27034
|
cancelled: reason === "replaced" || reason === "cancelled",
|
|
25437
27035
|
reason,
|
|
25438
27036
|
replacement: this._wrapTransaction(tx),
|
|
@@ -25469,7 +27067,7 @@ var BaseProvider = class extends Provider {
|
|
|
25469
27067
|
if (alreadyDone()) {
|
|
25470
27068
|
return;
|
|
25471
27069
|
}
|
|
25472
|
-
reject(
|
|
27070
|
+
reject(logger30.makeError("timeout exceeded", Logger.errors.TIMEOUT, { timeout }));
|
|
25473
27071
|
}, timeout);
|
|
25474
27072
|
if (timer2.unref) {
|
|
25475
27073
|
timer2.unref();
|
|
@@ -25482,18 +27080,18 @@ var BaseProvider = class extends Provider {
|
|
|
25482
27080
|
});
|
|
25483
27081
|
}
|
|
25484
27082
|
getBlockNumber() {
|
|
25485
|
-
return
|
|
27083
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25486
27084
|
return this._getInternalBlockNumber(0);
|
|
25487
27085
|
});
|
|
25488
27086
|
}
|
|
25489
27087
|
getGasPrice() {
|
|
25490
|
-
return
|
|
27088
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25491
27089
|
yield this.getNetwork();
|
|
25492
27090
|
const result = yield this.perform("getGasPrice", {});
|
|
25493
27091
|
try {
|
|
25494
27092
|
return BigNumber.from(result);
|
|
25495
27093
|
} catch (error) {
|
|
25496
|
-
return
|
|
27094
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25497
27095
|
method: "getGasPrice",
|
|
25498
27096
|
result,
|
|
25499
27097
|
error
|
|
@@ -25502,7 +27100,7 @@ var BaseProvider = class extends Provider {
|
|
|
25502
27100
|
});
|
|
25503
27101
|
}
|
|
25504
27102
|
getBalance(addressOrName, blockTag) {
|
|
25505
|
-
return
|
|
27103
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25506
27104
|
yield this.getNetwork();
|
|
25507
27105
|
const params = yield resolveProperties({
|
|
25508
27106
|
address: this._getAddress(addressOrName),
|
|
@@ -25512,7 +27110,7 @@ var BaseProvider = class extends Provider {
|
|
|
25512
27110
|
try {
|
|
25513
27111
|
return BigNumber.from(result);
|
|
25514
27112
|
} catch (error) {
|
|
25515
|
-
return
|
|
27113
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25516
27114
|
method: "getBalance",
|
|
25517
27115
|
params,
|
|
25518
27116
|
result,
|
|
@@ -25522,7 +27120,7 @@ var BaseProvider = class extends Provider {
|
|
|
25522
27120
|
});
|
|
25523
27121
|
}
|
|
25524
27122
|
getTransactionCount(addressOrName, blockTag) {
|
|
25525
|
-
return
|
|
27123
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25526
27124
|
yield this.getNetwork();
|
|
25527
27125
|
const params = yield resolveProperties({
|
|
25528
27126
|
address: this._getAddress(addressOrName),
|
|
@@ -25532,7 +27130,7 @@ var BaseProvider = class extends Provider {
|
|
|
25532
27130
|
try {
|
|
25533
27131
|
return BigNumber.from(result).toNumber();
|
|
25534
27132
|
} catch (error) {
|
|
25535
|
-
return
|
|
27133
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25536
27134
|
method: "getTransactionCount",
|
|
25537
27135
|
params,
|
|
25538
27136
|
result,
|
|
@@ -25542,7 +27140,7 @@ var BaseProvider = class extends Provider {
|
|
|
25542
27140
|
});
|
|
25543
27141
|
}
|
|
25544
27142
|
getCode(addressOrName, blockTag) {
|
|
25545
|
-
return
|
|
27143
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25546
27144
|
yield this.getNetwork();
|
|
25547
27145
|
const params = yield resolveProperties({
|
|
25548
27146
|
address: this._getAddress(addressOrName),
|
|
@@ -25552,7 +27150,7 @@ var BaseProvider = class extends Provider {
|
|
|
25552
27150
|
try {
|
|
25553
27151
|
return hexlify(result);
|
|
25554
27152
|
} catch (error) {
|
|
25555
|
-
return
|
|
27153
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25556
27154
|
method: "getCode",
|
|
25557
27155
|
params,
|
|
25558
27156
|
result,
|
|
@@ -25562,7 +27160,7 @@ var BaseProvider = class extends Provider {
|
|
|
25562
27160
|
});
|
|
25563
27161
|
}
|
|
25564
27162
|
getStorageAt(addressOrName, position, blockTag) {
|
|
25565
|
-
return
|
|
27163
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25566
27164
|
yield this.getNetwork();
|
|
25567
27165
|
const params = yield resolveProperties({
|
|
25568
27166
|
address: this._getAddress(addressOrName),
|
|
@@ -25573,7 +27171,7 @@ var BaseProvider = class extends Provider {
|
|
|
25573
27171
|
try {
|
|
25574
27172
|
return hexlify(result);
|
|
25575
27173
|
} catch (error) {
|
|
25576
|
-
return
|
|
27174
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25577
27175
|
method: "getStorageAt",
|
|
25578
27176
|
params,
|
|
25579
27177
|
result,
|
|
@@ -25589,9 +27187,9 @@ var BaseProvider = class extends Provider {
|
|
|
25589
27187
|
}
|
|
25590
27188
|
const result = tx;
|
|
25591
27189
|
if (hash3 != null && tx.hash !== hash3) {
|
|
25592
|
-
|
|
27190
|
+
logger30.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash3 });
|
|
25593
27191
|
}
|
|
25594
|
-
result.wait = (confirms, timeout) =>
|
|
27192
|
+
result.wait = (confirms, timeout) => __awaiter10(this, void 0, void 0, function* () {
|
|
25595
27193
|
if (confirms == null) {
|
|
25596
27194
|
confirms = 1;
|
|
25597
27195
|
}
|
|
@@ -25615,7 +27213,7 @@ var BaseProvider = class extends Provider {
|
|
|
25615
27213
|
}
|
|
25616
27214
|
this._emitted["t:" + tx.hash] = receipt.blockNumber;
|
|
25617
27215
|
if (receipt.status === 0) {
|
|
25618
|
-
|
|
27216
|
+
logger30.throwError("transaction failed", Logger.errors.CALL_EXCEPTION, {
|
|
25619
27217
|
transactionHash: tx.hash,
|
|
25620
27218
|
transaction: tx,
|
|
25621
27219
|
receipt
|
|
@@ -25626,7 +27224,7 @@ var BaseProvider = class extends Provider {
|
|
|
25626
27224
|
return result;
|
|
25627
27225
|
}
|
|
25628
27226
|
sendTransaction(signedTransaction) {
|
|
25629
|
-
return
|
|
27227
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25630
27228
|
yield this.getNetwork();
|
|
25631
27229
|
const hexTx = yield Promise.resolve(signedTransaction).then((t) => hexlify(t));
|
|
25632
27230
|
const tx = this.formatter.transaction(signedTransaction);
|
|
@@ -25645,7 +27243,7 @@ var BaseProvider = class extends Provider {
|
|
|
25645
27243
|
});
|
|
25646
27244
|
}
|
|
25647
27245
|
_getTransactionRequest(transaction) {
|
|
25648
|
-
return
|
|
27246
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25649
27247
|
const values = yield transaction;
|
|
25650
27248
|
const tx = {};
|
|
25651
27249
|
["from", "to"].forEach((key2) => {
|
|
@@ -25679,7 +27277,7 @@ var BaseProvider = class extends Provider {
|
|
|
25679
27277
|
});
|
|
25680
27278
|
}
|
|
25681
27279
|
_getFilter(filter) {
|
|
25682
|
-
return
|
|
27280
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25683
27281
|
filter = yield filter;
|
|
25684
27282
|
const result = {};
|
|
25685
27283
|
if (filter.address != null) {
|
|
@@ -25701,9 +27299,9 @@ var BaseProvider = class extends Provider {
|
|
|
25701
27299
|
});
|
|
25702
27300
|
}
|
|
25703
27301
|
_call(transaction, blockTag, attempt) {
|
|
25704
|
-
return
|
|
27302
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25705
27303
|
if (attempt >= MAX_CCIP_REDIRECTS) {
|
|
25706
|
-
|
|
27304
|
+
logger30.throwError("CCIP read exceeded maximum redirections", Logger.errors.SERVER_ERROR, {
|
|
25707
27305
|
redirects: attempt,
|
|
25708
27306
|
transaction
|
|
25709
27307
|
});
|
|
@@ -25715,7 +27313,7 @@ var BaseProvider = class extends Provider {
|
|
|
25715
27313
|
const data = hexDataSlice(result, 4);
|
|
25716
27314
|
const sender = hexDataSlice(data, 0, 32);
|
|
25717
27315
|
if (!BigNumber.from(sender).eq(txSender)) {
|
|
25718
|
-
|
|
27316
|
+
logger30.throwError("CCIP Read sender did not match", Logger.errors.CALL_EXCEPTION, {
|
|
25719
27317
|
name: "OffchainLookup",
|
|
25720
27318
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
25721
27319
|
transaction,
|
|
@@ -25729,7 +27327,7 @@ var BaseProvider = class extends Provider {
|
|
|
25729
27327
|
for (let u = 0; u < urlsLength; u++) {
|
|
25730
27328
|
const url = _parseString(urlsData, u * 32);
|
|
25731
27329
|
if (url == null) {
|
|
25732
|
-
|
|
27330
|
+
logger30.throwError("CCIP Read contained corrupt URL string", Logger.errors.CALL_EXCEPTION, {
|
|
25733
27331
|
name: "OffchainLookup",
|
|
25734
27332
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
25735
27333
|
transaction,
|
|
@@ -25740,7 +27338,7 @@ var BaseProvider = class extends Provider {
|
|
|
25740
27338
|
}
|
|
25741
27339
|
const calldata = _parseBytes(data, 64);
|
|
25742
27340
|
if (!BigNumber.from(hexDataSlice(data, 100, 128)).isZero()) {
|
|
25743
|
-
|
|
27341
|
+
logger30.throwError("CCIP Read callback selector included junk", Logger.errors.CALL_EXCEPTION, {
|
|
25744
27342
|
name: "OffchainLookup",
|
|
25745
27343
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
25746
27344
|
transaction,
|
|
@@ -25751,7 +27349,7 @@ var BaseProvider = class extends Provider {
|
|
|
25751
27349
|
const extraData = _parseBytes(data, 128);
|
|
25752
27350
|
const ccipResult = yield this.ccipReadFetch(transaction, calldata, urls);
|
|
25753
27351
|
if (ccipResult == null) {
|
|
25754
|
-
|
|
27352
|
+
logger30.throwError("CCIP Read disabled or provided no URLs", Logger.errors.CALL_EXCEPTION, {
|
|
25755
27353
|
name: "OffchainLookup",
|
|
25756
27354
|
signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
|
|
25757
27355
|
transaction,
|
|
@@ -25772,7 +27370,7 @@ var BaseProvider = class extends Provider {
|
|
|
25772
27370
|
try {
|
|
25773
27371
|
return hexlify(result);
|
|
25774
27372
|
} catch (error) {
|
|
25775
|
-
return
|
|
27373
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25776
27374
|
method: "call",
|
|
25777
27375
|
params: { transaction, blockTag },
|
|
25778
27376
|
result,
|
|
@@ -25782,7 +27380,7 @@ var BaseProvider = class extends Provider {
|
|
|
25782
27380
|
});
|
|
25783
27381
|
}
|
|
25784
27382
|
call(transaction, blockTag) {
|
|
25785
|
-
return
|
|
27383
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25786
27384
|
yield this.getNetwork();
|
|
25787
27385
|
const resolved = yield resolveProperties({
|
|
25788
27386
|
transaction: this._getTransactionRequest(transaction),
|
|
@@ -25793,7 +27391,7 @@ var BaseProvider = class extends Provider {
|
|
|
25793
27391
|
});
|
|
25794
27392
|
}
|
|
25795
27393
|
estimateGas(transaction) {
|
|
25796
|
-
return
|
|
27394
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25797
27395
|
yield this.getNetwork();
|
|
25798
27396
|
const params = yield resolveProperties({
|
|
25799
27397
|
transaction: this._getTransactionRequest(transaction)
|
|
@@ -25802,7 +27400,7 @@ var BaseProvider = class extends Provider {
|
|
|
25802
27400
|
try {
|
|
25803
27401
|
return BigNumber.from(result);
|
|
25804
27402
|
} catch (error) {
|
|
25805
|
-
return
|
|
27403
|
+
return logger30.throwError("bad result from backend", Logger.errors.SERVER_ERROR, {
|
|
25806
27404
|
method: "estimateGas",
|
|
25807
27405
|
params,
|
|
25808
27406
|
result,
|
|
@@ -25812,14 +27410,14 @@ var BaseProvider = class extends Provider {
|
|
|
25812
27410
|
});
|
|
25813
27411
|
}
|
|
25814
27412
|
_getAddress(addressOrName) {
|
|
25815
|
-
return
|
|
27413
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25816
27414
|
addressOrName = yield addressOrName;
|
|
25817
27415
|
if (typeof addressOrName !== "string") {
|
|
25818
|
-
|
|
27416
|
+
logger30.throwArgumentError("invalid address or ENS name", "name", addressOrName);
|
|
25819
27417
|
}
|
|
25820
27418
|
const address = yield this.resolveName(addressOrName);
|
|
25821
27419
|
if (address == null) {
|
|
25822
|
-
|
|
27420
|
+
logger30.throwError("ENS name not configured", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
25823
27421
|
operation: `resolveName(${JSON.stringify(addressOrName)})`
|
|
25824
27422
|
});
|
|
25825
27423
|
}
|
|
@@ -25827,7 +27425,7 @@ var BaseProvider = class extends Provider {
|
|
|
25827
27425
|
});
|
|
25828
27426
|
}
|
|
25829
27427
|
_getBlock(blockHashOrBlockTag, includeTransactions) {
|
|
25830
|
-
return
|
|
27428
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25831
27429
|
yield this.getNetwork();
|
|
25832
27430
|
blockHashOrBlockTag = yield blockHashOrBlockTag;
|
|
25833
27431
|
let blockNumber = -128;
|
|
@@ -25843,10 +27441,10 @@ var BaseProvider = class extends Provider {
|
|
|
25843
27441
|
blockNumber = parseInt(params.blockTag.substring(2), 16);
|
|
25844
27442
|
}
|
|
25845
27443
|
} catch (error) {
|
|
25846
|
-
|
|
27444
|
+
logger30.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
|
|
25847
27445
|
}
|
|
25848
27446
|
}
|
|
25849
|
-
return poll(() =>
|
|
27447
|
+
return poll(() => __awaiter10(this, void 0, void 0, function* () {
|
|
25850
27448
|
const block = yield this.perform("getBlock", params);
|
|
25851
27449
|
if (block == null) {
|
|
25852
27450
|
if (params.blockHash != null) {
|
|
@@ -25893,11 +27491,11 @@ var BaseProvider = class extends Provider {
|
|
|
25893
27491
|
return this._getBlock(blockHashOrBlockTag, true);
|
|
25894
27492
|
}
|
|
25895
27493
|
getTransaction(transactionHash) {
|
|
25896
|
-
return
|
|
27494
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25897
27495
|
yield this.getNetwork();
|
|
25898
27496
|
transactionHash = yield transactionHash;
|
|
25899
27497
|
const params = { transactionHash: this.formatter.hash(transactionHash, true) };
|
|
25900
|
-
return poll(() =>
|
|
27498
|
+
return poll(() => __awaiter10(this, void 0, void 0, function* () {
|
|
25901
27499
|
const result = yield this.perform("getTransaction", params);
|
|
25902
27500
|
if (result == null) {
|
|
25903
27501
|
if (this._emitted["t:" + transactionHash] == null) {
|
|
@@ -25921,11 +27519,11 @@ var BaseProvider = class extends Provider {
|
|
|
25921
27519
|
});
|
|
25922
27520
|
}
|
|
25923
27521
|
getTransactionReceipt(transactionHash) {
|
|
25924
|
-
return
|
|
27522
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25925
27523
|
yield this.getNetwork();
|
|
25926
27524
|
transactionHash = yield transactionHash;
|
|
25927
27525
|
const params = { transactionHash: this.formatter.hash(transactionHash, true) };
|
|
25928
|
-
return poll(() =>
|
|
27526
|
+
return poll(() => __awaiter10(this, void 0, void 0, function* () {
|
|
25929
27527
|
const result = yield this.perform("getTransactionReceipt", params);
|
|
25930
27528
|
if (result == null) {
|
|
25931
27529
|
if (this._emitted["t:" + transactionHash] == null) {
|
|
@@ -25952,7 +27550,7 @@ var BaseProvider = class extends Provider {
|
|
|
25952
27550
|
});
|
|
25953
27551
|
}
|
|
25954
27552
|
getLogs(filter) {
|
|
25955
|
-
return
|
|
27553
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25956
27554
|
yield this.getNetwork();
|
|
25957
27555
|
const params = yield resolveProperties({ filter: this._getFilter(filter) });
|
|
25958
27556
|
const logs = yield this.perform("getLogs", params);
|
|
@@ -25965,17 +27563,17 @@ var BaseProvider = class extends Provider {
|
|
|
25965
27563
|
});
|
|
25966
27564
|
}
|
|
25967
27565
|
getEtherPrice() {
|
|
25968
|
-
return
|
|
27566
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25969
27567
|
yield this.getNetwork();
|
|
25970
27568
|
return this.perform("getEtherPrice", {});
|
|
25971
27569
|
});
|
|
25972
27570
|
}
|
|
25973
27571
|
_getBlockTag(blockTag) {
|
|
25974
|
-
return
|
|
27572
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25975
27573
|
blockTag = yield blockTag;
|
|
25976
27574
|
if (typeof blockTag === "number" && blockTag < 0) {
|
|
25977
27575
|
if (blockTag % 1) {
|
|
25978
|
-
|
|
27576
|
+
logger30.throwArgumentError("invalid BlockTag", "blockTag", blockTag);
|
|
25979
27577
|
}
|
|
25980
27578
|
let blockNumber = yield this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
|
|
25981
27579
|
blockNumber += blockTag;
|
|
@@ -25988,7 +27586,7 @@ var BaseProvider = class extends Provider {
|
|
|
25988
27586
|
});
|
|
25989
27587
|
}
|
|
25990
27588
|
getResolver(name) {
|
|
25991
|
-
return
|
|
27589
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
25992
27590
|
let currentName = name;
|
|
25993
27591
|
while (true) {
|
|
25994
27592
|
if (currentName === "" || currentName === ".") {
|
|
@@ -26010,13 +27608,13 @@ var BaseProvider = class extends Provider {
|
|
|
26010
27608
|
});
|
|
26011
27609
|
}
|
|
26012
27610
|
_getResolver(name, operation) {
|
|
26013
|
-
return
|
|
27611
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26014
27612
|
if (operation == null) {
|
|
26015
27613
|
operation = "ENS";
|
|
26016
27614
|
}
|
|
26017
27615
|
const network = yield this.getNetwork();
|
|
26018
27616
|
if (!network.ensAddress) {
|
|
26019
|
-
|
|
27617
|
+
logger30.throwError("network does not support ENS", Logger.errors.UNSUPPORTED_OPERATION, { operation, network: network.name });
|
|
26020
27618
|
}
|
|
26021
27619
|
try {
|
|
26022
27620
|
const addrData = yield this.call({
|
|
@@ -26030,7 +27628,7 @@ var BaseProvider = class extends Provider {
|
|
|
26030
27628
|
});
|
|
26031
27629
|
}
|
|
26032
27630
|
resolveName(name) {
|
|
26033
|
-
return
|
|
27631
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26034
27632
|
name = yield name;
|
|
26035
27633
|
try {
|
|
26036
27634
|
return Promise.resolve(this.formatter.address(name));
|
|
@@ -26040,7 +27638,7 @@ var BaseProvider = class extends Provider {
|
|
|
26040
27638
|
}
|
|
26041
27639
|
}
|
|
26042
27640
|
if (typeof name !== "string") {
|
|
26043
|
-
|
|
27641
|
+
logger30.throwArgumentError("invalid ENS name", "name", name);
|
|
26044
27642
|
}
|
|
26045
27643
|
const resolver = yield this.getResolver(name);
|
|
26046
27644
|
if (!resolver) {
|
|
@@ -26050,7 +27648,7 @@ var BaseProvider = class extends Provider {
|
|
|
26050
27648
|
});
|
|
26051
27649
|
}
|
|
26052
27650
|
lookupAddress(address) {
|
|
26053
|
-
return
|
|
27651
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26054
27652
|
address = yield address;
|
|
26055
27653
|
address = this.formatter.address(address);
|
|
26056
27654
|
const node = address.substring(2).toLowerCase() + ".addr.reverse";
|
|
@@ -26070,7 +27668,7 @@ var BaseProvider = class extends Provider {
|
|
|
26070
27668
|
});
|
|
26071
27669
|
}
|
|
26072
27670
|
getAvatar(nameOrAddress) {
|
|
26073
|
-
return
|
|
27671
|
+
return __awaiter10(this, void 0, void 0, function* () {
|
|
26074
27672
|
let resolver = null;
|
|
26075
27673
|
if (isHexString(nameOrAddress)) {
|
|
26076
27674
|
const address = this.formatter.address(nameOrAddress);
|
|
@@ -26116,7 +27714,7 @@ var BaseProvider = class extends Provider {
|
|
|
26116
27714
|
});
|
|
26117
27715
|
}
|
|
26118
27716
|
perform(method, params) {
|
|
26119
|
-
return
|
|
27717
|
+
return logger30.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
26120
27718
|
}
|
|
26121
27719
|
_startEvent(event) {
|
|
26122
27720
|
this.polling = this._events.filter((e) => e.pollable()).length > 0;
|
|
@@ -26220,8 +27818,8 @@ var BaseProvider = class extends Provider {
|
|
|
26220
27818
|
}
|
|
26221
27819
|
};
|
|
26222
27820
|
|
|
26223
|
-
// node_modules
|
|
26224
|
-
var
|
|
27821
|
+
// node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js
|
|
27822
|
+
var __awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
26225
27823
|
function adopt(value) {
|
|
26226
27824
|
return value instanceof P ? value : new P(function(resolve) {
|
|
26227
27825
|
resolve(value);
|
|
@@ -26248,7 +27846,7 @@ var __awaiter12 = function(thisArg, _arguments, P, generator) {
|
|
|
26248
27846
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26249
27847
|
});
|
|
26250
27848
|
};
|
|
26251
|
-
var
|
|
27849
|
+
var logger31 = new Logger(version23);
|
|
26252
27850
|
var errorGas = ["call", "estimateGas"];
|
|
26253
27851
|
function spelunk(value, requireData) {
|
|
26254
27852
|
if (value == null) {
|
|
@@ -26284,7 +27882,7 @@ function checkError(method, error, params) {
|
|
|
26284
27882
|
if (result) {
|
|
26285
27883
|
return result.data;
|
|
26286
27884
|
}
|
|
26287
|
-
|
|
27885
|
+
logger31.throwError("missing revert data in call exception; Transaction reverted without a reason string", Logger.errors.CALL_EXCEPTION, {
|
|
26288
27886
|
data: "0x",
|
|
26289
27887
|
transaction,
|
|
26290
27888
|
error
|
|
@@ -26296,7 +27894,7 @@ function checkError(method, error, params) {
|
|
|
26296
27894
|
result = spelunk(error, false);
|
|
26297
27895
|
}
|
|
26298
27896
|
if (result) {
|
|
26299
|
-
|
|
27897
|
+
logger31.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
26300
27898
|
reason: result.message,
|
|
26301
27899
|
method,
|
|
26302
27900
|
transaction,
|
|
@@ -26314,35 +27912,35 @@ function checkError(method, error, params) {
|
|
|
26314
27912
|
}
|
|
26315
27913
|
message = (message || "").toLowerCase();
|
|
26316
27914
|
if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
|
|
26317
|
-
|
|
27915
|
+
logger31.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
26318
27916
|
error,
|
|
26319
27917
|
method,
|
|
26320
27918
|
transaction
|
|
26321
27919
|
});
|
|
26322
27920
|
}
|
|
26323
27921
|
if (message.match(/nonce (is )?too low/i)) {
|
|
26324
|
-
|
|
27922
|
+
logger31.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
26325
27923
|
error,
|
|
26326
27924
|
method,
|
|
26327
27925
|
transaction
|
|
26328
27926
|
});
|
|
26329
27927
|
}
|
|
26330
27928
|
if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {
|
|
26331
|
-
|
|
27929
|
+
logger31.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
26332
27930
|
error,
|
|
26333
27931
|
method,
|
|
26334
27932
|
transaction
|
|
26335
27933
|
});
|
|
26336
27934
|
}
|
|
26337
27935
|
if (message.match(/only replay-protected/i)) {
|
|
26338
|
-
|
|
27936
|
+
logger31.throwError("legacy pre-eip-155 transactions not supported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26339
27937
|
error,
|
|
26340
27938
|
method,
|
|
26341
27939
|
transaction
|
|
26342
27940
|
});
|
|
26343
27941
|
}
|
|
26344
27942
|
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
|
|
26345
|
-
|
|
27943
|
+
logger31.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
26346
27944
|
error,
|
|
26347
27945
|
method,
|
|
26348
27946
|
transaction
|
|
@@ -26388,11 +27986,11 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26388
27986
|
defineReadOnly(this, "_index", addressOrIndex);
|
|
26389
27987
|
defineReadOnly(this, "_address", null);
|
|
26390
27988
|
} else {
|
|
26391
|
-
|
|
27989
|
+
logger31.throwArgumentError("invalid address or index", "addressOrIndex", addressOrIndex);
|
|
26392
27990
|
}
|
|
26393
27991
|
}
|
|
26394
27992
|
connect(provider) {
|
|
26395
|
-
return
|
|
27993
|
+
return logger31.throwError("cannot alter JSON-RPC Signer connection", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26396
27994
|
operation: "connect"
|
|
26397
27995
|
});
|
|
26398
27996
|
}
|
|
@@ -26405,7 +28003,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26405
28003
|
}
|
|
26406
28004
|
return this.provider.send("eth_accounts", []).then((accounts) => {
|
|
26407
28005
|
if (accounts.length <= this._index) {
|
|
26408
|
-
|
|
28006
|
+
logger31.throwError("unknown account #" + this._index, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26409
28007
|
operation: "getAddress"
|
|
26410
28008
|
});
|
|
26411
28009
|
}
|
|
@@ -26426,13 +28024,13 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26426
28024
|
transaction.gasLimit = this.provider.estimateGas(estimate);
|
|
26427
28025
|
}
|
|
26428
28026
|
if (transaction.to != null) {
|
|
26429
|
-
transaction.to = Promise.resolve(transaction.to).then((to) =>
|
|
28027
|
+
transaction.to = Promise.resolve(transaction.to).then((to) => __awaiter11(this, void 0, void 0, function* () {
|
|
26430
28028
|
if (to == null) {
|
|
26431
28029
|
return null;
|
|
26432
28030
|
}
|
|
26433
28031
|
const address = yield this.provider.resolveName(to);
|
|
26434
28032
|
if (address == null) {
|
|
26435
|
-
|
|
28033
|
+
logger31.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
26436
28034
|
}
|
|
26437
28035
|
return address;
|
|
26438
28036
|
}));
|
|
@@ -26443,7 +28041,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26443
28041
|
}).then(({ tx, sender }) => {
|
|
26444
28042
|
if (tx.from != null) {
|
|
26445
28043
|
if (tx.from.toLowerCase() !== sender) {
|
|
26446
|
-
|
|
28044
|
+
logger31.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
26447
28045
|
}
|
|
26448
28046
|
} else {
|
|
26449
28047
|
tx.from = sender;
|
|
@@ -26453,7 +28051,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26453
28051
|
return hash3;
|
|
26454
28052
|
}, (error) => {
|
|
26455
28053
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
26456
|
-
|
|
28054
|
+
logger31.throwError("user rejected transaction", Logger.errors.ACTION_REJECTED, {
|
|
26457
28055
|
action: "sendTransaction",
|
|
26458
28056
|
transaction: tx
|
|
26459
28057
|
});
|
|
@@ -26463,16 +28061,16 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26463
28061
|
});
|
|
26464
28062
|
}
|
|
26465
28063
|
signTransaction(transaction) {
|
|
26466
|
-
return
|
|
28064
|
+
return logger31.throwError("signing transactions is unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26467
28065
|
operation: "signTransaction"
|
|
26468
28066
|
});
|
|
26469
28067
|
}
|
|
26470
28068
|
sendTransaction(transaction) {
|
|
26471
|
-
return
|
|
28069
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26472
28070
|
const blockNumber = yield this.provider._getInternalBlockNumber(100 + 2 * this.provider.pollingInterval);
|
|
26473
28071
|
const hash3 = yield this.sendUncheckedTransaction(transaction);
|
|
26474
28072
|
try {
|
|
26475
|
-
return yield poll(() =>
|
|
28073
|
+
return yield poll(() => __awaiter11(this, void 0, void 0, function* () {
|
|
26476
28074
|
const tx = yield this.provider.getTransaction(hash3);
|
|
26477
28075
|
if (tx === null) {
|
|
26478
28076
|
return void 0;
|
|
@@ -26486,14 +28084,14 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26486
28084
|
});
|
|
26487
28085
|
}
|
|
26488
28086
|
signMessage(message) {
|
|
26489
|
-
return
|
|
28087
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26490
28088
|
const data = typeof message === "string" ? toUtf8Bytes(message) : message;
|
|
26491
28089
|
const address = yield this.getAddress();
|
|
26492
28090
|
try {
|
|
26493
28091
|
return yield this.provider.send("personal_sign", [hexlify(data), address.toLowerCase()]);
|
|
26494
28092
|
} catch (error) {
|
|
26495
28093
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
26496
|
-
|
|
28094
|
+
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
26497
28095
|
action: "signMessage",
|
|
26498
28096
|
from: address,
|
|
26499
28097
|
messageData: message
|
|
@@ -26504,14 +28102,14 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26504
28102
|
});
|
|
26505
28103
|
}
|
|
26506
28104
|
_legacySignMessage(message) {
|
|
26507
|
-
return
|
|
28105
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26508
28106
|
const data = typeof message === "string" ? toUtf8Bytes(message) : message;
|
|
26509
28107
|
const address = yield this.getAddress();
|
|
26510
28108
|
try {
|
|
26511
28109
|
return yield this.provider.send("eth_sign", [address.toLowerCase(), hexlify(data)]);
|
|
26512
28110
|
} catch (error) {
|
|
26513
28111
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
26514
|
-
|
|
28112
|
+
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
26515
28113
|
action: "_legacySignMessage",
|
|
26516
28114
|
from: address,
|
|
26517
28115
|
messageData: message
|
|
@@ -26522,7 +28120,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26522
28120
|
});
|
|
26523
28121
|
}
|
|
26524
28122
|
_signTypedData(domain, types, value) {
|
|
26525
|
-
return
|
|
28123
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26526
28124
|
const populated = yield TypedDataEncoder.resolveNames(domain, types, value, (name) => {
|
|
26527
28125
|
return this.provider.resolveName(name);
|
|
26528
28126
|
});
|
|
@@ -26534,7 +28132,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26534
28132
|
]);
|
|
26535
28133
|
} catch (error) {
|
|
26536
28134
|
if (typeof error.message === "string" && error.message.match(/user denied/i)) {
|
|
26537
|
-
|
|
28135
|
+
logger31.throwError("user rejected signing", Logger.errors.ACTION_REJECTED, {
|
|
26538
28136
|
action: "_signTypedData",
|
|
26539
28137
|
from: address,
|
|
26540
28138
|
messageData: { domain: populated.domain, types, value: populated.value }
|
|
@@ -26545,7 +28143,7 @@ var JsonRpcSigner = class extends Signer {
|
|
|
26545
28143
|
});
|
|
26546
28144
|
}
|
|
26547
28145
|
unlock(password) {
|
|
26548
|
-
return
|
|
28146
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26549
28147
|
const provider = this.provider;
|
|
26550
28148
|
const address = yield this.getAddress();
|
|
26551
28149
|
return provider.send("personal_unlockAccount", [address.toLowerCase(), password, null]);
|
|
@@ -26631,7 +28229,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26631
28229
|
return this._cache["detectNetwork"];
|
|
26632
28230
|
}
|
|
26633
28231
|
_uncachedDetectNetwork() {
|
|
26634
|
-
return
|
|
28232
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26635
28233
|
yield timer(0);
|
|
26636
28234
|
let chainId = null;
|
|
26637
28235
|
try {
|
|
@@ -26647,14 +28245,14 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26647
28245
|
try {
|
|
26648
28246
|
return getNetwork2(BigNumber.from(chainId).toNumber());
|
|
26649
28247
|
} catch (error) {
|
|
26650
|
-
return
|
|
28248
|
+
return logger31.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
26651
28249
|
chainId,
|
|
26652
28250
|
event: "invalidNetwork",
|
|
26653
28251
|
serverError: error
|
|
26654
28252
|
});
|
|
26655
28253
|
}
|
|
26656
28254
|
}
|
|
26657
|
-
return
|
|
28255
|
+
return logger31.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
|
|
26658
28256
|
event: "noNetwork"
|
|
26659
28257
|
});
|
|
26660
28258
|
});
|
|
@@ -26757,7 +28355,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26757
28355
|
return null;
|
|
26758
28356
|
}
|
|
26759
28357
|
perform(method, params) {
|
|
26760
|
-
return
|
|
28358
|
+
return __awaiter11(this, void 0, void 0, function* () {
|
|
26761
28359
|
if (method === "call" || method === "estimateGas") {
|
|
26762
28360
|
const tx = params.transaction;
|
|
26763
28361
|
if (tx && tx.type != null && BigNumber.from(tx.type).isZero()) {
|
|
@@ -26773,7 +28371,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26773
28371
|
}
|
|
26774
28372
|
const args = this.prepareRequest(method, params);
|
|
26775
28373
|
if (args == null) {
|
|
26776
|
-
|
|
28374
|
+
logger31.throwError(method + " not implemented", Logger.errors.NOT_IMPLEMENTED, { operation: method });
|
|
26777
28375
|
}
|
|
26778
28376
|
try {
|
|
26779
28377
|
return yield this.send(args[0], args[1]);
|
|
@@ -26880,7 +28478,7 @@ var JsonRpcProvider = class extends BaseProvider {
|
|
|
26880
28478
|
}
|
|
26881
28479
|
};
|
|
26882
28480
|
|
|
26883
|
-
// node_modules
|
|
28481
|
+
// node_modules/@ethersproject/providers/lib.esm/ws.js
|
|
26884
28482
|
var WS = null;
|
|
26885
28483
|
try {
|
|
26886
28484
|
WS = WebSocket;
|
|
@@ -26888,16 +28486,16 @@ try {
|
|
|
26888
28486
|
throw new Error("inject please");
|
|
26889
28487
|
}
|
|
26890
28488
|
} catch (error) {
|
|
26891
|
-
const
|
|
28489
|
+
const logger48 = new Logger(version23);
|
|
26892
28490
|
WS = function() {
|
|
26893
|
-
|
|
28491
|
+
logger48.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26894
28492
|
operation: "new WebSocket()"
|
|
26895
28493
|
});
|
|
26896
28494
|
};
|
|
26897
28495
|
}
|
|
26898
28496
|
|
|
26899
|
-
// node_modules
|
|
26900
|
-
var
|
|
28497
|
+
// node_modules/@ethersproject/providers/lib.esm/websocket-provider.js
|
|
28498
|
+
var __awaiter12 = function(thisArg, _arguments, P, generator) {
|
|
26901
28499
|
function adopt(value) {
|
|
26902
28500
|
return value instanceof P ? value : new P(function(resolve) {
|
|
26903
28501
|
resolve(value);
|
|
@@ -26924,12 +28522,12 @@ var __awaiter13 = function(thisArg, _arguments, P, generator) {
|
|
|
26924
28522
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26925
28523
|
});
|
|
26926
28524
|
};
|
|
26927
|
-
var
|
|
28525
|
+
var logger32 = new Logger(version23);
|
|
26928
28526
|
var NextId = 1;
|
|
26929
28527
|
var WebSocketProvider = class extends JsonRpcProvider {
|
|
26930
28528
|
constructor(url, network) {
|
|
26931
28529
|
if (network === "any") {
|
|
26932
|
-
|
|
28530
|
+
logger32.throwError("WebSocketProvider does not support 'any' network yet", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
26933
28531
|
operation: "network:any"
|
|
26934
28532
|
});
|
|
26935
28533
|
}
|
|
@@ -27015,17 +28613,17 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27015
28613
|
return 0;
|
|
27016
28614
|
}
|
|
27017
28615
|
resetEventsBlock(blockNumber) {
|
|
27018
|
-
|
|
28616
|
+
logger32.throwError("cannot reset events block on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
27019
28617
|
operation: "resetEventBlock"
|
|
27020
28618
|
});
|
|
27021
28619
|
}
|
|
27022
28620
|
set pollingInterval(value) {
|
|
27023
|
-
|
|
28621
|
+
logger32.throwError("cannot set polling interval on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
27024
28622
|
operation: "setPollingInterval"
|
|
27025
28623
|
});
|
|
27026
28624
|
}
|
|
27027
28625
|
poll() {
|
|
27028
|
-
return
|
|
28626
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
27029
28627
|
return null;
|
|
27030
28628
|
});
|
|
27031
28629
|
}
|
|
@@ -27033,7 +28631,7 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27033
28631
|
if (!value) {
|
|
27034
28632
|
return;
|
|
27035
28633
|
}
|
|
27036
|
-
|
|
28634
|
+
logger32.throwError("cannot set polling on WebSocketProvider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
27037
28635
|
operation: "setPolling"
|
|
27038
28636
|
});
|
|
27039
28637
|
}
|
|
@@ -27067,7 +28665,7 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27067
28665
|
return "ws://localhost:8546";
|
|
27068
28666
|
}
|
|
27069
28667
|
_subscribe(tag, param, processFunc) {
|
|
27070
|
-
return
|
|
28668
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
27071
28669
|
let subIdPromise = this._subIds[tag];
|
|
27072
28670
|
if (subIdPromise == null) {
|
|
27073
28671
|
subIdPromise = Promise.all(param).then((param2) => {
|
|
@@ -27152,7 +28750,7 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27152
28750
|
});
|
|
27153
28751
|
}
|
|
27154
28752
|
destroy() {
|
|
27155
|
-
return
|
|
28753
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
27156
28754
|
if (this.websocket.readyState === WS.CONNECTING) {
|
|
27157
28755
|
yield new Promise((resolve) => {
|
|
27158
28756
|
this.websocket.onopen = function() {
|
|
@@ -27168,8 +28766,8 @@ var WebSocketProvider = class extends JsonRpcProvider {
|
|
|
27168
28766
|
}
|
|
27169
28767
|
};
|
|
27170
28768
|
|
|
27171
|
-
// node_modules
|
|
27172
|
-
var
|
|
28769
|
+
// node_modules/@ethersproject/providers/lib.esm/url-json-rpc-provider.js
|
|
28770
|
+
var __awaiter13 = function(thisArg, _arguments, P, generator) {
|
|
27173
28771
|
function adopt(value) {
|
|
27174
28772
|
return value instanceof P ? value : new P(function(resolve) {
|
|
27175
28773
|
resolve(value);
|
|
@@ -27196,18 +28794,18 @@ var __awaiter14 = function(thisArg, _arguments, P, generator) {
|
|
|
27196
28794
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27197
28795
|
});
|
|
27198
28796
|
};
|
|
27199
|
-
var
|
|
28797
|
+
var logger33 = new Logger(version23);
|
|
27200
28798
|
var StaticJsonRpcProvider = class extends JsonRpcProvider {
|
|
27201
28799
|
detectNetwork() {
|
|
27202
28800
|
const _super = Object.create(null, {
|
|
27203
28801
|
detectNetwork: { get: () => super.detectNetwork }
|
|
27204
28802
|
});
|
|
27205
|
-
return
|
|
28803
|
+
return __awaiter13(this, void 0, void 0, function* () {
|
|
27206
28804
|
let network = this.network;
|
|
27207
28805
|
if (network == null) {
|
|
27208
28806
|
network = yield _super.detectNetwork.call(this);
|
|
27209
28807
|
if (!network) {
|
|
27210
|
-
|
|
28808
|
+
logger33.throwError("no network detected", Logger.errors.UNKNOWN_ERROR, {});
|
|
27211
28809
|
}
|
|
27212
28810
|
if (this._network == null) {
|
|
27213
28811
|
defineReadOnly(this, "_network", network);
|
|
@@ -27220,7 +28818,7 @@ var StaticJsonRpcProvider = class extends JsonRpcProvider {
|
|
|
27220
28818
|
};
|
|
27221
28819
|
var UrlJsonRpcProvider = class _UrlJsonRpcProvider extends StaticJsonRpcProvider {
|
|
27222
28820
|
constructor(network, apiKey) {
|
|
27223
|
-
|
|
28821
|
+
logger33.checkAbstract(new.target, _UrlJsonRpcProvider);
|
|
27224
28822
|
network = getStatic(new.target, "getNetwork")(network);
|
|
27225
28823
|
apiKey = getStatic(new.target, "getApiKey")(apiKey);
|
|
27226
28824
|
const connection = getStatic(new.target, "getUrl")(network, apiKey);
|
|
@@ -27234,13 +28832,13 @@ var UrlJsonRpcProvider = class _UrlJsonRpcProvider extends StaticJsonRpcProvider
|
|
|
27234
28832
|
}
|
|
27235
28833
|
}
|
|
27236
28834
|
_startPending() {
|
|
27237
|
-
|
|
28835
|
+
logger33.warn("WARNING: API provider does not support pending filters");
|
|
27238
28836
|
}
|
|
27239
28837
|
isCommunityResource() {
|
|
27240
28838
|
return false;
|
|
27241
28839
|
}
|
|
27242
28840
|
getSigner(address) {
|
|
27243
|
-
return
|
|
28841
|
+
return logger33.throwError("API provider does not support signing", Logger.errors.UNSUPPORTED_OPERATION, { operation: "getSigner" });
|
|
27244
28842
|
}
|
|
27245
28843
|
listAccounts() {
|
|
27246
28844
|
return Promise.resolve([]);
|
|
@@ -27253,14 +28851,14 @@ var UrlJsonRpcProvider = class _UrlJsonRpcProvider extends StaticJsonRpcProvider
|
|
|
27253
28851
|
// API key will have been sanitized by the getApiKey first, so any validation
|
|
27254
28852
|
// or transformations can be done there.
|
|
27255
28853
|
static getUrl(network, apiKey) {
|
|
27256
|
-
return
|
|
28854
|
+
return logger33.throwError("not implemented; sub-classes must override getUrl", Logger.errors.NOT_IMPLEMENTED, {
|
|
27257
28855
|
operation: "getUrl"
|
|
27258
28856
|
});
|
|
27259
28857
|
}
|
|
27260
28858
|
};
|
|
27261
28859
|
|
|
27262
|
-
// node_modules
|
|
27263
|
-
var
|
|
28860
|
+
// node_modules/@ethersproject/providers/lib.esm/alchemy-provider.js
|
|
28861
|
+
var logger34 = new Logger(version23);
|
|
27264
28862
|
var defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";
|
|
27265
28863
|
var AlchemyWebSocketProvider = class extends WebSocketProvider {
|
|
27266
28864
|
constructor(network, apiKey) {
|
|
@@ -27282,7 +28880,7 @@ var AlchemyProvider = class extends UrlJsonRpcProvider {
|
|
|
27282
28880
|
return defaultApiKey;
|
|
27283
28881
|
}
|
|
27284
28882
|
if (apiKey && typeof apiKey !== "string") {
|
|
27285
|
-
|
|
28883
|
+
logger34.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
27286
28884
|
}
|
|
27287
28885
|
return apiKey;
|
|
27288
28886
|
}
|
|
@@ -27323,7 +28921,7 @@ var AlchemyProvider = class extends UrlJsonRpcProvider {
|
|
|
27323
28921
|
host = "opt-sepolia.g.alchemy.com/v2/";
|
|
27324
28922
|
break;
|
|
27325
28923
|
default:
|
|
27326
|
-
|
|
28924
|
+
logger34.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
27327
28925
|
}
|
|
27328
28926
|
return {
|
|
27329
28927
|
allowGzip: true,
|
|
@@ -27341,8 +28939,8 @@ var AlchemyProvider = class extends UrlJsonRpcProvider {
|
|
|
27341
28939
|
}
|
|
27342
28940
|
};
|
|
27343
28941
|
|
|
27344
|
-
// node_modules
|
|
27345
|
-
var
|
|
28942
|
+
// node_modules/@ethersproject/providers/lib.esm/ankr-provider.js
|
|
28943
|
+
var logger35 = new Logger(version23);
|
|
27346
28944
|
var defaultApiKey2 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";
|
|
27347
28945
|
function getHost(name) {
|
|
27348
28946
|
switch (name) {
|
|
@@ -27369,7 +28967,7 @@ function getHost(name) {
|
|
|
27369
28967
|
case "arbitrum":
|
|
27370
28968
|
return "rpc.ankr.com/arbitrum/";
|
|
27371
28969
|
}
|
|
27372
|
-
return
|
|
28970
|
+
return logger35.throwArgumentError("unsupported network", "name", name);
|
|
27373
28971
|
}
|
|
27374
28972
|
var AnkrProvider = class extends UrlJsonRpcProvider {
|
|
27375
28973
|
isCommunityResource() {
|
|
@@ -27403,8 +29001,8 @@ var AnkrProvider = class extends UrlJsonRpcProvider {
|
|
|
27403
29001
|
}
|
|
27404
29002
|
};
|
|
27405
29003
|
|
|
27406
|
-
// node_modules
|
|
27407
|
-
var
|
|
29004
|
+
// node_modules/@ethersproject/providers/lib.esm/cloudflare-provider.js
|
|
29005
|
+
var __awaiter14 = function(thisArg, _arguments, P, generator) {
|
|
27408
29006
|
function adopt(value) {
|
|
27409
29007
|
return value instanceof P ? value : new P(function(resolve) {
|
|
27410
29008
|
resolve(value);
|
|
@@ -27431,11 +29029,11 @@ var __awaiter15 = function(thisArg, _arguments, P, generator) {
|
|
|
27431
29029
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27432
29030
|
});
|
|
27433
29031
|
};
|
|
27434
|
-
var
|
|
29032
|
+
var logger36 = new Logger(version23);
|
|
27435
29033
|
var CloudflareProvider = class extends UrlJsonRpcProvider {
|
|
27436
29034
|
static getApiKey(apiKey) {
|
|
27437
29035
|
if (apiKey != null) {
|
|
27438
|
-
|
|
29036
|
+
logger36.throwArgumentError("apiKey not supported for cloudflare", "apiKey", apiKey);
|
|
27439
29037
|
}
|
|
27440
29038
|
return null;
|
|
27441
29039
|
}
|
|
@@ -27446,7 +29044,7 @@ var CloudflareProvider = class extends UrlJsonRpcProvider {
|
|
|
27446
29044
|
host = "https://cloudflare-eth.com/";
|
|
27447
29045
|
break;
|
|
27448
29046
|
default:
|
|
27449
|
-
|
|
29047
|
+
logger36.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
27450
29048
|
}
|
|
27451
29049
|
return host;
|
|
27452
29050
|
}
|
|
@@ -27454,7 +29052,7 @@ var CloudflareProvider = class extends UrlJsonRpcProvider {
|
|
|
27454
29052
|
const _super = Object.create(null, {
|
|
27455
29053
|
perform: { get: () => super.perform }
|
|
27456
29054
|
});
|
|
27457
|
-
return
|
|
29055
|
+
return __awaiter14(this, void 0, void 0, function* () {
|
|
27458
29056
|
if (method === "getBlockNumber") {
|
|
27459
29057
|
const block = yield _super.perform.call(this, "getBlock", { blockTag: "latest" });
|
|
27460
29058
|
return block.number;
|
|
@@ -27464,8 +29062,8 @@ var CloudflareProvider = class extends UrlJsonRpcProvider {
|
|
|
27464
29062
|
}
|
|
27465
29063
|
};
|
|
27466
29064
|
|
|
27467
|
-
// node_modules
|
|
27468
|
-
var
|
|
29065
|
+
// node_modules/@ethersproject/providers/lib.esm/etherscan-provider.js
|
|
29066
|
+
var __awaiter15 = function(thisArg, _arguments, P, generator) {
|
|
27469
29067
|
function adopt(value) {
|
|
27470
29068
|
return value instanceof P ? value : new P(function(resolve) {
|
|
27471
29069
|
resolve(value);
|
|
@@ -27492,7 +29090,7 @@ var __awaiter16 = function(thisArg, _arguments, P, generator) {
|
|
|
27492
29090
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27493
29091
|
});
|
|
27494
29092
|
};
|
|
27495
|
-
var
|
|
29093
|
+
var logger37 = new Logger(version23);
|
|
27496
29094
|
function getTransactionPostData(transaction) {
|
|
27497
29095
|
const result = {};
|
|
27498
29096
|
for (let key2 in transaction) {
|
|
@@ -27574,7 +29172,7 @@ function checkError2(method, error, transaction) {
|
|
|
27574
29172
|
if (isHexString(data)) {
|
|
27575
29173
|
return data;
|
|
27576
29174
|
}
|
|
27577
|
-
|
|
29175
|
+
logger37.throwError("missing revert data in call exception", Logger.errors.CALL_EXCEPTION, {
|
|
27578
29176
|
error,
|
|
27579
29177
|
data: "0x"
|
|
27580
29178
|
});
|
|
@@ -27592,28 +29190,28 @@ function checkError2(method, error, transaction) {
|
|
|
27592
29190
|
}
|
|
27593
29191
|
message = (message || "").toLowerCase();
|
|
27594
29192
|
if (message.match(/insufficient funds/)) {
|
|
27595
|
-
|
|
29193
|
+
logger37.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
|
|
27596
29194
|
error,
|
|
27597
29195
|
method,
|
|
27598
29196
|
transaction
|
|
27599
29197
|
});
|
|
27600
29198
|
}
|
|
27601
29199
|
if (message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)) {
|
|
27602
|
-
|
|
29200
|
+
logger37.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
|
|
27603
29201
|
error,
|
|
27604
29202
|
method,
|
|
27605
29203
|
transaction
|
|
27606
29204
|
});
|
|
27607
29205
|
}
|
|
27608
29206
|
if (message.match(/another transaction with same nonce/)) {
|
|
27609
|
-
|
|
29207
|
+
logger37.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
|
|
27610
29208
|
error,
|
|
27611
29209
|
method,
|
|
27612
29210
|
transaction
|
|
27613
29211
|
});
|
|
27614
29212
|
}
|
|
27615
29213
|
if (message.match(/execution failed due to an exception|execution reverted/)) {
|
|
27616
|
-
|
|
29214
|
+
logger37.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
27617
29215
|
error,
|
|
27618
29216
|
method,
|
|
27619
29217
|
transaction
|
|
@@ -27649,7 +29247,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27649
29247
|
return "https://api-goerli-optimistic.etherscan.io";
|
|
27650
29248
|
default:
|
|
27651
29249
|
}
|
|
27652
|
-
return
|
|
29250
|
+
return logger37.throwArgumentError("unsupported network", "network", this.network.name);
|
|
27653
29251
|
}
|
|
27654
29252
|
getUrl(module, params) {
|
|
27655
29253
|
const query = Object.keys(params).reduce((accum, key2) => {
|
|
@@ -27671,7 +29269,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27671
29269
|
return params;
|
|
27672
29270
|
}
|
|
27673
29271
|
fetch(module, params, post) {
|
|
27674
|
-
return
|
|
29272
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
27675
29273
|
const url = post ? this.getPostUrl() : this.getUrl(module, params);
|
|
27676
29274
|
const payload = post ? this.getPostData(module, params) : null;
|
|
27677
29275
|
const procFunc = module === "proxy" ? getJsonResult : getResult2;
|
|
@@ -27708,7 +29306,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27708
29306
|
});
|
|
27709
29307
|
}
|
|
27710
29308
|
detectNetwork() {
|
|
27711
|
-
return
|
|
29309
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
27712
29310
|
return this.network;
|
|
27713
29311
|
});
|
|
27714
29312
|
}
|
|
@@ -27716,7 +29314,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27716
29314
|
const _super = Object.create(null, {
|
|
27717
29315
|
perform: { get: () => super.perform }
|
|
27718
29316
|
});
|
|
27719
|
-
return
|
|
29317
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
27720
29318
|
switch (method) {
|
|
27721
29319
|
case "getBlockNumber":
|
|
27722
29320
|
return this.fetch("proxy", { action: "eth_blockNumber" });
|
|
@@ -27809,12 +29407,12 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27809
29407
|
}
|
|
27810
29408
|
if (params.filter.topics && params.filter.topics.length > 0) {
|
|
27811
29409
|
if (params.filter.topics.length > 1) {
|
|
27812
|
-
|
|
29410
|
+
logger37.throwError("unsupported topic count", Logger.errors.UNSUPPORTED_OPERATION, { topics: params.filter.topics });
|
|
27813
29411
|
}
|
|
27814
29412
|
if (params.filter.topics.length === 1) {
|
|
27815
29413
|
const topic0 = params.filter.topics[0];
|
|
27816
29414
|
if (typeof topic0 !== "string" || topic0.length !== 66) {
|
|
27817
|
-
|
|
29415
|
+
logger37.throwError("unsupported topic format", Logger.errors.UNSUPPORTED_OPERATION, { topic0 });
|
|
27818
29416
|
}
|
|
27819
29417
|
args.topic0 = topic0;
|
|
27820
29418
|
}
|
|
@@ -27852,7 +29450,7 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27852
29450
|
// Error: Result window is too large, PageNo x Offset size must
|
|
27853
29451
|
// be less than or equal to 10000
|
|
27854
29452
|
getHistory(addressOrName, startBlock, endBlock) {
|
|
27855
|
-
return
|
|
29453
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
27856
29454
|
const params = {
|
|
27857
29455
|
action: "txlist",
|
|
27858
29456
|
address: yield this.resolveName(addressOrName),
|
|
@@ -27883,8 +29481,8 @@ var EtherscanProvider = class extends BaseProvider {
|
|
|
27883
29481
|
}
|
|
27884
29482
|
};
|
|
27885
29483
|
|
|
27886
|
-
// node_modules
|
|
27887
|
-
var
|
|
29484
|
+
// node_modules/@ethersproject/providers/lib.esm/fallback-provider.js
|
|
29485
|
+
var __awaiter16 = function(thisArg, _arguments, P, generator) {
|
|
27888
29486
|
function adopt(value) {
|
|
27889
29487
|
return value instanceof P ? value : new P(function(resolve) {
|
|
27890
29488
|
resolve(value);
|
|
@@ -27911,7 +29509,7 @@ var __awaiter17 = function(thisArg, _arguments, P, generator) {
|
|
|
27911
29509
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27912
29510
|
});
|
|
27913
29511
|
};
|
|
27914
|
-
var
|
|
29512
|
+
var logger38 = new Logger(version23);
|
|
27915
29513
|
function now() {
|
|
27916
29514
|
return (/* @__PURE__ */ new Date()).getTime();
|
|
27917
29515
|
}
|
|
@@ -27924,7 +29522,7 @@ function checkNetworks(networks2) {
|
|
|
27924
29522
|
}
|
|
27925
29523
|
if (result) {
|
|
27926
29524
|
if (!(result.name === network.name && result.chainId === network.chainId && (result.ensAddress === network.ensAddress || result.ensAddress == null && network.ensAddress == null))) {
|
|
27927
|
-
|
|
29525
|
+
logger38.throwArgumentError("provider mismatch", "networks", networks2);
|
|
27928
29526
|
}
|
|
27929
29527
|
} else {
|
|
27930
29528
|
result = network;
|
|
@@ -28125,7 +29723,7 @@ function getProcessFunc(provider, method, params) {
|
|
|
28125
29723
|
return normalizedTally(normalize2, provider.quorum);
|
|
28126
29724
|
}
|
|
28127
29725
|
function waitForSync(config, blockNumber) {
|
|
28128
|
-
return
|
|
29726
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
28129
29727
|
const provider = config.provider;
|
|
28130
29728
|
if (provider.blockNumber != null && provider.blockNumber >= blockNumber || blockNumber === -1) {
|
|
28131
29729
|
return provider;
|
|
@@ -28146,7 +29744,7 @@ function waitForSync(config, blockNumber) {
|
|
|
28146
29744
|
});
|
|
28147
29745
|
}
|
|
28148
29746
|
function getRunner(config, currentBlockNumber, method, params) {
|
|
28149
|
-
return
|
|
29747
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
28150
29748
|
let provider = config.provider;
|
|
28151
29749
|
switch (method) {
|
|
28152
29750
|
case "getBlockNumber":
|
|
@@ -28194,7 +29792,7 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
28194
29792
|
return provider.getLogs(filter);
|
|
28195
29793
|
}
|
|
28196
29794
|
}
|
|
28197
|
-
return
|
|
29795
|
+
return logger38.throwError("unknown method error", Logger.errors.UNKNOWN_ERROR, {
|
|
28198
29796
|
method,
|
|
28199
29797
|
params
|
|
28200
29798
|
});
|
|
@@ -28203,7 +29801,7 @@ function getRunner(config, currentBlockNumber, method, params) {
|
|
|
28203
29801
|
var FallbackProvider = class extends BaseProvider {
|
|
28204
29802
|
constructor(providers, quorum) {
|
|
28205
29803
|
if (providers.length === 0) {
|
|
28206
|
-
|
|
29804
|
+
logger38.throwArgumentError("missing providers", "providers", providers);
|
|
28207
29805
|
}
|
|
28208
29806
|
const providerConfigs = providers.map((configOrProvider, index) => {
|
|
28209
29807
|
if (Provider.isProvider(configOrProvider)) {
|
|
@@ -28223,7 +29821,7 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28223
29821
|
}
|
|
28224
29822
|
const weight = config.weight;
|
|
28225
29823
|
if (weight % 1 || weight > 512 || weight < 1) {
|
|
28226
|
-
|
|
29824
|
+
logger38.throwArgumentError("invalid weight; must be integer in [1, 512]", `providers[${index}].weight`, weight);
|
|
28227
29825
|
}
|
|
28228
29826
|
return Object.freeze(config);
|
|
28229
29827
|
});
|
|
@@ -28231,7 +29829,7 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28231
29829
|
if (quorum == null) {
|
|
28232
29830
|
quorum = total / 2;
|
|
28233
29831
|
} else if (quorum > total) {
|
|
28234
|
-
|
|
29832
|
+
logger38.throwArgumentError("quorum will always fail; larger than total weight", "quorum", quorum);
|
|
28235
29833
|
}
|
|
28236
29834
|
let networkOrReady = checkNetworks(providerConfigs.map((c) => c.provider.network));
|
|
28237
29835
|
if (networkOrReady == null) {
|
|
@@ -28247,13 +29845,13 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28247
29845
|
this._highestBlockNumber = -1;
|
|
28248
29846
|
}
|
|
28249
29847
|
detectNetwork() {
|
|
28250
|
-
return
|
|
29848
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
28251
29849
|
const networks2 = yield Promise.all(this.providerConfigs.map((c) => c.provider.getNetwork()));
|
|
28252
29850
|
return checkNetworks(networks2);
|
|
28253
29851
|
});
|
|
28254
29852
|
}
|
|
28255
29853
|
perform(method, params) {
|
|
28256
|
-
return
|
|
29854
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
28257
29855
|
if (method === "sendTransaction") {
|
|
28258
29856
|
const results = yield Promise.all(this.providerConfigs.map((c) => {
|
|
28259
29857
|
return c.provider.sendTransaction(params.signedTransaction).then((result) => {
|
|
@@ -28388,7 +29986,7 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28388
29986
|
}
|
|
28389
29987
|
props[name] = e[name];
|
|
28390
29988
|
});
|
|
28391
|
-
|
|
29989
|
+
logger38.throwError(e.reason || e.message, errorCode, props);
|
|
28392
29990
|
});
|
|
28393
29991
|
if (configs.filter((c) => !c.done).length === 0) {
|
|
28394
29992
|
break;
|
|
@@ -28400,7 +29998,7 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28400
29998
|
}
|
|
28401
29999
|
c.cancelled = true;
|
|
28402
30000
|
});
|
|
28403
|
-
return
|
|
30001
|
+
return logger38.throwError("failed to meet quorum", Logger.errors.SERVER_ERROR, {
|
|
28404
30002
|
method,
|
|
28405
30003
|
params,
|
|
28406
30004
|
//results: configs.map((c) => c.result),
|
|
@@ -28412,18 +30010,18 @@ var FallbackProvider = class extends BaseProvider {
|
|
|
28412
30010
|
}
|
|
28413
30011
|
};
|
|
28414
30012
|
|
|
28415
|
-
// node_modules
|
|
30013
|
+
// node_modules/@ethersproject/providers/lib.esm/ipc-provider.js
|
|
28416
30014
|
var IpcProvider = null;
|
|
28417
30015
|
|
|
28418
|
-
// node_modules
|
|
28419
|
-
var
|
|
30016
|
+
// node_modules/@ethersproject/providers/lib.esm/infura-provider.js
|
|
30017
|
+
var logger39 = new Logger(version23);
|
|
28420
30018
|
var defaultProjectId = "84842078b09946638c03157f83405213";
|
|
28421
30019
|
var InfuraWebSocketProvider = class extends WebSocketProvider {
|
|
28422
30020
|
constructor(network, apiKey) {
|
|
28423
30021
|
const provider = new InfuraProvider(network, apiKey);
|
|
28424
30022
|
const connection = provider.connection;
|
|
28425
30023
|
if (connection.password) {
|
|
28426
|
-
|
|
30024
|
+
logger39.throwError("INFURA WebSocket project secrets unsupported", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
28427
30025
|
operation: "InfuraProvider.getWebSocketProvider()"
|
|
28428
30026
|
});
|
|
28429
30027
|
}
|
|
@@ -28453,8 +30051,8 @@ var InfuraProvider = class extends UrlJsonRpcProvider {
|
|
|
28453
30051
|
if (typeof apiKey === "string") {
|
|
28454
30052
|
apiKeyObj.projectId = apiKey;
|
|
28455
30053
|
} else if (apiKey.projectSecret != null) {
|
|
28456
|
-
|
|
28457
|
-
|
|
30054
|
+
logger39.assertArgument(typeof apiKey.projectId === "string", "projectSecret requires a projectId", "projectId", apiKey.projectId);
|
|
30055
|
+
logger39.assertArgument(typeof apiKey.projectSecret === "string", "invalid projectSecret", "projectSecret", "[REDACTED]");
|
|
28458
30056
|
apiKeyObj.projectId = apiKey.projectId;
|
|
28459
30057
|
apiKeyObj.projectSecret = apiKey.projectSecret;
|
|
28460
30058
|
} else if (apiKey.projectId) {
|
|
@@ -28500,7 +30098,7 @@ var InfuraProvider = class extends UrlJsonRpcProvider {
|
|
|
28500
30098
|
host = "arbitrum-sepolia.infura.io";
|
|
28501
30099
|
break;
|
|
28502
30100
|
default:
|
|
28503
|
-
|
|
30101
|
+
logger39.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
28504
30102
|
argument: "network",
|
|
28505
30103
|
value: network
|
|
28506
30104
|
});
|
|
@@ -28526,7 +30124,7 @@ var InfuraProvider = class extends UrlJsonRpcProvider {
|
|
|
28526
30124
|
}
|
|
28527
30125
|
};
|
|
28528
30126
|
|
|
28529
|
-
// node_modules
|
|
30127
|
+
// node_modules/@ethersproject/providers/lib.esm/json-rpc-batch-provider.js
|
|
28530
30128
|
var JsonRpcBatchProvider = class extends JsonRpcProvider {
|
|
28531
30129
|
send(method, params) {
|
|
28532
30130
|
const request = {
|
|
@@ -28590,18 +30188,18 @@ var JsonRpcBatchProvider = class extends JsonRpcProvider {
|
|
|
28590
30188
|
}
|
|
28591
30189
|
};
|
|
28592
30190
|
|
|
28593
|
-
// node_modules
|
|
28594
|
-
var
|
|
30191
|
+
// node_modules/@ethersproject/providers/lib.esm/nodesmith-provider.js
|
|
30192
|
+
var logger40 = new Logger(version23);
|
|
28595
30193
|
var defaultApiKey3 = "ETHERS_JS_SHARED";
|
|
28596
30194
|
var NodesmithProvider = class extends UrlJsonRpcProvider {
|
|
28597
30195
|
static getApiKey(apiKey) {
|
|
28598
30196
|
if (apiKey && typeof apiKey !== "string") {
|
|
28599
|
-
|
|
30197
|
+
logger40.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
28600
30198
|
}
|
|
28601
30199
|
return apiKey || defaultApiKey3;
|
|
28602
30200
|
}
|
|
28603
30201
|
static getUrl(network, apiKey) {
|
|
28604
|
-
|
|
30202
|
+
logger40.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");
|
|
28605
30203
|
let host = null;
|
|
28606
30204
|
switch (network.name) {
|
|
28607
30205
|
case "homestead":
|
|
@@ -28620,14 +30218,14 @@ var NodesmithProvider = class extends UrlJsonRpcProvider {
|
|
|
28620
30218
|
host = "https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";
|
|
28621
30219
|
break;
|
|
28622
30220
|
default:
|
|
28623
|
-
|
|
30221
|
+
logger40.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
28624
30222
|
}
|
|
28625
30223
|
return host + "?apiKey=" + apiKey;
|
|
28626
30224
|
}
|
|
28627
30225
|
};
|
|
28628
30226
|
|
|
28629
|
-
// node_modules
|
|
28630
|
-
var
|
|
30227
|
+
// node_modules/@ethersproject/providers/lib.esm/pocket-provider.js
|
|
30228
|
+
var logger41 = new Logger(version23);
|
|
28631
30229
|
var defaultApplicationId = "62e1ad51b37b8e00394bda3b";
|
|
28632
30230
|
var PocketProvider = class extends UrlJsonRpcProvider {
|
|
28633
30231
|
static getApiKey(apiKey) {
|
|
@@ -28646,7 +30244,7 @@ var PocketProvider = class extends UrlJsonRpcProvider {
|
|
|
28646
30244
|
} else if (apiKey.applicationId) {
|
|
28647
30245
|
apiKeyObj.applicationId = apiKey.applicationId;
|
|
28648
30246
|
} else {
|
|
28649
|
-
|
|
30247
|
+
logger41.throwArgumentError("unsupported PocketProvider apiKey", "apiKey", apiKey);
|
|
28650
30248
|
}
|
|
28651
30249
|
return apiKeyObj;
|
|
28652
30250
|
}
|
|
@@ -28675,7 +30273,7 @@ var PocketProvider = class extends UrlJsonRpcProvider {
|
|
|
28675
30273
|
host = "eth-ropsten.gateway.pokt.network";
|
|
28676
30274
|
break;
|
|
28677
30275
|
default:
|
|
28678
|
-
|
|
30276
|
+
logger41.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
|
|
28679
30277
|
argument: "network",
|
|
28680
30278
|
value: network
|
|
28681
30279
|
});
|
|
@@ -28693,13 +30291,13 @@ var PocketProvider = class extends UrlJsonRpcProvider {
|
|
|
28693
30291
|
}
|
|
28694
30292
|
};
|
|
28695
30293
|
|
|
28696
|
-
// node_modules
|
|
28697
|
-
var
|
|
30294
|
+
// node_modules/@ethersproject/providers/lib.esm/quicknode-provider.js
|
|
30295
|
+
var logger42 = new Logger(version23);
|
|
28698
30296
|
var defaultApiKey4 = "919b412a057b5e9c9b6dce193c5a60242d6efadb";
|
|
28699
30297
|
var QuickNodeProvider = class extends UrlJsonRpcProvider {
|
|
28700
30298
|
static getApiKey(apiKey) {
|
|
28701
30299
|
if (apiKey && typeof apiKey !== "string") {
|
|
28702
|
-
|
|
30300
|
+
logger42.throwArgumentError("invalid apiKey", "apiKey", apiKey);
|
|
28703
30301
|
}
|
|
28704
30302
|
return apiKey || defaultApiKey4;
|
|
28705
30303
|
}
|
|
@@ -28761,14 +30359,14 @@ var QuickNodeProvider = class extends UrlJsonRpcProvider {
|
|
|
28761
30359
|
host = "ethers.xdai.quiknode.pro";
|
|
28762
30360
|
break;
|
|
28763
30361
|
default:
|
|
28764
|
-
|
|
30362
|
+
logger42.throwArgumentError("unsupported network", "network", arguments[0]);
|
|
28765
30363
|
}
|
|
28766
30364
|
return "https://" + host + "/" + apiKey;
|
|
28767
30365
|
}
|
|
28768
30366
|
};
|
|
28769
30367
|
|
|
28770
|
-
// node_modules
|
|
28771
|
-
var
|
|
30368
|
+
// node_modules/@ethersproject/providers/lib.esm/web3-provider.js
|
|
30369
|
+
var logger43 = new Logger(version23);
|
|
28772
30370
|
var _nextId = 1;
|
|
28773
30371
|
function buildWeb3LegacyFetcher(provider, sendFunc) {
|
|
28774
30372
|
const fetcher = "Web3LegacyFetcher";
|
|
@@ -28851,7 +30449,7 @@ function buildEip1193Fetcher(provider) {
|
|
|
28851
30449
|
var Web3Provider = class extends JsonRpcProvider {
|
|
28852
30450
|
constructor(provider, network) {
|
|
28853
30451
|
if (provider == null) {
|
|
28854
|
-
|
|
30452
|
+
logger43.throwArgumentError("missing provider", "provider", provider);
|
|
28855
30453
|
}
|
|
28856
30454
|
let path2 = null;
|
|
28857
30455
|
let jsonRpcFetchFunc = null;
|
|
@@ -28875,7 +30473,7 @@ var Web3Provider = class extends JsonRpcProvider {
|
|
|
28875
30473
|
} else if (provider.send) {
|
|
28876
30474
|
jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));
|
|
28877
30475
|
} else {
|
|
28878
|
-
|
|
30476
|
+
logger43.throwArgumentError("unsupported provider", "provider", provider);
|
|
28879
30477
|
}
|
|
28880
30478
|
if (!path2) {
|
|
28881
30479
|
path2 = "unknown:";
|
|
@@ -28890,8 +30488,8 @@ var Web3Provider = class extends JsonRpcProvider {
|
|
|
28890
30488
|
}
|
|
28891
30489
|
};
|
|
28892
30490
|
|
|
28893
|
-
// node_modules
|
|
28894
|
-
var
|
|
30491
|
+
// node_modules/@ethersproject/providers/lib.esm/index.js
|
|
30492
|
+
var logger44 = new Logger(version23);
|
|
28895
30493
|
function getDefaultProvider(network, options) {
|
|
28896
30494
|
if (network == null) {
|
|
28897
30495
|
network = "homestead";
|
|
@@ -28907,13 +30505,13 @@ function getDefaultProvider(network, options) {
|
|
|
28907
30505
|
case "wss":
|
|
28908
30506
|
return new WebSocketProvider(network);
|
|
28909
30507
|
default:
|
|
28910
|
-
|
|
30508
|
+
logger44.throwArgumentError("unsupported URL scheme", "network", network);
|
|
28911
30509
|
}
|
|
28912
30510
|
}
|
|
28913
30511
|
}
|
|
28914
30512
|
const n = getNetwork(network);
|
|
28915
30513
|
if (!n || !n._defaultProvider) {
|
|
28916
|
-
|
|
30514
|
+
logger44.throwError("unsupported getDefaultProvider network", Logger.errors.NETWORK_ERROR, {
|
|
28917
30515
|
operation: "getDefaultProvider",
|
|
28918
30516
|
network
|
|
28919
30517
|
});
|
|
@@ -29039,14 +30637,14 @@ __export(utils_exports, {
|
|
|
29039
30637
|
});
|
|
29040
30638
|
|
|
29041
30639
|
// node_modules/@ethersproject/solidity/lib.esm/_version.js
|
|
29042
|
-
var
|
|
30640
|
+
var version24 = "solidity/5.8.0";
|
|
29043
30641
|
|
|
29044
30642
|
// node_modules/@ethersproject/solidity/lib.esm/index.js
|
|
29045
30643
|
var regexBytes = new RegExp("^bytes([0-9]+)$");
|
|
29046
30644
|
var regexNumber = new RegExp("^(u?int)([0-9]*)$");
|
|
29047
30645
|
var regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$");
|
|
29048
30646
|
var Zeros2 = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
29049
|
-
var
|
|
30647
|
+
var logger45 = new Logger(version24);
|
|
29050
30648
|
function _pack(type, value, isArray) {
|
|
29051
30649
|
switch (type) {
|
|
29052
30650
|
case "address":
|
|
@@ -29069,7 +30667,7 @@ function _pack(type, value, isArray) {
|
|
|
29069
30667
|
if (match2) {
|
|
29070
30668
|
let size = parseInt(match2[2] || "256");
|
|
29071
30669
|
if (match2[2] && String(size) !== match2[2] || size % 8 !== 0 || size === 0 || size > 256) {
|
|
29072
|
-
|
|
30670
|
+
logger45.throwArgumentError("invalid number type", "type", type);
|
|
29073
30671
|
}
|
|
29074
30672
|
if (isArray) {
|
|
29075
30673
|
size = 256;
|
|
@@ -29081,10 +30679,10 @@ function _pack(type, value, isArray) {
|
|
|
29081
30679
|
if (match2) {
|
|
29082
30680
|
const size = parseInt(match2[1]);
|
|
29083
30681
|
if (String(size) !== match2[1] || size === 0 || size > 32) {
|
|
29084
|
-
|
|
30682
|
+
logger45.throwArgumentError("invalid bytes type", "type", type);
|
|
29085
30683
|
}
|
|
29086
30684
|
if (arrayify(value).byteLength !== size) {
|
|
29087
|
-
|
|
30685
|
+
logger45.throwArgumentError(`invalid value for ${type}`, "value", value);
|
|
29088
30686
|
}
|
|
29089
30687
|
if (isArray) {
|
|
29090
30688
|
return arrayify((value + Zeros2).substring(0, 66));
|
|
@@ -29096,7 +30694,7 @@ function _pack(type, value, isArray) {
|
|
|
29096
30694
|
const baseType = match2[1];
|
|
29097
30695
|
const count = parseInt(match2[2] || String(value.length));
|
|
29098
30696
|
if (count != value.length) {
|
|
29099
|
-
|
|
30697
|
+
logger45.throwArgumentError(`invalid array length for ${type}`, "value", value);
|
|
29100
30698
|
}
|
|
29101
30699
|
const result = [];
|
|
29102
30700
|
value.forEach(function(value2) {
|
|
@@ -29104,11 +30702,11 @@ function _pack(type, value, isArray) {
|
|
|
29104
30702
|
});
|
|
29105
30703
|
return concat(result);
|
|
29106
30704
|
}
|
|
29107
|
-
return
|
|
30705
|
+
return logger45.throwArgumentError("invalid type", "type", type);
|
|
29108
30706
|
}
|
|
29109
30707
|
function pack2(types, values) {
|
|
29110
30708
|
if (types.length != values.length) {
|
|
29111
|
-
|
|
30709
|
+
logger45.throwArgumentError("wrong number of values; expected ${ types.length }", "values", values);
|
|
29112
30710
|
}
|
|
29113
30711
|
const tight = [];
|
|
29114
30712
|
types.forEach(function(type, index) {
|
|
@@ -29124,10 +30722,10 @@ function sha2562(types, values) {
|
|
|
29124
30722
|
}
|
|
29125
30723
|
|
|
29126
30724
|
// node_modules/@ethersproject/units/lib.esm/_version.js
|
|
29127
|
-
var
|
|
30725
|
+
var version25 = "units/5.8.0";
|
|
29128
30726
|
|
|
29129
30727
|
// node_modules/@ethersproject/units/lib.esm/index.js
|
|
29130
|
-
var
|
|
30728
|
+
var logger46 = new Logger(version25);
|
|
29131
30729
|
var names = [
|
|
29132
30730
|
"wei",
|
|
29133
30731
|
"kwei",
|
|
@@ -29140,7 +30738,7 @@ var names = [
|
|
|
29140
30738
|
function commify(value) {
|
|
29141
30739
|
const comps = String(value).split(".");
|
|
29142
30740
|
if (comps.length > 2 || !comps[0].match(/^-?[0-9]*$/) || comps[1] && !comps[1].match(/^[0-9]*$/) || value === "." || value === "-.") {
|
|
29143
|
-
|
|
30741
|
+
logger46.throwArgumentError("invalid value", "value", value);
|
|
29144
30742
|
}
|
|
29145
30743
|
let whole = comps[0];
|
|
29146
30744
|
let negative = "";
|
|
@@ -29185,7 +30783,7 @@ function formatUnits(value, unitName) {
|
|
|
29185
30783
|
}
|
|
29186
30784
|
function parseUnits(value, unitName) {
|
|
29187
30785
|
if (typeof value !== "string") {
|
|
29188
|
-
|
|
30786
|
+
logger46.throwArgumentError("value must be a string", "value", value);
|
|
29189
30787
|
}
|
|
29190
30788
|
if (typeof unitName === "string") {
|
|
29191
30789
|
const index = names.indexOf(unitName);
|
|
@@ -29203,10 +30801,10 @@ function parseEther(ether) {
|
|
|
29203
30801
|
}
|
|
29204
30802
|
|
|
29205
30803
|
// node_modules/ethers/lib.esm/_version.js
|
|
29206
|
-
var
|
|
30804
|
+
var version26 = "ethers/5.8.0";
|
|
29207
30805
|
|
|
29208
30806
|
// node_modules/ethers/lib.esm/ethers.js
|
|
29209
|
-
var
|
|
30807
|
+
var logger47 = new Logger(version26);
|
|
29210
30808
|
|
|
29211
30809
|
// node_modules/ethers/lib.esm/index.js
|
|
29212
30810
|
try {
|
|
@@ -31187,6 +32785,7 @@ function createPKPManager(config) {
|
|
|
31187
32785
|
}
|
|
31188
32786
|
|
|
31189
32787
|
// src/modules/loan/loan-creator.module.ts
|
|
32788
|
+
var import_dh_lit_actions = __toESM(require_pkg_src());
|
|
31190
32789
|
var LoanCreator = class {
|
|
31191
32790
|
config;
|
|
31192
32791
|
transactionTimeoutMs;
|
|
@@ -31283,10 +32882,9 @@ var LoanCreator = class {
|
|
|
31283
32882
|
} else if (this.config.litOps.config && pkpValidationRegistryAddress && pkpValidationRegistryAddress !== "0x0000000000000000000000000000000000000000") {
|
|
31284
32883
|
this.config.litOps.config.pkpValidationRegistryAddress = pkpValidationRegistryAddress;
|
|
31285
32884
|
}
|
|
31286
|
-
const { DH_LIT_ACTIONS_CHIPOTLE: DH_LIT_ACTIONS_CHIPOTLE2 } = await import("@gvnrdao/dh-lit-actions");
|
|
31287
32885
|
let certificationCid;
|
|
31288
32886
|
if (isChipotleNetwork) {
|
|
31289
|
-
if (!
|
|
32887
|
+
if (!import_dh_lit_actions.DH_LIT_ACTIONS_CHIPOTLE.btcTransactionSigner?.authorizedCidHex) {
|
|
31290
32888
|
return failure(
|
|
31291
32889
|
new SDKError({
|
|
31292
32890
|
message: "DH_LIT_ACTIONS_CHIPOTLE.btcTransactionSigner.authorizedCidHex is required for loan creation (must match PKPValidation.getCid on-chain).",
|
|
@@ -31295,7 +32893,7 @@ var LoanCreator = class {
|
|
|
31295
32893
|
})
|
|
31296
32894
|
);
|
|
31297
32895
|
}
|
|
31298
|
-
certificationCid =
|
|
32896
|
+
certificationCid = import_dh_lit_actions.DH_LIT_ACTIONS_CHIPOTLE.btcTransactionSigner.authorizedCidHex.toLowerCase();
|
|
31299
32897
|
} else {
|
|
31300
32898
|
throw new SDKError({
|
|
31301
32899
|
message: `Unsupported litNetwork '${litNetwork}' for loan creation. Only the chipotle network is supported.`,
|
|
@@ -34891,8 +36489,8 @@ function createMockTokenManager(config) {
|
|
|
34891
36489
|
}
|
|
34892
36490
|
|
|
34893
36491
|
// src/modules/diamond-hands-sdk.ts
|
|
36492
|
+
var import_dh_lit_actions2 = __toESM(require_pkg_src());
|
|
34894
36493
|
import { LitOps } from "@gvnrdao/dh-lit-ops";
|
|
34895
|
-
import { DH_LIT_ACTIONS_CHIPOTLE } from "@gvnrdao/dh-lit-actions";
|
|
34896
36494
|
|
|
34897
36495
|
// src/utils/telegram-messaging.utils.ts
|
|
34898
36496
|
var TelegramBot = null;
|
|
@@ -35221,7 +36819,6 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
35221
36819
|
network: config.litNetwork || DEFAULT_LIT_NETWORK,
|
|
35222
36820
|
signer: config.mode === "standalone" ? config.litOpsSigner : void 0,
|
|
35223
36821
|
serviceEndpoint: isServiceModeConfig(config) ? config.serviceEndpoint : void 0,
|
|
35224
|
-
serviceAuthToken: isServiceModeConfig(config) ? config.serviceAuthToken : void 0,
|
|
35225
36822
|
debug: config.debug,
|
|
35226
36823
|
litNodeConnectTimeoutMs: config.litNodeConnectTimeoutMs
|
|
35227
36824
|
// TODO Round 2: Add litActionExecution config when added to config.i.ts interface
|
|
@@ -36000,7 +37597,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
36000
37597
|
}
|
|
36001
37598
|
} else {
|
|
36002
37599
|
try {
|
|
36003
|
-
const nagaPkpNftAddress = DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
37600
|
+
const nagaPkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
36004
37601
|
pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
36005
37602
|
position2.pkpId,
|
|
36006
37603
|
this.getProviderOrThrow(),
|
|
@@ -37103,7 +38700,7 @@ Error data: ${errorData || "none"}`
|
|
|
37103
38700
|
wasLiquidated: false
|
|
37104
38701
|
};
|
|
37105
38702
|
}
|
|
37106
|
-
const nagaPkpNftAddressLiq = DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
38703
|
+
const nagaPkpNftAddressLiq = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
37107
38704
|
const pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
37108
38705
|
position.pkpId,
|
|
37109
38706
|
this.getProviderOrThrow(),
|
|
@@ -39184,7 +40781,7 @@ Error data: ${errorData || "none"}`
|
|
|
39184
40781
|
}
|
|
39185
40782
|
} else {
|
|
39186
40783
|
try {
|
|
39187
|
-
const nagaPkpNftAddress = DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
40784
|
+
const nagaPkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
39188
40785
|
pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
39189
40786
|
position.pkpId,
|
|
39190
40787
|
this.getProviderOrThrow(),
|
|
@@ -39815,7 +41412,7 @@ Error data: ${errorData || "none"}`
|
|
|
39815
41412
|
} else {
|
|
39816
41413
|
try {
|
|
39817
41414
|
const pkpId = position.pkpId;
|
|
39818
|
-
const nagaPkpNftAddress = DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
41415
|
+
const nagaPkpNftAddress = import_dh_lit_actions2.DH_LIT_ACTIONS_CHIPOTLE.pkpValidator?.pkp?.ethAddress ?? "";
|
|
39819
41416
|
pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
39820
41417
|
pkpId,
|
|
39821
41418
|
this.getProviderOrThrow(),
|