@lombard.finance/sdk 5.0.3 → 5.0.4
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 +12 -0
- package/dist/api-functions/storeNetworkFeeSignature/storeNetworkFeeSignature.d.ts +13 -0
- package/dist/api-functions/storeNetworkFeeSignature/storeNetworkFeeSignature.d.ts.map +1 -1
- package/dist/api.cjs +1 -1
- package/dist/api.js +12 -11
- package/dist/api.js.map +1 -1
- package/dist/btc.cjs +1 -1
- package/dist/btc.js +2 -2
- package/dist/chains/btc/actions/stake/config/evm.d.ts.map +1 -1
- package/dist/chunks/{BtcActions-BE75KQhS.js → BtcActions-D7HekjRg.js} +235 -216
- package/dist/chunks/{BtcActions-BE75KQhS.js.map → BtcActions-D7HekjRg.js.map} +1 -1
- package/dist/chunks/BtcActions-lp4P72ln.cjs +2 -0
- package/dist/chunks/{BtcActions-hLkixDlL.cjs.map → BtcActions-lp4P72ln.cjs.map} +1 -1
- package/dist/chunks/EvmActions-CynfSVFq.cjs +7 -0
- package/dist/chunks/{EvmActions-DIkhiG2i.cjs.map → EvmActions-CynfSVFq.cjs.map} +1 -1
- package/dist/chunks/{EvmActions-DCy8q_l4.js → EvmActions-nbR8cSa4.js} +37 -36
- package/dist/chunks/{EvmActions-DCy8q_l4.js.map → EvmActions-nbR8cSa4.js.map} +1 -1
- package/dist/chunks/depositStatus-DUXMloTa.cjs +2 -0
- package/dist/chunks/{depositStatus-CeoqUgM5.cjs.map → depositStatus-DUXMloTa.cjs.map} +1 -1
- package/dist/chunks/{depositStatus-CacTFWfJ.js → depositStatus-hmXphYhu.js} +2 -2
- package/dist/chunks/{depositStatus-CacTFWfJ.js.map → depositStatus-hmXphYhu.js.map} +1 -1
- package/dist/chunks/{events-Cu4qfdgE.js → events-BP_Ahnsm.js} +42 -41
- package/dist/chunks/{events-Cu4qfdgE.js.map → events-BP_Ahnsm.js.map} +1 -1
- package/dist/chunks/events-DY2qn8Q0.cjs +2 -0
- package/dist/chunks/{events-C3tg6XPm.cjs.map → events-DY2qn8Q0.cjs.map} +1 -1
- package/dist/chunks/getNetworkFeeSignature-DqKLslZc.cjs +2 -0
- package/dist/chunks/getNetworkFeeSignature-DqKLslZc.cjs.map +1 -0
- package/dist/chunks/getNetworkFeeSignature-FuDJWrMC.js +38 -0
- package/dist/chunks/getNetworkFeeSignature-FuDJWrMC.js.map +1 -0
- package/dist/chunks/statusConstants-D4DN05kK.cjs +2 -0
- package/dist/chunks/{statusConstants-BPtrxbYC.cjs.map → statusConstants-D4DN05kK.cjs.map} +1 -1
- package/dist/chunks/{statusConstants-8pqtLXvX.js → statusConstants-DLrd03gT.js} +3 -3
- package/dist/chunks/{statusConstants-8pqtLXvX.js.map → statusConstants-DLrd03gT.js.map} +1 -1
- package/dist/chunks/storeNetworkFeeSignature-BaG3AU8U.cjs +2 -0
- package/dist/chunks/storeNetworkFeeSignature-BaG3AU8U.cjs.map +1 -0
- package/dist/chunks/storeNetworkFeeSignature-sCt4_nHr.js +52 -0
- package/dist/chunks/storeNetworkFeeSignature-sCt4_nHr.js.map +1 -0
- package/dist/common/chains.d.ts +3 -0
- package/dist/common/chains.d.ts.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +4 -4
- package/dist/evm.cjs +1 -1
- package/dist/evm.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +264 -263
- package/package.json +1 -1
- package/dist/chunks/BtcActions-hLkixDlL.cjs +0 -2
- package/dist/chunks/EvmActions-DIkhiG2i.cjs +0 -7
- package/dist/chunks/constants-D1FnS2Z8.js +0 -6
- package/dist/chunks/constants-D1FnS2Z8.js.map +0 -1
- package/dist/chunks/constants-ueShGH9R.cjs +0 -2
- package/dist/chunks/constants-ueShGH9R.cjs.map +0 -1
- package/dist/chunks/depositStatus-CeoqUgM5.cjs +0 -2
- package/dist/chunks/events-C3tg6XPm.cjs +0 -2
- package/dist/chunks/statusConstants-BPtrxbYC.cjs +0 -2
- package/dist/chunks/storeNetworkFeeSignature-Z0NcQyIn.cjs +0 -2
- package/dist/chunks/storeNetworkFeeSignature-Z0NcQyIn.cjs.map +0 -1
- package/dist/chunks/storeNetworkFeeSignature-ZdHcFmfP.js +0 -65
- package/dist/chunks/storeNetworkFeeSignature-ZdHcFmfP.js.map +0 -1
|
@@ -2,12 +2,13 @@ var dt = Object.defineProperty;
|
|
|
2
2
|
var pt = (r, a, t) => a in r ? dt(r, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[a] = t;
|
|
3
3
|
var m = (r, a, t) => pt(r, typeof a != "symbol" ? a + "" : a, t);
|
|
4
4
|
import D from "bignumber.js";
|
|
5
|
-
import { getMintingFee as at, signNetworkFee as it, getStakeAndBakeFee as mt, signStakeAndBake as lt, signLbtcDestinationAddr as vt, waitForTransactionReceipt as F, depositEarn as Et, claimLBTC as Ct, redeemToken as nt, getTokenAllowance as _t, approveToken as gt, depositToken as wt, cancelWithdrawInternal as At, withdrawEarn as
|
|
5
|
+
import { getMintingFee as at, signNetworkFee as it, getStakeAndBakeFee as mt, signStakeAndBake as lt, signLbtcDestinationAddr as vt, waitForTransactionReceipt as F, depositEarn as Et, claimLBTC as Ct, redeemToken as nt, getTokenAllowance as _t, approveToken as gt, depositToken as wt, cancelWithdrawInternal as At, withdrawEarn as ft, queueWithdrawInternal as It } from "./withdrawEarn-BM_JOe4k.js";
|
|
6
6
|
import { Token as E, makeWalletClient as z, CHAIN_ID_TO_VIEM_CHAIN_MAP as M, AddressKind as Dt, ChainId as et } from "./token-addresses-DVnRPyu4.js";
|
|
7
7
|
import { makePublicClient as N, getTokenInfo as U, toBaseDenomination as q, fromBaseDenomination as y, getErrorMessage as Tt, getTokenContractInfo as W } from "./tokens-BUrC15ra.js";
|
|
8
|
-
import { Chain as
|
|
9
|
-
import {
|
|
10
|
-
import { requiresAutoMintFee as
|
|
8
|
+
import { Chain as f, BaseAction as x, EvmOperationStatus as s, validatePrepareParams as O, LombardError as h, parseChainIdentifier as w, StepStatus as i, objectType as B, evmAmountSchema as b, stringType as Pt, evmAddressSchema as rt, getEvmAssetChains as T, bitcoinAddressSchema as ot, getEvmChainsWithAllAssets as ct, WithdrawErrorCode as H, createEvmCoreContext as St } from "./statusConstants-DLrd03gT.js";
|
|
9
|
+
import { storeNetworkFeeSignature as xt } from "./storeNetworkFeeSignature-sCt4_nHr.js";
|
|
10
|
+
import { requiresAutoMintFee as Lt } from "./fee-requirements-CCNsxAvJ.js";
|
|
11
|
+
import { getNetworkFeeSignature as Nt } from "./getNetworkFeeSignature-FuDJWrMC.js";
|
|
11
12
|
import { DefiProtocol as S, AssetId as l } from "./defi-registry-DULXbu3D.js";
|
|
12
13
|
import { r as o } from "./index-CfcQ_g3t.js";
|
|
13
14
|
import { erc20Abi as st } from "viem";
|
|
@@ -85,7 +86,7 @@ class Ot {
|
|
|
85
86
|
}) };
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function Pe() {
|
|
89
90
|
return {
|
|
90
91
|
id: "evm",
|
|
91
92
|
chain: "evm",
|
|
@@ -99,35 +100,35 @@ const Bt = {
|
|
|
99
100
|
// Veda - Ethereum
|
|
100
101
|
{
|
|
101
102
|
asset: l.LBTC,
|
|
102
|
-
sourceChains: [
|
|
103
|
+
sourceChains: [f.ETHEREUM],
|
|
103
104
|
protocols: [S.Veda],
|
|
104
105
|
envs: [o.prod]
|
|
105
106
|
},
|
|
106
107
|
// Veda - Base
|
|
107
108
|
{
|
|
108
109
|
asset: l.LBTC,
|
|
109
|
-
sourceChains: [
|
|
110
|
+
sourceChains: [f.BASE],
|
|
110
111
|
protocols: [S.Veda],
|
|
111
112
|
envs: [o.prod]
|
|
112
113
|
},
|
|
113
114
|
// Veda - BSC
|
|
114
115
|
{
|
|
115
116
|
asset: l.LBTC,
|
|
116
|
-
sourceChains: [
|
|
117
|
+
sourceChains: [f.BSC],
|
|
117
118
|
protocols: [S.Veda],
|
|
118
119
|
envs: [o.prod]
|
|
119
120
|
},
|
|
120
121
|
// Veda - Corn
|
|
121
122
|
{
|
|
122
123
|
asset: l.LBTC,
|
|
123
|
-
sourceChains: [
|
|
124
|
+
sourceChains: [f.CORN],
|
|
124
125
|
protocols: [S.Veda],
|
|
125
126
|
envs: [o.prod]
|
|
126
127
|
},
|
|
127
128
|
// Silo - Avalanche
|
|
128
129
|
{
|
|
129
130
|
asset: l.LBTC,
|
|
130
|
-
sourceChains: [
|
|
131
|
+
sourceChains: [f.AVALANCHE],
|
|
131
132
|
protocols: [S.Silo],
|
|
132
133
|
envs: [o.prod]
|
|
133
134
|
}
|
|
@@ -419,10 +420,10 @@ const Mt = T(l.BTCb, [o.prod]), Ht = T(l.BTCb, [
|
|
|
419
420
|
],
|
|
420
421
|
addressSchema: rt
|
|
421
422
|
};
|
|
422
|
-
var
|
|
423
|
+
var I = /* @__PURE__ */ ((r) => (r.IDLE = "idle", r.NEEDS_APPROVAL = "needs-approval", r.READY = "ready", r.BRIDGING = "bridging", r.COMPLETED = "completed", r))(I || {});
|
|
423
424
|
class Yt extends x {
|
|
424
425
|
constructor(t, e) {
|
|
425
|
-
super(
|
|
426
|
+
super(I.IDLE);
|
|
426
427
|
m(this, "_amount");
|
|
427
428
|
m(this, "_recipient");
|
|
428
429
|
m(this, "_needsApproval", !1);
|
|
@@ -446,27 +447,27 @@ class Yt extends x {
|
|
|
446
447
|
this._claimData = { data: t, proofSignature: e };
|
|
447
448
|
}
|
|
448
449
|
async prepare(t) {
|
|
449
|
-
return this.assertStatus(
|
|
450
|
+
return this.assertStatus(I.IDLE, "prepare"), this.act(async () => {
|
|
450
451
|
const e = O(this.prepareSchema, t, {
|
|
451
452
|
destChain: this.params.destChain
|
|
452
453
|
});
|
|
453
454
|
this._amount = e.amount, this._recipient = e.recipient, this._needsApproval = !1, this.emitProgress({
|
|
454
|
-
status:
|
|
455
|
+
status: I.READY,
|
|
455
456
|
steps: {
|
|
456
457
|
approval: i.COMPLETE,
|
|
457
458
|
execution: i.IDLE,
|
|
458
459
|
bridging: i.IDLE
|
|
459
460
|
}
|
|
460
461
|
});
|
|
461
|
-
},
|
|
462
|
+
}, I.READY);
|
|
462
463
|
}
|
|
463
464
|
async approve() {
|
|
464
|
-
return this.assertStatus(
|
|
465
|
+
return this.assertStatus(I.NEEDS_APPROVAL, "approve"), this.act(async () => {
|
|
465
466
|
this._needsApproval = !1;
|
|
466
|
-
},
|
|
467
|
+
}, I.READY);
|
|
467
468
|
}
|
|
468
469
|
async execute() {
|
|
469
|
-
if (this.assertStatus(
|
|
470
|
+
if (this.assertStatus(I.READY, "execute"), !this._claimData)
|
|
470
471
|
throw h.missingParameter("claimData");
|
|
471
472
|
return this.act(async () => {
|
|
472
473
|
const t = await this.ctx.getProvider("evm");
|
|
@@ -474,7 +475,7 @@ class Yt extends x {
|
|
|
474
475
|
throw h.providerMissing(this.params.sourceChain, "evm");
|
|
475
476
|
const e = w(this.params.destChain);
|
|
476
477
|
this.emitProgress({
|
|
477
|
-
status:
|
|
478
|
+
status: I.READY,
|
|
478
479
|
steps: {
|
|
479
480
|
approval: i.COMPLETE,
|
|
480
481
|
execution: i.PENDING,
|
|
@@ -490,14 +491,14 @@ class Yt extends x {
|
|
|
490
491
|
env: this.ctx.env
|
|
491
492
|
});
|
|
492
493
|
return this._txHash = n, this.emitProgress({
|
|
493
|
-
status:
|
|
494
|
+
status: I.COMPLETED,
|
|
494
495
|
steps: {
|
|
495
496
|
approval: i.COMPLETE,
|
|
496
497
|
execution: i.COMPLETE,
|
|
497
498
|
bridging: i.IDLE
|
|
498
499
|
}
|
|
499
500
|
}), this.emitCompleted(), { txHash: n };
|
|
500
|
-
},
|
|
501
|
+
}, I.COMPLETED);
|
|
501
502
|
}
|
|
502
503
|
get prepareSchema() {
|
|
503
504
|
return B({
|
|
@@ -521,7 +522,7 @@ const $t = T(l.BTCb, [o.prod]), Gt = T(l.BTCb, [
|
|
|
521
522
|
assetIn: l.BTCb,
|
|
522
523
|
assetOut: l.BTC,
|
|
523
524
|
sourceChains: $t,
|
|
524
|
-
destChain:
|
|
525
|
+
destChain: f.BITCOIN_MAINNET,
|
|
525
526
|
envs: [o.prod]
|
|
526
527
|
},
|
|
527
528
|
// BTC.b → BTC (to Bitcoin Signet - testnet)
|
|
@@ -529,7 +530,7 @@ const $t = T(l.BTCb, [o.prod]), Gt = T(l.BTCb, [
|
|
|
529
530
|
assetIn: l.BTCb,
|
|
530
531
|
assetOut: l.BTC,
|
|
531
532
|
sourceChains: Gt,
|
|
532
|
-
destChain:
|
|
533
|
+
destChain: f.BITCOIN_SIGNET,
|
|
533
534
|
envs: [o.testnet, o.stage, o.dev, o.ibc]
|
|
534
535
|
}
|
|
535
536
|
// TODO: Add L-Asset routes when deployed
|
|
@@ -538,7 +539,7 @@ const $t = T(l.BTCb, [o.prod]), Gt = T(l.BTCb, [
|
|
|
538
539
|
recipientSchema: ot
|
|
539
540
|
};
|
|
540
541
|
async function K(r, a, t, e) {
|
|
541
|
-
if (!
|
|
542
|
+
if (!Lt(r))
|
|
542
543
|
return {
|
|
543
544
|
requiresAuth: !1,
|
|
544
545
|
hasValidSignature: !1,
|
|
@@ -546,7 +547,7 @@ async function K(r, a, t, e) {
|
|
|
546
547
|
feeFormatted: null,
|
|
547
548
|
expirationDate: null
|
|
548
549
|
};
|
|
549
|
-
const n = await W(e, r, t), d = await
|
|
550
|
+
const n = await W(e, r, t), d = await Nt({
|
|
550
551
|
address: a,
|
|
551
552
|
chainId: r,
|
|
552
553
|
env: t,
|
|
@@ -578,7 +579,7 @@ async function Q(r) {
|
|
|
578
579
|
env: d,
|
|
579
580
|
token: u
|
|
580
581
|
});
|
|
581
|
-
return await
|
|
582
|
+
return await xt({
|
|
582
583
|
signature: c.signature,
|
|
583
584
|
typedData: c.typedData,
|
|
584
585
|
address: t,
|
|
@@ -941,13 +942,13 @@ const Jt = T(l.LBTC, [o.prod]), Xt = T(l.LBTC, [
|
|
|
941
942
|
// Production: EVM chains with LBTC → Bitcoin Mainnet
|
|
942
943
|
{
|
|
943
944
|
sourceChains: Jt,
|
|
944
|
-
destChain:
|
|
945
|
+
destChain: f.BITCOIN_MAINNET,
|
|
945
946
|
envs: [o.prod]
|
|
946
947
|
},
|
|
947
948
|
// Testnet: EVM chains with LBTC → Bitcoin Signet
|
|
948
949
|
{
|
|
949
950
|
sourceChains: Xt,
|
|
950
|
-
destChain:
|
|
951
|
+
destChain: f.BITCOIN_SIGNET,
|
|
951
952
|
envs: [o.testnet, o.stage, o.dev, o.ibc]
|
|
952
953
|
}
|
|
953
954
|
],
|
|
@@ -1115,7 +1116,7 @@ const ht = {
|
|
|
1115
1116
|
routes: [
|
|
1116
1117
|
// Veda - Ethereum, Base, BSC, Corn
|
|
1117
1118
|
{
|
|
1118
|
-
sourceChains: [
|
|
1119
|
+
sourceChains: [f.ETHEREUM, f.BASE, f.BSC, f.CORN],
|
|
1119
1120
|
protocols: [S.Veda],
|
|
1120
1121
|
envs: [o.prod]
|
|
1121
1122
|
}
|
|
@@ -1372,13 +1373,13 @@ class oe extends x {
|
|
|
1372
1373
|
steps: { approval: i.COMPLETE, queueing: i.PENDING }
|
|
1373
1374
|
});
|
|
1374
1375
|
let e;
|
|
1375
|
-
return k(this._chainId) ? e = (await
|
|
1376
|
+
return k(this._chainId) ? e = (await ft({
|
|
1376
1377
|
amount: this._amount,
|
|
1377
1378
|
account: this._account,
|
|
1378
1379
|
chainId: this._chainId,
|
|
1379
1380
|
provider: t,
|
|
1380
1381
|
env: this.ctx.env
|
|
1381
|
-
})).queueTxHash : e = await
|
|
1382
|
+
})).queueTxHash : e = await It({
|
|
1382
1383
|
amount: this._amount,
|
|
1383
1384
|
approve: !1,
|
|
1384
1385
|
account: this._account,
|
|
@@ -1550,13 +1551,13 @@ class ue {
|
|
|
1550
1551
|
return Wt(this.ctx, a);
|
|
1551
1552
|
}
|
|
1552
1553
|
}
|
|
1553
|
-
function
|
|
1554
|
+
function Se(r) {
|
|
1554
1555
|
return new ue(r);
|
|
1555
1556
|
}
|
|
1556
1557
|
export {
|
|
1557
1558
|
ue as EvmActions,
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1559
|
+
I as EvmDepositStatus,
|
|
1560
|
+
Se as evmActions,
|
|
1561
|
+
Pe as evmModule
|
|
1561
1562
|
};
|
|
1562
|
-
//# sourceMappingURL=EvmActions-
|
|
1563
|
+
//# sourceMappingURL=EvmActions-nbR8cSa4.js.map
|