@lombard.finance/sdk 4.3.0 → 4.3.2
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/CHANGELOG.md +33 -0
- package/dist/btc.cjs +1 -1
- package/dist/btc.js +2 -2
- package/dist/chains/btc/actions/deposit/BtcDeposit.d.ts +3 -2
- package/dist/chains/btc/actions/deposit/BtcDeposit.d.ts.map +1 -1
- package/dist/chains/btc/actions/deposit/types.d.ts +1 -1
- package/dist/chains/btc/actions/deposit/types.d.ts.map +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/BtcDepositAndDeploy.d.ts +3 -2
- package/dist/chains/btc/actions/depositAndDeploy/BtcDepositAndDeploy.d.ts.map +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/types.d.ts +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/types.d.ts.map +1 -1
- package/dist/chains/btc/actions/shared/BaseBtcAction.d.ts +3 -2
- package/dist/chains/btc/actions/shared/BaseBtcAction.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/BtcStake.d.ts +3 -2
- package/dist/chains/btc/actions/stake/BtcStake.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/types.d.ts +1 -1
- package/dist/chains/btc/actions/stake/types.d.ts.map +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/BtcStakeAndDeploy.d.ts +3 -2
- package/dist/chains/btc/actions/stakeAndDeploy/BtcStakeAndDeploy.d.ts.map +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/types.d.ts +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/deploy/EvmDeploy.d.ts.map +1 -1
- package/dist/chains/evm/actions/stake/EvmStake.d.ts.map +1 -1
- package/dist/chains/evm/actions/withdraw/EvmWithdraw.d.ts.map +1 -1
- package/dist/chunks/BtcActions-XbVRQEcM.cjs +2 -0
- package/dist/chunks/BtcActions-XbVRQEcM.cjs.map +1 -0
- package/dist/chunks/{BtcActions-C_A1dUQ0.js → BtcActions-k-qs1uO0.js} +83 -79
- package/dist/chunks/BtcActions-k-qs1uO0.js.map +1 -0
- package/dist/chunks/EvmActions-BVzQ3fLK.cjs +2 -0
- package/dist/chunks/EvmActions-BVzQ3fLK.cjs.map +1 -0
- package/dist/chunks/{EvmActions-DucgT60w.js → EvmActions-B_dF42So.js} +219 -219
- package/dist/chunks/EvmActions-B_dF42So.js.map +1 -0
- package/dist/chunks/{events-DPi6MDRA.js → events-DdV_xi-2.js} +6 -5
- package/dist/chunks/events-DdV_xi-2.js.map +1 -0
- package/dist/chunks/events-DqIJRzJo.cjs +2 -0
- package/dist/chunks/events-DqIJRzJo.cjs.map +1 -0
- package/dist/chunks/{getSharesByAddress-U48H_ygt.cjs → getSharesByAddress-BEgOf1C0.cjs} +2 -2
- package/dist/chunks/{getSharesByAddress-U48H_ygt.cjs.map → getSharesByAddress-BEgOf1C0.cjs.map} +1 -1
- package/dist/chunks/{getSharesByAddress-cUtkrKTq.js → getSharesByAddress-BiruCDp6.js} +2 -2
- package/dist/chunks/{getSharesByAddress-cUtkrKTq.js.map → getSharesByAddress-BiruCDp6.js.map} +1 -1
- package/dist/chunks/{statusConstants-fmtIEEEM.cjs → statusConstants-BLiNBT6s.cjs} +2 -2
- package/dist/chunks/{statusConstants-fmtIEEEM.cjs.map → statusConstants-BLiNBT6s.cjs.map} +1 -1
- package/dist/chunks/{statusConstants-CJk6vOiM.js → statusConstants-DFxMrVob.js} +2 -2
- package/dist/chunks/{statusConstants-CJk6vOiM.js.map → statusConstants-DFxMrVob.js.map} +1 -1
- package/dist/chunks/{unstakeLBTC-B4Rwf65e.js → unstakeLBTC-DAIR9NO_.js} +281 -280
- package/dist/chunks/{unstakeLBTC-B4Rwf65e.js.map → unstakeLBTC-DAIR9NO_.js.map} +1 -1
- package/dist/chunks/unstakeLBTC-H0zdYQa6.cjs +2 -0
- package/dist/chunks/{unstakeLBTC-Wlfi14de.cjs.map → unstakeLBTC-H0zdYQa6.cjs.map} +1 -1
- package/dist/contracts.cjs +1 -1
- package/dist/contracts.js +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +5 -5
- package/dist/evm.cjs +1 -1
- package/dist/evm.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +6 -6
- package/dist/services/ApiService.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/BtcActions-ByhBml_1.cjs +0 -2
- package/dist/chunks/BtcActions-ByhBml_1.cjs.map +0 -1
- package/dist/chunks/BtcActions-C_A1dUQ0.js.map +0 -1
- package/dist/chunks/EvmActions-DoYIhj61.cjs +0 -2
- package/dist/chunks/EvmActions-DoYIhj61.cjs.map +0 -1
- package/dist/chunks/EvmActions-DucgT60w.js.map +0 -1
- package/dist/chunks/events-BTtwgCev.cjs +0 -2
- package/dist/chunks/events-BTtwgCev.cjs.map +0 -1
- package/dist/chunks/events-DPi6MDRA.js.map +0 -1
- package/dist/chunks/unstakeLBTC-Wlfi14de.cjs +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h as U, m as w, b as f, i as k, g as X, e as ee, t as K, f as j, U as te, r as ne } from "./tokens-C6qZHzph.js";
|
|
2
|
-
import { o as d, A, U as R, b as O, D as _, G as Ae, B as ge, I as Ce, F as he
|
|
2
|
+
import { o as d, A, U as R, a as v, b as O, D as _, G as Ae, B as ge, I as Ce, F as he } from "./token-addresses-FKpA3uc4.js";
|
|
3
3
|
import { f as V } from "./satoshi-Ch6y8aYG.js";
|
|
4
4
|
import { p as G, d as Me } from "./index-CfcQ_g3t.js";
|
|
5
|
-
import { getContract as ae,
|
|
5
|
+
import { getContract as ae, createWalletClient as ve, http as Re, isHex as De, encodeFunctionData as xe, decodeFunctionData as Z, encodeAbiParameters as Ee, keccak256 as se, zeroAddress as Ie, parseGwei as W } from "viem";
|
|
6
6
|
import { D as ke, b as Se, a as $ } from "./defi-registry-wNFN3qyB.js";
|
|
7
7
|
import g from "bignumber.js";
|
|
8
8
|
import { t as ie, n as re, D as oe, e as Y } from "./time-QPeEEEnQ.js";
|
|
@@ -2406,7 +2406,250 @@ async function ht({
|
|
|
2406
2406
|
requiredAmount: BigInt(m.toFixed(0, g.ROUND_DOWN))
|
|
2407
2407
|
}) : We({ chainId: r, provider: i, typedData: M });
|
|
2408
2408
|
}
|
|
2409
|
-
|
|
2409
|
+
class T extends Error {
|
|
2410
|
+
constructor(n, a, t) {
|
|
2411
|
+
super(a), this.code = n, this.context = t, this.name = "SignerError";
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
function le(e, n = "transaction") {
|
|
2415
|
+
if (!e.from)
|
|
2416
|
+
throw new T(
|
|
2417
|
+
"MISSING_FROM_ADDRESS",
|
|
2418
|
+
`Missing 'from' address for ${n}`,
|
|
2419
|
+
{ transaction: e, operation: n }
|
|
2420
|
+
);
|
|
2421
|
+
if (!e.to)
|
|
2422
|
+
throw new T(
|
|
2423
|
+
"MISSING_TO_ADDRESS",
|
|
2424
|
+
`Missing 'to' address for ${n}`,
|
|
2425
|
+
{ transaction: e, operation: n }
|
|
2426
|
+
);
|
|
2427
|
+
if (e.data !== void 0 && !De(e.data))
|
|
2428
|
+
throw new T(
|
|
2429
|
+
"INVALID_DATA",
|
|
2430
|
+
`Transaction data must be valid hex string for ${n}`,
|
|
2431
|
+
{ transaction: e, operation: n, data: e.data }
|
|
2432
|
+
);
|
|
2433
|
+
if (e.chainId && !/^0x[0-9a-fA-F]+$/.test(e.chainId))
|
|
2434
|
+
throw new T(
|
|
2435
|
+
"INVALID_CHAIN_ID",
|
|
2436
|
+
`Chain ID must be a hex string (e.g., "0x1") for ${n}`,
|
|
2437
|
+
{ transaction: e, operation: n, chainId: e.chainId }
|
|
2438
|
+
);
|
|
2439
|
+
}
|
|
2440
|
+
function Ke(e, n, a) {
|
|
2441
|
+
const t = v[a];
|
|
2442
|
+
if (!t)
|
|
2443
|
+
throw new T(
|
|
2444
|
+
"UNSUPPORTED_CHAIN",
|
|
2445
|
+
`Chain ID ${a} is not supported`,
|
|
2446
|
+
{ chainId: a, availableChains: Object.keys(v) }
|
|
2447
|
+
);
|
|
2448
|
+
return {
|
|
2449
|
+
address: n,
|
|
2450
|
+
type: "local",
|
|
2451
|
+
publicKey: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
2452
|
+
source: "custom",
|
|
2453
|
+
/**
|
|
2454
|
+
* Signs a transaction using the SignerAdapter.
|
|
2455
|
+
* This is called by Viem's wallet client when executing transactions.
|
|
2456
|
+
*/
|
|
2457
|
+
async signTransaction(r) {
|
|
2458
|
+
const i = {
|
|
2459
|
+
from: n,
|
|
2460
|
+
to: r.to ?? void 0,
|
|
2461
|
+
data: r.data,
|
|
2462
|
+
value: r.value,
|
|
2463
|
+
gas: r.gas,
|
|
2464
|
+
maxFeePerGas: r.maxFeePerGas,
|
|
2465
|
+
maxPriorityFeePerGas: r.maxPriorityFeePerGas,
|
|
2466
|
+
chainId: r.chainId ? `0x${r.chainId.toString(16)}` : `0x${t.id.toString(16)}`,
|
|
2467
|
+
nonce: r.nonce
|
|
2468
|
+
};
|
|
2469
|
+
le(i, "signTransaction");
|
|
2470
|
+
let p;
|
|
2471
|
+
if (await e.sign(i, async (o) => (p = o, o)), !p)
|
|
2472
|
+
throw new T(
|
|
2473
|
+
"SIGNING_FAILED",
|
|
2474
|
+
"Signer did not return a signed transaction",
|
|
2475
|
+
{ transaction: i }
|
|
2476
|
+
);
|
|
2477
|
+
return p;
|
|
2478
|
+
},
|
|
2479
|
+
/**
|
|
2480
|
+
* Signs a message (EIP-191).
|
|
2481
|
+
* Not implemented as it's not needed for contract transactions.
|
|
2482
|
+
*/
|
|
2483
|
+
async signMessage() {
|
|
2484
|
+
throw new T(
|
|
2485
|
+
"NOT_IMPLEMENTED",
|
|
2486
|
+
"Message signing is not supported by this adapter",
|
|
2487
|
+
{ method: "signMessage" }
|
|
2488
|
+
);
|
|
2489
|
+
},
|
|
2490
|
+
/**
|
|
2491
|
+
* Signs typed data (EIP-712).
|
|
2492
|
+
* Not implemented as it's not needed for contract transactions.
|
|
2493
|
+
*/
|
|
2494
|
+
async signTypedData() {
|
|
2495
|
+
throw new T(
|
|
2496
|
+
"NOT_IMPLEMENTED",
|
|
2497
|
+
"Typed data signing is not supported by this adapter",
|
|
2498
|
+
{ method: "signTypedData" }
|
|
2499
|
+
);
|
|
2500
|
+
}
|
|
2501
|
+
};
|
|
2502
|
+
}
|
|
2503
|
+
function Mt(e, n, a) {
|
|
2504
|
+
const t = v[a];
|
|
2505
|
+
if (!t)
|
|
2506
|
+
throw new T(
|
|
2507
|
+
"UNSUPPORTED_CHAIN",
|
|
2508
|
+
`Chain ID ${a} is not supported`,
|
|
2509
|
+
{ chainId: a }
|
|
2510
|
+
);
|
|
2511
|
+
const s = Ke(e, n, a);
|
|
2512
|
+
return ve({
|
|
2513
|
+
account: s,
|
|
2514
|
+
chain: t,
|
|
2515
|
+
transport: Re()
|
|
2516
|
+
// Uses default RPC
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2519
|
+
async function F({
|
|
2520
|
+
params: e,
|
|
2521
|
+
publicClient: n,
|
|
2522
|
+
walletClient: a,
|
|
2523
|
+
simulateArgs: t,
|
|
2524
|
+
operation: s
|
|
2525
|
+
}) {
|
|
2526
|
+
if (!H(e) && !Ne(e))
|
|
2527
|
+
throw new T(
|
|
2528
|
+
"INVALID_PARAMETERS",
|
|
2529
|
+
'Must provide either "provider" or "signer" in parameters',
|
|
2530
|
+
{ params: e, operation: s }
|
|
2531
|
+
);
|
|
2532
|
+
let r;
|
|
2533
|
+
try {
|
|
2534
|
+
r = await n.simulateContract(
|
|
2535
|
+
t
|
|
2536
|
+
);
|
|
2537
|
+
} catch (o) {
|
|
2538
|
+
throw new T(
|
|
2539
|
+
"SIMULATION_FAILED",
|
|
2540
|
+
`Failed to simulate ${s} transaction: ${o instanceof Error ? o.message : "Unknown error"}`,
|
|
2541
|
+
{
|
|
2542
|
+
operation: s,
|
|
2543
|
+
simulateArgs: t,
|
|
2544
|
+
error: o instanceof Error ? o.message : String(o)
|
|
2545
|
+
}
|
|
2546
|
+
);
|
|
2547
|
+
}
|
|
2548
|
+
const { request: i } = r;
|
|
2549
|
+
if (!i.account)
|
|
2550
|
+
throw new T(
|
|
2551
|
+
"INVALID_SIMULATION",
|
|
2552
|
+
`Simulation succeeded but no account was set for ${s}`,
|
|
2553
|
+
{ operation: s, request: i }
|
|
2554
|
+
);
|
|
2555
|
+
if (!i.address)
|
|
2556
|
+
throw new T(
|
|
2557
|
+
"INVALID_SIMULATION",
|
|
2558
|
+
`Simulation succeeded but no target address was set for ${s}`,
|
|
2559
|
+
{ operation: s, request: i }
|
|
2560
|
+
);
|
|
2561
|
+
let p;
|
|
2562
|
+
if (H(e)) {
|
|
2563
|
+
if (!a)
|
|
2564
|
+
throw new T(
|
|
2565
|
+
"MISSING_WALLET_CLIENT",
|
|
2566
|
+
"Provider flow requires a wallet client",
|
|
2567
|
+
{ operation: s, params: e }
|
|
2568
|
+
);
|
|
2569
|
+
try {
|
|
2570
|
+
p = await a.writeContract(i);
|
|
2571
|
+
} catch (o) {
|
|
2572
|
+
throw new T(
|
|
2573
|
+
"PROVIDER_TRANSACTION_FAILED",
|
|
2574
|
+
`Failed to execute ${s} via provider: ${o instanceof Error ? o.message : "Unknown error"}`,
|
|
2575
|
+
{
|
|
2576
|
+
operation: s,
|
|
2577
|
+
request: i,
|
|
2578
|
+
error: o instanceof Error ? o.message : String(o)
|
|
2579
|
+
}
|
|
2580
|
+
);
|
|
2581
|
+
}
|
|
2582
|
+
} else
|
|
2583
|
+
try {
|
|
2584
|
+
const o = v[e.chainId];
|
|
2585
|
+
if (!o)
|
|
2586
|
+
throw new T(
|
|
2587
|
+
"UNSUPPORTED_CHAIN",
|
|
2588
|
+
`Chain ${e.chainId} not supported`,
|
|
2589
|
+
{ chainId: e.chainId }
|
|
2590
|
+
);
|
|
2591
|
+
const u = xe({
|
|
2592
|
+
abi: t.abi,
|
|
2593
|
+
functionName: t.functionName,
|
|
2594
|
+
args: t.args
|
|
2595
|
+
}), y = {
|
|
2596
|
+
from: e.account,
|
|
2597
|
+
to: i.address,
|
|
2598
|
+
data: u,
|
|
2599
|
+
value: i.value,
|
|
2600
|
+
gas: i.gas,
|
|
2601
|
+
maxFeePerGas: i.maxFeePerGas,
|
|
2602
|
+
maxPriorityFeePerGas: i.maxPriorityFeePerGas,
|
|
2603
|
+
chainId: `0x${o.id.toString(16)}`
|
|
2604
|
+
};
|
|
2605
|
+
le(y, s), p = await e.signer.sign(y, async (m) => await n.sendRawTransaction({
|
|
2606
|
+
serializedTransaction: m
|
|
2607
|
+
}));
|
|
2608
|
+
} catch (o) {
|
|
2609
|
+
throw new T(
|
|
2610
|
+
"SIGNER_TRANSACTION_FAILED",
|
|
2611
|
+
`Failed to execute ${s} via signer: ${o instanceof Error ? o.message : "Unknown error"}`,
|
|
2612
|
+
{
|
|
2613
|
+
operation: s,
|
|
2614
|
+
request: i,
|
|
2615
|
+
error: o instanceof Error ? o.message : String(o)
|
|
2616
|
+
}
|
|
2617
|
+
);
|
|
2618
|
+
}
|
|
2619
|
+
return { txHash: p, request: i };
|
|
2620
|
+
}
|
|
2621
|
+
async function je(e, n, a) {
|
|
2622
|
+
try {
|
|
2623
|
+
const t = await e.waitForTransactionReceipt({
|
|
2624
|
+
hash: n
|
|
2625
|
+
});
|
|
2626
|
+
if (t.status === "reverted")
|
|
2627
|
+
throw new T(
|
|
2628
|
+
"TRANSACTION_REVERTED",
|
|
2629
|
+
`${a} transaction reverted`,
|
|
2630
|
+
{
|
|
2631
|
+
operation: a,
|
|
2632
|
+
txHash: n,
|
|
2633
|
+
receipt: {
|
|
2634
|
+
blockNumber: t.blockNumber,
|
|
2635
|
+
gasUsed: t.gasUsed
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
);
|
|
2639
|
+
return t;
|
|
2640
|
+
} catch (t) {
|
|
2641
|
+
throw t instanceof T ? t : new T(
|
|
2642
|
+
"RECEIPT_WAIT_FAILED",
|
|
2643
|
+
`Failed to wait for ${a} transaction receipt: ${t instanceof Error ? t.message : "Unknown error"}`,
|
|
2644
|
+
{
|
|
2645
|
+
operation: a,
|
|
2646
|
+
txHash: n,
|
|
2647
|
+
error: t instanceof Error ? t.message : String(t)
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
const J = "0xe288fb4a", Q = "0x155b6b13", qe = {
|
|
2410
2653
|
type: "function",
|
|
2411
2654
|
name: "MessageV1",
|
|
2412
2655
|
inputs: [
|
|
@@ -2417,7 +2660,7 @@ const J = "0xe288fb4a", Q = "0x155b6b13", Ke = {
|
|
|
2417
2660
|
{ name: "msgDestinationCaller", type: "bytes32" },
|
|
2418
2661
|
{ name: "msgBody", type: "bytes" }
|
|
2419
2662
|
]
|
|
2420
|
-
},
|
|
2663
|
+
}, Ze = {
|
|
2421
2664
|
type: "function",
|
|
2422
2665
|
name: "mint",
|
|
2423
2666
|
inputs: [
|
|
@@ -2426,7 +2669,7 @@ const J = "0xe288fb4a", Q = "0x155b6b13", Ke = {
|
|
|
2426
2669
|
{ name: "amount", type: "uint256" }
|
|
2427
2670
|
]
|
|
2428
2671
|
};
|
|
2429
|
-
function
|
|
2672
|
+
function Ye(e) {
|
|
2430
2673
|
if (!e.startsWith("0x"))
|
|
2431
2674
|
throw new Error("Payload must be 0x-prefixed hex");
|
|
2432
2675
|
const n = e.slice(0, 10);
|
|
@@ -2435,7 +2678,7 @@ function qe(e) {
|
|
|
2435
2678
|
`Invalid GMP selector: expected ${J}, got ${n}`
|
|
2436
2679
|
);
|
|
2437
2680
|
const a = Z({
|
|
2438
|
-
abi: [
|
|
2681
|
+
abi: [qe],
|
|
2439
2682
|
data: e
|
|
2440
2683
|
});
|
|
2441
2684
|
if (!a.args)
|
|
@@ -2449,7 +2692,7 @@ function qe(e) {
|
|
|
2449
2692
|
`Invalid mint selector in body: expected ${Q}, got ${u}`
|
|
2450
2693
|
);
|
|
2451
2694
|
const y = Z({
|
|
2452
|
-
abi: [
|
|
2695
|
+
abi: [Ze],
|
|
2453
2696
|
data: o
|
|
2454
2697
|
});
|
|
2455
2698
|
if (!y.args)
|
|
@@ -2471,8 +2714,8 @@ function qe(e) {
|
|
|
2471
2714
|
}
|
|
2472
2715
|
};
|
|
2473
2716
|
}
|
|
2474
|
-
function
|
|
2475
|
-
const { msgNonce: a, mint: t } = e, s =
|
|
2717
|
+
function Je(e, n) {
|
|
2718
|
+
const { msgNonce: a, mint: t } = e, s = Ee(
|
|
2476
2719
|
[
|
|
2477
2720
|
{ name: "nonce", type: "uint256" },
|
|
2478
2721
|
{ name: "chainId", type: "uint256" },
|
|
@@ -2495,7 +2738,7 @@ function Ze(e, n) {
|
|
|
2495
2738
|
);
|
|
2496
2739
|
return se(s);
|
|
2497
2740
|
}
|
|
2498
|
-
const
|
|
2741
|
+
const Qe = [
|
|
2499
2742
|
{
|
|
2500
2743
|
inputs: [
|
|
2501
2744
|
{ internalType: "address", name: "aDefaultAdmin", type: "address" },
|
|
@@ -3147,9 +3390,9 @@ const Ye = [
|
|
|
3147
3390
|
stateMutability: "view",
|
|
3148
3391
|
type: "function"
|
|
3149
3392
|
}
|
|
3150
|
-
], Je = /* @__PURE__ */ JSON.parse('[{"inputs":[{"internalType":"address","name":"aDefaultAdmin","type":"address"},{"internalType":"address","name":"aPauser","type":"address"},{"internalType":"address","name":"aDepositReporter","type":"address"},{"internalType":"address","name":"aWithdrawalValidator","type":"address"},{"internalType":"uint256","name":"aMaxDeposits","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"uint48","name":"schedule","type":"uint48"}],"name":"AccessControlEnforcedDefaultAdminDelay","type":"error"},{"inputs":[],"name":"AccessControlEnforcedDefaultAdminRules","type":"error"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"AccessControlInvalidDefaultAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"}],"name":"AlreadyReported","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"AlreadyWithdrawn","type":"error"},{"inputs":[],"name":"BadDepositReport","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[],"name":"SameValidationThreshold","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalFailedValidation","type":"error"},{"anonymous":false,"inputs":[],"name":"DefaultAdminDelayChangeCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint48","name":"newDelay","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"effectSchedule","type":"uint48"}],"name":"DefaultAdminDelayChangeScheduled","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminTransferCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"uint48","name":"acceptSchedule","type":"uint48"}],"name":"DefaultAdminTransferScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"reportId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"numDeposits","type":"uint256"}],"name":"DepositsReported","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numDeposits","type":"uint256"}],"name":"MaxDepositsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldThreshold","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"UpdateValidateThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"depositID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalNotValidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"depositID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalValidated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_REPORTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATION_GUARDIAN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWAL_VALIDATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"beginDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"}],"name":"changeDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelay","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelayIncreaseWait","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"}],"name":"depositHistory","outputs":[{"internalType":"enum Bascule.DepositState","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdmin","outputs":[{"internalType":"address","name":"newAdmin","type":"address"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdminDelay","outputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"reportId","type":"bytes32"},{"internalType":"bytes32[]","name":"depositIDs","type":"bytes32[]"}],"name":"reportDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollbackDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"aMaxDeposits","type":"uint256"}],"name":"setMaxDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"updateValidateThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validateThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"validateWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"}]');
|
|
3393
|
+
], Xe = /* @__PURE__ */ JSON.parse('[{"inputs":[{"internalType":"address","name":"aDefaultAdmin","type":"address"},{"internalType":"address","name":"aPauser","type":"address"},{"internalType":"address","name":"aDepositReporter","type":"address"},{"internalType":"address","name":"aWithdrawalValidator","type":"address"},{"internalType":"uint256","name":"aMaxDeposits","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"uint48","name":"schedule","type":"uint48"}],"name":"AccessControlEnforcedDefaultAdminDelay","type":"error"},{"inputs":[],"name":"AccessControlEnforcedDefaultAdminRules","type":"error"},{"inputs":[{"internalType":"address","name":"defaultAdmin","type":"address"}],"name":"AccessControlInvalidDefaultAdmin","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"}],"name":"AlreadyReported","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"AlreadyWithdrawn","type":"error"},{"inputs":[],"name":"BadDepositReport","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[],"name":"SameValidationThreshold","type":"error"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalFailedValidation","type":"error"},{"anonymous":false,"inputs":[],"name":"DefaultAdminDelayChangeCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint48","name":"newDelay","type":"uint48"},{"indexed":false,"internalType":"uint48","name":"effectSchedule","type":"uint48"}],"name":"DefaultAdminDelayChangeScheduled","type":"event"},{"anonymous":false,"inputs":[],"name":"DefaultAdminTransferCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"uint48","name":"acceptSchedule","type":"uint48"}],"name":"DefaultAdminTransferScheduled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"reportId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"numDeposits","type":"uint256"}],"name":"DepositsReported","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"numDeposits","type":"uint256"}],"name":"MaxDepositsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldThreshold","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"UpdateValidateThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"depositID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalNotValidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"depositID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"WithdrawalValidated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_REPORTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATION_GUARDIAN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWAL_VALIDATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"beginDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelDefaultAdminTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"}],"name":"changeDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelay","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultAdminDelayIncreaseWait","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"}],"name":"depositHistory","outputs":[{"internalType":"enum Bascule.DepositState","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdmin","outputs":[{"internalType":"address","name":"newAdmin","type":"address"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingDefaultAdminDelay","outputs":[{"internalType":"uint48","name":"newDelay","type":"uint48"},{"internalType":"uint48","name":"schedule","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"reportId","type":"bytes32"},{"internalType":"bytes32[]","name":"depositIDs","type":"bytes32[]"}],"name":"reportDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollbackDefaultAdminDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"aMaxDeposits","type":"uint256"}],"name":"setMaxDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newThreshold","type":"uint256"}],"name":"updateValidateThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validateThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"depositID","type":"bytes32"},{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"name":"validateWithdrawal","outputs":[],"stateMutability":"nonpayable","type":"function"}]');
|
|
3151
3394
|
var L = /* @__PURE__ */ ((e) => (e[e.UNREPORTED = 0] = "UNREPORTED", e[e.REPORTED = 1] = "REPORTED", e[e.WITHDRAWN = 2] = "WITHDRAWN", e))(L || {});
|
|
3152
|
-
async function
|
|
3395
|
+
async function et({
|
|
3153
3396
|
deposit: e,
|
|
3154
3397
|
rawPayload: n,
|
|
3155
3398
|
provider: a,
|
|
@@ -3193,7 +3436,7 @@ async function Qe({
|
|
|
3193
3436
|
address: u.address,
|
|
3194
3437
|
functionName: "Bascule"
|
|
3195
3438
|
});
|
|
3196
|
-
if (y ===
|
|
3439
|
+
if (y === Ie)
|
|
3197
3440
|
return 1;
|
|
3198
3441
|
let m;
|
|
3199
3442
|
if (a ? m = R({ provider: a, chainId: t }) : m = w({ chainId: t, rpcUrl: s }), !m)
|
|
@@ -3203,8 +3446,8 @@ async function Qe({
|
|
|
3203
3446
|
const b = (_(t) || Ae(t) || ge(t) || Ce(t) || he(t)) && i === d.LBTC;
|
|
3204
3447
|
try {
|
|
3205
3448
|
if (b) {
|
|
3206
|
-
const h = p.startsWith("0x") ? p : `0x${p}`, M =
|
|
3207
|
-
abi:
|
|
3449
|
+
const h = p.startsWith("0x") ? p : `0x${p}`, M = Ye(h), B = Je(M, t), [, D] = await o.readContract({
|
|
3450
|
+
abi: Qe,
|
|
3208
3451
|
address: y,
|
|
3209
3452
|
functionName: "mintHistory",
|
|
3210
3453
|
args: [B]
|
|
@@ -3215,7 +3458,7 @@ async function Qe({
|
|
|
3215
3458
|
Buffer.from(p.slice(8), "hex")
|
|
3216
3459
|
);
|
|
3217
3460
|
return await ae({
|
|
3218
|
-
abi:
|
|
3461
|
+
abi: Xe,
|
|
3219
3462
|
address: y,
|
|
3220
3463
|
client: o
|
|
3221
3464
|
}).read.depositHistory([
|
|
@@ -3225,7 +3468,7 @@ async function Qe({
|
|
|
3225
3468
|
throw new Error(X(l));
|
|
3226
3469
|
}
|
|
3227
3470
|
}
|
|
3228
|
-
async function
|
|
3471
|
+
async function vt({
|
|
3229
3472
|
account: e,
|
|
3230
3473
|
token: n,
|
|
3231
3474
|
spender: a,
|
|
@@ -3250,7 +3493,7 @@ async function Mt({
|
|
|
3250
3493
|
});
|
|
3251
3494
|
return await u.writeContract(b);
|
|
3252
3495
|
}
|
|
3253
|
-
async function
|
|
3496
|
+
async function Rt({
|
|
3254
3497
|
token: e,
|
|
3255
3498
|
owner: n,
|
|
3256
3499
|
spender: a,
|
|
@@ -3281,7 +3524,7 @@ const z = async (e, n, a) => {
|
|
|
3281
3524
|
maxPriorityFeePerGas: r
|
|
3282
3525
|
};
|
|
3283
3526
|
};
|
|
3284
|
-
async function
|
|
3527
|
+
async function tt({
|
|
3285
3528
|
data: e,
|
|
3286
3529
|
proofSignature: n,
|
|
3287
3530
|
account: a,
|
|
@@ -3300,7 +3543,7 @@ async function Xe({
|
|
|
3300
3543
|
t,
|
|
3301
3544
|
i,
|
|
3302
3545
|
A.Adapter
|
|
3303
|
-
), u = await
|
|
3546
|
+
), u = await et({
|
|
3304
3547
|
chainId: t,
|
|
3305
3548
|
rawPayload: e,
|
|
3306
3549
|
env: i,
|
|
@@ -3334,7 +3577,7 @@ async function Xe({
|
|
|
3334
3577
|
});
|
|
3335
3578
|
return await m.writeContract(c);
|
|
3336
3579
|
}
|
|
3337
|
-
async function
|
|
3580
|
+
async function Dt({
|
|
3338
3581
|
data: e,
|
|
3339
3582
|
proofSignature: n,
|
|
3340
3583
|
account: a,
|
|
@@ -3343,7 +3586,7 @@ async function Rt({
|
|
|
3343
3586
|
rpcUrl: r,
|
|
3344
3587
|
env: i
|
|
3345
3588
|
}) {
|
|
3346
|
-
return
|
|
3589
|
+
return tt({
|
|
3347
3590
|
data: e,
|
|
3348
3591
|
proofSignature: n,
|
|
3349
3592
|
account: a,
|
|
@@ -3354,13 +3597,13 @@ async function Rt({
|
|
|
3354
3597
|
token: d.LBTC
|
|
3355
3598
|
});
|
|
3356
3599
|
}
|
|
3357
|
-
const
|
|
3600
|
+
const nt = [
|
|
3358
3601
|
{
|
|
3359
3602
|
tokenIn: d.BTCb,
|
|
3360
3603
|
tokenOut: d.LBTC
|
|
3361
3604
|
}
|
|
3362
3605
|
];
|
|
3363
|
-
async function
|
|
3606
|
+
async function xt({
|
|
3364
3607
|
tokenIn: e,
|
|
3365
3608
|
chainId: n,
|
|
3366
3609
|
env: a,
|
|
@@ -3378,7 +3621,7 @@ async function Dt({
|
|
|
3378
3621
|
functionName: "getAssetRouter"
|
|
3379
3622
|
});
|
|
3380
3623
|
}
|
|
3381
|
-
async function
|
|
3624
|
+
async function Et({
|
|
3382
3625
|
account: e,
|
|
3383
3626
|
amount: n,
|
|
3384
3627
|
chainId: a,
|
|
@@ -3388,7 +3631,7 @@ async function xt({
|
|
|
3388
3631
|
tokenIn: i = d.BTCb,
|
|
3389
3632
|
tokenOut: p = d.LBTC
|
|
3390
3633
|
}) {
|
|
3391
|
-
if (!
|
|
3634
|
+
if (!nt.find(
|
|
3392
3635
|
(N) => N.tokenIn === i && N.tokenOut === p
|
|
3393
3636
|
))
|
|
3394
3637
|
throw new te(i, p, a, t);
|
|
@@ -3435,249 +3678,6 @@ async function xt({
|
|
|
3435
3678
|
account: e
|
|
3436
3679
|
});
|
|
3437
3680
|
}
|
|
3438
|
-
class T extends Error {
|
|
3439
|
-
constructor(n, a, t) {
|
|
3440
|
-
super(a), this.code = n, this.context = t, this.name = "SignerError";
|
|
3441
|
-
}
|
|
3442
|
-
}
|
|
3443
|
-
function le(e, n = "transaction") {
|
|
3444
|
-
if (!e.from)
|
|
3445
|
-
throw new T(
|
|
3446
|
-
"MISSING_FROM_ADDRESS",
|
|
3447
|
-
`Missing 'from' address for ${n}`,
|
|
3448
|
-
{ transaction: e, operation: n }
|
|
3449
|
-
);
|
|
3450
|
-
if (!e.to)
|
|
3451
|
-
throw new T(
|
|
3452
|
-
"MISSING_TO_ADDRESS",
|
|
3453
|
-
`Missing 'to' address for ${n}`,
|
|
3454
|
-
{ transaction: e, operation: n }
|
|
3455
|
-
);
|
|
3456
|
-
if (e.data !== void 0 && !Ee(e.data))
|
|
3457
|
-
throw new T(
|
|
3458
|
-
"INVALID_DATA",
|
|
3459
|
-
`Transaction data must be valid hex string for ${n}`,
|
|
3460
|
-
{ transaction: e, operation: n, data: e.data }
|
|
3461
|
-
);
|
|
3462
|
-
if (e.chainId && !/^0x[0-9a-fA-F]+$/.test(e.chainId))
|
|
3463
|
-
throw new T(
|
|
3464
|
-
"INVALID_CHAIN_ID",
|
|
3465
|
-
`Chain ID must be a hex string (e.g., "0x1") for ${n}`,
|
|
3466
|
-
{ transaction: e, operation: n, chainId: e.chainId }
|
|
3467
|
-
);
|
|
3468
|
-
}
|
|
3469
|
-
function tt(e, n, a) {
|
|
3470
|
-
const t = v[a];
|
|
3471
|
-
if (!t)
|
|
3472
|
-
throw new T(
|
|
3473
|
-
"UNSUPPORTED_CHAIN",
|
|
3474
|
-
`Chain ID ${a} is not supported`,
|
|
3475
|
-
{ chainId: a, availableChains: Object.keys(v) }
|
|
3476
|
-
);
|
|
3477
|
-
return {
|
|
3478
|
-
address: n,
|
|
3479
|
-
type: "local",
|
|
3480
|
-
publicKey: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
3481
|
-
source: "custom",
|
|
3482
|
-
/**
|
|
3483
|
-
* Signs a transaction using the SignerAdapter.
|
|
3484
|
-
* This is called by Viem's wallet client when executing transactions.
|
|
3485
|
-
*/
|
|
3486
|
-
async signTransaction(r) {
|
|
3487
|
-
const i = {
|
|
3488
|
-
from: n,
|
|
3489
|
-
to: r.to ?? void 0,
|
|
3490
|
-
data: r.data,
|
|
3491
|
-
value: r.value,
|
|
3492
|
-
gas: r.gas,
|
|
3493
|
-
maxFeePerGas: r.maxFeePerGas,
|
|
3494
|
-
maxPriorityFeePerGas: r.maxPriorityFeePerGas,
|
|
3495
|
-
chainId: r.chainId ? `0x${r.chainId.toString(16)}` : `0x${t.id.toString(16)}`,
|
|
3496
|
-
nonce: r.nonce
|
|
3497
|
-
};
|
|
3498
|
-
le(i, "signTransaction");
|
|
3499
|
-
let p;
|
|
3500
|
-
if (await e.sign(i, async (o) => (p = o, o)), !p)
|
|
3501
|
-
throw new T(
|
|
3502
|
-
"SIGNING_FAILED",
|
|
3503
|
-
"Signer did not return a signed transaction",
|
|
3504
|
-
{ transaction: i }
|
|
3505
|
-
);
|
|
3506
|
-
return p;
|
|
3507
|
-
},
|
|
3508
|
-
/**
|
|
3509
|
-
* Signs a message (EIP-191).
|
|
3510
|
-
* Not implemented as it's not needed for contract transactions.
|
|
3511
|
-
*/
|
|
3512
|
-
async signMessage() {
|
|
3513
|
-
throw new T(
|
|
3514
|
-
"NOT_IMPLEMENTED",
|
|
3515
|
-
"Message signing is not supported by this adapter",
|
|
3516
|
-
{ method: "signMessage" }
|
|
3517
|
-
);
|
|
3518
|
-
},
|
|
3519
|
-
/**
|
|
3520
|
-
* Signs typed data (EIP-712).
|
|
3521
|
-
* Not implemented as it's not needed for contract transactions.
|
|
3522
|
-
*/
|
|
3523
|
-
async signTypedData() {
|
|
3524
|
-
throw new T(
|
|
3525
|
-
"NOT_IMPLEMENTED",
|
|
3526
|
-
"Typed data signing is not supported by this adapter",
|
|
3527
|
-
{ method: "signTypedData" }
|
|
3528
|
-
);
|
|
3529
|
-
}
|
|
3530
|
-
};
|
|
3531
|
-
}
|
|
3532
|
-
function Et(e, n, a) {
|
|
3533
|
-
const t = v[a];
|
|
3534
|
-
if (!t)
|
|
3535
|
-
throw new T(
|
|
3536
|
-
"UNSUPPORTED_CHAIN",
|
|
3537
|
-
`Chain ID ${a} is not supported`,
|
|
3538
|
-
{ chainId: a }
|
|
3539
|
-
);
|
|
3540
|
-
const s = tt(e, n, a);
|
|
3541
|
-
return De({
|
|
3542
|
-
account: s,
|
|
3543
|
-
chain: t,
|
|
3544
|
-
transport: xe()
|
|
3545
|
-
// Uses default RPC
|
|
3546
|
-
});
|
|
3547
|
-
}
|
|
3548
|
-
async function F({
|
|
3549
|
-
params: e,
|
|
3550
|
-
publicClient: n,
|
|
3551
|
-
walletClient: a,
|
|
3552
|
-
simulateArgs: t,
|
|
3553
|
-
operation: s
|
|
3554
|
-
}) {
|
|
3555
|
-
if (!H(e) && !Ne(e))
|
|
3556
|
-
throw new T(
|
|
3557
|
-
"INVALID_PARAMETERS",
|
|
3558
|
-
'Must provide either "provider" or "signer" in parameters',
|
|
3559
|
-
{ params: e, operation: s }
|
|
3560
|
-
);
|
|
3561
|
-
let r;
|
|
3562
|
-
try {
|
|
3563
|
-
r = await n.simulateContract(
|
|
3564
|
-
t
|
|
3565
|
-
);
|
|
3566
|
-
} catch (o) {
|
|
3567
|
-
throw new T(
|
|
3568
|
-
"SIMULATION_FAILED",
|
|
3569
|
-
`Failed to simulate ${s} transaction: ${o instanceof Error ? o.message : "Unknown error"}`,
|
|
3570
|
-
{
|
|
3571
|
-
operation: s,
|
|
3572
|
-
simulateArgs: t,
|
|
3573
|
-
error: o instanceof Error ? o.message : String(o)
|
|
3574
|
-
}
|
|
3575
|
-
);
|
|
3576
|
-
}
|
|
3577
|
-
const { request: i } = r;
|
|
3578
|
-
if (!i.account)
|
|
3579
|
-
throw new T(
|
|
3580
|
-
"INVALID_SIMULATION",
|
|
3581
|
-
`Simulation succeeded but no account was set for ${s}`,
|
|
3582
|
-
{ operation: s, request: i }
|
|
3583
|
-
);
|
|
3584
|
-
if (!i.address)
|
|
3585
|
-
throw new T(
|
|
3586
|
-
"INVALID_SIMULATION",
|
|
3587
|
-
`Simulation succeeded but no target address was set for ${s}`,
|
|
3588
|
-
{ operation: s, request: i }
|
|
3589
|
-
);
|
|
3590
|
-
let p;
|
|
3591
|
-
if (H(e)) {
|
|
3592
|
-
if (!a)
|
|
3593
|
-
throw new T(
|
|
3594
|
-
"MISSING_WALLET_CLIENT",
|
|
3595
|
-
"Provider flow requires a wallet client",
|
|
3596
|
-
{ operation: s, params: e }
|
|
3597
|
-
);
|
|
3598
|
-
try {
|
|
3599
|
-
p = await a.writeContract(i);
|
|
3600
|
-
} catch (o) {
|
|
3601
|
-
throw new T(
|
|
3602
|
-
"PROVIDER_TRANSACTION_FAILED",
|
|
3603
|
-
`Failed to execute ${s} via provider: ${o instanceof Error ? o.message : "Unknown error"}`,
|
|
3604
|
-
{
|
|
3605
|
-
operation: s,
|
|
3606
|
-
request: i,
|
|
3607
|
-
error: o instanceof Error ? o.message : String(o)
|
|
3608
|
-
}
|
|
3609
|
-
);
|
|
3610
|
-
}
|
|
3611
|
-
} else
|
|
3612
|
-
try {
|
|
3613
|
-
const o = v[e.chainId];
|
|
3614
|
-
if (!o)
|
|
3615
|
-
throw new T(
|
|
3616
|
-
"UNSUPPORTED_CHAIN",
|
|
3617
|
-
`Chain ${e.chainId} not supported`,
|
|
3618
|
-
{ chainId: e.chainId }
|
|
3619
|
-
);
|
|
3620
|
-
const u = Ie({
|
|
3621
|
-
abi: t.abi,
|
|
3622
|
-
functionName: t.functionName,
|
|
3623
|
-
args: t.args
|
|
3624
|
-
}), y = {
|
|
3625
|
-
from: e.account,
|
|
3626
|
-
to: i.address,
|
|
3627
|
-
data: u,
|
|
3628
|
-
value: i.value,
|
|
3629
|
-
gas: i.gas,
|
|
3630
|
-
maxFeePerGas: i.maxFeePerGas,
|
|
3631
|
-
maxPriorityFeePerGas: i.maxPriorityFeePerGas,
|
|
3632
|
-
chainId: `0x${o.id.toString(16)}`
|
|
3633
|
-
};
|
|
3634
|
-
le(y, s), p = await e.signer.sign(y, async (m) => await n.sendRawTransaction({
|
|
3635
|
-
serializedTransaction: m
|
|
3636
|
-
}));
|
|
3637
|
-
} catch (o) {
|
|
3638
|
-
throw new T(
|
|
3639
|
-
"SIGNER_TRANSACTION_FAILED",
|
|
3640
|
-
`Failed to execute ${s} via signer: ${o instanceof Error ? o.message : "Unknown error"}`,
|
|
3641
|
-
{
|
|
3642
|
-
operation: s,
|
|
3643
|
-
request: i,
|
|
3644
|
-
error: o instanceof Error ? o.message : String(o)
|
|
3645
|
-
}
|
|
3646
|
-
);
|
|
3647
|
-
}
|
|
3648
|
-
return { txHash: p, request: i };
|
|
3649
|
-
}
|
|
3650
|
-
async function nt(e, n, a) {
|
|
3651
|
-
try {
|
|
3652
|
-
const t = await e.waitForTransactionReceipt({
|
|
3653
|
-
hash: n
|
|
3654
|
-
});
|
|
3655
|
-
if (t.status === "reverted")
|
|
3656
|
-
throw new T(
|
|
3657
|
-
"TRANSACTION_REVERTED",
|
|
3658
|
-
`${a} transaction reverted`,
|
|
3659
|
-
{
|
|
3660
|
-
operation: a,
|
|
3661
|
-
txHash: n,
|
|
3662
|
-
receipt: {
|
|
3663
|
-
blockNumber: t.blockNumber,
|
|
3664
|
-
gasUsed: t.gasUsed
|
|
3665
|
-
}
|
|
3666
|
-
}
|
|
3667
|
-
);
|
|
3668
|
-
return t;
|
|
3669
|
-
} catch (t) {
|
|
3670
|
-
throw t instanceof T ? t : new T(
|
|
3671
|
-
"RECEIPT_WAIT_FAILED",
|
|
3672
|
-
`Failed to wait for ${a} transaction receipt: ${t instanceof Error ? t.message : "Unknown error"}`,
|
|
3673
|
-
{
|
|
3674
|
-
operation: a,
|
|
3675
|
-
txHash: n,
|
|
3676
|
-
error: t instanceof Error ? t.message : String(t)
|
|
3677
|
-
}
|
|
3678
|
-
);
|
|
3679
|
-
}
|
|
3680
|
-
}
|
|
3681
3681
|
const at = [
|
|
3682
3682
|
// Redeem to BTC
|
|
3683
3683
|
{ tokenIn: d.LBTC },
|
|
@@ -3761,7 +3761,7 @@ async function st(e) {
|
|
|
3761
3761
|
args: [E.address, I(c)]
|
|
3762
3762
|
},
|
|
3763
3763
|
operation: "BTC.b approval"
|
|
3764
|
-
}), q = await
|
|
3764
|
+
}), q = await je(
|
|
3765
3765
|
y,
|
|
3766
3766
|
we,
|
|
3767
3767
|
"BTC.b approval"
|
|
@@ -3847,15 +3847,16 @@ async function It(e) {
|
|
|
3847
3847
|
export {
|
|
3848
3848
|
S as A,
|
|
3849
3849
|
L as B,
|
|
3850
|
+
je as C,
|
|
3850
3851
|
T as S,
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3852
|
+
vt as a,
|
|
3853
|
+
Ke as b,
|
|
3854
|
+
Dt as c,
|
|
3855
|
+
Mt as d,
|
|
3856
|
+
Et as e,
|
|
3857
|
+
xt as f,
|
|
3857
3858
|
Le as g,
|
|
3858
|
-
|
|
3859
|
+
et as h,
|
|
3859
3860
|
ft as i,
|
|
3860
3861
|
Tt as j,
|
|
3861
3862
|
Pe as k,
|
|
@@ -3865,8 +3866,8 @@ export {
|
|
|
3865
3866
|
pe as o,
|
|
3866
3867
|
ye as p,
|
|
3867
3868
|
At as q,
|
|
3868
|
-
|
|
3869
|
-
|
|
3869
|
+
Rt as r,
|
|
3870
|
+
tt as s,
|
|
3870
3871
|
st as t,
|
|
3871
3872
|
gt as u,
|
|
3872
3873
|
Ct as v,
|
|
@@ -3875,4 +3876,4 @@ export {
|
|
|
3875
3876
|
le as y,
|
|
3876
3877
|
z
|
|
3877
3878
|
};
|
|
3878
|
-
//# sourceMappingURL=unstakeLBTC-
|
|
3879
|
+
//# sourceMappingURL=unstakeLBTC-DAIR9NO_.js.map
|