punkkit-sdk 1.0.14 → 1.0.16
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 +241 -248
- package/dist/index.mjs +241 -248
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4363,11 +4363,11 @@ var init_lib4 = __esm({
|
|
|
4363
4363
|
init_version4();
|
|
4364
4364
|
__awaiter = function(thisArg, _arguments, P, generator) {
|
|
4365
4365
|
function adopt(value) {
|
|
4366
|
-
return value instanceof P ? value : new P(function(
|
|
4367
|
-
|
|
4366
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
4367
|
+
resolve(value);
|
|
4368
4368
|
});
|
|
4369
4369
|
}
|
|
4370
|
-
return new (P || (P = Promise))(function(
|
|
4370
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
4371
4371
|
function fulfilled(value) {
|
|
4372
4372
|
try {
|
|
4373
4373
|
step(generator.next(value));
|
|
@@ -4383,7 +4383,7 @@ var init_lib4 = __esm({
|
|
|
4383
4383
|
}
|
|
4384
4384
|
}
|
|
4385
4385
|
function step(result) {
|
|
4386
|
-
result.done ?
|
|
4386
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
4387
4387
|
}
|
|
4388
4388
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
4389
4389
|
});
|
|
@@ -5231,12 +5231,12 @@ var init_fragments = __esm({
|
|
|
5231
5231
|
// node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js
|
|
5232
5232
|
function checkResultErrors(result) {
|
|
5233
5233
|
const errors = [];
|
|
5234
|
-
const checkErrors = function(
|
|
5234
|
+
const checkErrors = function(path, object) {
|
|
5235
5235
|
if (!Array.isArray(object)) {
|
|
5236
5236
|
return;
|
|
5237
5237
|
}
|
|
5238
5238
|
for (let key3 in object) {
|
|
5239
|
-
const childPath =
|
|
5239
|
+
const childPath = path.slice();
|
|
5240
5240
|
childPath.push(key3);
|
|
5241
5241
|
try {
|
|
5242
5242
|
checkErrors(childPath, object[key3]);
|
|
@@ -7695,11 +7695,11 @@ var init_typed_data = __esm({
|
|
|
7695
7695
|
init_id();
|
|
7696
7696
|
__awaiter2 = function(thisArg, _arguments, P, generator) {
|
|
7697
7697
|
function adopt(value) {
|
|
7698
|
-
return value instanceof P ? value : new P(function(
|
|
7699
|
-
|
|
7698
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
7699
|
+
resolve(value);
|
|
7700
7700
|
});
|
|
7701
7701
|
}
|
|
7702
|
-
return new (P || (P = Promise))(function(
|
|
7702
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
7703
7703
|
function fulfilled(value) {
|
|
7704
7704
|
try {
|
|
7705
7705
|
step(generator.next(value));
|
|
@@ -7715,7 +7715,7 @@ var init_typed_data = __esm({
|
|
|
7715
7715
|
}
|
|
7716
7716
|
}
|
|
7717
7717
|
function step(result) {
|
|
7718
|
-
result.done ?
|
|
7718
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
7719
7719
|
}
|
|
7720
7720
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7721
7721
|
});
|
|
@@ -8656,11 +8656,11 @@ var init_lib14 = __esm({
|
|
|
8656
8656
|
init_version10();
|
|
8657
8657
|
__awaiter3 = function(thisArg, _arguments, P, generator) {
|
|
8658
8658
|
function adopt(value) {
|
|
8659
|
-
return value instanceof P ? value : new P(function(
|
|
8660
|
-
|
|
8659
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
8660
|
+
resolve(value);
|
|
8661
8661
|
});
|
|
8662
8662
|
}
|
|
8663
|
-
return new (P || (P = Promise))(function(
|
|
8663
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
8664
8664
|
function fulfilled(value) {
|
|
8665
8665
|
try {
|
|
8666
8666
|
step(generator.next(value));
|
|
@@ -8676,7 +8676,7 @@ var init_lib14 = __esm({
|
|
|
8676
8676
|
}
|
|
8677
8677
|
}
|
|
8678
8678
|
function step(result) {
|
|
8679
|
-
result.done ?
|
|
8679
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
8680
8680
|
}
|
|
8681
8681
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8682
8682
|
});
|
|
@@ -8743,11 +8743,11 @@ var init_lib15 = __esm({
|
|
|
8743
8743
|
init_version11();
|
|
8744
8744
|
__awaiter4 = function(thisArg, _arguments, P, generator) {
|
|
8745
8745
|
function adopt(value) {
|
|
8746
|
-
return value instanceof P ? value : new P(function(
|
|
8747
|
-
|
|
8746
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
8747
|
+
resolve(value);
|
|
8748
8748
|
});
|
|
8749
8749
|
}
|
|
8750
|
-
return new (P || (P = Promise))(function(
|
|
8750
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
8751
8751
|
function fulfilled(value) {
|
|
8752
8752
|
try {
|
|
8753
8753
|
step(generator.next(value));
|
|
@@ -8763,7 +8763,7 @@ var init_lib15 = __esm({
|
|
|
8763
8763
|
}
|
|
8764
8764
|
}
|
|
8765
8765
|
function step(result) {
|
|
8766
|
-
result.done ?
|
|
8766
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
8767
8767
|
}
|
|
8768
8768
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8769
8769
|
});
|
|
@@ -10738,8 +10738,8 @@ function createCommonjsModule(fn, basedir, module2) {
|
|
|
10738
10738
|
return module2 = {
|
|
10739
10739
|
path: basedir,
|
|
10740
10740
|
exports: {},
|
|
10741
|
-
require: function(
|
|
10742
|
-
return commonjsRequire(
|
|
10741
|
+
require: function(path, base3) {
|
|
10742
|
+
return commonjsRequire(path, base3 === void 0 || base3 === null ? module2.path : base3);
|
|
10743
10743
|
}
|
|
10744
10744
|
}, fn(module2, module2.exports), module2.exports;
|
|
10745
10745
|
}
|
|
@@ -13432,11 +13432,11 @@ var init_lib18 = __esm({
|
|
|
13432
13432
|
init_version14();
|
|
13433
13433
|
__awaiter5 = function(thisArg, _arguments, P, generator) {
|
|
13434
13434
|
function adopt(value) {
|
|
13435
|
-
return value instanceof P ? value : new P(function(
|
|
13436
|
-
|
|
13435
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
13436
|
+
resolve(value);
|
|
13437
13437
|
});
|
|
13438
13438
|
}
|
|
13439
|
-
return new (P || (P = Promise))(function(
|
|
13439
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
13440
13440
|
function fulfilled(value) {
|
|
13441
13441
|
try {
|
|
13442
13442
|
step(generator.next(value));
|
|
@@ -13452,7 +13452,7 @@ var init_lib18 = __esm({
|
|
|
13452
13452
|
}
|
|
13453
13453
|
}
|
|
13454
13454
|
function step(result) {
|
|
13455
|
-
result.done ?
|
|
13455
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
13456
13456
|
}
|
|
13457
13457
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13458
13458
|
});
|
|
@@ -15528,11 +15528,11 @@ var init_lib22 = __esm({
|
|
|
15528
15528
|
init_version18();
|
|
15529
15529
|
__awaiter6 = function(thisArg, _arguments, P, generator) {
|
|
15530
15530
|
function adopt(value) {
|
|
15531
|
-
return value instanceof P ? value : new P(function(
|
|
15532
|
-
|
|
15531
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
15532
|
+
resolve(value);
|
|
15533
15533
|
});
|
|
15534
15534
|
}
|
|
15535
|
-
return new (P || (P = Promise))(function(
|
|
15535
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
15536
15536
|
function fulfilled(value) {
|
|
15537
15537
|
try {
|
|
15538
15538
|
step(generator.next(value));
|
|
@@ -15548,7 +15548,7 @@ var init_lib22 = __esm({
|
|
|
15548
15548
|
}
|
|
15549
15549
|
}
|
|
15550
15550
|
function step(result) {
|
|
15551
|
-
result.done ?
|
|
15551
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
15552
15552
|
}
|
|
15553
15553
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15554
15554
|
});
|
|
@@ -15584,11 +15584,11 @@ var init_lib23 = __esm({
|
|
|
15584
15584
|
init_version19();
|
|
15585
15585
|
__awaiter7 = function(thisArg, _arguments, P, generator) {
|
|
15586
15586
|
function adopt(value) {
|
|
15587
|
-
return value instanceof P ? value : new P(function(
|
|
15588
|
-
|
|
15587
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
15588
|
+
resolve(value);
|
|
15589
15589
|
});
|
|
15590
15590
|
}
|
|
15591
|
-
return new (P || (P = Promise))(function(
|
|
15591
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
15592
15592
|
function fulfilled(value) {
|
|
15593
15593
|
try {
|
|
15594
15594
|
step(generator.next(value));
|
|
@@ -15604,7 +15604,7 @@ var init_lib23 = __esm({
|
|
|
15604
15604
|
}
|
|
15605
15605
|
}
|
|
15606
15606
|
function step(result) {
|
|
15607
|
-
result.done ?
|
|
15607
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
15608
15608
|
}
|
|
15609
15609
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15610
15610
|
});
|
|
@@ -16389,9 +16389,9 @@ var init_lib28 = __esm({
|
|
|
16389
16389
|
if (index > 4294967295) {
|
|
16390
16390
|
throw new Error("invalid index - " + String(index));
|
|
16391
16391
|
}
|
|
16392
|
-
let
|
|
16393
|
-
if (
|
|
16394
|
-
|
|
16392
|
+
let path = this.path;
|
|
16393
|
+
if (path) {
|
|
16394
|
+
path += "/" + (index & ~HardenedBit);
|
|
16395
16395
|
}
|
|
16396
16396
|
const data = new Uint8Array(37);
|
|
16397
16397
|
if (index & HardenedBit) {
|
|
@@ -16399,8 +16399,8 @@ var init_lib28 = __esm({
|
|
|
16399
16399
|
throw new Error("cannot derive child of neutered node");
|
|
16400
16400
|
}
|
|
16401
16401
|
data.set(arrayify(this.privateKey), 1);
|
|
16402
|
-
if (
|
|
16403
|
-
|
|
16402
|
+
if (path) {
|
|
16403
|
+
path += "'";
|
|
16404
16404
|
}
|
|
16405
16405
|
} else {
|
|
16406
16406
|
data.set(arrayify(this.publicKey));
|
|
@@ -16419,21 +16419,21 @@ var init_lib28 = __esm({
|
|
|
16419
16419
|
const ek = new SigningKey(hexlify(IL));
|
|
16420
16420
|
Ki = ek._addPoint(this.publicKey);
|
|
16421
16421
|
}
|
|
16422
|
-
let mnemonicOrPath =
|
|
16422
|
+
let mnemonicOrPath = path;
|
|
16423
16423
|
const srcMnemonic = this.mnemonic;
|
|
16424
16424
|
if (srcMnemonic) {
|
|
16425
16425
|
mnemonicOrPath = Object.freeze({
|
|
16426
16426
|
phrase: srcMnemonic.phrase,
|
|
16427
|
-
path
|
|
16427
|
+
path,
|
|
16428
16428
|
locale: srcMnemonic.locale || "en"
|
|
16429
16429
|
});
|
|
16430
16430
|
}
|
|
16431
16431
|
return new _HDNode(_constructorGuard6, ki, Ki, this.fingerprint, bytes32(IR), index, this.depth + 1, mnemonicOrPath);
|
|
16432
16432
|
}
|
|
16433
|
-
derivePath(
|
|
16434
|
-
const components =
|
|
16433
|
+
derivePath(path) {
|
|
16434
|
+
const components = path.split("/");
|
|
16435
16435
|
if (components.length === 0 || components[0] === "m" && this.depth !== 0) {
|
|
16436
|
-
throw new Error("invalid path - " +
|
|
16436
|
+
throw new Error("invalid path - " + path);
|
|
16437
16437
|
}
|
|
16438
16438
|
if (components[0] === "m") {
|
|
16439
16439
|
components.shift();
|
|
@@ -17168,9 +17168,9 @@ function getPassword(password) {
|
|
|
17168
17168
|
}
|
|
17169
17169
|
return arrayify(password);
|
|
17170
17170
|
}
|
|
17171
|
-
function searchPath(object,
|
|
17171
|
+
function searchPath(object, path) {
|
|
17172
17172
|
let currentChild = object;
|
|
17173
|
-
const comps =
|
|
17173
|
+
const comps = path.toLowerCase().split("/");
|
|
17174
17174
|
for (let i = 0; i < comps.length; i++) {
|
|
17175
17175
|
let matchingChild = null;
|
|
17176
17176
|
for (const key3 in currentChild) {
|
|
@@ -17734,7 +17734,7 @@ var require_scrypt = __commonJS({
|
|
|
17734
17734
|
}
|
|
17735
17735
|
const lib = {
|
|
17736
17736
|
scrypt: function(password, salt, N2, r3, p, dkLen, progressCallback) {
|
|
17737
|
-
return new Promise(function(
|
|
17737
|
+
return new Promise(function(resolve, reject) {
|
|
17738
17738
|
let lastProgress = 0;
|
|
17739
17739
|
if (progressCallback) {
|
|
17740
17740
|
progressCallback(0);
|
|
@@ -17746,7 +17746,7 @@ var require_scrypt = __commonJS({
|
|
|
17746
17746
|
if (progressCallback && lastProgress !== 1) {
|
|
17747
17747
|
progressCallback(1);
|
|
17748
17748
|
}
|
|
17749
|
-
|
|
17749
|
+
resolve(new Uint8Array(key3));
|
|
17750
17750
|
} else if (progressCallback && progress !== lastProgress) {
|
|
17751
17751
|
lastProgress = progress;
|
|
17752
17752
|
return progressCallback(progress);
|
|
@@ -17819,12 +17819,12 @@ function _getAccount(data, key3) {
|
|
|
17819
17819
|
const mnemonicIv = looseArrayify(searchPath(data, "x-ethers/mnemonicCounter"));
|
|
17820
17820
|
const mnemonicCounter = new import_aes_js2.default.Counter(mnemonicIv);
|
|
17821
17821
|
const mnemonicAesCtr = new import_aes_js2.default.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);
|
|
17822
|
-
const
|
|
17822
|
+
const path = searchPath(data, "x-ethers/path") || defaultPath;
|
|
17823
17823
|
const locale = searchPath(data, "x-ethers/locale") || "en";
|
|
17824
17824
|
const entropy = arrayify(mnemonicAesCtr.decrypt(mnemonicCiphertext));
|
|
17825
17825
|
try {
|
|
17826
17826
|
const mnemonic = entropyToMnemonic(entropy, locale);
|
|
17827
|
-
const node = HDNode.fromMnemonic(mnemonic, null, locale).derivePath(
|
|
17827
|
+
const node = HDNode.fromMnemonic(mnemonic, null, locale).derivePath(path);
|
|
17828
17828
|
if (node.privateKey != account.privateKey) {
|
|
17829
17829
|
throw new Error("mnemonic mismatch");
|
|
17830
17830
|
}
|
|
@@ -17924,12 +17924,12 @@ function encrypt(account, password, options, progressCallback) {
|
|
|
17924
17924
|
const privateKey = arrayify(account.privateKey);
|
|
17925
17925
|
const passwordBytes = getPassword(password);
|
|
17926
17926
|
let entropy = null;
|
|
17927
|
-
let
|
|
17927
|
+
let path = null;
|
|
17928
17928
|
let locale = null;
|
|
17929
17929
|
if (hasMnemonic(account)) {
|
|
17930
17930
|
const srcMnemonic = account.mnemonic;
|
|
17931
17931
|
entropy = arrayify(mnemonicToEntropy(srcMnemonic.phrase, srcMnemonic.locale || "en"));
|
|
17932
|
-
|
|
17932
|
+
path = srcMnemonic.path || defaultPath;
|
|
17933
17933
|
locale = srcMnemonic.locale || "en";
|
|
17934
17934
|
}
|
|
17935
17935
|
let client = options.client;
|
|
@@ -18015,7 +18015,7 @@ function encrypt(account, password, options, progressCallback) {
|
|
|
18015
18015
|
gethFilename: "UTC--" + timestamp + "--" + data.address,
|
|
18016
18016
|
mnemonicCounter: hexlify(mnemonicIv).substring(2),
|
|
18017
18017
|
mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),
|
|
18018
|
-
path
|
|
18018
|
+
path,
|
|
18019
18019
|
locale,
|
|
18020
18020
|
version: "0.1"
|
|
18021
18021
|
};
|
|
@@ -18042,11 +18042,11 @@ var init_keystore = __esm({
|
|
|
18042
18042
|
init_version24();
|
|
18043
18043
|
__awaiter8 = function(thisArg, _arguments, P, generator) {
|
|
18044
18044
|
function adopt(value) {
|
|
18045
|
-
return value instanceof P ? value : new P(function(
|
|
18046
|
-
|
|
18045
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
18046
|
+
resolve(value);
|
|
18047
18047
|
});
|
|
18048
18048
|
}
|
|
18049
|
-
return new (P || (P = Promise))(function(
|
|
18049
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
18050
18050
|
function fulfilled(value) {
|
|
18051
18051
|
try {
|
|
18052
18052
|
step(generator.next(value));
|
|
@@ -18062,7 +18062,7 @@ var init_keystore = __esm({
|
|
|
18062
18062
|
}
|
|
18063
18063
|
}
|
|
18064
18064
|
function step(result) {
|
|
18065
|
-
result.done ?
|
|
18065
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
18066
18066
|
}
|
|
18067
18067
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18068
18068
|
});
|
|
@@ -18154,11 +18154,11 @@ var init_lib31 = __esm({
|
|
|
18154
18154
|
init_version25();
|
|
18155
18155
|
__awaiter9 = function(thisArg, _arguments, P, generator) {
|
|
18156
18156
|
function adopt(value) {
|
|
18157
|
-
return value instanceof P ? value : new P(function(
|
|
18158
|
-
|
|
18157
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
18158
|
+
resolve(value);
|
|
18159
18159
|
});
|
|
18160
18160
|
}
|
|
18161
|
-
return new (P || (P = Promise))(function(
|
|
18161
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
18162
18162
|
function fulfilled(value) {
|
|
18163
18163
|
try {
|
|
18164
18164
|
step(generator.next(value));
|
|
@@ -18174,7 +18174,7 @@ var init_lib31 = __esm({
|
|
|
18174
18174
|
}
|
|
18175
18175
|
}
|
|
18176
18176
|
function step(result) {
|
|
18177
|
-
result.done ?
|
|
18177
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
18178
18178
|
}
|
|
18179
18179
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18180
18180
|
});
|
|
@@ -18309,11 +18309,11 @@ var init_lib31 = __esm({
|
|
|
18309
18309
|
static fromEncryptedJsonSync(json, password) {
|
|
18310
18310
|
return new _Wallet(decryptJsonWalletSync(json, password));
|
|
18311
18311
|
}
|
|
18312
|
-
static fromMnemonic(mnemonic,
|
|
18313
|
-
if (!
|
|
18314
|
-
|
|
18312
|
+
static fromMnemonic(mnemonic, path, wordlist2) {
|
|
18313
|
+
if (!path) {
|
|
18314
|
+
path = defaultPath;
|
|
18315
18315
|
}
|
|
18316
|
-
return new _Wallet(HDNode.fromMnemonic(mnemonic, null, wordlist2).derivePath(
|
|
18316
|
+
return new _Wallet(HDNode.fromMnemonic(mnemonic, null, wordlist2).derivePath(path));
|
|
18317
18317
|
}
|
|
18318
18318
|
};
|
|
18319
18319
|
}
|
|
@@ -18722,11 +18722,11 @@ var init_geturl = __esm({
|
|
|
18722
18722
|
init_lib2();
|
|
18723
18723
|
__awaiter10 = function(thisArg, _arguments, P, generator) {
|
|
18724
18724
|
function adopt(value) {
|
|
18725
|
-
return value instanceof P ? value : new P(function(
|
|
18726
|
-
|
|
18725
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
18726
|
+
resolve(value);
|
|
18727
18727
|
});
|
|
18728
18728
|
}
|
|
18729
|
-
return new (P || (P = Promise))(function(
|
|
18729
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
18730
18730
|
function fulfilled(value) {
|
|
18731
18731
|
try {
|
|
18732
18732
|
step(generator.next(value));
|
|
@@ -18742,7 +18742,7 @@ var init_geturl = __esm({
|
|
|
18742
18742
|
}
|
|
18743
18743
|
}
|
|
18744
18744
|
function step(result) {
|
|
18745
|
-
result.done ?
|
|
18745
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
18746
18746
|
}
|
|
18747
18747
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18748
18748
|
});
|
|
@@ -18752,8 +18752,8 @@ var init_geturl = __esm({
|
|
|
18752
18752
|
|
|
18753
18753
|
// node_modules/@ethersproject/web/lib.esm/index.js
|
|
18754
18754
|
function staller(duration) {
|
|
18755
|
-
return new Promise((
|
|
18756
|
-
setTimeout(
|
|
18755
|
+
return new Promise((resolve) => {
|
|
18756
|
+
setTimeout(resolve, duration);
|
|
18757
18757
|
});
|
|
18758
18758
|
}
|
|
18759
18759
|
function bodyify(value, type) {
|
|
@@ -18873,7 +18873,7 @@ function _fetchData(connection, body, processFunc) {
|
|
|
18873
18873
|
options.headers = flatHeaders;
|
|
18874
18874
|
const runningTimeout = (function() {
|
|
18875
18875
|
let timer2 = null;
|
|
18876
|
-
const promise = new Promise(function(
|
|
18876
|
+
const promise = new Promise(function(resolve, reject) {
|
|
18877
18877
|
if (timeout) {
|
|
18878
18878
|
timer2 = setTimeout(() => {
|
|
18879
18879
|
if (timer2 == null) {
|
|
@@ -19043,7 +19043,7 @@ function poll(func, options) {
|
|
|
19043
19043
|
if (options.interval == null) {
|
|
19044
19044
|
options.interval = 250;
|
|
19045
19045
|
}
|
|
19046
|
-
return new Promise(function(
|
|
19046
|
+
return new Promise(function(resolve, reject) {
|
|
19047
19047
|
let timer2 = null;
|
|
19048
19048
|
let done = false;
|
|
19049
19049
|
const cancel = () => {
|
|
@@ -19069,7 +19069,7 @@ function poll(func, options) {
|
|
|
19069
19069
|
return func().then(function(result) {
|
|
19070
19070
|
if (result !== void 0) {
|
|
19071
19071
|
if (cancel()) {
|
|
19072
|
-
|
|
19072
|
+
resolve(result);
|
|
19073
19073
|
}
|
|
19074
19074
|
} else if (options.oncePoll) {
|
|
19075
19075
|
options.oncePoll.once("poll", check);
|
|
@@ -19115,11 +19115,11 @@ var init_lib34 = __esm({
|
|
|
19115
19115
|
init_geturl();
|
|
19116
19116
|
__awaiter11 = function(thisArg, _arguments, P, generator) {
|
|
19117
19117
|
function adopt(value) {
|
|
19118
|
-
return value instanceof P ? value : new P(function(
|
|
19119
|
-
|
|
19118
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
19119
|
+
resolve(value);
|
|
19120
19120
|
});
|
|
19121
19121
|
}
|
|
19122
|
-
return new (P || (P = Promise))(function(
|
|
19122
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
19123
19123
|
function fulfilled(value) {
|
|
19124
19124
|
try {
|
|
19125
19125
|
step(generator.next(value));
|
|
@@ -19135,7 +19135,7 @@ var init_lib34 = __esm({
|
|
|
19135
19135
|
}
|
|
19136
19136
|
}
|
|
19137
19137
|
function step(result) {
|
|
19138
|
-
result.done ?
|
|
19138
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
19139
19139
|
}
|
|
19140
19140
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19141
19141
|
});
|
|
@@ -19801,8 +19801,8 @@ function getTime() {
|
|
|
19801
19801
|
return (/* @__PURE__ */ new Date()).getTime();
|
|
19802
19802
|
}
|
|
19803
19803
|
function stall(duration) {
|
|
19804
|
-
return new Promise((
|
|
19805
|
-
setTimeout(
|
|
19804
|
+
return new Promise((resolve) => {
|
|
19805
|
+
setTimeout(resolve, duration);
|
|
19806
19806
|
});
|
|
19807
19807
|
}
|
|
19808
19808
|
function bytes32ify(value) {
|
|
@@ -19891,11 +19891,11 @@ var init_base_provider = __esm({
|
|
|
19891
19891
|
init_formatter();
|
|
19892
19892
|
__awaiter12 = function(thisArg, _arguments, P, generator) {
|
|
19893
19893
|
function adopt(value) {
|
|
19894
|
-
return value instanceof P ? value : new P(function(
|
|
19895
|
-
|
|
19894
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
19895
|
+
resolve(value);
|
|
19896
19896
|
});
|
|
19897
19897
|
}
|
|
19898
|
-
return new (P || (P = Promise))(function(
|
|
19898
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
19899
19899
|
function fulfilled(value) {
|
|
19900
19900
|
try {
|
|
19901
19901
|
step(generator.next(value));
|
|
@@ -19911,7 +19911,7 @@ var init_base_provider = __esm({
|
|
|
19911
19911
|
}
|
|
19912
19912
|
}
|
|
19913
19913
|
function step(result) {
|
|
19914
|
-
result.done ?
|
|
19914
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
19915
19915
|
}
|
|
19916
19916
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19917
19917
|
});
|
|
@@ -20704,7 +20704,7 @@ var init_base_provider = __esm({
|
|
|
20704
20704
|
if ((receipt ? receipt.confirmations : 0) >= confirmations) {
|
|
20705
20705
|
return receipt;
|
|
20706
20706
|
}
|
|
20707
|
-
return new Promise((
|
|
20707
|
+
return new Promise((resolve, reject) => {
|
|
20708
20708
|
const cancelFuncs = [];
|
|
20709
20709
|
let done = false;
|
|
20710
20710
|
const alreadyDone = function() {
|
|
@@ -20724,7 +20724,7 @@ var init_base_provider = __esm({
|
|
|
20724
20724
|
if (alreadyDone()) {
|
|
20725
20725
|
return;
|
|
20726
20726
|
}
|
|
20727
|
-
|
|
20727
|
+
resolve(receipt2);
|
|
20728
20728
|
};
|
|
20729
20729
|
this.on(transactionHash, minedHandler);
|
|
20730
20730
|
cancelFuncs.push(() => {
|
|
@@ -21673,8 +21673,8 @@ function checkError(method, error, params) {
|
|
|
21673
21673
|
throw error;
|
|
21674
21674
|
}
|
|
21675
21675
|
function timer(timeout) {
|
|
21676
|
-
return new Promise(function(
|
|
21677
|
-
setTimeout(
|
|
21676
|
+
return new Promise(function(resolve) {
|
|
21677
|
+
setTimeout(resolve, timeout);
|
|
21678
21678
|
});
|
|
21679
21679
|
}
|
|
21680
21680
|
function getResult(payload) {
|
|
@@ -21709,11 +21709,11 @@ var init_json_rpc_provider = __esm({
|
|
|
21709
21709
|
init_base_provider();
|
|
21710
21710
|
__awaiter13 = function(thisArg, _arguments, P, generator) {
|
|
21711
21711
|
function adopt(value) {
|
|
21712
|
-
return value instanceof P ? value : new P(function(
|
|
21713
|
-
|
|
21712
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
21713
|
+
resolve(value);
|
|
21714
21714
|
});
|
|
21715
21715
|
}
|
|
21716
|
-
return new (P || (P = Promise))(function(
|
|
21716
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
21717
21717
|
function fulfilled(value) {
|
|
21718
21718
|
try {
|
|
21719
21719
|
step(generator.next(value));
|
|
@@ -21729,7 +21729,7 @@ var init_json_rpc_provider = __esm({
|
|
|
21729
21729
|
}
|
|
21730
21730
|
}
|
|
21731
21731
|
function step(result) {
|
|
21732
|
-
result.done ?
|
|
21732
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
21733
21733
|
}
|
|
21734
21734
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21735
21735
|
});
|
|
@@ -21955,10 +21955,10 @@ var init_json_rpc_provider = __esm({
|
|
|
21955
21955
|
constructor(url, network) {
|
|
21956
21956
|
let networkOrReady = network;
|
|
21957
21957
|
if (networkOrReady == null) {
|
|
21958
|
-
networkOrReady = new Promise((
|
|
21958
|
+
networkOrReady = new Promise((resolve, reject) => {
|
|
21959
21959
|
setTimeout(() => {
|
|
21960
21960
|
this.detectNetwork().then((network2) => {
|
|
21961
|
-
|
|
21961
|
+
resolve(network2);
|
|
21962
21962
|
}, (error) => {
|
|
21963
21963
|
reject(error);
|
|
21964
21964
|
});
|
|
@@ -22285,11 +22285,11 @@ var init_websocket_provider = __esm({
|
|
|
22285
22285
|
init_version28();
|
|
22286
22286
|
__awaiter14 = function(thisArg, _arguments, P, generator) {
|
|
22287
22287
|
function adopt(value) {
|
|
22288
|
-
return value instanceof P ? value : new P(function(
|
|
22289
|
-
|
|
22288
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
22289
|
+
resolve(value);
|
|
22290
22290
|
});
|
|
22291
22291
|
}
|
|
22292
|
-
return new (P || (P = Promise))(function(
|
|
22292
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
22293
22293
|
function fulfilled(value) {
|
|
22294
22294
|
try {
|
|
22295
22295
|
step(generator.next(value));
|
|
@@ -22305,7 +22305,7 @@ var init_websocket_provider = __esm({
|
|
|
22305
22305
|
}
|
|
22306
22306
|
}
|
|
22307
22307
|
function step(result) {
|
|
22308
|
-
result.done ?
|
|
22308
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
22309
22309
|
}
|
|
22310
22310
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22311
22311
|
});
|
|
@@ -22425,12 +22425,12 @@ var init_websocket_provider = __esm({
|
|
|
22425
22425
|
}
|
|
22426
22426
|
send(method, params) {
|
|
22427
22427
|
const rid = NextId++;
|
|
22428
|
-
return new Promise((
|
|
22428
|
+
return new Promise((resolve, reject) => {
|
|
22429
22429
|
function callback(error, result) {
|
|
22430
22430
|
if (error) {
|
|
22431
22431
|
return reject(error);
|
|
22432
22432
|
}
|
|
22433
|
-
return
|
|
22433
|
+
return resolve(result);
|
|
22434
22434
|
}
|
|
22435
22435
|
const payload = JSON.stringify({
|
|
22436
22436
|
method,
|
|
@@ -22541,12 +22541,12 @@ var init_websocket_provider = __esm({
|
|
|
22541
22541
|
destroy() {
|
|
22542
22542
|
return __awaiter14(this, void 0, void 0, function* () {
|
|
22543
22543
|
if (this.websocket.readyState === WS.CONNECTING) {
|
|
22544
|
-
yield new Promise((
|
|
22544
|
+
yield new Promise((resolve) => {
|
|
22545
22545
|
this.websocket.onopen = function() {
|
|
22546
|
-
|
|
22546
|
+
resolve(true);
|
|
22547
22547
|
};
|
|
22548
22548
|
this.websocket.onerror = function() {
|
|
22549
|
-
|
|
22549
|
+
resolve(false);
|
|
22550
22550
|
};
|
|
22551
22551
|
});
|
|
22552
22552
|
}
|
|
@@ -22568,11 +22568,11 @@ var init_url_json_rpc_provider = __esm({
|
|
|
22568
22568
|
init_json_rpc_provider();
|
|
22569
22569
|
__awaiter15 = function(thisArg, _arguments, P, generator) {
|
|
22570
22570
|
function adopt(value) {
|
|
22571
|
-
return value instanceof P ? value : new P(function(
|
|
22572
|
-
|
|
22571
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
22572
|
+
resolve(value);
|
|
22573
22573
|
});
|
|
22574
22574
|
}
|
|
22575
|
-
return new (P || (P = Promise))(function(
|
|
22575
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
22576
22576
|
function fulfilled(value) {
|
|
22577
22577
|
try {
|
|
22578
22578
|
step(generator.next(value));
|
|
@@ -22588,7 +22588,7 @@ var init_url_json_rpc_provider = __esm({
|
|
|
22588
22588
|
}
|
|
22589
22589
|
}
|
|
22590
22590
|
function step(result) {
|
|
22591
|
-
result.done ?
|
|
22591
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
22592
22592
|
}
|
|
22593
22593
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22594
22594
|
});
|
|
@@ -22815,11 +22815,11 @@ var init_cloudflare_provider = __esm({
|
|
|
22815
22815
|
init_version28();
|
|
22816
22816
|
__awaiter16 = function(thisArg, _arguments, P, generator) {
|
|
22817
22817
|
function adopt(value) {
|
|
22818
|
-
return value instanceof P ? value : new P(function(
|
|
22819
|
-
|
|
22818
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
22819
|
+
resolve(value);
|
|
22820
22820
|
});
|
|
22821
22821
|
}
|
|
22822
|
-
return new (P || (P = Promise))(function(
|
|
22822
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
22823
22823
|
function fulfilled(value) {
|
|
22824
22824
|
try {
|
|
22825
22825
|
step(generator.next(value));
|
|
@@ -22835,7 +22835,7 @@ var init_cloudflare_provider = __esm({
|
|
|
22835
22835
|
}
|
|
22836
22836
|
}
|
|
22837
22837
|
function step(result) {
|
|
22838
|
-
result.done ?
|
|
22838
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
22839
22839
|
}
|
|
22840
22840
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22841
22841
|
});
|
|
@@ -23018,11 +23018,11 @@ var init_etherscan_provider = __esm({
|
|
|
23018
23018
|
init_base_provider();
|
|
23019
23019
|
__awaiter17 = function(thisArg, _arguments, P, generator) {
|
|
23020
23020
|
function adopt(value) {
|
|
23021
|
-
return value instanceof P ? value : new P(function(
|
|
23022
|
-
|
|
23021
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
23022
|
+
resolve(value);
|
|
23023
23023
|
});
|
|
23024
23024
|
}
|
|
23025
|
-
return new (P || (P = Promise))(function(
|
|
23025
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
23026
23026
|
function fulfilled(value) {
|
|
23027
23027
|
try {
|
|
23028
23028
|
step(generator.next(value));
|
|
@@ -23038,7 +23038,7 @@ var init_etherscan_provider = __esm({
|
|
|
23038
23038
|
}
|
|
23039
23039
|
}
|
|
23040
23040
|
function step(result) {
|
|
23041
|
-
result.done ?
|
|
23041
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
23042
23042
|
}
|
|
23043
23043
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23044
23044
|
});
|
|
@@ -23370,13 +23370,13 @@ function serialize2(value) {
|
|
|
23370
23370
|
function stall2(duration) {
|
|
23371
23371
|
let cancel = null;
|
|
23372
23372
|
let timer2 = null;
|
|
23373
|
-
let promise = new Promise((
|
|
23373
|
+
let promise = new Promise((resolve) => {
|
|
23374
23374
|
cancel = function() {
|
|
23375
23375
|
if (timer2) {
|
|
23376
23376
|
clearTimeout(timer2);
|
|
23377
23377
|
timer2 = null;
|
|
23378
23378
|
}
|
|
23379
|
-
|
|
23379
|
+
resolve();
|
|
23380
23380
|
};
|
|
23381
23381
|
timer2 = setTimeout(cancel, duration);
|
|
23382
23382
|
});
|
|
@@ -23389,22 +23389,22 @@ function stall2(duration) {
|
|
|
23389
23389
|
}
|
|
23390
23390
|
return { cancel, getPromise, wait };
|
|
23391
23391
|
}
|
|
23392
|
-
function exposeDebugConfig(
|
|
23392
|
+
function exposeDebugConfig(config2, now2) {
|
|
23393
23393
|
const result = {
|
|
23394
|
-
weight:
|
|
23394
|
+
weight: config2.weight
|
|
23395
23395
|
};
|
|
23396
|
-
Object.defineProperty(result, "provider", { get: () =>
|
|
23397
|
-
if (
|
|
23398
|
-
result.start =
|
|
23396
|
+
Object.defineProperty(result, "provider", { get: () => config2.provider });
|
|
23397
|
+
if (config2.start) {
|
|
23398
|
+
result.start = config2.start;
|
|
23399
23399
|
}
|
|
23400
23400
|
if (now2) {
|
|
23401
|
-
result.duration = now2 -
|
|
23401
|
+
result.duration = now2 - config2.start;
|
|
23402
23402
|
}
|
|
23403
|
-
if (
|
|
23404
|
-
if (
|
|
23405
|
-
result.error =
|
|
23403
|
+
if (config2.done) {
|
|
23404
|
+
if (config2.error) {
|
|
23405
|
+
result.error = config2.error;
|
|
23406
23406
|
} else {
|
|
23407
|
-
result.result =
|
|
23407
|
+
result.result = config2.result || null;
|
|
23408
23408
|
}
|
|
23409
23409
|
}
|
|
23410
23410
|
return result;
|
|
@@ -23508,30 +23508,30 @@ function getProcessFunc(provider, method, params) {
|
|
|
23508
23508
|
}
|
|
23509
23509
|
return normalizedTally(normalize3, provider.quorum);
|
|
23510
23510
|
}
|
|
23511
|
-
function waitForSync(
|
|
23511
|
+
function waitForSync(config2, blockNumber) {
|
|
23512
23512
|
return __awaiter18(this, void 0, void 0, function* () {
|
|
23513
|
-
const provider =
|
|
23513
|
+
const provider = config2.provider;
|
|
23514
23514
|
if (provider.blockNumber != null && provider.blockNumber >= blockNumber || blockNumber === -1) {
|
|
23515
23515
|
return provider;
|
|
23516
23516
|
}
|
|
23517
23517
|
return poll(() => {
|
|
23518
|
-
return new Promise((
|
|
23518
|
+
return new Promise((resolve, reject) => {
|
|
23519
23519
|
setTimeout(function() {
|
|
23520
23520
|
if (provider.blockNumber >= blockNumber) {
|
|
23521
|
-
return
|
|
23521
|
+
return resolve(provider);
|
|
23522
23522
|
}
|
|
23523
|
-
if (
|
|
23524
|
-
return
|
|
23523
|
+
if (config2.cancelled) {
|
|
23524
|
+
return resolve(null);
|
|
23525
23525
|
}
|
|
23526
|
-
return
|
|
23526
|
+
return resolve(void 0);
|
|
23527
23527
|
}, 0);
|
|
23528
23528
|
});
|
|
23529
23529
|
}, { oncePoll: provider });
|
|
23530
23530
|
});
|
|
23531
23531
|
}
|
|
23532
|
-
function getRunner(
|
|
23532
|
+
function getRunner(config2, currentBlockNumber, method, params) {
|
|
23533
23533
|
return __awaiter18(this, void 0, void 0, function* () {
|
|
23534
|
-
let provider =
|
|
23534
|
+
let provider = config2.provider;
|
|
23535
23535
|
switch (method) {
|
|
23536
23536
|
case "getBlockNumber":
|
|
23537
23537
|
case "getGasPrice":
|
|
@@ -23545,23 +23545,23 @@ function getRunner(config3, currentBlockNumber, method, params) {
|
|
|
23545
23545
|
case "getTransactionCount":
|
|
23546
23546
|
case "getCode":
|
|
23547
23547
|
if (params.blockTag && isHexString(params.blockTag)) {
|
|
23548
|
-
provider = yield waitForSync(
|
|
23548
|
+
provider = yield waitForSync(config2, currentBlockNumber);
|
|
23549
23549
|
}
|
|
23550
23550
|
return provider[method](params.address, params.blockTag || "latest");
|
|
23551
23551
|
case "getStorageAt":
|
|
23552
23552
|
if (params.blockTag && isHexString(params.blockTag)) {
|
|
23553
|
-
provider = yield waitForSync(
|
|
23553
|
+
provider = yield waitForSync(config2, currentBlockNumber);
|
|
23554
23554
|
}
|
|
23555
23555
|
return provider.getStorageAt(params.address, params.position, params.blockTag || "latest");
|
|
23556
23556
|
case "getBlock":
|
|
23557
23557
|
if (params.blockTag && isHexString(params.blockTag)) {
|
|
23558
|
-
provider = yield waitForSync(
|
|
23558
|
+
provider = yield waitForSync(config2, currentBlockNumber);
|
|
23559
23559
|
}
|
|
23560
23560
|
return provider[params.includeTransactions ? "getBlockWithTransactions" : "getBlock"](params.blockTag || params.blockHash);
|
|
23561
23561
|
case "call":
|
|
23562
23562
|
case "estimateGas":
|
|
23563
23563
|
if (params.blockTag && isHexString(params.blockTag)) {
|
|
23564
|
-
provider = yield waitForSync(
|
|
23564
|
+
provider = yield waitForSync(config2, currentBlockNumber);
|
|
23565
23565
|
}
|
|
23566
23566
|
if (method === "call" && params.blockTag) {
|
|
23567
23567
|
return provider[method](params.transaction, params.blockTag);
|
|
@@ -23573,7 +23573,7 @@ function getRunner(config3, currentBlockNumber, method, params) {
|
|
|
23573
23573
|
case "getLogs": {
|
|
23574
23574
|
let filter = params.filter;
|
|
23575
23575
|
if (filter.fromBlock && isHexString(filter.fromBlock) || filter.toBlock && isHexString(filter.toBlock)) {
|
|
23576
|
-
provider = yield waitForSync(
|
|
23576
|
+
provider = yield waitForSync(config2, currentBlockNumber);
|
|
23577
23577
|
}
|
|
23578
23578
|
return provider.getLogs(filter);
|
|
23579
23579
|
}
|
|
@@ -23600,11 +23600,11 @@ var init_fallback_provider = __esm({
|
|
|
23600
23600
|
init_version28();
|
|
23601
23601
|
__awaiter18 = function(thisArg, _arguments, P, generator) {
|
|
23602
23602
|
function adopt(value) {
|
|
23603
|
-
return value instanceof P ? value : new P(function(
|
|
23604
|
-
|
|
23603
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
23604
|
+
resolve(value);
|
|
23605
23605
|
});
|
|
23606
23606
|
}
|
|
23607
|
-
return new (P || (P = Promise))(function(
|
|
23607
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
23608
23608
|
function fulfilled(value) {
|
|
23609
23609
|
try {
|
|
23610
23610
|
step(generator.next(value));
|
|
@@ -23620,7 +23620,7 @@ var init_fallback_provider = __esm({
|
|
|
23620
23620
|
}
|
|
23621
23621
|
}
|
|
23622
23622
|
function step(result) {
|
|
23623
|
-
result.done ?
|
|
23623
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
23624
23624
|
}
|
|
23625
23625
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23626
23626
|
});
|
|
@@ -23653,21 +23653,21 @@ var init_fallback_provider = __esm({
|
|
|
23653
23653
|
const priority = 1;
|
|
23654
23654
|
return Object.freeze({ provider: configOrProvider, weight: 1, stallTimeout, priority });
|
|
23655
23655
|
}
|
|
23656
|
-
const
|
|
23657
|
-
if (
|
|
23658
|
-
|
|
23656
|
+
const config2 = shallowCopy(configOrProvider);
|
|
23657
|
+
if (config2.priority == null) {
|
|
23658
|
+
config2.priority = 1;
|
|
23659
23659
|
}
|
|
23660
|
-
if (
|
|
23661
|
-
|
|
23660
|
+
if (config2.stallTimeout == null) {
|
|
23661
|
+
config2.stallTimeout = isCommunityResource(configOrProvider) ? 2e3 : 750;
|
|
23662
23662
|
}
|
|
23663
|
-
if (
|
|
23664
|
-
|
|
23663
|
+
if (config2.weight == null) {
|
|
23664
|
+
config2.weight = 1;
|
|
23665
23665
|
}
|
|
23666
|
-
const weight =
|
|
23666
|
+
const weight = config2.weight;
|
|
23667
23667
|
if (weight % 1 || weight > 512 || weight < 1) {
|
|
23668
23668
|
logger43.throwArgumentError("invalid weight; must be integer in [1, 512]", `providers[${index}].weight`, weight);
|
|
23669
23669
|
}
|
|
23670
|
-
return Object.freeze(
|
|
23670
|
+
return Object.freeze(config2);
|
|
23671
23671
|
});
|
|
23672
23672
|
const total = providerConfigs.reduce((accum, c) => accum + c.weight, 0);
|
|
23673
23673
|
if (quorum == null) {
|
|
@@ -23677,9 +23677,9 @@ var init_fallback_provider = __esm({
|
|
|
23677
23677
|
}
|
|
23678
23678
|
let networkOrReady = checkNetworks(providerConfigs.map((c) => c.provider.network));
|
|
23679
23679
|
if (networkOrReady == null) {
|
|
23680
|
-
networkOrReady = new Promise((
|
|
23680
|
+
networkOrReady = new Promise((resolve, reject) => {
|
|
23681
23681
|
setTimeout(() => {
|
|
23682
|
-
this.detectNetwork().then(
|
|
23682
|
+
this.detectNetwork().then(resolve, reject);
|
|
23683
23683
|
}, 0);
|
|
23684
23684
|
});
|
|
23685
23685
|
}
|
|
@@ -23725,33 +23725,33 @@ var init_fallback_provider = __esm({
|
|
|
23725
23725
|
const t0 = now();
|
|
23726
23726
|
let inflightWeight = configs.filter((c) => c.runner && t0 - c.start < c.stallTimeout).reduce((accum, c) => accum + c.weight, 0);
|
|
23727
23727
|
while (inflightWeight < this.quorum && i < configs.length) {
|
|
23728
|
-
const
|
|
23728
|
+
const config2 = configs[i++];
|
|
23729
23729
|
const rid = nextRid++;
|
|
23730
|
-
|
|
23731
|
-
|
|
23732
|
-
|
|
23733
|
-
|
|
23730
|
+
config2.start = now();
|
|
23731
|
+
config2.staller = stall2(config2.stallTimeout);
|
|
23732
|
+
config2.staller.wait(() => {
|
|
23733
|
+
config2.staller = null;
|
|
23734
23734
|
});
|
|
23735
|
-
|
|
23736
|
-
|
|
23737
|
-
|
|
23735
|
+
config2.runner = getRunner(config2, currentBlockNumber, method, params).then((result) => {
|
|
23736
|
+
config2.done = true;
|
|
23737
|
+
config2.result = result;
|
|
23738
23738
|
if (this.listenerCount("debug")) {
|
|
23739
23739
|
this.emit("debug", {
|
|
23740
23740
|
action: "request",
|
|
23741
23741
|
rid,
|
|
23742
|
-
backend: exposeDebugConfig(
|
|
23742
|
+
backend: exposeDebugConfig(config2, now()),
|
|
23743
23743
|
request: { method, params: deepCopy(params) },
|
|
23744
23744
|
provider: this
|
|
23745
23745
|
});
|
|
23746
23746
|
}
|
|
23747
23747
|
}, (error) => {
|
|
23748
|
-
|
|
23749
|
-
|
|
23748
|
+
config2.done = true;
|
|
23749
|
+
config2.error = error;
|
|
23750
23750
|
if (this.listenerCount("debug")) {
|
|
23751
23751
|
this.emit("debug", {
|
|
23752
23752
|
action: "request",
|
|
23753
23753
|
rid,
|
|
23754
|
-
backend: exposeDebugConfig(
|
|
23754
|
+
backend: exposeDebugConfig(config2, now()),
|
|
23755
23755
|
request: { method, params: deepCopy(params) },
|
|
23756
23756
|
provider: this
|
|
23757
23757
|
});
|
|
@@ -23761,12 +23761,12 @@ var init_fallback_provider = __esm({
|
|
|
23761
23761
|
this.emit("debug", {
|
|
23762
23762
|
action: "request",
|
|
23763
23763
|
rid,
|
|
23764
|
-
backend: exposeDebugConfig(
|
|
23764
|
+
backend: exposeDebugConfig(config2, null),
|
|
23765
23765
|
request: { method, params: deepCopy(params) },
|
|
23766
23766
|
provider: this
|
|
23767
23767
|
});
|
|
23768
23768
|
}
|
|
23769
|
-
inflightWeight +=
|
|
23769
|
+
inflightWeight += config2.weight;
|
|
23770
23770
|
}
|
|
23771
23771
|
const waiting = [];
|
|
23772
23772
|
configs.forEach((c) => {
|
|
@@ -24002,8 +24002,8 @@ var init_json_rpc_batch_provider = __esm({
|
|
|
24002
24002
|
this._pendingBatch = [];
|
|
24003
24003
|
}
|
|
24004
24004
|
const inflightRequest = { request, resolve: null, reject: null };
|
|
24005
|
-
const promise = new Promise((
|
|
24006
|
-
inflightRequest.resolve =
|
|
24005
|
+
const promise = new Promise((resolve, reject) => {
|
|
24006
|
+
inflightRequest.resolve = resolve;
|
|
24007
24007
|
inflightRequest.reject = reject;
|
|
24008
24008
|
});
|
|
24009
24009
|
this._pendingBatch.push(inflightRequest);
|
|
@@ -24186,7 +24186,7 @@ function buildWeb3LegacyFetcher(provider, sendFunc) {
|
|
|
24186
24186
|
id: _nextId++,
|
|
24187
24187
|
jsonrpc: "2.0"
|
|
24188
24188
|
};
|
|
24189
|
-
return new Promise((
|
|
24189
|
+
return new Promise((resolve, reject) => {
|
|
24190
24190
|
this.emit("debug", {
|
|
24191
24191
|
action: "request",
|
|
24192
24192
|
fetcher,
|
|
@@ -24217,7 +24217,7 @@ function buildWeb3LegacyFetcher(provider, sendFunc) {
|
|
|
24217
24217
|
error2.data = response.error.data;
|
|
24218
24218
|
return reject(error2);
|
|
24219
24219
|
}
|
|
24220
|
-
|
|
24220
|
+
resolve(response.result);
|
|
24221
24221
|
});
|
|
24222
24222
|
});
|
|
24223
24223
|
};
|
|
@@ -24270,21 +24270,21 @@ var init_web3_provider = __esm({
|
|
|
24270
24270
|
if (provider == null) {
|
|
24271
24271
|
logger47.throwArgumentError("missing provider", "provider", provider);
|
|
24272
24272
|
}
|
|
24273
|
-
let
|
|
24273
|
+
let path = null;
|
|
24274
24274
|
let jsonRpcFetchFunc = null;
|
|
24275
24275
|
let subprovider = null;
|
|
24276
24276
|
if (typeof provider === "function") {
|
|
24277
|
-
|
|
24277
|
+
path = "unknown:";
|
|
24278
24278
|
jsonRpcFetchFunc = provider;
|
|
24279
24279
|
} else {
|
|
24280
|
-
|
|
24281
|
-
if (!
|
|
24282
|
-
|
|
24280
|
+
path = provider.host || provider.path || "";
|
|
24281
|
+
if (!path && provider.isMetaMask) {
|
|
24282
|
+
path = "metamask";
|
|
24283
24283
|
}
|
|
24284
24284
|
subprovider = provider;
|
|
24285
24285
|
if (provider.request) {
|
|
24286
|
-
if (
|
|
24287
|
-
|
|
24286
|
+
if (path === "") {
|
|
24287
|
+
path = "eip-1193:";
|
|
24288
24288
|
}
|
|
24289
24289
|
jsonRpcFetchFunc = buildEip1193Fetcher(provider);
|
|
24290
24290
|
} else if (provider.sendAsync) {
|
|
@@ -24294,11 +24294,11 @@ var init_web3_provider = __esm({
|
|
|
24294
24294
|
} else {
|
|
24295
24295
|
logger47.throwArgumentError("unsupported provider", "provider", provider);
|
|
24296
24296
|
}
|
|
24297
|
-
if (!
|
|
24298
|
-
|
|
24297
|
+
if (!path) {
|
|
24298
|
+
path = "unknown:";
|
|
24299
24299
|
}
|
|
24300
24300
|
}
|
|
24301
|
-
super(
|
|
24301
|
+
super(path, network);
|
|
24302
24302
|
defineReadOnly(this, "jsonRpcFetchFunc", jsonRpcFetchFunc);
|
|
24303
24303
|
defineReadOnly(this, "provider", subprovider);
|
|
24304
24304
|
}
|
|
@@ -25239,12 +25239,12 @@ var init_fragments2 = __esm({
|
|
|
25239
25239
|
// node_modules/ethers/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js
|
|
25240
25240
|
function checkResultErrors2(result) {
|
|
25241
25241
|
const errors = [];
|
|
25242
|
-
const checkErrors = function(
|
|
25242
|
+
const checkErrors = function(path, object) {
|
|
25243
25243
|
if (!Array.isArray(object)) {
|
|
25244
25244
|
return;
|
|
25245
25245
|
}
|
|
25246
25246
|
for (let key3 in object) {
|
|
25247
|
-
const childPath =
|
|
25247
|
+
const childPath = path.slice();
|
|
25248
25248
|
childPath.push(key3);
|
|
25249
25249
|
try {
|
|
25250
25250
|
checkErrors(childPath, object[key3]);
|
|
@@ -27298,11 +27298,11 @@ var init_typed_data2 = __esm({
|
|
|
27298
27298
|
init_id2();
|
|
27299
27299
|
__awaiter19 = function(thisArg, _arguments, P, generator) {
|
|
27300
27300
|
function adopt(value) {
|
|
27301
|
-
return value instanceof P ? value : new P(function(
|
|
27302
|
-
|
|
27301
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
27302
|
+
resolve(value);
|
|
27303
27303
|
});
|
|
27304
27304
|
}
|
|
27305
|
-
return new (P || (P = Promise))(function(
|
|
27305
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
27306
27306
|
function fulfilled(value) {
|
|
27307
27307
|
try {
|
|
27308
27308
|
step(generator.next(value));
|
|
@@ -27318,7 +27318,7 @@ var init_typed_data2 = __esm({
|
|
|
27318
27318
|
}
|
|
27319
27319
|
}
|
|
27320
27320
|
function step(result) {
|
|
27321
|
-
result.done ?
|
|
27321
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
27322
27322
|
}
|
|
27323
27323
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27324
27324
|
});
|
|
@@ -28350,8 +28350,8 @@ function createCommonjsModule2(fn, basedir, module2) {
|
|
|
28350
28350
|
return module2 = {
|
|
28351
28351
|
path: basedir,
|
|
28352
28352
|
exports: {},
|
|
28353
|
-
require: function(
|
|
28354
|
-
return commonjsRequire2(
|
|
28353
|
+
require: function(path, base3) {
|
|
28354
|
+
return commonjsRequire2(path, base3 === void 0 || base3 === null ? module2.path : base3);
|
|
28355
28355
|
}
|
|
28356
28356
|
}, fn(module2, module2.exports), module2.exports;
|
|
28357
28357
|
}
|
|
@@ -30864,11 +30864,11 @@ var init_geturl2 = __esm({
|
|
|
30864
30864
|
init_lib20();
|
|
30865
30865
|
__awaiter20 = function(thisArg, _arguments, P, generator) {
|
|
30866
30866
|
function adopt(value) {
|
|
30867
|
-
return value instanceof P ? value : new P(function(
|
|
30868
|
-
|
|
30867
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
30868
|
+
resolve(value);
|
|
30869
30869
|
});
|
|
30870
30870
|
}
|
|
30871
|
-
return new (P || (P = Promise))(function(
|
|
30871
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
30872
30872
|
function fulfilled(value) {
|
|
30873
30873
|
try {
|
|
30874
30874
|
step(generator.next(value));
|
|
@@ -30884,7 +30884,7 @@ var init_geturl2 = __esm({
|
|
|
30884
30884
|
}
|
|
30885
30885
|
}
|
|
30886
30886
|
function step(result) {
|
|
30887
|
-
result.done ?
|
|
30887
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
30888
30888
|
}
|
|
30889
30889
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
30890
30890
|
});
|
|
@@ -30894,8 +30894,8 @@ var init_geturl2 = __esm({
|
|
|
30894
30894
|
|
|
30895
30895
|
// node_modules/ethers/node_modules/@ethersproject/web/lib.esm/index.js
|
|
30896
30896
|
function staller2(duration) {
|
|
30897
|
-
return new Promise((
|
|
30898
|
-
setTimeout(
|
|
30897
|
+
return new Promise((resolve) => {
|
|
30898
|
+
setTimeout(resolve, duration);
|
|
30899
30899
|
});
|
|
30900
30900
|
}
|
|
30901
30901
|
function bodyify2(value, type) {
|
|
@@ -31015,7 +31015,7 @@ function _fetchData2(connection, body, processFunc) {
|
|
|
31015
31015
|
options.headers = flatHeaders;
|
|
31016
31016
|
const runningTimeout = (function() {
|
|
31017
31017
|
let timer2 = null;
|
|
31018
|
-
const promise = new Promise(function(
|
|
31018
|
+
const promise = new Promise(function(resolve, reject) {
|
|
31019
31019
|
if (timeout) {
|
|
31020
31020
|
timer2 = setTimeout(() => {
|
|
31021
31021
|
if (timer2 == null) {
|
|
@@ -31185,7 +31185,7 @@ function poll2(func, options) {
|
|
|
31185
31185
|
if (options.interval == null) {
|
|
31186
31186
|
options.interval = 250;
|
|
31187
31187
|
}
|
|
31188
|
-
return new Promise(function(
|
|
31188
|
+
return new Promise(function(resolve, reject) {
|
|
31189
31189
|
let timer2 = null;
|
|
31190
31190
|
let done = false;
|
|
31191
31191
|
const cancel = () => {
|
|
@@ -31211,7 +31211,7 @@ function poll2(func, options) {
|
|
|
31211
31211
|
return func().then(function(result) {
|
|
31212
31212
|
if (result !== void 0) {
|
|
31213
31213
|
if (cancel()) {
|
|
31214
|
-
|
|
31214
|
+
resolve(result);
|
|
31215
31215
|
}
|
|
31216
31216
|
} else if (options.oncePoll) {
|
|
31217
31217
|
options.oncePoll.once("poll", check);
|
|
@@ -31257,11 +31257,11 @@ var init_lib48 = __esm({
|
|
|
31257
31257
|
init_geturl2();
|
|
31258
31258
|
__awaiter21 = function(thisArg, _arguments, P, generator) {
|
|
31259
31259
|
function adopt(value) {
|
|
31260
|
-
return value instanceof P ? value : new P(function(
|
|
31261
|
-
|
|
31260
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
31261
|
+
resolve(value);
|
|
31262
31262
|
});
|
|
31263
31263
|
}
|
|
31264
|
-
return new (P || (P = Promise))(function(
|
|
31264
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
31265
31265
|
function fulfilled(value) {
|
|
31266
31266
|
try {
|
|
31267
31267
|
step(generator.next(value));
|
|
@@ -31277,7 +31277,7 @@ var init_lib48 = __esm({
|
|
|
31277
31277
|
}
|
|
31278
31278
|
}
|
|
31279
31279
|
function step(result) {
|
|
31280
|
-
result.done ?
|
|
31280
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
31281
31281
|
}
|
|
31282
31282
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31283
31283
|
});
|
|
@@ -31485,14 +31485,9 @@ var init_lib49 = __esm({
|
|
|
31485
31485
|
|
|
31486
31486
|
// config/env.config.ts
|
|
31487
31487
|
function getEnvValue(key3, defaultValue) {
|
|
31488
|
-
const envDefine = Object.keys(env).reduce((acc, curr) => {
|
|
31489
|
-
acc[`process.env.${curr}`] = JSON.stringify(env[curr] || process.env[curr]);
|
|
31490
|
-
return acc;
|
|
31491
|
-
}, {});
|
|
31492
|
-
console.log(`Loaded environment variables: ${JSON.stringify(envDefine)}`);
|
|
31493
31488
|
const value = process.env[key3];
|
|
31494
31489
|
if (value === void 0 || value === "") {
|
|
31495
|
-
console.
|
|
31490
|
+
console.warn(`Environment variable ${key3} is not set, using default value: ${defaultValue}`);
|
|
31496
31491
|
return defaultValue;
|
|
31497
31492
|
}
|
|
31498
31493
|
return value;
|
|
@@ -31535,20 +31530,20 @@ function loadConfig() {
|
|
|
31535
31530
|
)
|
|
31536
31531
|
},
|
|
31537
31532
|
contracts: {
|
|
31538
|
-
mutiVoucher: getEnvValue("MutiVoucher", ""),
|
|
31533
|
+
mutiVoucher: getEnvValue("MutiVoucher", "0x0000000000000000000000000000000000000044"),
|
|
31539
31534
|
auction: {
|
|
31540
|
-
chainYVaultV2: getEnvValue("ChainYVaultV2", ""),
|
|
31541
|
-
chainXAuctionV2: getEnvValue("ChainXAuctionV2", ""),
|
|
31542
|
-
coinbase: getEnvValue("Coinbase", "")
|
|
31535
|
+
chainYVaultV2: getEnvValue("ChainYVaultV2", "0xAa9e62EB6d74d66Ff6720D1A8143c8237067Ff58"),
|
|
31536
|
+
chainXAuctionV2: getEnvValue("ChainXAuctionV2", "0x88566F811b751Fa527A0816d99d6968E00f2eBef"),
|
|
31537
|
+
coinbase: getEnvValue("Coinbase", "0xAa9e62EB6d74d66Ff6720D1A8143c8237067Ff58")
|
|
31543
31538
|
},
|
|
31544
31539
|
uniswap: {
|
|
31545
|
-
create2: getEnvValue("Create2", "
|
|
31546
|
-
token0: getEnvValue("Token0", "
|
|
31547
|
-
token1: getEnvValue("Token1", "
|
|
31548
|
-
poolManager: getEnvValue("PoolManager", "
|
|
31549
|
-
liquidPool: getEnvValue("LiquidPool", "
|
|
31550
|
-
limitOrder: getEnvValue("LimitOrder", "
|
|
31551
|
-
dynamicFee: getEnvValue("DynamicFee", "
|
|
31540
|
+
create2: getEnvValue("Create2", "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e"),
|
|
31541
|
+
token0: getEnvValue("Token0", "0x3E8d9Ad590542AE8731960202CE0334B5c7c317D"),
|
|
31542
|
+
token1: getEnvValue("Token1", "0xF8407E61094a14601a7224AB628152B309788659"),
|
|
31543
|
+
poolManager: getEnvValue("PoolManager", "0xEEB0F62083f9bcF1e161ABb1889E9c4C14b74D46"),
|
|
31544
|
+
liquidPool: getEnvValue("LiquidPool", "0x6E454E4110Cb7FD3D77e43Fb02D52f8D49fa78e6"),
|
|
31545
|
+
limitOrder: getEnvValue("LimitOrder", "0x865d655032B0532a6D15EC26cBC23B9F49121040"),
|
|
31546
|
+
dynamicFee: getEnvValue("DynamicFee", "0x69dbAac488aa6cA7e023316D610c9B9327e85040")
|
|
31552
31547
|
}
|
|
31553
31548
|
},
|
|
31554
31549
|
abiPaths: {
|
|
@@ -31582,18 +31577,15 @@ function loadConfig() {
|
|
|
31582
31577
|
}
|
|
31583
31578
|
};
|
|
31584
31579
|
}
|
|
31585
|
-
var
|
|
31580
|
+
var config, RPC_URL, PRIVATE_KEY, ACCOUNT_ADDR;
|
|
31586
31581
|
var init_env_config = __esm({
|
|
31587
31582
|
"config/env.config.ts"() {
|
|
31588
31583
|
"use strict";
|
|
31589
|
-
dotenv = __toESM(require("dotenv"));
|
|
31590
31584
|
init_lib49();
|
|
31591
|
-
|
|
31592
|
-
|
|
31593
|
-
|
|
31594
|
-
|
|
31595
|
-
PRIVATE_KEY = config2.wallet.privateKey;
|
|
31596
|
-
ACCOUNT_ADDR = config2.wallet.address;
|
|
31585
|
+
config = loadConfig();
|
|
31586
|
+
RPC_URL = config.rpc.url;
|
|
31587
|
+
PRIVATE_KEY = config.wallet.privateKey;
|
|
31588
|
+
ACCOUNT_ADDR = config.wallet.address;
|
|
31597
31589
|
}
|
|
31598
31590
|
});
|
|
31599
31591
|
|
|
@@ -35280,13 +35272,13 @@ var init_uniswap_config = __esm({
|
|
|
35280
35272
|
init_Create2();
|
|
35281
35273
|
init_Example();
|
|
35282
35274
|
CONTRACT_ADDRESSES = {
|
|
35283
|
-
Create2:
|
|
35284
|
-
Token0:
|
|
35285
|
-
Token1:
|
|
35286
|
-
PoolManager:
|
|
35287
|
-
LiquidPool:
|
|
35288
|
-
LimitOrder:
|
|
35289
|
-
DynamicFee:
|
|
35275
|
+
Create2: config.contracts.uniswap.create2,
|
|
35276
|
+
Token0: config.contracts.uniswap.token0,
|
|
35277
|
+
Token1: config.contracts.uniswap.token1,
|
|
35278
|
+
PoolManager: config.contracts.uniswap.poolManager,
|
|
35279
|
+
LiquidPool: config.contracts.uniswap.liquidPool,
|
|
35280
|
+
LimitOrder: config.contracts.uniswap.limitOrder,
|
|
35281
|
+
DynamicFee: config.contracts.uniswap.dynamicFee
|
|
35290
35282
|
};
|
|
35291
35283
|
CONTRACTS_ABI = {
|
|
35292
35284
|
PoolManager: PoolManager_default,
|
|
@@ -35297,13 +35289,13 @@ var init_uniswap_config = __esm({
|
|
|
35297
35289
|
Create2: Create2_default,
|
|
35298
35290
|
Example: Example_default
|
|
35299
35291
|
};
|
|
35300
|
-
SALT =
|
|
35301
|
-
SALT_LIMITORDER =
|
|
35302
|
-
PRICE_INIT =
|
|
35303
|
-
PRICE_LIMIT =
|
|
35304
|
-
INITIAL_LIQUIDITY =
|
|
35305
|
-
INITIAL_SUPPLY =
|
|
35306
|
-
DYNAMIC_FEE_FLAG =
|
|
35292
|
+
SALT = config.pool.salt;
|
|
35293
|
+
SALT_LIMITORDER = config.pool.saltLimitOrder;
|
|
35294
|
+
PRICE_INIT = config.pool.priceInit;
|
|
35295
|
+
PRICE_LIMIT = config.pool.priceLimit;
|
|
35296
|
+
INITIAL_LIQUIDITY = config.pool.initialLiquidity;
|
|
35297
|
+
INITIAL_SUPPLY = config.pool.initialSupply;
|
|
35298
|
+
DYNAMIC_FEE_FLAG = config.pool.dynamicFeeFlag;
|
|
35307
35299
|
POOL_KEYS = {
|
|
35308
35300
|
limitOrderPoolKey: {
|
|
35309
35301
|
currency0: CONTRACT_ADDRESSES.Token0,
|
|
@@ -35534,6 +35526,7 @@ function getAbi(artifact) {
|
|
|
35534
35526
|
return artifact.abi ? artifact.abi : artifact;
|
|
35535
35527
|
}
|
|
35536
35528
|
async function getContract(wallet, name) {
|
|
35529
|
+
console.log(`Getting contract `, name, CONTRACT_ADDRESSES.LiquidPool);
|
|
35537
35530
|
switch (name) {
|
|
35538
35531
|
case "Token0":
|
|
35539
35532
|
return new ethers_exports.Contract(CONTRACT_ADDRESSES.Token0, getAbi(CONTRACTS_ABI.MockERC20), wallet);
|
|
@@ -35569,9 +35562,9 @@ var require_place = __commonJS({
|
|
|
35569
35562
|
const tx = await contract.place(poolKey, tickLower, zeroForOne, liquidity);
|
|
35570
35563
|
await tx.wait();
|
|
35571
35564
|
console.log("Limit order set successfully:");
|
|
35572
|
-
return new Promise((
|
|
35565
|
+
return new Promise((resolve, reject) => {
|
|
35573
35566
|
contract.once("Place", (owner, epoch, key3, tickLower2, zeroForOne2, liquidity2) => {
|
|
35574
|
-
|
|
35567
|
+
resolve({
|
|
35575
35568
|
owner,
|
|
35576
35569
|
epoch: epoch.toString(),
|
|
35577
35570
|
key: key3,
|
|
@@ -37581,9 +37574,9 @@ var ChainYVaultV2_default = {
|
|
|
37581
37574
|
};
|
|
37582
37575
|
|
|
37583
37576
|
// config/auction.config.ts
|
|
37584
|
-
var chainXAuctionV2Addr =
|
|
37585
|
-
var chainYVaultV2Addr =
|
|
37586
|
-
var coinbaseAddr =
|
|
37577
|
+
var chainXAuctionV2Addr = config.contracts.auction.chainXAuctionV2;
|
|
37578
|
+
var chainYVaultV2Addr = config.contracts.auction.chainYVaultV2;
|
|
37579
|
+
var coinbaseAddr = config.contracts.auction.coinbase;
|
|
37587
37580
|
var AUCTION_ADDR = {
|
|
37588
37581
|
chainXAuction: chainXAuctionV2Addr,
|
|
37589
37582
|
chainYVault: chainYVaultV2Addr,
|
|
@@ -38261,7 +38254,7 @@ var MutiVoucher_default = {
|
|
|
38261
38254
|
};
|
|
38262
38255
|
|
|
38263
38256
|
// config/voucher.config.ts
|
|
38264
|
-
var MUTI_VOUCHER_ADDR =
|
|
38257
|
+
var MUTI_VOUCHER_ADDR = config.contracts.mutiVoucher;
|
|
38265
38258
|
var MUTI_VOUCHER_ABI = MutiVoucher_default;
|
|
38266
38259
|
|
|
38267
38260
|
// src/voucher.ts
|