@gardenfi/core 3.0.6 → 3.0.7
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-B3rC4a4B.cjs → ccip-D_7TxSBL.cjs} +1 -1
- package/dist/{ccip-CEYa5LHY.js → ccip-DuJNhB3j.js} +1 -1
- package/dist/{index-D8ji0NGd.cjs → index-BPpJbLfH.cjs} +3 -3
- package/dist/{index-i5Tm5x54.js → index-iviEKv0P.js} +84 -84
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ var w6 = (t, e, r) => e in t ? g6(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
6
6
|
var _p = (t, e, r) => w6(t, typeof e != "symbol" ? e + "" : e, r), Tp = (t, e, r) => e.has(t) || kp("Cannot " + r);
|
|
7
7
|
var Be = (t, e, r) => (Tp(t, e, "read from private field"), r ? r.call(t) : e.get(t)), vs = (t, e, r) => e.has(t) ? kp("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Es = (t, e, r, n) => (Tp(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r);
|
|
8
8
|
import { ChainAsset as Ct, Assets as v6, BlockchainType as Ze, isOrder as E6, isBitcoin as ki, ArbitrumLocalnet as S6, EthereumLocalnet as A6, isEvmOrderResponse as Fm, isEVM as x6, isEvmNativeToken as k6, isStarknetOrderResponse as jm, isSolanaOrderResponse as Lm, isSolanaNativeToken as _6, isSuiOrderResponse as Hm, OrderStatus as di, isCompleted as T6, parseAction as I6, OrderAction as ut, getBlockchainType as P6, OrderLifecycle as O6, Orderbook as B6 } from "@gardenfi/orderbook";
|
|
9
|
-
import { Network as Qe, Environment as Ip, Ok as re, Err as B, Fetcher as ht, waitForTransactionReceipt as Li, sleep as Po, trim0x as lt, Url as Vt, EventBroker as Dm, with0x as
|
|
9
|
+
import { Network as Qe, Environment as Ip, Ok as re, Err as B, Fetcher as ht, waitForTransactionReceipt as Li, sleep as Po, trim0x as lt, Url as Vt, EventBroker as Dm, with0x as ke, checkAllowanceAndApprove as C6, hexToU32Array as Oc, DigestKey as $6, ApiKey as R6, hasKeys as N6 } from "@gardenfi/utils";
|
|
10
10
|
import * as Se from "bitcoinjs-lib";
|
|
11
11
|
import { crypto as U6, Transaction as qr, script as $s, payments as Xr, address as Oo, networks as Hu, Psbt as Pp, initEccLib as M6 } from "bitcoinjs-lib";
|
|
12
12
|
import * as pr from "tiny-secp256k1";
|
|
@@ -5370,7 +5370,7 @@ async function cu(t, e) {
|
|
|
5370
5370
|
});
|
|
5371
5371
|
return ne === "0x" ? { data: void 0 } : { data: ne };
|
|
5372
5372
|
} catch (te) {
|
|
5373
|
-
const G = j8(te), { offchainLookup: I, offchainLookupSignature: j } = await import("./ccip-
|
|
5373
|
+
const G = j8(te), { offchainLookup: I, offchainLookupSignature: j } = await import("./ccip-DuJNhB3j.js");
|
|
5374
5374
|
if (t.ccipRead !== !1 && (G == null ? void 0 : G.slice(0, 10)) === j && g)
|
|
5375
5375
|
return { data: await I(t, { data: G, to: g }) };
|
|
5376
5376
|
throw M && (G == null ? void 0 : G.slice(0, 10)) === "0x101bb98d" ? new wE({ factory: p }) : xg(te, {
|
|
@@ -11214,11 +11214,11 @@ function N3(t) {
|
|
|
11214
11214
|
const ye = u(ie), me = f.BASE.multiply(ie).toAffine(), ge = c(me.x);
|
|
11215
11215
|
if (ge === xn)
|
|
11216
11216
|
return;
|
|
11217
|
-
const
|
|
11218
|
-
if (
|
|
11217
|
+
const xe = c(ye * c(le + ge * F));
|
|
11218
|
+
if (xe === xn)
|
|
11219
11219
|
return;
|
|
11220
|
-
let tt = (me.x === ge ? 0 : 2) | Number(me.y & ft), Oe =
|
|
11221
|
-
return j && m(
|
|
11220
|
+
let tt = (me.x === ge ? 0 : 2) | Number(me.y & ft), Oe = xe;
|
|
11221
|
+
return j && m(xe) && (Oe = b(xe), tt ^= 1), new S(ge, Oe, tt);
|
|
11222
11222
|
}
|
|
11223
11223
|
return { seed: ae, k2sig: ue };
|
|
11224
11224
|
}
|
|
@@ -12351,11 +12351,11 @@ const hf = {
|
|
|
12351
12351
|
}, Uc = {
|
|
12352
12352
|
[Qe.MAINNET]: {
|
|
12353
12353
|
chainId: "0x534e5f4d41494e",
|
|
12354
|
-
nodeUrl: "https://starknet
|
|
12354
|
+
nodeUrl: "https://rpc.starknet.lava.build"
|
|
12355
12355
|
},
|
|
12356
12356
|
[Qe.TESTNET]: {
|
|
12357
12357
|
chainId: "0x534e5f5345504f4c4941",
|
|
12358
|
-
nodeUrl: "https://starknet-sepolia.
|
|
12358
|
+
nodeUrl: "https://starknet-sepolia-rpc.publicnode.com"
|
|
12359
12359
|
},
|
|
12360
12360
|
[Qe.LOCALNET]: {
|
|
12361
12361
|
chainId: "",
|
|
@@ -13271,13 +13271,13 @@ Kh.write = function(t, e, r, n, s, i) {
|
|
|
13271
13271
|
}, a.prototype.readBigUInt64LE = Dn(function(h) {
|
|
13272
13272
|
h = h >>> 0, ge(h, "offset");
|
|
13273
13273
|
const y = this[h], A = this[h + 7];
|
|
13274
|
-
(y === void 0 || A === void 0) &&
|
|
13274
|
+
(y === void 0 || A === void 0) && xe(h, this.length - 8);
|
|
13275
13275
|
const C = y + this[++h] * 2 ** 8 + this[++h] * 2 ** 16 + this[++h] * 2 ** 24, U = this[++h] + this[++h] * 2 ** 8 + this[++h] * 2 ** 16 + A * 2 ** 24;
|
|
13276
13276
|
return BigInt(C) + (BigInt(U) << BigInt(32));
|
|
13277
13277
|
}), a.prototype.readBigUInt64BE = Dn(function(h) {
|
|
13278
13278
|
h = h >>> 0, ge(h, "offset");
|
|
13279
13279
|
const y = this[h], A = this[h + 7];
|
|
13280
|
-
(y === void 0 || A === void 0) &&
|
|
13280
|
+
(y === void 0 || A === void 0) && xe(h, this.length - 8);
|
|
13281
13281
|
const C = y * 2 ** 24 + this[++h] * 2 ** 16 + this[++h] * 2 ** 8 + this[++h], U = this[++h] * 2 ** 24 + this[++h] * 2 ** 16 + this[++h] * 2 ** 8 + A;
|
|
13282
13282
|
return (BigInt(C) << BigInt(32)) + BigInt(U);
|
|
13283
13283
|
}), a.prototype.readIntLE = function(h, y, A) {
|
|
@@ -13309,13 +13309,13 @@ Kh.write = function(t, e, r, n, s, i) {
|
|
|
13309
13309
|
}, a.prototype.readBigInt64LE = Dn(function(h) {
|
|
13310
13310
|
h = h >>> 0, ge(h, "offset");
|
|
13311
13311
|
const y = this[h], A = this[h + 7];
|
|
13312
|
-
(y === void 0 || A === void 0) &&
|
|
13312
|
+
(y === void 0 || A === void 0) && xe(h, this.length - 8);
|
|
13313
13313
|
const C = this[h + 4] + this[h + 5] * 2 ** 8 + this[h + 6] * 2 ** 16 + (A << 24);
|
|
13314
13314
|
return (BigInt(C) << BigInt(32)) + BigInt(y + this[++h] * 2 ** 8 + this[++h] * 2 ** 16 + this[++h] * 2 ** 24);
|
|
13315
13315
|
}), a.prototype.readBigInt64BE = Dn(function(h) {
|
|
13316
13316
|
h = h >>> 0, ge(h, "offset");
|
|
13317
13317
|
const y = this[h], A = this[h + 7];
|
|
13318
|
-
(y === void 0 || A === void 0) &&
|
|
13318
|
+
(y === void 0 || A === void 0) && xe(h, this.length - 8);
|
|
13319
13319
|
const C = (y << 24) + // Overflow
|
|
13320
13320
|
this[++h] * 2 ** 16 + this[++h] * 2 ** 8 + this[++h];
|
|
13321
13321
|
return (BigInt(C) << BigInt(32)) + BigInt(this[++h] * 2 ** 24 + this[++h] * 2 ** 16 + this[++h] * 2 ** 8 + A);
|
|
@@ -13529,7 +13529,7 @@ Kh.write = function(t, e, r, n, s, i) {
|
|
|
13529
13529
|
return `${w.slice(0, y)}${h}`;
|
|
13530
13530
|
}
|
|
13531
13531
|
function ye(w, h, y) {
|
|
13532
|
-
ge(h, "offset"), (w[h] === void 0 || w[h + y] === void 0) &&
|
|
13532
|
+
ge(h, "offset"), (w[h] === void 0 || w[h + y] === void 0) && xe(h, w.length - (y + 1));
|
|
13533
13533
|
}
|
|
13534
13534
|
function me(w, h, y, A, C, U) {
|
|
13535
13535
|
if (w > y || w < h) {
|
|
@@ -13543,7 +13543,7 @@ Kh.write = function(t, e, r, n, s, i) {
|
|
|
13543
13543
|
if (typeof w != "number")
|
|
13544
13544
|
throw new ue.ERR_INVALID_ARG_TYPE(h, "number", w);
|
|
13545
13545
|
}
|
|
13546
|
-
function
|
|
13546
|
+
function xe(w, h, y) {
|
|
13547
13547
|
throw Math.floor(w) !== w ? (ge(w, y), new ue.ERR_OUT_OF_RANGE("offset", "an integer", w)) : h < 0 ? new ue.ERR_BUFFER_OUT_OF_BOUNDS() : new ue.ERR_OUT_OF_RANGE(
|
|
13548
13548
|
"offset",
|
|
13549
13549
|
`>= 0 and <= ${h}`,
|
|
@@ -18461,7 +18461,7 @@ class ha extends Dm {
|
|
|
18461
18461
|
async generateSecret(e) {
|
|
18462
18462
|
const r = await this.signMessage(e);
|
|
18463
18463
|
if (!r.ok) return B(r.error);
|
|
18464
|
-
const n = So(
|
|
18464
|
+
const n = So(ke(r.val)), s = So(n);
|
|
18465
18465
|
return re({ secret: n, secretHash: s });
|
|
18466
18466
|
}
|
|
18467
18467
|
async signMessage(e) {
|
|
@@ -19314,15 +19314,15 @@ const DT = async (t, e) => {
|
|
|
19314
19314
|
if (!t.account) return B("No account found");
|
|
19315
19315
|
try {
|
|
19316
19316
|
const n = await Th({
|
|
19317
|
-
address:
|
|
19317
|
+
address: ke(e.htlc),
|
|
19318
19318
|
abi: HT,
|
|
19319
19319
|
client: t
|
|
19320
19320
|
}).write.initiate(
|
|
19321
19321
|
[
|
|
19322
|
-
|
|
19322
|
+
ke(e.redeemer),
|
|
19323
19323
|
e.timelock,
|
|
19324
19324
|
e.amount,
|
|
19325
|
-
|
|
19325
|
+
ke(e.secretHash)
|
|
19326
19326
|
],
|
|
19327
19327
|
{ account: t.account, chain: t.chain, value: e.amount }
|
|
19328
19328
|
), s = await Li(t, n);
|
|
@@ -19334,7 +19334,7 @@ const DT = async (t, e) => {
|
|
|
19334
19334
|
if (!t.account) return B("No account found");
|
|
19335
19335
|
try {
|
|
19336
19336
|
const s = Th({
|
|
19337
|
-
address:
|
|
19337
|
+
address: ke(n.htlc),
|
|
19338
19338
|
abi: Ow,
|
|
19339
19339
|
client: t
|
|
19340
19340
|
}), i = await C6(
|
|
@@ -19362,10 +19362,10 @@ const DT = async (t, e) => {
|
|
|
19362
19362
|
},
|
|
19363
19363
|
primaryType: "Initiate",
|
|
19364
19364
|
message: {
|
|
19365
|
-
redeemer:
|
|
19365
|
+
redeemer: ke(n.redeemer),
|
|
19366
19366
|
timelock: n.timelock,
|
|
19367
19367
|
amount: n.amount,
|
|
19368
|
-
secretHash:
|
|
19368
|
+
secretHash: ke(n.secretHash)
|
|
19369
19369
|
}
|
|
19370
19370
|
}), c = new ja(r, e), u = await Q1({
|
|
19371
19371
|
wallet: t,
|
|
@@ -19374,10 +19374,10 @@ const DT = async (t, e) => {
|
|
|
19374
19374
|
if (u) return re(u);
|
|
19375
19375
|
const f = await s.write.initiate(
|
|
19376
19376
|
[
|
|
19377
|
-
|
|
19377
|
+
ke(n.redeemer),
|
|
19378
19378
|
n.timelock,
|
|
19379
19379
|
n.amount,
|
|
19380
|
-
|
|
19380
|
+
ke(n.secretHash)
|
|
19381
19381
|
],
|
|
19382
19382
|
{ account: t.account, chain: t.chain }
|
|
19383
19383
|
), l = await Li(t, f);
|
|
@@ -19390,9 +19390,9 @@ const DT = async (t, e) => {
|
|
|
19390
19390
|
try {
|
|
19391
19391
|
const r = await t.sendTransaction({
|
|
19392
19392
|
account: t.account,
|
|
19393
|
-
to:
|
|
19393
|
+
to: ke(e.to),
|
|
19394
19394
|
value: BigInt(e.value),
|
|
19395
|
-
data:
|
|
19395
|
+
data: ke(e.data),
|
|
19396
19396
|
gas: BigInt(e.gas_limit),
|
|
19397
19397
|
chain: t.chain
|
|
19398
19398
|
}), n = await Li(t, r);
|
|
@@ -20149,10 +20149,10 @@ class vI {
|
|
|
20149
20149
|
const i = await qh(s.asset, this.url);
|
|
20150
20150
|
if (!i.ok) return B(i.error);
|
|
20151
20151
|
const o = Ct.fromString(s.asset), a = {
|
|
20152
|
-
redeemer:
|
|
20152
|
+
redeemer: ke(s.redeemer),
|
|
20153
20153
|
timelock: BigInt(s.timelock),
|
|
20154
20154
|
amount: BigInt(s.amount),
|
|
20155
|
-
secretHash:
|
|
20155
|
+
secretHash: ke(s.secret_hash)
|
|
20156
20156
|
};
|
|
20157
20157
|
return k6(o.chain, o.symbol) ? DT(this.wallet, {
|
|
20158
20158
|
...a,
|
|
@@ -20177,9 +20177,9 @@ class vI {
|
|
|
20177
20177
|
const o = e.initiate_transaction, a = await this.wallet.sendTransaction({
|
|
20178
20178
|
account: this.wallet.account,
|
|
20179
20179
|
chain: this.wallet.chain,
|
|
20180
|
-
to:
|
|
20180
|
+
to: ke(o.to),
|
|
20181
20181
|
value: BigInt(o.value),
|
|
20182
|
-
data:
|
|
20182
|
+
data: ke(o.data),
|
|
20183
20183
|
gas: BigInt(o.gas_limit)
|
|
20184
20184
|
}), c = await Li(this.wallet, a);
|
|
20185
20185
|
return c.ok ? !c.val || c.val.status !== "success" ? B("Native initiate transaction failed") : re(a) : B(c.error);
|
|
@@ -20203,15 +20203,15 @@ class vI {
|
|
|
20203
20203
|
if (i) return re(i);
|
|
20204
20204
|
try {
|
|
20205
20205
|
const o = Th({
|
|
20206
|
-
address:
|
|
20206
|
+
address: ke(e.initiate_transaction.to),
|
|
20207
20207
|
abi: Ow,
|
|
20208
20208
|
client: this.wallet
|
|
20209
20209
|
}), a = e.typed_data.message, c = await o.write.initiate(
|
|
20210
20210
|
[
|
|
20211
|
-
|
|
20211
|
+
ke(a.redeemer),
|
|
20212
20212
|
BigInt(a.timelock),
|
|
20213
20213
|
BigInt(a.amount),
|
|
20214
|
-
|
|
20214
|
+
ke(a.secretHash)
|
|
20215
20215
|
],
|
|
20216
20216
|
{ account: this.wallet.account, chain: this.wallet.chain }
|
|
20217
20217
|
), u = await Li(this.wallet, c);
|
|
@@ -21378,9 +21378,9 @@ const $w = [
|
|
|
21378
21378
|
return re("Allowance already approved");
|
|
21379
21379
|
const a = Bo.uint256(BigInt(n)), c = await t.execute([
|
|
21380
21380
|
{
|
|
21381
|
-
contractAddress:
|
|
21381
|
+
contractAddress: ke(e),
|
|
21382
21382
|
entrypoint: "approve",
|
|
21383
|
-
calldata: [
|
|
21383
|
+
calldata: [ke(r), a.low, a.high]
|
|
21384
21384
|
}
|
|
21385
21385
|
]);
|
|
21386
21386
|
await s.waitForTransaction(
|
|
@@ -21426,11 +21426,11 @@ const $w = [
|
|
|
21426
21426
|
try {
|
|
21427
21427
|
const i = await new Zd(
|
|
21428
21428
|
$w,
|
|
21429
|
-
|
|
21429
|
+
ke(e),
|
|
21430
21430
|
n
|
|
21431
21431
|
).call("allowance", [
|
|
21432
|
-
|
|
21433
|
-
|
|
21432
|
+
ke(t),
|
|
21433
|
+
ke(r)
|
|
21434
21434
|
]);
|
|
21435
21435
|
return re(BigInt((i == null ? void 0 : i.toString()) || "0"));
|
|
21436
21436
|
} catch (s) {
|
|
@@ -21751,11 +21751,11 @@ class xI {
|
|
|
21751
21751
|
const { source_swap: n } = r, { redeemer: s, amount: i } = n, { secret_hash: o, timelock: a } = n, c = n.asset;
|
|
21752
21752
|
try {
|
|
21753
21753
|
const u = Bo.uint256(BigInt(i)), f = {
|
|
21754
|
-
contractAddress:
|
|
21754
|
+
contractAddress: ke(e),
|
|
21755
21755
|
entrypoint: "approve",
|
|
21756
21756
|
calldata: [c, u.low, u.high]
|
|
21757
21757
|
}, l = Bo.uint256(i), p = {
|
|
21758
|
-
contractAddress:
|
|
21758
|
+
contractAddress: ke(c),
|
|
21759
21759
|
entrypoint: "initiate",
|
|
21760
21760
|
calldata: [
|
|
21761
21761
|
s,
|
|
@@ -21777,7 +21777,7 @@ class xI {
|
|
|
21777
21777
|
const { source_swap: r } = e, { redeemer: n, amount: s } = r;
|
|
21778
21778
|
if (!r.secret_hash)
|
|
21779
21779
|
return B("Invalid order: secret_hash is undefined");
|
|
21780
|
-
const i =
|
|
21780
|
+
const i = ke(r.secret_hash), a = {
|
|
21781
21781
|
domain: {
|
|
21782
21782
|
name: "HTLC",
|
|
21783
21783
|
version: L6.encodeShortString("1"),
|
|
@@ -21821,8 +21821,8 @@ class xI {
|
|
|
21821
21821
|
try {
|
|
21822
21822
|
const r = e.approval_transaction, n = await this.account.execute([
|
|
21823
21823
|
{
|
|
21824
|
-
contractAddress:
|
|
21825
|
-
entrypoint:
|
|
21824
|
+
contractAddress: ke(r.to),
|
|
21825
|
+
entrypoint: "approve",
|
|
21826
21826
|
calldata: r.calldata
|
|
21827
21827
|
}
|
|
21828
21828
|
]);
|
|
@@ -21848,8 +21848,8 @@ class xI {
|
|
|
21848
21848
|
if (!c) return B("No initiate_transaction found for native initiate");
|
|
21849
21849
|
const u = await this.account.execute([
|
|
21850
21850
|
{
|
|
21851
|
-
contractAddress:
|
|
21852
|
-
entrypoint:
|
|
21851
|
+
contractAddress: ke(c.to),
|
|
21852
|
+
entrypoint: "initiate",
|
|
21853
21853
|
calldata: c.calldata
|
|
21854
21854
|
}
|
|
21855
21855
|
]);
|
|
@@ -23420,19 +23420,19 @@ function Dw() {
|
|
|
23420
23420
|
if (me === "%" && ye !== "%")
|
|
23421
23421
|
throw new o("invalid intrinsic syntax, expected opening `%`");
|
|
23422
23422
|
var ge = [];
|
|
23423
|
-
return P(ie, ne, function(
|
|
23424
|
-
ge[ge.length] = Oe ? P(Mr, ae, "$1") : tt ||
|
|
23423
|
+
return P(ie, ne, function(xe, tt, Oe, Mr) {
|
|
23424
|
+
ge[ge.length] = Oe ? P(Mr, ae, "$1") : tt || xe;
|
|
23425
23425
|
}), ge;
|
|
23426
23426
|
}, ue = function(ie, ye) {
|
|
23427
23427
|
var me = ie, ge;
|
|
23428
23428
|
if (I(te, me) && (ge = te[me], me = "%" + ge[0] + "%"), I(J, me)) {
|
|
23429
|
-
var
|
|
23430
|
-
if (
|
|
23429
|
+
var xe = J[me];
|
|
23430
|
+
if (xe === V && (xe = K(me)), typeof xe > "u" && !ye)
|
|
23431
23431
|
throw new a("intrinsic " + ie + " exists, but is not available. Please file an issue!");
|
|
23432
23432
|
return {
|
|
23433
23433
|
alias: ge,
|
|
23434
23434
|
name: me,
|
|
23435
|
-
value:
|
|
23435
|
+
value: xe
|
|
23436
23436
|
};
|
|
23437
23437
|
}
|
|
23438
23438
|
throw new o("intrinsic " + ie + " does not exist!");
|
|
@@ -23444,7 +23444,7 @@ function Dw() {
|
|
|
23444
23444
|
throw new a('"allowMissing" argument must be a boolean');
|
|
23445
23445
|
if (F(/^%?[^%]*%?$/, ie) === null)
|
|
23446
23446
|
throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
23447
|
-
var me = le(ie), ge = me.length > 0 ? me[0] : "",
|
|
23447
|
+
var me = le(ie), ge = me.length > 0 ? me[0] : "", xe = ue("%" + ge + "%", ye), tt = xe.name, Oe = xe.value, Mr = !1, ws = xe.alias;
|
|
23448
23448
|
ws && (ge = ws[0], X(me, j([0, 1], ws)));
|
|
23449
23449
|
for (var z = 1, Fr = !0; z < me.length; z += 1) {
|
|
23450
23450
|
var _t = me[z], Tt = R(_t, 0, 1), Hn = R(_t, -1);
|
|
@@ -24051,10 +24051,10 @@ function EP() {
|
|
|
24051
24051
|
return m(z, f);
|
|
24052
24052
|
}
|
|
24053
24053
|
t.isStringObject = ge;
|
|
24054
|
-
function
|
|
24054
|
+
function xe(z) {
|
|
24055
24055
|
return m(z, l);
|
|
24056
24056
|
}
|
|
24057
|
-
t.isBooleanObject =
|
|
24057
|
+
t.isBooleanObject = xe;
|
|
24058
24058
|
function tt(z) {
|
|
24059
24059
|
return o && m(z, p);
|
|
24060
24060
|
}
|
|
@@ -24064,7 +24064,7 @@ function EP() {
|
|
|
24064
24064
|
}
|
|
24065
24065
|
t.isSymbolObject = Oe;
|
|
24066
24066
|
function Mr(z) {
|
|
24067
|
-
return me(z) || ge(z) ||
|
|
24067
|
+
return me(z) || ge(z) || xe(z) || tt(z) || Oe(z);
|
|
24068
24068
|
}
|
|
24069
24069
|
t.isBoxedPrimitive = Mr;
|
|
24070
24070
|
function ws(z) {
|
|
@@ -24256,10 +24256,10 @@ function Vw() {
|
|
|
24256
24256
|
if (F < 0)
|
|
24257
24257
|
return N(R) ? P.stylize(RegExp.prototype.toString.call(R), "regexp") : P.stylize("[Object]", "special");
|
|
24258
24258
|
P.seen.push(R);
|
|
24259
|
-
var
|
|
24260
|
-
return ye ?
|
|
24259
|
+
var xe;
|
|
24260
|
+
return ye ? xe = d(P, R, F, ue, le) : xe = le.map(function(tt) {
|
|
24261
24261
|
return m(P, R, F, ue, tt, ye);
|
|
24262
|
-
}), P.seen.pop(), b(
|
|
24262
|
+
}), P.seen.pop(), b(xe, ie, me);
|
|
24263
24263
|
}
|
|
24264
24264
|
function l(P, R) {
|
|
24265
24265
|
if (O(R))
|
|
@@ -26662,7 +26662,7 @@ function Qs(t) {
|
|
|
26662
26662
|
(a) => FO(a.trim())
|
|
26663
26663
|
) : [];
|
|
26664
26664
|
return {
|
|
26665
|
-
address: n ? e :
|
|
26665
|
+
address: n ? e : Ae(e),
|
|
26666
26666
|
module: r,
|
|
26667
26667
|
name: i,
|
|
26668
26668
|
typeParams: o
|
|
@@ -26674,12 +26674,12 @@ function Vc(t) {
|
|
|
26674
26674
|
).join(",")}>` : "";
|
|
26675
26675
|
return `${e}::${r}::${n}${i}`;
|
|
26676
26676
|
}
|
|
26677
|
-
function
|
|
26677
|
+
function Ae(t, e = !1) {
|
|
26678
26678
|
let r = t.toLowerCase();
|
|
26679
26679
|
return !e && r.startsWith("0x") && (r = r.slice(2)), `0x${r.padStart(Fu * 2, "0")}`;
|
|
26680
26680
|
}
|
|
26681
26681
|
function Tn(t, e = !1) {
|
|
26682
|
-
return
|
|
26682
|
+
return Ae(t, e);
|
|
26683
26683
|
}
|
|
26684
26684
|
function jO(t) {
|
|
26685
26685
|
return /^(0x|0X)?[a-fA-F0-9]+$/.test(t) && t.length % 2 === 0;
|
|
@@ -26717,7 +26717,7 @@ class _r {
|
|
|
26717
26717
|
if (s)
|
|
26718
26718
|
return {
|
|
26719
26719
|
struct: {
|
|
26720
|
-
address: r ?
|
|
26720
|
+
address: r ? Ae(s[1]) : s[1],
|
|
26721
26721
|
module: s[2],
|
|
26722
26722
|
name: s[3],
|
|
26723
26723
|
typeParams: s[5] === void 0 ? [] : _r.parseStructTypeArgs(s[5], r)
|
|
@@ -26776,11 +26776,11 @@ function VO(t) {
|
|
|
26776
26776
|
const Ne = _.bytes(Fu).transform({
|
|
26777
26777
|
validate: (t) => {
|
|
26778
26778
|
const e = typeof t == "string" ? t : Zi(t);
|
|
26779
|
-
if (!e || !xr(
|
|
26779
|
+
if (!e || !xr(Ae(e)))
|
|
26780
26780
|
throw new Error(`Invalid Sui address ${e}`);
|
|
26781
26781
|
},
|
|
26782
|
-
input: (t) => typeof t == "string" ? c2(
|
|
26783
|
-
output: (t) =>
|
|
26782
|
+
input: (t) => typeof t == "string" ? c2(Ae(t)) : t,
|
|
26783
|
+
output: (t) => Ae(Zi(t))
|
|
26784
26784
|
}), Ir = _.vector(_.u8()).transform({
|
|
26785
26785
|
name: "ObjectDigest",
|
|
26786
26786
|
input: (t) => ya(t),
|
|
@@ -27772,7 +27772,7 @@ function fi(t) {
|
|
|
27772
27772
|
}
|
|
27773
27773
|
const ao = Pe(
|
|
27774
27774
|
pe(),
|
|
27775
|
-
ju((t) =>
|
|
27775
|
+
ju((t) => Ae(t)),
|
|
27776
27776
|
za(xr)
|
|
27777
27777
|
), Jt = ao, ti = pe(), qt = Pe(
|
|
27778
27778
|
vt([pe(), Pe(Le(), qe())]),
|
|
@@ -28520,7 +28520,7 @@ const Pr = {
|
|
|
28520
28520
|
ImmOrOwnedObject: {
|
|
28521
28521
|
digest: e,
|
|
28522
28522
|
version: r,
|
|
28523
|
-
objectId:
|
|
28523
|
+
objectId: Ae(t)
|
|
28524
28524
|
}
|
|
28525
28525
|
}
|
|
28526
28526
|
};
|
|
@@ -28537,7 +28537,7 @@ const Pr = {
|
|
|
28537
28537
|
SharedObject: {
|
|
28538
28538
|
mutable: e,
|
|
28539
28539
|
initialSharedVersion: r,
|
|
28540
|
-
objectId:
|
|
28540
|
+
objectId: Ae(t)
|
|
28541
28541
|
}
|
|
28542
28542
|
}
|
|
28543
28543
|
};
|
|
@@ -28550,7 +28550,7 @@ const Pr = {
|
|
|
28550
28550
|
Receiving: {
|
|
28551
28551
|
digest: e,
|
|
28552
28552
|
version: r,
|
|
28553
|
-
objectId:
|
|
28553
|
+
objectId: Ae(t)
|
|
28554
28554
|
}
|
|
28555
28555
|
}
|
|
28556
28556
|
};
|
|
@@ -28952,7 +28952,7 @@ function J4(t, e, r) {
|
|
|
28952
28952
|
const Q4 = "object", eB = "ID", tB = "ascii", rB = "String", nB = "string", sB = "String", iB = "option", oB = "Option";
|
|
28953
28953
|
function aB(t) {
|
|
28954
28954
|
const e = typeof t.body == "object" && "datatype" in t.body ? t.body.datatype : null;
|
|
28955
|
-
return !!e &&
|
|
28955
|
+
return !!e && Ae(e.package) === Ae("0x2") && e.module === "tx_context" && e.type === "TxContext";
|
|
28956
28956
|
}
|
|
28957
28957
|
function Hd(t) {
|
|
28958
28958
|
if (typeof t == "string")
|
|
@@ -28986,8 +28986,8 @@ function Hd(t) {
|
|
|
28986
28986
|
return e ? he.vector(e) : null;
|
|
28987
28987
|
}
|
|
28988
28988
|
if ("datatype" in t) {
|
|
28989
|
-
const e =
|
|
28990
|
-
if (e ===
|
|
28989
|
+
const e = Ae(t.datatype.package);
|
|
28990
|
+
if (e === Ae(V4)) {
|
|
28991
28991
|
if (t.datatype.module === tB && t.datatype.type === rB || t.datatype.module === nB && t.datatype.type === sB)
|
|
28992
28992
|
return he.String;
|
|
28993
28993
|
if (t.datatype.module === iB && t.datatype.type === oB) {
|
|
@@ -28995,7 +28995,7 @@ function Hd(t) {
|
|
|
28995
28995
|
return r ? he.vector(r) : null;
|
|
28996
28996
|
}
|
|
28997
28997
|
}
|
|
28998
|
-
if (e ===
|
|
28998
|
+
if (e === Ae(X2) && t.datatype.module === Q4 && t.datatype.type === eB)
|
|
28999
28999
|
return he.Address;
|
|
29000
29000
|
}
|
|
29001
29001
|
return null;
|
|
@@ -29138,7 +29138,7 @@ async function yB(t, e) {
|
|
|
29138
29138
|
if (!l.UnresolvedObject)
|
|
29139
29139
|
continue;
|
|
29140
29140
|
let p;
|
|
29141
|
-
const d =
|
|
29141
|
+
const d = Ae(l.UnresolvedObject.objectId), m = u.get(d);
|
|
29142
29142
|
l.UnresolvedObject.initialSharedVersion ?? (m == null ? void 0 : m.initialSharedVersion) ? p = Pr.SharedObjectRef({
|
|
29143
29143
|
objectId: d,
|
|
29144
29144
|
initialSharedVersion: l.UnresolvedObject.initialSharedVersion || (m == null ? void 0 : m.initialSharedVersion),
|
|
@@ -29362,7 +29362,7 @@ function kB(t, e) {
|
|
|
29362
29362
|
return n.set(r), n.set(e, r.length), J2(n, { dkLen: 32 });
|
|
29363
29363
|
}
|
|
29364
29364
|
function Im(t) {
|
|
29365
|
-
return
|
|
29365
|
+
return Ae(t).replace("0x", "");
|
|
29366
29366
|
}
|
|
29367
29367
|
class Ht {
|
|
29368
29368
|
constructor(e) {
|
|
@@ -29564,11 +29564,11 @@ class Ht {
|
|
|
29564
29564
|
}
|
|
29565
29565
|
function Pm(t) {
|
|
29566
29566
|
if (typeof t == "string")
|
|
29567
|
-
return
|
|
29567
|
+
return Ae(t);
|
|
29568
29568
|
if (t.Object)
|
|
29569
|
-
return t.Object.ImmOrOwnedObject ?
|
|
29569
|
+
return t.Object.ImmOrOwnedObject ? Ae(t.Object.ImmOrOwnedObject.objectId) : t.Object.Receiving ? Ae(t.Object.Receiving.objectId) : Ae(t.Object.SharedObject.objectId);
|
|
29570
29570
|
if (t.UnresolvedObject)
|
|
29571
|
-
return
|
|
29571
|
+
return Ae(t.UnresolvedObject.objectId);
|
|
29572
29572
|
}
|
|
29573
29573
|
var t6 = (t) => {
|
|
29574
29574
|
throw TypeError(t);
|
|
@@ -29743,7 +29743,7 @@ function PB(t) {
|
|
|
29743
29743
|
for (const [e, r] of Object.entries(t.packages)) {
|
|
29744
29744
|
if (!Zt(e))
|
|
29745
29745
|
throw new Error(`Invalid package name: ${e}`);
|
|
29746
|
-
if (!xr(
|
|
29746
|
+
if (!xr(Ae(r)))
|
|
29747
29747
|
throw new Error(`Invalid package ID: ${r}`);
|
|
29748
29748
|
}
|
|
29749
29749
|
if (t != null && t.types)
|
|
@@ -29924,7 +29924,7 @@ const l6 = class Wd {
|
|
|
29924
29924
|
const n = Pm(r), s = Y(this, ce).inputs.find((a) => n === Pm(a));
|
|
29925
29925
|
return (i = s == null ? void 0 : s.Object) != null && i.SharedObject && typeof r == "object" && ((o = r.Object) != null && o.SharedObject) && (s.Object.SharedObject.mutable = s.Object.SharedObject.mutable || r.Object.SharedObject.mutable), s ? { $kind: "Input", Input: Y(this, ce).inputs.indexOf(s), type: "object" } : st(this, Ke, Tc).call(this, "object", typeof r == "string" ? {
|
|
29926
29926
|
$kind: "UnresolvedObject",
|
|
29927
|
-
UnresolvedObject: { objectId:
|
|
29927
|
+
UnresolvedObject: { objectId: Ae(r) }
|
|
29928
29928
|
} : r);
|
|
29929
29929
|
}
|
|
29930
29930
|
);
|
|
@@ -30988,7 +30988,7 @@ class Rm extends w2 {
|
|
|
30988
30988
|
limit: s,
|
|
30989
30989
|
signal: i
|
|
30990
30990
|
}) {
|
|
30991
|
-
if (!r || !xr(
|
|
30991
|
+
if (!r || !xr(Ae(r)))
|
|
30992
30992
|
throw new Error("Invalid Sui address");
|
|
30993
30993
|
return e && Dt(e) && (e = (await this.core.mvr.resolveType({
|
|
30994
30994
|
type: e
|
|
@@ -31002,7 +31002,7 @@ class Rm extends w2 {
|
|
|
31002
31002
|
* Get all Coin objects owned by an address.
|
|
31003
31003
|
*/
|
|
31004
31004
|
async getAllCoins(e) {
|
|
31005
|
-
if (!e.owner || !xr(
|
|
31005
|
+
if (!e.owner || !xr(Ae(e.owner)))
|
|
31006
31006
|
throw new Error("Invalid Sui address");
|
|
31007
31007
|
return await this.transport.request({
|
|
31008
31008
|
method: "suix_getAllCoins",
|
|
@@ -31014,7 +31014,7 @@ class Rm extends w2 {
|
|
|
31014
31014
|
* Get the total coin balance for one coin type, owned by the address owner.
|
|
31015
31015
|
*/
|
|
31016
31016
|
async getBalance({ owner: e, coinType: r, signal: n }) {
|
|
31017
|
-
if (!e || !xr(
|
|
31017
|
+
if (!e || !xr(Ae(e)))
|
|
31018
31018
|
throw new Error("Invalid Sui address");
|
|
31019
31019
|
return r && Dt(r) && (r = (await this.core.mvr.resolveType({
|
|
31020
31020
|
type: r
|
|
@@ -31028,7 +31028,7 @@ class Rm extends w2 {
|
|
|
31028
31028
|
* Get the total coin balance for all coin types, owned by the address owner.
|
|
31029
31029
|
*/
|
|
31030
31030
|
async getAllBalances(e) {
|
|
31031
|
-
if (!e.owner || !xr(
|
|
31031
|
+
if (!e.owner || !xr(Ae(e.owner)))
|
|
31032
31032
|
throw new Error("Invalid Sui address");
|
|
31033
31033
|
return await this.transport.request({
|
|
31034
31034
|
method: "suix_getAllBalances",
|
|
@@ -31155,7 +31155,7 @@ class Rm extends w2 {
|
|
|
31155
31155
|
* Get all objects owned by an address
|
|
31156
31156
|
*/
|
|
31157
31157
|
async getOwnedObjects(e) {
|
|
31158
|
-
if (!e.owner || !xr(
|
|
31158
|
+
if (!e.owner || !xr(Ae(e.owner)))
|
|
31159
31159
|
throw new Error("Invalid Sui address");
|
|
31160
31160
|
const r = e.filter ? {
|
|
31161
31161
|
...e.filter
|
|
@@ -31333,7 +31333,7 @@ class Rm extends w2 {
|
|
|
31333
31333
|
* Return the delegated stakes for an address
|
|
31334
31334
|
*/
|
|
31335
31335
|
async getStakes(e) {
|
|
31336
|
-
if (!e.owner || !xr(
|
|
31336
|
+
if (!e.owner || !xr(Ae(e.owner)))
|
|
31337
31337
|
throw new Error("Invalid Sui address");
|
|
31338
31338
|
return await this.transport.request({
|
|
31339
31339
|
method: "suix_getStakes",
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BPpJbLfH.cjs");exports.API=e.API;exports.BitcoinNetwork=e.BitcoinNetwork;exports.BitcoinProvider=e.BitcoinProvider;exports.BitcoinWallet=e.BitcoinWallet;exports.DEFAULT_AFFILIATE_ASSET=e.DEFAULT_AFFILIATE_ASSET;exports.EvmRelay=e.EvmRelay;exports.Garden=e.Garden;exports.Quote=e.Quote;exports.STARKNET_CONFIG=e.STARKNET_CONFIG;exports.SUI_CONFIG=e.SUI_CONFIG;exports.SecretManager=e.SecretManager;exports.SolanaHTLC=e.SolanaHTLC;exports.SolanaRelay=e.SolanaRelay;exports.SolanaRelayerAddress=e.SolanaRelayerAddress;exports.StarknetHTLC=e.StarknetHTLC;exports.StarknetRelay=e.StarknetRelay;exports.alpenTestnet=e.alpenTestnet;exports.botanixMainnet=e.botanixMainnet;exports.checkStarknetAlloance=e.checkAllowance;exports.checkStarknetAllowanceAndApprove=e.checkAllowanceAndApprove;exports.constructOrderPair=e.constructOrderPair;exports.evmToViemChainMap=e.evmToViemChainMap;exports.getChainNameFromChainId=e.getChainNameFromChainId;exports.hyperliquid=e.hyperliquid;exports.hyperliquidTestnet=e.hyperliquidTestnet;exports.isStarknetAllowanceSufficient=e.isAllowanceSufficient;exports.resolveApiConfig=e.resolveApiConfig;exports.solanaProgramAddress=e.solanaProgramAddress;exports.switchOrAddNetwork=e.switchOrAddNetwork;exports.toXOnly=e.toXOnly;exports.validateBTCAddress=e.validateBTCAddress;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as s, D as t, F as n, I as r, J as o, E as i, G as l, Q as A, L as d, M as c, m as S, k as T, j as k, N as C, h, S as p, A as m, u as y, p as I, n as v, q as F, w as N, x as u, y as w, z as E, o as O, r as L, O as R, C as f, t as g, v as B } from "./index-
|
|
1
|
+
import { K as s, D as t, F as n, I as r, J as o, E as i, G as l, Q as A, L as d, M as c, m as S, k as T, j as k, N as C, h, S as p, A as m, u as y, p as I, n as v, q as F, w as N, x as u, y as w, z as E, o as O, r as L, O as R, C as f, t as g, v as B } from "./index-iviEKv0P.js";
|
|
2
2
|
export {
|
|
3
3
|
s as API,
|
|
4
4
|
t as BitcoinNetwork,
|