@gardenfi/core 2.3.1-beta.2 → 2.3.1-beta.3
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/{ccip-BJvawIoJ.js → ccip-D9_IiC8U.js} +1 -1
- package/dist/{ccip-hhlZ0ik8.cjs → ccip-DGIK3sSb.cjs} +1 -1
- package/dist/{index-94YZ_zvS.cjs → index-DCJAE0NI.cjs} +11 -11
- package/dist/{index-BdKFxH7-.js → index-Di1jzASx.js} +213 -214
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/src/lib/garden/garden.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { Network as Br, Environment as Yt, Ok as ie, Err as H, Url as Pt, Fetche
|
|
|
3
3
|
import * as Of from "varuint-bitcoin";
|
|
4
4
|
import im from "varuint-bitcoin";
|
|
5
5
|
import * as gt from "tiny-secp256k1";
|
|
6
|
-
import * as
|
|
6
|
+
import * as le from "bitcoinjs-lib";
|
|
7
7
|
import { crypto as sm, Transaction as Dt, script as Yr, payments as Gt, address as xi, networks as Zo, Psbt as Cf, initEccLib as om } from "bitcoinjs-lib";
|
|
8
8
|
import am from "bignumber.js";
|
|
9
9
|
import { ECPairFactory as Ms } from "ecpair";
|
|
@@ -12,7 +12,7 @@ import { mixed as Nf } from "yup";
|
|
|
12
12
|
import { validateMnemonic as fm, mnemonicToSeedSync as dm } from "bip39";
|
|
13
13
|
import { BIP32Factory as lm } from "bip32";
|
|
14
14
|
import { web3 as Zr, BN as Ff, Program as yp } from "@coral-xyz/anchor";
|
|
15
|
-
var
|
|
15
|
+
var Ee = /* @__PURE__ */ ((e) => (e.Idle = "Idle", e.Initiate = "Initiate", e.Redeem = "Redeem", e.Refund = "Refund", e))(Ee || {});
|
|
16
16
|
const pm = "1.0.8";
|
|
17
17
|
let ct = class Cc extends Error {
|
|
18
18
|
constructor(t, r = {}) {
|
|
@@ -4619,18 +4619,18 @@ const Aw = "0.1.1";
|
|
|
4619
4619
|
function _w() {
|
|
4620
4620
|
return Aw;
|
|
4621
4621
|
}
|
|
4622
|
-
class
|
|
4622
|
+
class we extends Error {
|
|
4623
4623
|
constructor(t, r = {}) {
|
|
4624
4624
|
const n = (() => {
|
|
4625
4625
|
var c;
|
|
4626
|
-
if (r.cause instanceof
|
|
4626
|
+
if (r.cause instanceof we) {
|
|
4627
4627
|
if (r.cause.details)
|
|
4628
4628
|
return r.cause.details;
|
|
4629
4629
|
if (r.cause.shortMessage)
|
|
4630
4630
|
return r.cause.shortMessage;
|
|
4631
4631
|
}
|
|
4632
4632
|
return r.cause && "details" in r.cause && typeof r.cause.details == "string" ? r.cause.details : (c = r.cause) != null && c.message ? r.cause.message : r.details;
|
|
4633
|
-
})(), i = r.cause instanceof
|
|
4633
|
+
})(), i = r.cause instanceof we && r.cause.docsPath || r.docsPath, o = `https://oxlib.sh${i ?? ""}`, a = [
|
|
4634
4634
|
t || "An error occurred.",
|
|
4635
4635
|
...r.metaMessages ? ["", ...r.metaMessages] : [],
|
|
4636
4636
|
...n || i ? [
|
|
@@ -4781,7 +4781,7 @@ function Nw(e, t = {}) {
|
|
|
4781
4781
|
for (let a = 0, c = 0; a < s; a++) {
|
|
4782
4782
|
const f = cd(i.charCodeAt(c++)), u = cd(i.charCodeAt(c++));
|
|
4783
4783
|
if (f === void 0 || u === void 0)
|
|
4784
|
-
throw new
|
|
4784
|
+
throw new we(`Invalid byte sequence ("${i[c - 2]}${i[c - 1]}" in "${i}").`);
|
|
4785
4785
|
o[a] = f * 16 + u;
|
|
4786
4786
|
}
|
|
4787
4787
|
return o;
|
|
@@ -4796,7 +4796,7 @@ function $w(e, t) {
|
|
|
4796
4796
|
function ud(e) {
|
|
4797
4797
|
return e.length;
|
|
4798
4798
|
}
|
|
4799
|
-
let Uw = class extends
|
|
4799
|
+
let Uw = class extends we {
|
|
4800
4800
|
constructor({ givenSize: t, maxSize: r }) {
|
|
4801
4801
|
super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`), Object.defineProperty(this, "name", {
|
|
4802
4802
|
enumerable: !0,
|
|
@@ -4805,7 +4805,7 @@ let Uw = class extends be {
|
|
|
4805
4805
|
value: "Bytes.SizeOverflowError"
|
|
4806
4806
|
});
|
|
4807
4807
|
}
|
|
4808
|
-
}, Hw = class extends
|
|
4808
|
+
}, Hw = class extends we {
|
|
4809
4809
|
constructor({ size: t, targetSize: r, type: n }) {
|
|
4810
4810
|
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
|
|
4811
4811
|
enumerable: !0,
|
|
@@ -4885,7 +4885,7 @@ function jw(e, t = {}) {
|
|
|
4885
4885
|
return !1;
|
|
4886
4886
|
}
|
|
4887
4887
|
}
|
|
4888
|
-
class $h extends
|
|
4888
|
+
class $h extends we {
|
|
4889
4889
|
constructor({ max: t, min: r, signed: n, size: i, value: s }) {
|
|
4890
4890
|
super(`Number \`${s}\` is not in safe${i ? ` ${i * 8}-bit` : ""}${n ? " signed" : " unsigned"} integer range ${t ? `(\`${r}\` to \`${t}\`)` : `(above \`${r}\`)`}`), Object.defineProperty(this, "name", {
|
|
4891
4891
|
enumerable: !0,
|
|
@@ -4895,7 +4895,7 @@ class $h extends be {
|
|
|
4895
4895
|
});
|
|
4896
4896
|
}
|
|
4897
4897
|
}
|
|
4898
|
-
class fd extends
|
|
4898
|
+
class fd extends we {
|
|
4899
4899
|
constructor(t) {
|
|
4900
4900
|
super(`Value \`${typeof t == "object" ? Pw(t) : t}\` of type \`${typeof t}\` is an invalid hex type.`, {
|
|
4901
4901
|
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
@@ -4907,7 +4907,7 @@ class fd extends be {
|
|
|
4907
4907
|
});
|
|
4908
4908
|
}
|
|
4909
4909
|
}
|
|
4910
|
-
class dd extends
|
|
4910
|
+
class dd extends we {
|
|
4911
4911
|
constructor(t) {
|
|
4912
4912
|
super(`Value \`${t}\` is an invalid hex value.`, {
|
|
4913
4913
|
metaMessages: [
|
|
@@ -4921,7 +4921,7 @@ class dd extends be {
|
|
|
4921
4921
|
});
|
|
4922
4922
|
}
|
|
4923
4923
|
}
|
|
4924
|
-
class zw extends
|
|
4924
|
+
class zw extends we {
|
|
4925
4925
|
constructor({ givenSize: t, maxSize: r }) {
|
|
4926
4926
|
super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`), Object.defineProperty(this, "name", {
|
|
4927
4927
|
enumerable: !0,
|
|
@@ -4931,7 +4931,7 @@ class zw extends be {
|
|
|
4931
4931
|
});
|
|
4932
4932
|
}
|
|
4933
4933
|
}
|
|
4934
|
-
class Uh extends
|
|
4934
|
+
class Uh extends we {
|
|
4935
4935
|
constructor({ offset: t, position: r, size: n }) {
|
|
4936
4936
|
super(`Slice ${r === "start" ? "starting" : "ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`), Object.defineProperty(this, "name", {
|
|
4937
4937
|
enumerable: !0,
|
|
@@ -4941,7 +4941,7 @@ class Uh extends be {
|
|
|
4941
4941
|
});
|
|
4942
4942
|
}
|
|
4943
4943
|
}
|
|
4944
|
-
class qw extends
|
|
4944
|
+
class qw extends we {
|
|
4945
4945
|
constructor({ size: t, targetSize: r, type: n }) {
|
|
4946
4946
|
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
|
|
4947
4947
|
enumerable: !0,
|
|
@@ -5442,7 +5442,7 @@ async function To(e, t) {
|
|
|
5442
5442
|
});
|
|
5443
5443
|
return Z === "0x" ? { data: void 0 } : { data: Z };
|
|
5444
5444
|
} catch (J) {
|
|
5445
|
-
const M = r1(J), { offchainLookup: k, offchainLookupSignature: q } = await import("./ccip-
|
|
5445
|
+
const M = r1(J), { offchainLookup: k, offchainLookupSignature: q } = await import("./ccip-D9_IiC8U.js");
|
|
5446
5446
|
if (e.ccipRead !== !1 && (M == null ? void 0 : M.slice(0, 10)) === q && A)
|
|
5447
5447
|
return { data: await k(e, { data: M, to: A }) };
|
|
5448
5448
|
throw O && (M == null ? void 0 : M.slice(0, 10)) === "0x101bb98d" ? new $b({ factory: y }) : zh(J, {
|
|
@@ -8184,7 +8184,7 @@ function iu(e, t = {}) {
|
|
|
8184
8184
|
return !1;
|
|
8185
8185
|
}
|
|
8186
8186
|
}
|
|
8187
|
-
class xd extends
|
|
8187
|
+
class xd extends we {
|
|
8188
8188
|
constructor({ address: t, cause: r }) {
|
|
8189
8189
|
super(`Address "${t}" is invalid.`, {
|
|
8190
8190
|
cause: r
|
|
@@ -8196,7 +8196,7 @@ class xd extends be {
|
|
|
8196
8196
|
});
|
|
8197
8197
|
}
|
|
8198
8198
|
}
|
|
8199
|
-
class D2 extends
|
|
8199
|
+
class D2 extends we {
|
|
8200
8200
|
constructor() {
|
|
8201
8201
|
super("Address is not a 20 byte (40 hexadecimal character) value."), Object.defineProperty(this, "name", {
|
|
8202
8202
|
enumerable: !0,
|
|
@@ -8206,7 +8206,7 @@ class D2 extends be {
|
|
|
8206
8206
|
});
|
|
8207
8207
|
}
|
|
8208
8208
|
}
|
|
8209
|
-
class j2 extends
|
|
8209
|
+
class j2 extends we {
|
|
8210
8210
|
constructor() {
|
|
8211
8211
|
super("Address does not match its checksum counterpart."), Object.defineProperty(this, "name", {
|
|
8212
8212
|
enumerable: !0,
|
|
@@ -8238,7 +8238,7 @@ function su(e) {
|
|
|
8238
8238
|
}
|
|
8239
8239
|
}
|
|
8240
8240
|
if (!s)
|
|
8241
|
-
throw new
|
|
8241
|
+
throw new we("Unable to normalize signature.");
|
|
8242
8242
|
return i;
|
|
8243
8243
|
}
|
|
8244
8244
|
function ou(e, t) {
|
|
@@ -8345,7 +8345,7 @@ function q2(e) {
|
|
|
8345
8345
|
function Cn(e) {
|
|
8346
8346
|
return typeof e != "string" && "hash" in e && e.hash ? e.hash : P0(Ju(q2(e)));
|
|
8347
8347
|
}
|
|
8348
|
-
class G2 extends
|
|
8348
|
+
class G2 extends we {
|
|
8349
8349
|
constructor(t, r) {
|
|
8350
8350
|
super("Found ambiguous types in overloaded ABI Items.", {
|
|
8351
8351
|
metaMessages: [
|
|
@@ -8364,7 +8364,7 @@ class G2 extends be {
|
|
|
8364
8364
|
});
|
|
8365
8365
|
}
|
|
8366
8366
|
}
|
|
8367
|
-
class au extends
|
|
8367
|
+
class au extends we {
|
|
8368
8368
|
constructor({ name: t, data: r, type: n = "item" }) {
|
|
8369
8369
|
const i = t ? ` with name "${t}"` : r ? ` with data "${r}"` : "";
|
|
8370
8370
|
super(`ABI ${n}${i} not found.`), Object.defineProperty(this, "name", {
|
|
@@ -8499,7 +8499,7 @@ function X2(e, { type: t }) {
|
|
|
8499
8499
|
}
|
|
8500
8500
|
function J2(e) {
|
|
8501
8501
|
if (typeof e != "boolean")
|
|
8502
|
-
throw new
|
|
8502
|
+
throw new we(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
|
|
8503
8503
|
return { dynamic: !1, encoded: un(Nh(e)) };
|
|
8504
8504
|
}
|
|
8505
8505
|
function Q2(e, { signed: t, size: r }) {
|
|
@@ -8623,7 +8623,7 @@ function cu(e, t) {
|
|
|
8623
8623
|
}
|
|
8624
8624
|
e.encode = t;
|
|
8625
8625
|
})(cu || (cu = {}));
|
|
8626
|
-
class nv extends
|
|
8626
|
+
class nv extends we {
|
|
8627
8627
|
constructor({ expectedLength: t, givenLength: r, type: n }) {
|
|
8628
8628
|
super(`Array length mismatch for type \`${n}\`. Expected: \`${t}\`. Given: \`${r}\`.`), Object.defineProperty(this, "name", {
|
|
8629
8629
|
enumerable: !0,
|
|
@@ -8633,7 +8633,7 @@ class nv extends be {
|
|
|
8633
8633
|
});
|
|
8634
8634
|
}
|
|
8635
8635
|
}
|
|
8636
|
-
class C0 extends
|
|
8636
|
+
class C0 extends we {
|
|
8637
8637
|
constructor({ expectedSize: t, value: r }) {
|
|
8638
8638
|
super(`Size of bytes "${r}" (bytes${xt(r)}) does not match expected size (bytes${t}).`), Object.defineProperty(this, "name", {
|
|
8639
8639
|
enumerable: !0,
|
|
@@ -8643,7 +8643,7 @@ class C0 extends be {
|
|
|
8643
8643
|
});
|
|
8644
8644
|
}
|
|
8645
8645
|
}
|
|
8646
|
-
class R0 extends
|
|
8646
|
+
class R0 extends we {
|
|
8647
8647
|
constructor({ expectedLength: t, givenLength: r }) {
|
|
8648
8648
|
super([
|
|
8649
8649
|
"ABI encoding parameters/values length mismatch.",
|
|
@@ -8658,7 +8658,7 @@ class R0 extends be {
|
|
|
8658
8658
|
});
|
|
8659
8659
|
}
|
|
8660
8660
|
}
|
|
8661
|
-
class iv extends
|
|
8661
|
+
class iv extends we {
|
|
8662
8662
|
constructor(t) {
|
|
8663
8663
|
super(`Value \`${t}\` is not a valid array.`), Object.defineProperty(this, "name", {
|
|
8664
8664
|
enumerable: !0,
|
|
@@ -8668,7 +8668,7 @@ class iv extends be {
|
|
|
8668
8668
|
});
|
|
8669
8669
|
}
|
|
8670
8670
|
}
|
|
8671
|
-
class N0 extends
|
|
8671
|
+
class N0 extends we {
|
|
8672
8672
|
constructor(t) {
|
|
8673
8673
|
super(`Type \`${t}\` is not a valid ABI Type.`), Object.defineProperty(this, "name", {
|
|
8674
8674
|
enumerable: !0,
|
|
@@ -10964,11 +10964,11 @@ const jr = (e) => e.length === 64 ? e : e.slice(2), AE = (e) => {
|
|
|
10964
10964
|
}, Rd = (e, t, r, n) => e + ":" + t.toLowerCase() + "::" + r + ":" + n.toLowerCase();
|
|
10965
10965
|
function o5(e, t) {
|
|
10966
10966
|
if (!e) return !1;
|
|
10967
|
-
const r = t === Yt.MAINNET ?
|
|
10967
|
+
const r = t === Yt.MAINNET ? le.networks.bitcoin : t === Yt.TESTNET ? le.networks.testnet : le.networks.regtest;
|
|
10968
10968
|
if (!r) return !1;
|
|
10969
|
-
|
|
10969
|
+
le.initEccLib(gt);
|
|
10970
10970
|
try {
|
|
10971
|
-
return
|
|
10971
|
+
return le.address.toOutputScript(e, r), !0;
|
|
10972
10972
|
} catch {
|
|
10973
10973
|
return !1;
|
|
10974
10974
|
}
|
|
@@ -11019,7 +11019,7 @@ const Nd = async (e, t) => {
|
|
|
11019
11019
|
}
|
|
11020
11020
|
return !1;
|
|
11021
11021
|
};
|
|
11022
|
-
var
|
|
11022
|
+
var fe = /* @__PURE__ */ ((e) => (e.Created = "Created", e.Matched = "Matched", e.InitiateDetected = "InitiateDetected", e.Initiated = "Initiated", e.CounterPartyInitiateDetected = "CounterPartyInitiateDetected", e.CounterPartyInitiated = "CounterPartyInitiated", e.RedeemDetected = "RedeemDetected", e.Redeemed = "Redeemed", e.CounterPartyRedeemDetected = "CounterPartyRedeemDetected", e.CounterPartyRedeemed = "CounterPartyRedeemed", e.Completed = "Completed", e.CounterPartySwapExpired = "CounterPartySwapExpired", e.Expired = "Expired", e.RefundDetected = "RefundDetected", e.Refunded = "Refunded", e.CounterPartyRefundDetected = "CounterPartyRefundDetected", e.CounterPartyRefunded = "CounterPartyRefunded", e.Cancelled = "Cancelled", e.DeadLineExceeded = "DeadLineExceeded", e))(fe || {}), xe = /* @__PURE__ */ ((e) => (e.Idle = "Idle", e.InitiateDetected = "InitiateDetected", e.Initiated = "Initiated", e.RedeemDetected = "RedeemDetected", e.Redeemed = "Redeemed", e.RefundDetected = "RefundDetected", e.Refunded = "Refunded", e.Expired = "Expired", e))(xe || {});
|
|
11023
11023
|
const X0 = (e, t, r) => {
|
|
11024
11024
|
const n = Fd(
|
|
11025
11025
|
e.source_swap,
|
|
@@ -11029,22 +11029,22 @@ const X0 = (e, t, r) => {
|
|
|
11029
11029
|
r
|
|
11030
11030
|
);
|
|
11031
11031
|
if (i === xe.RedeemDetected)
|
|
11032
|
-
return
|
|
11033
|
-
if (i === xe.Redeemed) return
|
|
11034
|
-
if (n === xe.Refunded) return
|
|
11032
|
+
return fe.RedeemDetected;
|
|
11033
|
+
if (i === xe.Redeemed) return fe.Redeemed;
|
|
11034
|
+
if (n === xe.Refunded) return fe.Refunded;
|
|
11035
11035
|
if (n === xe.RefundDetected)
|
|
11036
|
-
return
|
|
11036
|
+
return fe.RefundDetected;
|
|
11037
11037
|
if (i === xe.Expired)
|
|
11038
|
-
return
|
|
11039
|
-
if (n === xe.Expired) return
|
|
11038
|
+
return fe.CounterPartySwapExpired;
|
|
11039
|
+
if (n === xe.Expired) return fe.Expired;
|
|
11040
11040
|
if (i === xe.Refunded)
|
|
11041
|
-
return
|
|
11041
|
+
return fe.CounterPartyRefunded;
|
|
11042
11042
|
if (i === xe.RefundDetected)
|
|
11043
|
-
return
|
|
11043
|
+
return fe.CounterPartyRefundDetected;
|
|
11044
11044
|
const s = Number(
|
|
11045
11045
|
e.create_order.additional_data.deadline
|
|
11046
11046
|
);
|
|
11047
|
-
return i === xe.Initiated ?
|
|
11047
|
+
return i === xe.Initiated ? fe.CounterPartyInitiated : i === xe.InitiateDetected ? fe.CounterPartyInitiateDetected : no(s, 12) ? fe.DeadLineExceeded : n === xe.Initiated ? fe.Initiated : no(s, 1) ? fe.DeadLineExceeded : n === xe.InitiateDetected ? fe.InitiateDetected : n === xe.Redeemed ? fe.CounterPartyRedeemed : n === xe.RedeemDetected ? fe.CounterPartyRedeemDetected : fe.Matched;
|
|
11048
11048
|
}, Fd = (e, t) => {
|
|
11049
11049
|
if (e.redeem_tx_hash)
|
|
11050
11050
|
return Number(e.redeem_block_number) ? xe.Redeemed : xe.RedeemDetected;
|
|
@@ -11064,16 +11064,16 @@ const X0 = (e, t, r) => {
|
|
|
11064
11064
|
return J0(n);
|
|
11065
11065
|
}, J0 = (e) => {
|
|
11066
11066
|
switch (e) {
|
|
11067
|
-
case
|
|
11068
|
-
return
|
|
11069
|
-
case
|
|
11070
|
-
case
|
|
11071
|
-
case
|
|
11072
|
-
return
|
|
11073
|
-
case
|
|
11074
|
-
return
|
|
11067
|
+
case fe.Matched:
|
|
11068
|
+
return Ee.Initiate;
|
|
11069
|
+
case fe.CounterPartyInitiated:
|
|
11070
|
+
case fe.CounterPartyInitiateDetected:
|
|
11071
|
+
case fe.RedeemDetected:
|
|
11072
|
+
return Ee.Redeem;
|
|
11073
|
+
case fe.Expired:
|
|
11074
|
+
return Ee.Refund;
|
|
11075
11075
|
default:
|
|
11076
|
-
return
|
|
11076
|
+
return Ee.Idle;
|
|
11077
11077
|
}
|
|
11078
11078
|
}, no = (e, t = 0) => {
|
|
11079
11079
|
const r = Date.now(), n = e * 1e3 + t * 36e5;
|
|
@@ -11521,10 +11521,10 @@ lf.write = function(e, t, r, n, i, s) {
|
|
|
11521
11521
|
return 1;
|
|
11522
11522
|
if (h >>>= 0, v >>>= 0, B >>>= 0, N >>>= 0, this === l) return 0;
|
|
11523
11523
|
let z = N - B, ce = v - h;
|
|
11524
|
-
const Se = Math.min(z, ce),
|
|
11525
|
-
for (let
|
|
11526
|
-
if (
|
|
11527
|
-
z =
|
|
11524
|
+
const Se = Math.min(z, ce), be = this.slice(B, N), Pe = l.slice(h, v);
|
|
11525
|
+
for (let he = 0; he < Se; ++he)
|
|
11526
|
+
if (be[he] !== Pe[he]) {
|
|
11527
|
+
z = be[he], ce = Pe[he];
|
|
11528
11528
|
break;
|
|
11529
11529
|
}
|
|
11530
11530
|
return z < ce ? -1 : ce < z ? 1 : 0;
|
|
@@ -11550,26 +11550,26 @@ lf.write = function(e, t, r, n, i, s) {
|
|
|
11550
11550
|
return -1;
|
|
11551
11551
|
N = 2, z /= 2, ce /= 2, h /= 2;
|
|
11552
11552
|
}
|
|
11553
|
-
function Se(Pe,
|
|
11554
|
-
return N === 1 ? Pe[
|
|
11553
|
+
function Se(Pe, he) {
|
|
11554
|
+
return N === 1 ? Pe[he] : Pe.readUInt16BE(he * N);
|
|
11555
11555
|
}
|
|
11556
|
-
let
|
|
11556
|
+
let be;
|
|
11557
11557
|
if (B) {
|
|
11558
11558
|
let Pe = -1;
|
|
11559
|
-
for (
|
|
11560
|
-
if (Se(m,
|
|
11561
|
-
if (Pe === -1 && (Pe =
|
|
11559
|
+
for (be = h; be < z; be++)
|
|
11560
|
+
if (Se(m, be) === Se(l, Pe === -1 ? 0 : be - Pe)) {
|
|
11561
|
+
if (Pe === -1 && (Pe = be), be - Pe + 1 === ce) return Pe * N;
|
|
11562
11562
|
} else
|
|
11563
|
-
Pe !== -1 && (
|
|
11563
|
+
Pe !== -1 && (be -= be - Pe), Pe = -1;
|
|
11564
11564
|
} else
|
|
11565
|
-
for (h + ce > z && (h = z - ce),
|
|
11565
|
+
for (h + ce > z && (h = z - ce), be = h; be >= 0; be--) {
|
|
11566
11566
|
let Pe = !0;
|
|
11567
|
-
for (let
|
|
11568
|
-
if (Se(m,
|
|
11567
|
+
for (let he = 0; he < ce; he++)
|
|
11568
|
+
if (Se(m, be + he) !== Se(l, he)) {
|
|
11569
11569
|
Pe = !1;
|
|
11570
11570
|
break;
|
|
11571
11571
|
}
|
|
11572
|
-
if (Pe) return
|
|
11572
|
+
if (Pe) return be;
|
|
11573
11573
|
}
|
|
11574
11574
|
return -1;
|
|
11575
11575
|
}
|
|
@@ -11661,19 +11661,19 @@ lf.write = function(e, t, r, n, i, s) {
|
|
|
11661
11661
|
const N = m[B];
|
|
11662
11662
|
let z = null, ce = N > 239 ? 4 : N > 223 ? 3 : N > 191 ? 2 : 1;
|
|
11663
11663
|
if (B + ce <= h) {
|
|
11664
|
-
let Se,
|
|
11664
|
+
let Se, be, Pe, he;
|
|
11665
11665
|
switch (ce) {
|
|
11666
11666
|
case 1:
|
|
11667
11667
|
N < 128 && (z = N);
|
|
11668
11668
|
break;
|
|
11669
11669
|
case 2:
|
|
11670
|
-
Se = m[B + 1], (Se & 192) === 128 && (
|
|
11670
|
+
Se = m[B + 1], (Se & 192) === 128 && (he = (N & 31) << 6 | Se & 63, he > 127 && (z = he));
|
|
11671
11671
|
break;
|
|
11672
11672
|
case 3:
|
|
11673
|
-
Se = m[B + 1],
|
|
11673
|
+
Se = m[B + 1], be = m[B + 2], (Se & 192) === 128 && (be & 192) === 128 && (he = (N & 15) << 12 | (Se & 63) << 6 | be & 63, he > 2047 && (he < 55296 || he > 57343) && (z = he));
|
|
11674
11674
|
break;
|
|
11675
11675
|
case 4:
|
|
11676
|
-
Se = m[B + 1],
|
|
11676
|
+
Se = m[B + 1], be = m[B + 2], Pe = m[B + 3], (Se & 192) === 128 && (be & 192) === 128 && (Pe & 192) === 128 && (he = (N & 15) << 18 | (Se & 63) << 12 | (be & 63) << 6 | Pe & 63, he > 65535 && he < 1114112 && (z = he));
|
|
11677
11677
|
}
|
|
11678
11678
|
}
|
|
11679
11679
|
z === null ? (z = 65533, ce = 1) : z > 65535 && (z -= 65536, v.push(z >>> 10 & 1023 | 55296), z = 56320 | z & 1023), v.push(z), B += ce;
|
|
@@ -11755,15 +11755,15 @@ lf.write = function(e, t, r, n, i, s) {
|
|
|
11755
11755
|
}, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(l, h) {
|
|
11756
11756
|
return l = l >>> 0, h || W(l, 4, this.length), this[l] * 16777216 + (this[l + 1] << 16 | this[l + 2] << 8 | this[l + 3]);
|
|
11757
11757
|
}, a.prototype.readBigUInt64LE = wr(function(l) {
|
|
11758
|
-
l = l >>> 0,
|
|
11758
|
+
l = l >>> 0, pe(l, "offset");
|
|
11759
11759
|
const h = this[l], v = this[l + 7];
|
|
11760
|
-
(h === void 0 || v === void 0) &&
|
|
11760
|
+
(h === void 0 || v === void 0) && ve(l, this.length - 8);
|
|
11761
11761
|
const B = h + this[++l] * 2 ** 8 + this[++l] * 2 ** 16 + this[++l] * 2 ** 24, N = this[++l] + this[++l] * 2 ** 8 + this[++l] * 2 ** 16 + v * 2 ** 24;
|
|
11762
11762
|
return BigInt(B) + (BigInt(N) << BigInt(32));
|
|
11763
11763
|
}), a.prototype.readBigUInt64BE = wr(function(l) {
|
|
11764
|
-
l = l >>> 0,
|
|
11764
|
+
l = l >>> 0, pe(l, "offset");
|
|
11765
11765
|
const h = this[l], v = this[l + 7];
|
|
11766
|
-
(h === void 0 || v === void 0) &&
|
|
11766
|
+
(h === void 0 || v === void 0) && ve(l, this.length - 8);
|
|
11767
11767
|
const B = h * 2 ** 24 + this[++l] * 2 ** 16 + this[++l] * 2 ** 8 + this[++l], N = this[++l] * 2 ** 24 + this[++l] * 2 ** 16 + this[++l] * 2 ** 8 + v;
|
|
11768
11768
|
return (BigInt(B) << BigInt(32)) + BigInt(N);
|
|
11769
11769
|
}), a.prototype.readIntLE = function(l, h, v) {
|
|
@@ -11793,15 +11793,15 @@ lf.write = function(e, t, r, n, i, s) {
|
|
|
11793
11793
|
}, a.prototype.readInt32BE = function(l, h) {
|
|
11794
11794
|
return l = l >>> 0, h || W(l, 4, this.length), this[l] << 24 | this[l + 1] << 16 | this[l + 2] << 8 | this[l + 3];
|
|
11795
11795
|
}, a.prototype.readBigInt64LE = wr(function(l) {
|
|
11796
|
-
l = l >>> 0,
|
|
11796
|
+
l = l >>> 0, pe(l, "offset");
|
|
11797
11797
|
const h = this[l], v = this[l + 7];
|
|
11798
|
-
(h === void 0 || v === void 0) &&
|
|
11798
|
+
(h === void 0 || v === void 0) && ve(l, this.length - 8);
|
|
11799
11799
|
const B = this[l + 4] + this[l + 5] * 2 ** 8 + this[l + 6] * 2 ** 16 + (v << 24);
|
|
11800
11800
|
return (BigInt(B) << BigInt(32)) + BigInt(h + this[++l] * 2 ** 8 + this[++l] * 2 ** 16 + this[++l] * 2 ** 24);
|
|
11801
11801
|
}), a.prototype.readBigInt64BE = wr(function(l) {
|
|
11802
|
-
l = l >>> 0,
|
|
11802
|
+
l = l >>> 0, pe(l, "offset");
|
|
11803
11803
|
const h = this[l], v = this[l + 7];
|
|
11804
|
-
(h === void 0 || v === void 0) &&
|
|
11804
|
+
(h === void 0 || v === void 0) && ve(l, this.length - 8);
|
|
11805
11805
|
const B = (h << 24) + // Overflow
|
|
11806
11806
|
this[++l] * 2 ** 16 + this[++l] * 2 ** 8 + this[++l];
|
|
11807
11807
|
return (BigInt(B) << BigInt(32)) + BigInt(this[++l] * 2 ** 24 + this[++l] * 2 ** 16 + this[++l] * 2 ** 8 + v);
|
|
@@ -11849,14 +11849,14 @@ lf.write = function(e, t, r, n, i, s) {
|
|
|
11849
11849
|
return l = +l, h = h >>> 0, v || I(this, l, h, 4, 4294967295, 0), this[h] = l >>> 24, this[h + 1] = l >>> 16, this[h + 2] = l >>> 8, this[h + 3] = l & 255, h + 4;
|
|
11850
11850
|
};
|
|
11851
11851
|
function R(m, l, h, v, B) {
|
|
11852
|
-
|
|
11852
|
+
de(l, v, B, m, h, 7);
|
|
11853
11853
|
let N = Number(l & BigInt(4294967295));
|
|
11854
11854
|
m[h++] = N, N = N >> 8, m[h++] = N, N = N >> 8, m[h++] = N, N = N >> 8, m[h++] = N;
|
|
11855
11855
|
let z = Number(l >> BigInt(32) & BigInt(4294967295));
|
|
11856
11856
|
return m[h++] = z, z = z >> 8, m[h++] = z, z = z >> 8, m[h++] = z, z = z >> 8, m[h++] = z, h;
|
|
11857
11857
|
}
|
|
11858
11858
|
function U(m, l, h, v, B) {
|
|
11859
|
-
|
|
11859
|
+
de(l, v, B, m, h, 7);
|
|
11860
11860
|
let N = Number(l & BigInt(4294967295));
|
|
11861
11861
|
m[h + 7] = N, N = N >> 8, m[h + 6] = N, N = N >> 8, m[h + 5] = N, N = N >> 8, m[h + 4] = N;
|
|
11862
11862
|
let z = Number(l >> BigInt(32) & BigInt(4294967295));
|
|
@@ -12015,9 +12015,9 @@ lf.write = function(e, t, r, n, i, s) {
|
|
|
12015
12015
|
return `${m.slice(0, h)}${l}`;
|
|
12016
12016
|
}
|
|
12017
12017
|
function oe(m, l, h) {
|
|
12018
|
-
|
|
12018
|
+
pe(l, "offset"), (m[l] === void 0 || m[l + h] === void 0) && ve(l, m.length - (h + 1));
|
|
12019
12019
|
}
|
|
12020
|
-
function
|
|
12020
|
+
function de(m, l, h, v, B, N) {
|
|
12021
12021
|
if (m > h || m < l) {
|
|
12022
12022
|
const z = typeof l == "bigint" ? "n" : "";
|
|
12023
12023
|
let ce;
|
|
@@ -12025,12 +12025,12 @@ lf.write = function(e, t, r, n, i, s) {
|
|
|
12025
12025
|
}
|
|
12026
12026
|
oe(v, B, N);
|
|
12027
12027
|
}
|
|
12028
|
-
function
|
|
12028
|
+
function pe(m, l) {
|
|
12029
12029
|
if (typeof m != "number")
|
|
12030
12030
|
throw new ne.ERR_INVALID_ARG_TYPE(l, "number", m);
|
|
12031
12031
|
}
|
|
12032
|
-
function
|
|
12033
|
-
throw Math.floor(m) !== m ? (
|
|
12032
|
+
function ve(m, l, h) {
|
|
12033
|
+
throw Math.floor(m) !== m ? (pe(m, h), new ne.ERR_OUT_OF_RANGE("offset", "an integer", m)) : l < 0 ? new ne.ERR_BUFFER_OUT_OF_BOUNDS() : new ne.ERR_OUT_OF_RANGE(
|
|
12034
12034
|
"offset",
|
|
12035
12035
|
`>= 0 and <= ${l}`,
|
|
12036
12036
|
m
|
|
@@ -14445,7 +14445,7 @@ ae.SIGHASH_OUTPUT_MASK = 3;
|
|
|
14445
14445
|
ae.SIGHASH_INPUT_MASK = 128;
|
|
14446
14446
|
ae.ADVANCED_TRANSACTION_MARKER = 0;
|
|
14447
14447
|
ae.ADVANCED_TRANSACTION_FLAG = 1;
|
|
14448
|
-
var
|
|
14448
|
+
var ye = {}, hs = {};
|
|
14449
14449
|
Object.defineProperty(hs, "__esModule", { value: !0 });
|
|
14450
14450
|
const A6 = 9007199254740991;
|
|
14451
14451
|
function bf(e) {
|
|
@@ -14963,27 +14963,27 @@ Mo.p2pkh = D6;
|
|
|
14963
14963
|
var Do = {};
|
|
14964
14964
|
Object.defineProperty(Do, "__esModule", { value: !0 });
|
|
14965
14965
|
Do.p2sh = void 0;
|
|
14966
|
-
const Zd = Lr, j6 = ze, zt = ft(),
|
|
14966
|
+
const Zd = Lr, j6 = ze, zt = ft(), ge = qe, Mt = at, Xd = wf, pi = zt.OPS;
|
|
14967
14967
|
function z6(e, t) {
|
|
14968
14968
|
if (!e.address && !e.hash && !e.output && !e.redeem && !e.input)
|
|
14969
14969
|
throw new TypeError("Not enough data");
|
|
14970
|
-
t = Object.assign({ validate: !0 }, t || {}), (0,
|
|
14970
|
+
t = Object.assign({ validate: !0 }, t || {}), (0, ge.typeforce)(
|
|
14971
14971
|
{
|
|
14972
|
-
network:
|
|
14973
|
-
address:
|
|
14974
|
-
hash:
|
|
14975
|
-
output:
|
|
14976
|
-
redeem:
|
|
14977
|
-
network:
|
|
14978
|
-
output:
|
|
14979
|
-
input:
|
|
14980
|
-
witness:
|
|
14981
|
-
|
|
14972
|
+
network: ge.typeforce.maybe(ge.typeforce.Object),
|
|
14973
|
+
address: ge.typeforce.maybe(ge.typeforce.String),
|
|
14974
|
+
hash: ge.typeforce.maybe(ge.typeforce.BufferN(20)),
|
|
14975
|
+
output: ge.typeforce.maybe(ge.typeforce.BufferN(23)),
|
|
14976
|
+
redeem: ge.typeforce.maybe({
|
|
14977
|
+
network: ge.typeforce.maybe(ge.typeforce.Object),
|
|
14978
|
+
output: ge.typeforce.maybe(ge.typeforce.Buffer),
|
|
14979
|
+
input: ge.typeforce.maybe(ge.typeforce.Buffer),
|
|
14980
|
+
witness: ge.typeforce.maybe(
|
|
14981
|
+
ge.typeforce.arrayOf(ge.typeforce.Buffer)
|
|
14982
14982
|
)
|
|
14983
14983
|
}),
|
|
14984
|
-
input:
|
|
14985
|
-
witness:
|
|
14986
|
-
|
|
14984
|
+
input: ge.typeforce.maybe(ge.typeforce.Buffer),
|
|
14985
|
+
witness: ge.typeforce.maybe(
|
|
14986
|
+
ge.typeforce.arrayOf(ge.typeforce.Buffer)
|
|
14987
14987
|
)
|
|
14988
14988
|
},
|
|
14989
14989
|
e
|
|
@@ -15097,7 +15097,7 @@ function z6(e, t) {
|
|
|
15097
15097
|
}
|
|
15098
15098
|
c(e.redeem);
|
|
15099
15099
|
}
|
|
15100
|
-
if (e.witness && e.redeem && e.redeem.witness && !(0,
|
|
15100
|
+
if (e.witness && e.redeem && e.redeem.witness && !(0, ge.stacksEqual)(e.redeem.witness, e.witness))
|
|
15101
15101
|
throw new TypeError("Witness and redeem.witness mismatch");
|
|
15102
15102
|
}
|
|
15103
15103
|
return Object.assign(n, e);
|
|
@@ -15341,30 +15341,30 @@ jo.p2wpkh = Y6;
|
|
|
15341
15341
|
var zo = {};
|
|
15342
15342
|
Object.defineProperty(zo, "__esModule", { value: !0 });
|
|
15343
15343
|
zo.p2wsh = void 0;
|
|
15344
|
-
const el = Lr, Z6 = ze, ar = ft(),
|
|
15344
|
+
const el = Lr, Z6 = ze, ar = ft(), me = qe, sr = at, Cs = mr, tl = ar.OPS, Ta = Buffer.alloc(0);
|
|
15345
15345
|
function Rs(e) {
|
|
15346
|
-
return !!(Buffer.isBuffer(e) && e.length === 65 && e[0] === 4 && (0,
|
|
15346
|
+
return !!(Buffer.isBuffer(e) && e.length === 65 && e[0] === 4 && (0, me.isPoint)(e));
|
|
15347
15347
|
}
|
|
15348
15348
|
function X6(e, t) {
|
|
15349
15349
|
if (!e.address && !e.hash && !e.output && !e.redeem && !e.witness)
|
|
15350
15350
|
throw new TypeError("Not enough data");
|
|
15351
|
-
t = Object.assign({ validate: !0 }, t || {}), (0,
|
|
15351
|
+
t = Object.assign({ validate: !0 }, t || {}), (0, me.typeforce)(
|
|
15352
15352
|
{
|
|
15353
|
-
network:
|
|
15354
|
-
address:
|
|
15355
|
-
hash:
|
|
15356
|
-
output:
|
|
15357
|
-
redeem:
|
|
15358
|
-
input:
|
|
15359
|
-
network:
|
|
15360
|
-
output:
|
|
15361
|
-
witness:
|
|
15362
|
-
|
|
15353
|
+
network: me.typeforce.maybe(me.typeforce.Object),
|
|
15354
|
+
address: me.typeforce.maybe(me.typeforce.String),
|
|
15355
|
+
hash: me.typeforce.maybe(me.typeforce.BufferN(32)),
|
|
15356
|
+
output: me.typeforce.maybe(me.typeforce.BufferN(34)),
|
|
15357
|
+
redeem: me.typeforce.maybe({
|
|
15358
|
+
input: me.typeforce.maybe(me.typeforce.Buffer),
|
|
15359
|
+
network: me.typeforce.maybe(me.typeforce.Object),
|
|
15360
|
+
output: me.typeforce.maybe(me.typeforce.Buffer),
|
|
15361
|
+
witness: me.typeforce.maybe(
|
|
15362
|
+
me.typeforce.arrayOf(me.typeforce.Buffer)
|
|
15363
15363
|
)
|
|
15364
15364
|
}),
|
|
15365
|
-
input:
|
|
15366
|
-
witness:
|
|
15367
|
-
|
|
15365
|
+
input: me.typeforce.maybe(me.typeforce.BufferN(0)),
|
|
15366
|
+
witness: me.typeforce.maybe(
|
|
15367
|
+
me.typeforce.arrayOf(me.typeforce.Buffer)
|
|
15368
15368
|
)
|
|
15369
15369
|
},
|
|
15370
15370
|
e
|
|
@@ -15459,7 +15459,7 @@ function X6(e, t) {
|
|
|
15459
15459
|
}
|
|
15460
15460
|
if (e.redeem.input && !ar.isPushOnly(n()))
|
|
15461
15461
|
throw new TypeError("Non push-only scriptSig");
|
|
15462
|
-
if (e.witness && e.redeem.witness && !(0,
|
|
15462
|
+
if (e.witness && e.redeem.witness && !(0, me.stacksEqual)(e.witness, e.redeem.witness))
|
|
15463
15463
|
throw new TypeError("Witness and redeem.witness mismatch");
|
|
15464
15464
|
if (e.redeem.input && n().some(Rs) || e.redeem.output && (ar.decompile(e.redeem.output) || []).some(
|
|
15465
15465
|
Rs
|
|
@@ -16017,8 +16017,8 @@ function xf() {
|
|
|
16017
16017
|
});
|
|
16018
16018
|
}(Aa)), Aa;
|
|
16019
16019
|
}
|
|
16020
|
-
Object.defineProperty(
|
|
16021
|
-
|
|
16020
|
+
Object.defineProperty(ye, "__esModule", { value: !0 });
|
|
16021
|
+
ye.signatureBlocksAction = ye.checkInputForSig = ye.pubkeyInScript = ye.pubkeyPositionInScript = ye.witnessStackToScriptWitness = ye.isP2TR = ye.isP2SHScript = ye.isP2WSHScript = ye.isP2WPKH = ye.isP2PKH = ye.isP2PK = ye.isP2MS = void 0;
|
|
16022
16022
|
const sl = hs, ki = ft(), Ns = ps, ix = Lr, bn = xf();
|
|
16023
16023
|
function wn(e) {
|
|
16024
16024
|
return (t) => {
|
|
@@ -16029,13 +16029,13 @@ function wn(e) {
|
|
|
16029
16029
|
}
|
|
16030
16030
|
};
|
|
16031
16031
|
}
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
|
|
16038
|
-
|
|
16032
|
+
ye.isP2MS = wn(bn.p2ms);
|
|
16033
|
+
ye.isP2PK = wn(bn.p2pk);
|
|
16034
|
+
ye.isP2PKH = wn(bn.p2pkh);
|
|
16035
|
+
ye.isP2WPKH = wn(bn.p2wpkh);
|
|
16036
|
+
ye.isP2WSHScript = wn(bn.p2wsh);
|
|
16037
|
+
ye.isP2SHScript = wn(bn.p2sh);
|
|
16038
|
+
ye.isP2TR = wn(bn.p2tr);
|
|
16039
16039
|
function sx(e) {
|
|
16040
16040
|
let t = Buffer.allocUnsafe(0);
|
|
16041
16041
|
function r(o) {
|
|
@@ -16053,23 +16053,23 @@ function sx(e) {
|
|
|
16053
16053
|
}
|
|
16054
16054
|
return s(e), t;
|
|
16055
16055
|
}
|
|
16056
|
-
|
|
16056
|
+
ye.witnessStackToScriptWitness = sx;
|
|
16057
16057
|
function Py(e, t) {
|
|
16058
16058
|
const r = (0, ix.hash160)(e), n = e.slice(1, 33), i = ki.decompile(t);
|
|
16059
16059
|
if (i === null) throw new Error("Unknown script error");
|
|
16060
16060
|
return i.findIndex((s) => typeof s == "number" ? !1 : s.equals(e) || s.equals(r) || s.equals(n));
|
|
16061
16061
|
}
|
|
16062
|
-
|
|
16062
|
+
ye.pubkeyPositionInScript = Py;
|
|
16063
16063
|
function ox(e, t) {
|
|
16064
16064
|
return Py(e, t) !== -1;
|
|
16065
16065
|
}
|
|
16066
|
-
|
|
16066
|
+
ye.pubkeyInScript = ox;
|
|
16067
16067
|
function ax(e, t) {
|
|
16068
16068
|
return cx(e).some(
|
|
16069
16069
|
(n) => Ty(n, ki.signature.decode, t)
|
|
16070
16070
|
);
|
|
16071
16071
|
}
|
|
16072
|
-
|
|
16072
|
+
ye.checkInputForSig = ax;
|
|
16073
16073
|
function Ty(e, t, r) {
|
|
16074
16074
|
const { hashType: n } = t(e), i = [];
|
|
16075
16075
|
switch (n & Ns.Transaction.SIGHASH_ANYONECANPAY && i.push("addInput"), n & 31) {
|
|
@@ -16082,7 +16082,7 @@ function Ty(e, t, r) {
|
|
|
16082
16082
|
}
|
|
16083
16083
|
return i.indexOf(r) === -1;
|
|
16084
16084
|
}
|
|
16085
|
-
|
|
16085
|
+
ye.signatureBlocksAction = Ty;
|
|
16086
16086
|
function cx(e) {
|
|
16087
16087
|
let t = [];
|
|
16088
16088
|
if ((e.partialSig || []).length === 0) {
|
|
@@ -16098,7 +16098,7 @@ function ux(e) {
|
|
|
16098
16098
|
}
|
|
16099
16099
|
Object.defineProperty(Ae, "__esModule", { value: !0 });
|
|
16100
16100
|
Ae.checkTaprootInputForSigs = Ae.tapTreeFromList = Ae.tapTreeToList = Ae.tweakInternalPubKey = Ae.checkTaprootOutputFields = Ae.checkTaprootInputFields = Ae.isTaprootOutput = Ae.isTaprootInput = Vs = Ae.serializeTaprootSignature = Ae.tapScriptFinalizer = Ae.toXOnly = void 0;
|
|
16101
|
-
const Af = qe, fx = ps, qo =
|
|
16101
|
+
const Af = qe, fx = ps, qo = ye, Ur = Ef, dx = xf(), lx = ye, px = (e) => e.length === 32 ? e : e.slice(1, 33);
|
|
16102
16102
|
Ae.toXOnly = px;
|
|
16103
16103
|
function hx(e, t, r) {
|
|
16104
16104
|
const n = Cx(
|
|
@@ -16330,7 +16330,7 @@ const Ue = {
|
|
|
16330
16330
|
controlBlockGenerationFailed: "failed to generate control block",
|
|
16331
16331
|
invalidLeaf: "invalid leaf"
|
|
16332
16332
|
}, Fs = 192;
|
|
16333
|
-
|
|
16333
|
+
le.initEccLib(gt);
|
|
16334
16334
|
class Bi {
|
|
16335
16335
|
/**
|
|
16336
16336
|
* Note: redeemerAddress and initiatorAddress should be x-only public key without 02 or 03 prefix
|
|
@@ -16375,7 +16375,7 @@ class Bi {
|
|
|
16375
16375
|
* Generates a taproot address for receiving the funds
|
|
16376
16376
|
*/
|
|
16377
16377
|
address() {
|
|
16378
|
-
const { address: t } =
|
|
16378
|
+
const { address: t } = le.payments.p2tr({
|
|
16379
16379
|
internalPubkey: this.internalPubkey,
|
|
16380
16380
|
network: this.network,
|
|
16381
16381
|
scriptTree: this.leaves()
|
|
@@ -16390,7 +16390,7 @@ class Bi {
|
|
|
16390
16390
|
return this.address();
|
|
16391
16391
|
}
|
|
16392
16392
|
async _buildRawTx(t, r) {
|
|
16393
|
-
const n = new
|
|
16393
|
+
const n = new le.Transaction();
|
|
16394
16394
|
n.version = 2;
|
|
16395
16395
|
const i = this.address(), s = await this.signer.getProvider();
|
|
16396
16396
|
let o = [];
|
|
@@ -16414,12 +16414,12 @@ class Bi {
|
|
|
16414
16414
|
for (let c = 0; c < o.length; c++)
|
|
16415
16415
|
n.addInput(Buffer.from(o[c].txid, "hex").reverse(), o[c].vout);
|
|
16416
16416
|
return r ?? (r = await s.suggestFee(i, a, $n.MEDIUM)), n.addOutput(
|
|
16417
|
-
|
|
16417
|
+
le.address.toOutputScript(t, this.network),
|
|
16418
16418
|
a - r
|
|
16419
16419
|
), { tx: n, usedUtxos: o };
|
|
16420
16420
|
}
|
|
16421
16421
|
async _tempBuildRawTx(t, r) {
|
|
16422
|
-
const n = new
|
|
16422
|
+
const n = new le.Transaction();
|
|
16423
16423
|
n.version = 2;
|
|
16424
16424
|
const i = this.address(), s = await this.signer.getProvider();
|
|
16425
16425
|
let o = [];
|
|
@@ -16443,7 +16443,7 @@ class Bi {
|
|
|
16443
16443
|
for (let c = 0; c < o.length; c++)
|
|
16444
16444
|
n.addInput(Buffer.from(o[c].txid, "hex").reverse(), o[c].vout);
|
|
16445
16445
|
if (n.addOutput(
|
|
16446
|
-
|
|
16446
|
+
le.address.toOutputScript(t, this.network),
|
|
16447
16447
|
a
|
|
16448
16448
|
), r) {
|
|
16449
16449
|
const c = await s.getFeeRates(), f = Math.ceil(c.hourFee * r), u = a - f;
|
|
@@ -16462,7 +16462,7 @@ class Bi {
|
|
|
16462
16462
|
* prevout script for the gardenHTLC address
|
|
16463
16463
|
*/
|
|
16464
16464
|
getOutputScript() {
|
|
16465
|
-
return
|
|
16465
|
+
return le.address.toOutputScript(this.address(), this.network);
|
|
16466
16466
|
}
|
|
16467
16467
|
async init(t) {
|
|
16468
16468
|
return t ?? (t = await (await this.signer.getProvider()).suggestFee(
|
|
@@ -16472,7 +16472,7 @@ class Bi {
|
|
|
16472
16472
|
)), await this.signer.send(this.address(), this.initiateAmount, t);
|
|
16473
16473
|
}
|
|
16474
16474
|
async generateRedeemSACP(t, r, n) {
|
|
16475
|
-
const { tx: i, usedUtxos: s } = await this._buildRawTx(r, n), o = this.getOutputScript(), a =
|
|
16475
|
+
const { tx: i, usedUtxos: s } = await this._buildRawTx(r, n), o = this.getOutputScript(), a = le.Transaction.SIGHASH_SINGLE | le.Transaction.SIGHASH_ANYONECANPAY, c = this.leafHash(
|
|
16476
16476
|
1
|
|
16477
16477
|
/* REDEEM */
|
|
16478
16478
|
), f = s.map((d) => d.value), u = Sn(o, s.length);
|
|
@@ -16497,7 +16497,7 @@ class Bi {
|
|
|
16497
16497
|
return i.toHex();
|
|
16498
16498
|
}
|
|
16499
16499
|
async generateInstantRefundSACP(t, r) {
|
|
16500
|
-
const { tx: n, usedUtxos: i } = await this._buildRawTx(t, r), s = this.getOutputScript(), o =
|
|
16500
|
+
const { tx: n, usedUtxos: i } = await this._buildRawTx(t, r), s = this.getOutputScript(), o = le.Transaction.SIGHASH_SINGLE | le.Transaction.SIGHASH_ANYONECANPAY, a = this.leafHash(
|
|
16501
16501
|
2
|
|
16502
16502
|
/* INSTANT_REFUND */
|
|
16503
16503
|
), c = i.map((u) => u.value), f = Sn(s, i.length);
|
|
@@ -16535,7 +16535,7 @@ class Bi {
|
|
|
16535
16535
|
for (const d of i)
|
|
16536
16536
|
if (!t.find((y) => y.utxo === d.txid))
|
|
16537
16537
|
throw new Error(Ue.counterPartySigNotFound(d.txid));
|
|
16538
|
-
const s = this.getOutputScript(), o =
|
|
16538
|
+
const s = this.getOutputScript(), o = le.Transaction.SIGHASH_DEFAULT, a = this.leafHash(
|
|
16539
16539
|
2
|
|
16540
16540
|
/* INSTANT_REFUND */
|
|
16541
16541
|
), c = i.map((d) => d.value), f = Sn(s, i.length);
|
|
@@ -16575,7 +16575,7 @@ class Bi {
|
|
|
16575
16575
|
*/
|
|
16576
16576
|
async redeem(t, r) {
|
|
16577
16577
|
Dr(
|
|
16578
|
-
|
|
16578
|
+
le.crypto.sha256(Buffer.from(t, "hex")).toString("hex") === this.secretHash,
|
|
16579
16579
|
Ue.secretMismatch
|
|
16580
16580
|
);
|
|
16581
16581
|
const n = r ?? await this.signer.getAddress(), { tx: i, usedUtxos: s } = await this._tempBuildRawTx(
|
|
@@ -16583,7 +16583,7 @@ class Bi {
|
|
|
16583
16583
|
), o = this.leafHash(
|
|
16584
16584
|
1
|
|
16585
16585
|
/* REDEEM */
|
|
16586
|
-
), a = s.map((y) => y.value), c = Sn(this.getOutputScript(), s.length), f =
|
|
16586
|
+
), a = s.map((y) => y.value), c = Sn(this.getOutputScript(), s.length), f = le.Transaction.SIGHASH_DEFAULT;
|
|
16587
16587
|
for (let y = 0; y < i.ins.length; y++) {
|
|
16588
16588
|
const p = i.hashForWitnessV1(
|
|
16589
16589
|
y,
|
|
@@ -16628,7 +16628,7 @@ class Bi {
|
|
|
16628
16628
|
}
|
|
16629
16629
|
async getRedeemHex(t, r) {
|
|
16630
16630
|
Dr(
|
|
16631
|
-
|
|
16631
|
+
le.crypto.sha256(Buffer.from(t, "hex")).toString("hex") === this.secretHash,
|
|
16632
16632
|
Ue.secretMismatch
|
|
16633
16633
|
);
|
|
16634
16634
|
const n = r ?? await this.signer.getAddress(), { tx: i, usedUtxos: s } = await this._tempBuildRawTx(
|
|
@@ -16636,7 +16636,7 @@ class Bi {
|
|
|
16636
16636
|
), o = this.leafHash(
|
|
16637
16637
|
1
|
|
16638
16638
|
/* REDEEM */
|
|
16639
|
-
), a = s.map((d) => d.value), c = Sn(this.getOutputScript(), s.length), f =
|
|
16639
|
+
), a = s.map((d) => d.value), c = Sn(this.getOutputScript(), s.length), f = le.Transaction.SIGHASH_DEFAULT;
|
|
16640
16640
|
for (let d = 0; d < i.ins.length; d++) {
|
|
16641
16641
|
const y = i.hashForWitnessV1(
|
|
16642
16642
|
d,
|
|
@@ -16692,7 +16692,7 @@ class Bi {
|
|
|
16692
16692
|
const a = this.leafHash(
|
|
16693
16693
|
0
|
|
16694
16694
|
/* REFUND */
|
|
16695
|
-
), c = i.map((y) => y.value), f = Sn(this.getOutputScript(), i.length), u =
|
|
16695
|
+
), c = i.map((y) => y.value), f = Sn(this.getOutputScript(), i.length), u = le.Transaction.SIGHASH_DEFAULT;
|
|
16696
16696
|
for (let y = 0; y < n.ins.length; y++) {
|
|
16697
16697
|
n.ins[y].sequence = this.expiry;
|
|
16698
16698
|
const p = n.hashForWitnessV1(
|
|
@@ -16743,7 +16743,7 @@ class Bi {
|
|
|
16743
16743
|
default:
|
|
16744
16744
|
throw new Error(Ue.invalidLeaf);
|
|
16745
16745
|
}
|
|
16746
|
-
const n =
|
|
16746
|
+
const n = le.payments.p2tr({
|
|
16747
16747
|
internalPubkey: this.internalPubkey,
|
|
16748
16748
|
network: this.network,
|
|
16749
16749
|
scriptTree: this.leaves(),
|
|
@@ -16763,12 +16763,12 @@ class Bi {
|
|
|
16763
16763
|
*/
|
|
16764
16764
|
leafHash(t) {
|
|
16765
16765
|
let r = this.redeemLeaf();
|
|
16766
|
-
return t === 0 && (r = this.refundLeaf()), t === 2 && (r = this.instantRefundLeaf()),
|
|
16766
|
+
return t === 0 && (r = this.refundLeaf()), t === 2 && (r = this.instantRefundLeaf()), le.crypto.taggedHash("TapLeaf", vE(r));
|
|
16767
16767
|
}
|
|
16768
16768
|
refundLeaf() {
|
|
16769
|
-
return
|
|
16769
|
+
return le.script.fromASM(
|
|
16770
16770
|
`
|
|
16771
|
-
${
|
|
16771
|
+
${le.script.number.encode(this.expiry).toString("hex")}
|
|
16772
16772
|
OP_CHECKSEQUENCEVERIFY
|
|
16773
16773
|
OP_DROP
|
|
16774
16774
|
${this.initiatorPubkey}
|
|
@@ -16777,7 +16777,7 @@ class Bi {
|
|
|
16777
16777
|
);
|
|
16778
16778
|
}
|
|
16779
16779
|
redeemLeaf() {
|
|
16780
|
-
return
|
|
16780
|
+
return le.script.fromASM(
|
|
16781
16781
|
`
|
|
16782
16782
|
OP_SHA256
|
|
16783
16783
|
${this.secretHash}
|
|
@@ -16788,7 +16788,7 @@ class Bi {
|
|
|
16788
16788
|
);
|
|
16789
16789
|
}
|
|
16790
16790
|
instantRefundLeaf() {
|
|
16791
|
-
return
|
|
16791
|
+
return le.script.fromASM(
|
|
16792
16792
|
`
|
|
16793
16793
|
${this.initiatorPubkey}
|
|
16794
16794
|
OP_CHECKSIG
|
|
@@ -16839,7 +16839,7 @@ class Bi {
|
|
|
16839
16839
|
n
|
|
16840
16840
|
);
|
|
16841
16841
|
return [
|
|
16842
|
-
|
|
16842
|
+
le.crypto.taggedHash(
|
|
16843
16843
|
"TapBranch",
|
|
16844
16844
|
Buffer.concat(s)
|
|
16845
16845
|
)
|
|
@@ -21933,11 +21933,11 @@ function Dy() {
|
|
|
21933
21933
|
else if (te === "%AsyncGeneratorFunction%")
|
|
21934
21934
|
oe = x("async function* () {}");
|
|
21935
21935
|
else if (te === "%AsyncGenerator%") {
|
|
21936
|
-
var
|
|
21937
|
-
|
|
21936
|
+
var de = re("%AsyncGeneratorFunction%");
|
|
21937
|
+
de && (oe = de.prototype);
|
|
21938
21938
|
} else if (te === "%AsyncIteratorPrototype%") {
|
|
21939
|
-
var
|
|
21940
|
-
|
|
21939
|
+
var pe = re("%AsyncGenerator%");
|
|
21940
|
+
pe && C && (oe = C(pe.prototype));
|
|
21941
21941
|
}
|
|
21942
21942
|
return V[te] = oe, oe;
|
|
21943
21943
|
}, J = {
|
|
@@ -21994,25 +21994,25 @@ function Dy() {
|
|
|
21994
21994
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
21995
21995
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
21996
21996
|
}, M = ms(), k = My(), q = M.call(O, Array.prototype.concat), W = M.call(F, Array.prototype.splice), I = M.call(O, String.prototype.replace), R = M.call(O, String.prototype.slice), U = M.call(O, RegExp.prototype.exec), Z = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Q = /\\(\\)?/g, se = function(te) {
|
|
21997
|
-
var oe = R(te, 0, 1),
|
|
21998
|
-
if (oe === "%" &&
|
|
21997
|
+
var oe = R(te, 0, 1), de = R(te, -1);
|
|
21998
|
+
if (oe === "%" && de !== "%")
|
|
21999
21999
|
throw new o("invalid intrinsic syntax, expected closing `%`");
|
|
22000
|
-
if (
|
|
22000
|
+
if (de === "%" && oe !== "%")
|
|
22001
22001
|
throw new o("invalid intrinsic syntax, expected opening `%`");
|
|
22002
|
-
var
|
|
22003
|
-
return I(te, Z, function(
|
|
22004
|
-
|
|
22005
|
-
}),
|
|
22002
|
+
var pe = [];
|
|
22003
|
+
return I(te, Z, function(ve, st, Ce, Rt) {
|
|
22004
|
+
pe[pe.length] = Ce ? I(Rt, Q, "$1") : st || ve;
|
|
22005
|
+
}), pe;
|
|
22006
22006
|
}, ne = function(te, oe) {
|
|
22007
|
-
var
|
|
22008
|
-
if (k(J,
|
|
22009
|
-
var
|
|
22010
|
-
if (
|
|
22007
|
+
var de = te, pe;
|
|
22008
|
+
if (k(J, de) && (pe = J[de], de = "%" + pe[0] + "%"), k(V, de)) {
|
|
22009
|
+
var ve = V[de];
|
|
22010
|
+
if (ve === $ && (ve = X(de)), typeof ve > "u" && !oe)
|
|
22011
22011
|
throw new a("intrinsic " + te + " exists, but is not available. Please file an issue!");
|
|
22012
22012
|
return {
|
|
22013
|
-
alias:
|
|
22014
|
-
name:
|
|
22015
|
-
value:
|
|
22013
|
+
alias: pe,
|
|
22014
|
+
name: de,
|
|
22015
|
+
value: ve
|
|
22016
22016
|
};
|
|
22017
22017
|
}
|
|
22018
22018
|
throw new o("intrinsic " + te + " does not exist!");
|
|
@@ -22024,13 +22024,13 @@ function Dy() {
|
|
|
22024
22024
|
throw new a('"allowMissing" argument must be a boolean');
|
|
22025
22025
|
if (U(/^%?[^%]*%?$/, te) === null)
|
|
22026
22026
|
throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
22027
|
-
var
|
|
22028
|
-
Mr && (
|
|
22029
|
-
for (var G = 1, Nt = !0; G <
|
|
22030
|
-
var Ge =
|
|
22027
|
+
var de = se(te), pe = de.length > 0 ? de[0] : "", ve = ne("%" + pe + "%", oe), st = ve.name, Ce = ve.value, Rt = !1, Mr = ve.alias;
|
|
22028
|
+
Mr && (pe = Mr[0], W(de, q([0, 1], Mr)));
|
|
22029
|
+
for (var G = 1, Nt = !0; G < de.length; G += 1) {
|
|
22030
|
+
var Ge = de[G], Ve = R(Ge, 0, 1), br = R(Ge, -1);
|
|
22031
22031
|
if ((Ve === '"' || Ve === "'" || Ve === "`" || br === '"' || br === "'" || br === "`") && Ve !== br)
|
|
22032
22032
|
throw new o("property names with quotes must have matching quotes");
|
|
22033
|
-
if ((Ge === "constructor" || !Nt) && (Rt = !0),
|
|
22033
|
+
if ((Ge === "constructor" || !Nt) && (Rt = !0), pe += "." + Ge, st = "%" + pe + "%", k(V, st))
|
|
22034
22034
|
Ce = V[st];
|
|
22035
22035
|
else if (Ce != null) {
|
|
22036
22036
|
if (!(Ge in Ce)) {
|
|
@@ -22038,7 +22038,7 @@ function Dy() {
|
|
|
22038
22038
|
throw new a("base intrinsic for " + te + " exists, but the property is not available.");
|
|
22039
22039
|
return;
|
|
22040
22040
|
}
|
|
22041
|
-
if (S && G + 1 >=
|
|
22041
|
+
if (S && G + 1 >= de.length) {
|
|
22042
22042
|
var vn = S(Ce, Ge);
|
|
22043
22043
|
Nt = !!vn, Nt && "get" in vn && !("originalValue" in vn.get) ? Ce = vn.get : Ce = Ce[Ge];
|
|
22044
22044
|
} else
|
|
@@ -22623,18 +22623,18 @@ function y_() {
|
|
|
22623
22623
|
return c(G) === "[object WebAssembly.Module]";
|
|
22624
22624
|
}
|
|
22625
22625
|
e.isWebAssemblyCompiledModule = oe;
|
|
22626
|
-
function
|
|
22626
|
+
function de(G) {
|
|
22627
22627
|
return g(G, f);
|
|
22628
22628
|
}
|
|
22629
|
-
e.isNumberObject =
|
|
22630
|
-
function
|
|
22629
|
+
e.isNumberObject = de;
|
|
22630
|
+
function pe(G) {
|
|
22631
22631
|
return g(G, u);
|
|
22632
22632
|
}
|
|
22633
|
-
e.isStringObject =
|
|
22634
|
-
function
|
|
22633
|
+
e.isStringObject = pe;
|
|
22634
|
+
function ve(G) {
|
|
22635
22635
|
return g(G, d);
|
|
22636
22636
|
}
|
|
22637
|
-
e.isBooleanObject =
|
|
22637
|
+
e.isBooleanObject = ve;
|
|
22638
22638
|
function st(G) {
|
|
22639
22639
|
return o && g(G, y);
|
|
22640
22640
|
}
|
|
@@ -22644,7 +22644,7 @@ function y_() {
|
|
|
22644
22644
|
}
|
|
22645
22645
|
e.isSymbolObject = Ce;
|
|
22646
22646
|
function Rt(G) {
|
|
22647
|
-
return
|
|
22647
|
+
return de(G) || pe(G) || ve(G) || st(G) || Ce(G);
|
|
22648
22648
|
}
|
|
22649
22649
|
e.isBoxedPrimitive = Rt;
|
|
22650
22650
|
function Mr(G) {
|
|
@@ -22826,20 +22826,20 @@ function zy() {
|
|
|
22826
22826
|
if (O(R))
|
|
22827
22827
|
return y(R);
|
|
22828
22828
|
}
|
|
22829
|
-
var te = "", oe = !1,
|
|
22830
|
-
if (E(R) && (oe = !0,
|
|
22831
|
-
var
|
|
22832
|
-
te = " [Function" +
|
|
22829
|
+
var te = "", oe = !1, de = ["{", "}"];
|
|
22830
|
+
if (E(R) && (oe = !0, de = ["[", "]"]), $(R)) {
|
|
22831
|
+
var pe = R.name ? ": " + R.name : "";
|
|
22832
|
+
te = " [Function" + pe + "]";
|
|
22833
22833
|
}
|
|
22834
22834
|
if (L(R) && (te = " " + RegExp.prototype.toString.call(R)), F(R) && (te = " " + Date.prototype.toUTCString.call(R)), O(R) && (te = " " + y(R)), se.length === 0 && (!oe || R.length == 0))
|
|
22835
|
-
return
|
|
22835
|
+
return de[0] + te + de[1];
|
|
22836
22836
|
if (U < 0)
|
|
22837
22837
|
return L(R) ? I.stylize(RegExp.prototype.toString.call(R), "regexp") : I.stylize("[Object]", "special");
|
|
22838
22838
|
I.seen.push(R);
|
|
22839
|
-
var
|
|
22840
|
-
return oe ?
|
|
22839
|
+
var ve;
|
|
22840
|
+
return oe ? ve = p(I, R, U, ne, se) : ve = se.map(function(st) {
|
|
22841
22841
|
return g(I, R, U, ne, st, oe);
|
|
22842
|
-
}), I.seen.pop(), b(
|
|
22842
|
+
}), I.seen.pop(), b(ve, te, de);
|
|
22843
22843
|
}
|
|
22844
22844
|
function d(I, R) {
|
|
22845
22845
|
if (C(R))
|
|
@@ -23694,13 +23694,12 @@ class Wy extends dp {
|
|
|
23694
23694
|
!0,
|
|
23695
23695
|
t,
|
|
23696
23696
|
async (r) => {
|
|
23697
|
-
const n = await this.
|
|
23698
|
-
r.data
|
|
23699
|
-
);
|
|
23697
|
+
const n = await this.assignStatus(r.data);
|
|
23700
23698
|
if (n.ok && (this.emit("onPendingOrdersChanged", n.val), r.data.length !== 0))
|
|
23701
23699
|
for (let i = 0; i < n.val.length; i++) {
|
|
23702
23700
|
const s = n.val[i], o = J0(s.status);
|
|
23703
|
-
if (Ko(s.source_swap.chain)
|
|
23701
|
+
if (Ko(s.source_swap.chain) && // post refund sacp for bitcoin orders only at relevent statuses
|
|
23702
|
+
(s.status === fe.InitiateDetected || s.status === fe.Initiated || s.status === fe.CounterPartyInitiated || s.status === fe.CounterPartyInitiateDetected || s.status === fe.CounterPartyRefundDetected || s.status === fe.CounterPartyRefunded || s.status === fe.CounterPartySwapExpired || s.status === fe.Expired || s.status === fe.DeadLineExceeded)) {
|
|
23704
23703
|
const a = this._btcWallet;
|
|
23705
23704
|
if (!a) {
|
|
23706
23705
|
this.emit("error", s, "BTC wallet not found");
|
|
@@ -23709,7 +23708,7 @@ class Wy extends dp {
|
|
|
23709
23708
|
await this.postRefundSACP(s, a);
|
|
23710
23709
|
}
|
|
23711
23710
|
switch (o) {
|
|
23712
|
-
case
|
|
23711
|
+
case Ee.Redeem: {
|
|
23713
23712
|
const a = await this._secretManager.generateSecret(
|
|
23714
23713
|
s.create_order.nonce
|
|
23715
23714
|
);
|
|
@@ -23747,7 +23746,7 @@ class Wy extends dp {
|
|
|
23747
23746
|
}
|
|
23748
23747
|
break;
|
|
23749
23748
|
}
|
|
23750
|
-
case
|
|
23749
|
+
case Ee.Refund: {
|
|
23751
23750
|
switch (Yo(s.source_swap.chain)) {
|
|
23752
23751
|
case dt.Solana: {
|
|
23753
23752
|
this.emit(
|
|
@@ -23801,7 +23800,7 @@ class Wy extends dp {
|
|
|
23801
23800
|
);
|
|
23802
23801
|
}
|
|
23803
23802
|
async solRedeem(t, r) {
|
|
23804
|
-
if (this.emit("log", t.create_order.create_id, "executing sol redeem"), this.orderExecutorCache.get(t,
|
|
23803
|
+
if (this.emit("log", t.create_order.create_id, "executing sol redeem"), this.orderExecutorCache.get(t, Ee.Redeem)) {
|
|
23805
23804
|
this.emit("log", t.create_order.create_id, "already redeemed");
|
|
23806
23805
|
return;
|
|
23807
23806
|
}
|
|
@@ -23813,15 +23812,15 @@ class Wy extends dp {
|
|
|
23813
23812
|
if (i.error) {
|
|
23814
23813
|
this.emit("error", t, i.error), i.error.includes("Order already redeemed") && this.orderExecutorCache.set(
|
|
23815
23814
|
t,
|
|
23816
|
-
|
|
23815
|
+
Ee.Redeem,
|
|
23817
23816
|
t.destination_swap.redeem_tx_hash
|
|
23818
23817
|
);
|
|
23819
23818
|
return;
|
|
23820
23819
|
}
|
|
23821
|
-
i.val && (this.orderExecutorCache.set(t,
|
|
23820
|
+
i.val && (this.orderExecutorCache.set(t, Ee.Redeem, i.val), this.emit("success", t, Ee.Redeem, i.val));
|
|
23822
23821
|
}
|
|
23823
23822
|
async evmRedeem(t, r) {
|
|
23824
|
-
if (this.emit("log", t.create_order.create_id, "executing evm redeem"), this.orderExecutorCache.get(t,
|
|
23823
|
+
if (this.emit("log", t.create_order.create_id, "executing evm redeem"), this.orderExecutorCache.get(t, Ee.Redeem)) {
|
|
23825
23824
|
this.emit("log", t.create_order.create_id, "already redeemed");
|
|
23826
23825
|
return;
|
|
23827
23826
|
}
|
|
@@ -23833,15 +23832,15 @@ class Wy extends dp {
|
|
|
23833
23832
|
if (!i.ok) {
|
|
23834
23833
|
this.emit("error", t, i.error), i.error.includes("Order already redeemed") && this.orderExecutorCache.set(
|
|
23835
23834
|
t,
|
|
23836
|
-
|
|
23835
|
+
Ee.Redeem,
|
|
23837
23836
|
t.destination_swap.redeem_tx_hash
|
|
23838
23837
|
);
|
|
23839
23838
|
return;
|
|
23840
23839
|
}
|
|
23841
|
-
this.orderExecutorCache.set(t,
|
|
23840
|
+
this.orderExecutorCache.set(t, Ee.Redeem, i.val), this.emit("success", t, Ee.Redeem, i.val);
|
|
23842
23841
|
}
|
|
23843
23842
|
async starknetRedeem(t, r) {
|
|
23844
|
-
if (this.emit("log", t.create_order.create_id, "executing starknet redeem"), this.orderExecutorCache.get(t,
|
|
23843
|
+
if (this.emit("log", t.create_order.create_id, "executing starknet redeem"), this.orderExecutorCache.get(t, Ee.Redeem)) {
|
|
23845
23844
|
this.emit("log", t.create_order.create_id, "already redeemed");
|
|
23846
23845
|
return;
|
|
23847
23846
|
}
|
|
@@ -23853,12 +23852,12 @@ class Wy extends dp {
|
|
|
23853
23852
|
if (!i.ok) {
|
|
23854
23853
|
this.emit("error", t, i.error), i.error.includes("Order already redeemed") && this.orderExecutorCache.set(
|
|
23855
23854
|
t,
|
|
23856
|
-
|
|
23855
|
+
Ee.Redeem,
|
|
23857
23856
|
t.destination_swap.redeem_tx_hash
|
|
23858
23857
|
);
|
|
23859
23858
|
return;
|
|
23860
23859
|
}
|
|
23861
|
-
i.val && (this.orderExecutorCache.set(t,
|
|
23860
|
+
i.val && (this.orderExecutorCache.set(t, Ee.Redeem, i.val), this.emit("success", t, Ee.Redeem, i.val));
|
|
23862
23861
|
}
|
|
23863
23862
|
async btcRedeem(t, r, n) {
|
|
23864
23863
|
var a, c;
|
|
@@ -23951,7 +23950,7 @@ class Wy extends dp {
|
|
|
23951
23950
|
"log",
|
|
23952
23951
|
r.create_order.create_id,
|
|
23953
23952
|
"rbf: btc redeem success"
|
|
23954
|
-
), this.emit("rbf", r, d.val)) : this.emit("success", r,
|
|
23953
|
+
), this.emit("rbf", r, d.val)) : this.emit("success", r, Ee.Redeem, d.val), this.bitcoinRedeemCache.set(r.create_order.create_id, {
|
|
23955
23954
|
redeemedFromUTXO: s,
|
|
23956
23955
|
redeemedAt: Date.now(),
|
|
23957
23956
|
redeemTxHash: d.val
|
|
@@ -23962,7 +23961,7 @@ class Wy extends dp {
|
|
|
23962
23961
|
}
|
|
23963
23962
|
async btcRefund(t, r) {
|
|
23964
23963
|
var n;
|
|
23965
|
-
if (!this.orderExecutorCache.get(r,
|
|
23964
|
+
if (!this.orderExecutorCache.get(r, Ee.Refund)) {
|
|
23966
23965
|
this.emit("log", r.create_order.create_id, "executing btc refund");
|
|
23967
23966
|
try {
|
|
23968
23967
|
const s = await (await Bi.from(
|
|
@@ -23975,7 +23974,7 @@ class Wy extends dp {
|
|
|
23975
23974
|
)).refund(
|
|
23976
23975
|
(n = r.create_order.additional_data) == null ? void 0 : n.bitcoin_optional_recipient
|
|
23977
23976
|
);
|
|
23978
|
-
this.orderExecutorCache.set(r,
|
|
23977
|
+
this.orderExecutorCache.set(r, Ee.Refund, s), this.emit("success", r, Ee.Refund, s);
|
|
23979
23978
|
} catch (i) {
|
|
23980
23979
|
this.emit("error", r, "Failed btc refund: " + i);
|
|
23981
23980
|
}
|
|
@@ -24016,7 +24015,7 @@ class Wy extends dp {
|
|
|
24016
24015
|
return;
|
|
24017
24016
|
}
|
|
24018
24017
|
}
|
|
24019
|
-
async
|
|
24018
|
+
async assignStatus(t) {
|
|
24020
24019
|
var i;
|
|
24021
24020
|
if (t.length === 0) return ie([]);
|
|
24022
24021
|
const r = await ((i = this._blockNumberFetcher) == null ? void 0 : i.fetchBlockNumbers());
|
|
@@ -24289,7 +24288,7 @@ export {
|
|
|
24289
24288
|
aA as L,
|
|
24290
24289
|
sA as M,
|
|
24291
24290
|
wt as N,
|
|
24292
|
-
|
|
24291
|
+
Ee as O,
|
|
24293
24292
|
X0 as P,
|
|
24294
24293
|
Ux as Q,
|
|
24295
24294
|
vA as R,
|
|
@@ -24312,7 +24311,7 @@ export {
|
|
|
24312
24311
|
d5 as k,
|
|
24313
24312
|
nf as l,
|
|
24314
24313
|
$x as m,
|
|
24315
|
-
|
|
24314
|
+
fe as n,
|
|
24316
24315
|
xe as o,
|
|
24317
24316
|
a5 as p,
|
|
24318
24317
|
Fd as q,
|