@lombard.finance/sdk 4.6.0 → 4.7.0
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 +23 -0
- package/README.md +8 -4
- package/dist/api-functions/getDepositsByAddress/getDepositsByAddress.d.ts +4 -0
- package/dist/api-functions/getDepositsByAddress/getDepositsByAddress.d.ts.map +1 -1
- package/dist/api.cjs +1 -1
- package/dist/api.js +5 -5
- package/dist/bridge.cjs +1 -1
- package/dist/bridge.js +1 -1
- package/dist/btc.cjs +1 -1
- package/dist/btc.js +2 -2
- package/dist/chains/btc/actions/deposit/config/solana.d.ts.map +1 -1
- package/dist/chains/solana/SolanaActions.d.ts +24 -6
- package/dist/chains/solana/SolanaActions.d.ts.map +1 -1
- package/dist/chains/solana/actions/index.d.ts +1 -0
- package/dist/chains/solana/actions/index.d.ts.map +1 -1
- package/dist/chains/solana/actions/redeem/SolanaRedeem.d.ts +5 -9
- package/dist/chains/solana/actions/redeem/SolanaRedeem.d.ts.map +1 -1
- package/dist/chains/solana/actions/redeem/config/solana.d.ts +1 -10
- package/dist/chains/solana/actions/redeem/config/solana.d.ts.map +1 -1
- package/dist/chains/solana/actions/redeem/config/types.d.ts +0 -14
- package/dist/chains/solana/actions/redeem/config/types.d.ts.map +1 -1
- package/dist/chains/solana/actions/redeem/factory.d.ts +0 -3
- package/dist/chains/solana/actions/redeem/factory.d.ts.map +1 -1
- package/dist/chains/solana/actions/redeem/types.d.ts +5 -17
- package/dist/chains/solana/actions/redeem/types.d.ts.map +1 -1
- package/dist/chains/solana/actions/stake/SolanaStake.d.ts +33 -0
- package/dist/chains/solana/actions/stake/SolanaStake.d.ts.map +1 -0
- package/dist/chains/solana/actions/stake/config/index.d.ts +8 -0
- package/dist/chains/solana/actions/stake/config/index.d.ts.map +1 -0
- package/dist/chains/solana/actions/stake/config/solana.d.ts +13 -0
- package/dist/chains/solana/actions/stake/config/solana.d.ts.map +1 -0
- package/dist/chains/solana/actions/stake/config/types.d.ts +20 -0
- package/dist/chains/solana/actions/stake/config/types.d.ts.map +1 -0
- package/dist/chains/solana/actions/stake/factory.d.ts +9 -0
- package/dist/chains/solana/actions/stake/factory.d.ts.map +1 -0
- package/dist/chains/solana/actions/stake/index.d.ts +9 -0
- package/dist/chains/solana/actions/stake/index.d.ts.map +1 -0
- package/dist/chains/solana/actions/stake/types.d.ts +39 -0
- package/dist/chains/solana/actions/stake/types.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/SolanaUnstake.d.ts +7 -4
- package/dist/chains/solana/actions/unstake/SolanaUnstake.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/config/btc.d.ts +13 -7
- package/dist/chains/solana/actions/unstake/config/btc.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/config/index.d.ts +1 -1
- package/dist/chains/solana/actions/unstake/config/index.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/config/types.d.ts +6 -2
- package/dist/chains/solana/actions/unstake/config/types.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/types.d.ts +4 -4
- package/dist/chains/solana/actions/unstake/types.d.ts.map +1 -1
- package/dist/chains/solana/utils.d.ts +2 -0
- package/dist/chains/solana/utils.d.ts.map +1 -1
- package/dist/chains/starknet/actions/unstake/StarknetUnstake.d.ts +2 -2
- package/dist/chains/starknet/actions/unstake/StarknetUnstake.d.ts.map +1 -1
- package/dist/chains/starknet/actions/unstake/types.d.ts +4 -4
- package/dist/chains/starknet/actions/unstake/types.d.ts.map +1 -1
- package/dist/chains/sui/actions/unstake/SuiUnstake.d.ts +2 -2
- package/dist/chains/sui/actions/unstake/SuiUnstake.d.ts.map +1 -1
- package/dist/chains/sui/actions/unstake/types.d.ts +4 -4
- package/dist/chains/sui/actions/unstake/types.d.ts.map +1 -1
- package/dist/chunks/BtcActions-CWFHlbUP.cjs +2 -0
- package/dist/chunks/BtcActions-CWFHlbUP.cjs.map +1 -0
- package/dist/chunks/{BtcActions-CI5XotUx.js → BtcActions-jvzGFmpz.js} +12 -8
- package/dist/chunks/BtcActions-jvzGFmpz.js.map +1 -0
- package/dist/chunks/{EvmActions-D_sFfTAK.cjs → EvmActions-BTKQAXTE.cjs} +2 -2
- package/dist/chunks/{EvmActions-D_sFfTAK.cjs.map → EvmActions-BTKQAXTE.cjs.map} +1 -1
- package/dist/chunks/{EvmActions-C7EKF3jb.js → EvmActions-hb-FhsLJ.js} +9 -9
- package/dist/chunks/{EvmActions-C7EKF3jb.js.map → EvmActions-hb-FhsLJ.js.map} +1 -1
- package/dist/chunks/ReferralsClient-D8dHEk_X.cjs +2 -0
- package/dist/chunks/ReferralsClient-D8dHEk_X.cjs.map +1 -0
- package/dist/chunks/{ReferralsClient-AxhLoWRT.js → ReferralsClient-W-0-383w.js} +58 -58
- package/dist/chunks/ReferralsClient-W-0-383w.js.map +1 -0
- package/dist/chunks/{approveLBTC-CUXEC3kw.cjs → approveLBTC-BMC4cZEk.cjs} +2 -2
- package/dist/chunks/{approveLBTC-CUXEC3kw.cjs.map → approveLBTC-BMC4cZEk.cjs.map} +1 -1
- package/dist/chunks/{approveLBTC-Du2El1tW.js → approveLBTC-BkdT1N3V.js} +3 -3
- package/dist/chunks/{approveLBTC-Du2El1tW.js.map → approveLBTC-BkdT1N3V.js.map} +1 -1
- package/dist/chunks/{blockchain-identifier-CTVaEPpY.js → blockchain-identifier-BLPnwbIN.js} +2 -2
- package/dist/chunks/{blockchain-identifier-CTVaEPpY.js.map → blockchain-identifier-BLPnwbIN.js.map} +1 -1
- package/dist/chunks/{blockchain-identifier-BTPGxLio.cjs → blockchain-identifier-Bp-LTIdG.cjs} +2 -2
- package/dist/chunks/{blockchain-identifier-BTPGxLio.cjs.map → blockchain-identifier-Bp-LTIdG.cjs.map} +1 -1
- package/dist/chunks/{bridge-dWaKrMKm.cjs → bridge-7Eq_Jmi2.cjs} +2 -2
- package/dist/chunks/{bridge-dWaKrMKm.cjs.map → bridge-7Eq_Jmi2.cjs.map} +1 -1
- package/dist/chunks/{bridge-DqGabhIY.js → bridge-DbB23m2a.js} +4 -4
- package/dist/chunks/{bridge-DqGabhIY.js.map → bridge-DbB23m2a.js.map} +1 -1
- package/dist/chunks/{config-JT3GvwPB.js → config-C8BfN_9P.js} +2 -2
- package/dist/chunks/{config-JT3GvwPB.js.map → config-C8BfN_9P.js.map} +1 -1
- package/dist/chunks/{config-CSo0k7gN.cjs → config-ow9X5H0c.cjs} +2 -2
- package/dist/chunks/{config-CSo0k7gN.cjs.map → config-ow9X5H0c.cjs.map} +1 -1
- package/dist/chunks/{defi-registry-hHpGoh1m.cjs → defi-registry-B8V6dRVB.cjs} +2 -2
- package/dist/chunks/{defi-registry-hHpGoh1m.cjs.map → defi-registry-B8V6dRVB.cjs.map} +1 -1
- package/dist/chunks/{defi-registry-ig-wro_O.js → defi-registry-CD8EUcNu.js} +3 -3
- package/dist/chunks/{defi-registry-ig-wro_O.js.map → defi-registry-CD8EUcNu.js.map} +1 -1
- package/dist/chunks/depositStatus-BJA7tNqc.cjs +2 -0
- package/dist/chunks/{depositStatus-D5t8HN_A.cjs.map → depositStatus-BJA7tNqc.cjs.map} +1 -1
- package/dist/chunks/{depositStatus-BrrE4n4B.js → depositStatus-HosfExLl.js} +38 -37
- package/dist/chunks/{depositStatus-BrrE4n4B.js.map → depositStatus-HosfExLl.js.map} +1 -1
- package/dist/chunks/events-BTPDrUUu.cjs +2 -0
- package/dist/chunks/events-BTPDrUUu.cjs.map +1 -0
- package/dist/chunks/events-DAiXVdGv.js +1274 -0
- package/dist/chunks/events-DAiXVdGv.js.map +1 -0
- package/dist/chunks/{get-exchange-ratio-B-xzYND1.js → get-exchange-ratio-Bl6pt546.js} +2 -2
- package/dist/chunks/{get-exchange-ratio-B-xzYND1.js.map → get-exchange-ratio-Bl6pt546.js.map} +1 -1
- package/dist/chunks/{get-exchange-ratio-BEhD4gLB.cjs → get-exchange-ratio-t1PW8I6_.cjs} +2 -2
- package/dist/chunks/{get-exchange-ratio-BEhD4gLB.cjs.map → get-exchange-ratio-t1PW8I6_.cjs.map} +1 -1
- package/dist/chunks/{get-positions-summary-iYshN1RQ.js → get-positions-summary-CaX2BCHp.js} +2 -2
- package/dist/chunks/{get-positions-summary-iYshN1RQ.js.map → get-positions-summary-CaX2BCHp.js.map} +1 -1
- package/dist/chunks/{get-positions-summary-Dh1QPLYO.cjs → get-positions-summary-DdZvBmCN.cjs} +2 -2
- package/dist/chunks/{get-positions-summary-Dh1QPLYO.cjs.map → get-positions-summary-DdZvBmCN.cjs.map} +1 -1
- package/dist/chunks/{get-vault-tvl-C3Yr4MI4.js → get-vault-tvl-CihHEkqK.js} +4 -4
- package/dist/chunks/{get-vault-tvl-C3Yr4MI4.js.map → get-vault-tvl-CihHEkqK.js.map} +1 -1
- package/dist/chunks/{get-vault-tvl-CRbxkHmr.cjs → get-vault-tvl-DZ-xzehy.cjs} +2 -2
- package/dist/chunks/{get-vault-tvl-CRbxkHmr.cjs.map → get-vault-tvl-DZ-xzehy.cjs.map} +1 -1
- package/dist/chunks/{get-vault-withdrawals-QqvpZnxA.cjs → get-vault-withdrawals-DLwFMQEB.cjs} +2 -2
- package/dist/chunks/{get-vault-withdrawals-QqvpZnxA.cjs.map → get-vault-withdrawals-DLwFMQEB.cjs.map} +1 -1
- package/dist/chunks/{get-vault-withdrawals-CQwNiILS.js → get-vault-withdrawals-QJOdxB5Z.js} +3 -3
- package/dist/chunks/{get-vault-withdrawals-CQwNiILS.js.map → get-vault-withdrawals-QJOdxB5Z.js.map} +1 -1
- package/dist/chunks/{getUserStakeAndBakeSignature-CSEyzgMc.cjs → getUserStakeAndBakeSignature-BmY5j0OM.cjs} +2 -2
- package/dist/chunks/{getUserStakeAndBakeSignature-CSEyzgMc.cjs.map → getUserStakeAndBakeSignature-BmY5j0OM.cjs.map} +1 -1
- package/dist/chunks/{getUserStakeAndBakeSignature-Su-k10ap.js → getUserStakeAndBakeSignature-CqlrwA0t.js} +4 -4
- package/dist/chunks/{getUserStakeAndBakeSignature-Su-k10ap.js.map → getUserStakeAndBakeSignature-CqlrwA0t.js.map} +1 -1
- package/dist/chunks/{lbtc-addresses-D8MYCdsx.js → lbtc-addresses-BlyGFWnW.js} +2 -2
- package/dist/chunks/{lbtc-addresses-D8MYCdsx.js.map → lbtc-addresses-BlyGFWnW.js.map} +1 -1
- package/dist/chunks/{lbtc-addresses-Kil252DX.cjs → lbtc-addresses-DjsipX5Q.cjs} +2 -2
- package/dist/chunks/{lbtc-addresses-Kil252DX.cjs.map → lbtc-addresses-DjsipX5Q.cjs.map} +1 -1
- package/dist/chunks/statusConstants-BTQAvx1I.cjs +2 -0
- package/dist/chunks/statusConstants-BTQAvx1I.cjs.map +1 -0
- package/dist/chunks/{statusConstants-BU4PglPs.js → statusConstants-D9eSk91U.js} +53 -43
- package/dist/chunks/statusConstants-D9eSk91U.js.map +1 -0
- package/dist/chunks/{storeNetworkFeeSignature-Buk4091C.cjs → storeNetworkFeeSignature-CLm8I2pf.cjs} +2 -2
- package/dist/chunks/{storeNetworkFeeSignature-Buk4091C.cjs.map → storeNetworkFeeSignature-CLm8I2pf.cjs.map} +1 -1
- package/dist/chunks/{storeNetworkFeeSignature-BODIpq3Y.js → storeNetworkFeeSignature-tprCigR1.js} +2 -2
- package/dist/chunks/{storeNetworkFeeSignature-BODIpq3Y.js.map → storeNetworkFeeSignature-tprCigR1.js.map} +1 -1
- package/dist/chunks/{token-addresses-D0v5cR1j.js → token-addresses-Ddar0FyS.js} +130 -124
- package/dist/chunks/token-addresses-Ddar0FyS.js.map +1 -0
- package/dist/chunks/{token-addresses-nzvTOi24.cjs → token-addresses-DvY-Mw7b.cjs} +2 -2
- package/dist/chunks/token-addresses-DvY-Mw7b.cjs.map +1 -0
- package/dist/chunks/{tokens-BkvA0Gp1.cjs → tokens-CBsz6l_2.cjs} +2 -2
- package/dist/chunks/{tokens-BkvA0Gp1.cjs.map → tokens-CBsz6l_2.cjs.map} +1 -1
- package/dist/chunks/{tokens-DgC1hfkm.js → tokens-HhVpKe3K.js} +2 -2
- package/dist/chunks/{tokens-DgC1hfkm.js.map → tokens-HhVpKe3K.js.map} +1 -1
- package/dist/chunks/{unstakeLBTC-BrVLnaac.js → unstakeLBTC-Bg8OsAMV.js} +5 -5
- package/dist/chunks/{unstakeLBTC-BrVLnaac.js.map → unstakeLBTC-Bg8OsAMV.js.map} +1 -1
- package/dist/chunks/{unstakeLBTC-3bwLj1qT.cjs → unstakeLBTC-BmHvDxBN.cjs} +2 -2
- package/dist/chunks/{unstakeLBTC-3bwLj1qT.cjs.map → unstakeLBTC-BmHvDxBN.cjs.map} +1 -1
- package/dist/chunks/{withdraw-BKEovicU.cjs → withdraw-Bkp5-2dG.cjs} +2 -2
- package/dist/chunks/{withdraw-BKEovicU.cjs.map → withdraw-Bkp5-2dG.cjs.map} +1 -1
- package/dist/chunks/{withdraw-rndehhDn.js → withdraw-kf8mYbYH.js} +4 -4
- package/dist/chunks/{withdraw-rndehhDn.js.map → withdraw-kf8mYbYH.js.map} +1 -1
- package/dist/chunks/{wrapToBtce-CML1FYEZ.js → wrapToBtce-By2mh503.js} +5 -5
- package/dist/chunks/{wrapToBtce-CML1FYEZ.js.map → wrapToBtce-By2mh503.js.map} +1 -1
- package/dist/chunks/{wrapToBtce-BVu8ALEo.cjs → wrapToBtce-DDeIlv3d.cjs} +2 -2
- package/dist/chunks/{wrapToBtce-BVu8ALEo.cjs.map → wrapToBtce-DDeIlv3d.cjs.map} +1 -1
- package/dist/contracts.cjs +1 -1
- package/dist/contracts.js +3 -3
- package/dist/core/assets/catalog.d.ts.map +1 -1
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +32 -32
- package/dist/defi.cjs +1 -1
- package/dist/defi.js +2 -2
- package/dist/entries/core.d.ts +1 -1
- package/dist/entries/core.d.ts.map +1 -1
- package/dist/evm.cjs +1 -1
- package/dist/evm.js +4 -4
- 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 +36 -36
- package/dist/metrics.cjs +1 -1
- package/dist/metrics.js +1 -1
- package/dist/shared/constants/statusConstants.d.ts +7 -3
- package/dist/shared/constants/statusConstants.d.ts.map +1 -1
- package/dist/shared/deposits/depositStatus.d.ts.map +1 -1
- package/dist/tokens/token-addresses.d.ts.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +4 -4
- package/dist/vaults.cjs +1 -1
- package/dist/vaults.js +7 -7
- package/package.json +2 -2
- package/dist/chains/solana/actions/unstake/config/solana.d.ts +0 -21
- package/dist/chains/solana/actions/unstake/config/solana.d.ts.map +0 -1
- package/dist/chunks/BtcActions-Bic_HKkw.cjs +0 -2
- package/dist/chunks/BtcActions-Bic_HKkw.cjs.map +0 -1
- package/dist/chunks/BtcActions-CI5XotUx.js.map +0 -1
- package/dist/chunks/ReferralsClient-AxhLoWRT.js.map +0 -1
- package/dist/chunks/ReferralsClient-bZo9Jpg6.cjs +0 -2
- package/dist/chunks/ReferralsClient-bZo9Jpg6.cjs.map +0 -1
- package/dist/chunks/depositStatus-D5t8HN_A.cjs +0 -2
- package/dist/chunks/events-BfRsYM_-.cjs +0 -2
- package/dist/chunks/events-BfRsYM_-.cjs.map +0 -1
- package/dist/chunks/events-LMs7IA1e.js +0 -1108
- package/dist/chunks/events-LMs7IA1e.js.map +0 -1
- package/dist/chunks/statusConstants-BU4PglPs.js.map +0 -1
- package/dist/chunks/statusConstants-CCKi5qUm.cjs +0 -2
- package/dist/chunks/statusConstants-CCKi5qUm.cjs.map +0 -1
- package/dist/chunks/token-addresses-D0v5cR1j.js.map +0 -1
- package/dist/chunks/token-addresses-nzvTOi24.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { r as o } from "./chunks/index-CfcQ_g3t.js";
|
|
2
|
-
import { BtcActionStatus as a, CHAIN_CATALOG as s, Chain as i, ContractErrorCode as n, ErrorCode as A, EvmOperationStatus as S, EvmOperationStatus as d, EvmOperationStatus as g, EvmOperationStatus as E, EvmOperationStatus as C, EvmOperationStatus as T, LombardError as p,
|
|
2
|
+
import { BtcActionStatus as a, CHAIN_CATALOG as s, Chain as i, ContractErrorCode as n, ErrorCode as A, EvmOperationStatus as S, EvmOperationStatus as d, EvmOperationStatus as g, EvmOperationStatus as E, EvmOperationStatus as C, EvmOperationStatus as T, LombardError as p, NonEvmOperationStatus as m, PartnerConfiguration as l, ProviderErrorCode as c, RegistryErrorCode as _, SDK_NAME as N, SDK_RUNTIME as u, SDK_VERSION as B, StepStatus as I, StrategyStatus as D, ValidationErrorCode as h, chainValueToKey as k, evmChainIdToChain as f, getAllAssetChains as v, getAssetAddress as x, getAssetChains as L, getAssetChainsForEnvs as R, getChainMetadata as M, getChainName as O, getExplorerTxUrl as y, isAssetDeployed as P, isChain as U, isEvmChain as V, isLombardError as F, isMainnet as H, isTestnet as b, wrapError as w } from "./chunks/statusConstants-D9eSk91U.js";
|
|
3
3
|
import { MIN_REDEEM_AMOUNT_BTC as W, MIN_STAKE_AMOUNT_BTC as G } from "./chunks/constants-D1FnS2Z8.js";
|
|
4
|
-
import { ApiNamespace as Y, BridgeEvent as z, DeployEvent as Q, DepositEvent as j, LombardSDK as J, RedeemEvent as X, SolanaActions as Z, StakeEvent as $, StarknetActions as ee, SuiActions as te, UnstakeEvent as oe, createConfig as re, createConsoleLogger as ae, createLombardSDK as se, createSilentLogger as ie, getSdkHeaders as ne, isBtcProvider as Ae, isEvmProvider as Se, isSolanaProvider as de, isStarknetProvider as ge, isSuiProvider as Ee, solanaActions as Ce, starknetActions as Te, suiActions as pe } from "./chunks/events-
|
|
5
|
-
import { BtcActions as le, BtcDeposit as ce, BtcDepositAndDeploy as _e, BtcStake as Ne, BtcStakeAndDeploy as ue, btcActions as Be, btcModule as Ie } from "./chunks/BtcActions-
|
|
6
|
-
import { EvmActions as
|
|
4
|
+
import { ApiNamespace as Y, BridgeEvent as z, DeployEvent as Q, DepositEvent as j, LombardSDK as J, RedeemEvent as X, SolanaActions as Z, StakeEvent as $, StarknetActions as ee, SuiActions as te, UnstakeEvent as oe, createConfig as re, createConsoleLogger as ae, createLombardSDK as se, createSilentLogger as ie, getSdkHeaders as ne, isBtcProvider as Ae, isEvmProvider as Se, isSolanaProvider as de, isStarknetProvider as ge, isSuiProvider as Ee, solanaActions as Ce, starknetActions as Te, suiActions as pe } from "./chunks/events-DAiXVdGv.js";
|
|
5
|
+
import { BtcActions as le, BtcDeposit as ce, BtcDepositAndDeploy as _e, BtcStake as Ne, BtcStakeAndDeploy as ue, btcActions as Be, btcModule as Ie } from "./chunks/BtcActions-jvzGFmpz.js";
|
|
6
|
+
import { EvmActions as he, EvmDepositStatus as ke, evmActions as fe, evmModule as ve } from "./chunks/EvmActions-hb-FhsLJ.js";
|
|
7
7
|
import { getApiConfig as Le } from "./chunks/api-config-Dm6dR85f.js";
|
|
8
|
-
import { BlockchainIdentifier as Me, getBaseNetworkByEnv as Oe, getBscNetworkByEnv as ye, getChainIdByName as Pe, getChainNameById as Ue, getEthNetworkByEnv as Ve, getSolanaNetworkByEnv as Fe, getSonicNetworkByEnv as He, getStarknetNetworkByEnv as be, getSuiNetworkByEnv as we } from "./chunks/blockchain-identifier-
|
|
9
|
-
import { AddressKind as We, CHAIN_ID_TO_LLAMA_CHAIN_NAME_MAP as Ge, CHAIN_ID_TO_VIEM_CHAIN_MAP as qe, ChainId as Ye, EVM_LBTC_ADDRESSES as ze, RATIO_TOKEN_MAP as Qe, SOLANA_DEVNET_CHAIN as je, SOLANA_MAINNET_CHAIN as Je, SOLANA_TESTNET_CHAIN as Xe, SOLANA_TOKEN_ADDRESSES as Ze, STARKNET_ASSET_ROUTER_ADDRESSES as $e, STARKNET_MAINNET_CHAIN as et, STARKNET_SEPOLIA_CHAIN as tt, STARKNET_TOKEN_ADDRESSES as ot, SUI_DEVNET_CHAIN as rt, SUI_LOCALNET_CHAIN as at, SUI_MAINNET_CHAIN as st, SUI_TESTNET_CHAIN as it, SUI_TOKEN_ADDRESSES as nt, TOKEN_ADDRESSES as At, Token as St, addChain as dt, allChains as gt, bob as Et, bobSepolia as Ct, getChain as Tt, getLlamaChainName as pt, getSolanaTokenAddress as mt, getStarknetTokenAddress as lt, getSuiTokenAddress as ct, getTokenAddressForChain as _t, getTokenByAddress as Nt, isEthereumChain as ut, isKatanaChain as Bt, isMegaethChain as It, isMonadChain as Dt, isSolanaChain as
|
|
8
|
+
import { BlockchainIdentifier as Me, getBaseNetworkByEnv as Oe, getBscNetworkByEnv as ye, getChainIdByName as Pe, getChainNameById as Ue, getEthNetworkByEnv as Ve, getSolanaNetworkByEnv as Fe, getSonicNetworkByEnv as He, getStarknetNetworkByEnv as be, getSuiNetworkByEnv as we } from "./chunks/blockchain-identifier-BLPnwbIN.js";
|
|
9
|
+
import { AddressKind as We, CHAIN_ID_TO_LLAMA_CHAIN_NAME_MAP as Ge, CHAIN_ID_TO_VIEM_CHAIN_MAP as qe, ChainId as Ye, EVM_LBTC_ADDRESSES as ze, RATIO_TOKEN_MAP as Qe, SOLANA_DEVNET_CHAIN as je, SOLANA_MAINNET_CHAIN as Je, SOLANA_TESTNET_CHAIN as Xe, SOLANA_TOKEN_ADDRESSES as Ze, STARKNET_ASSET_ROUTER_ADDRESSES as $e, STARKNET_MAINNET_CHAIN as et, STARKNET_SEPOLIA_CHAIN as tt, STARKNET_TOKEN_ADDRESSES as ot, SUI_DEVNET_CHAIN as rt, SUI_LOCALNET_CHAIN as at, SUI_MAINNET_CHAIN as st, SUI_TESTNET_CHAIN as it, SUI_TOKEN_ADDRESSES as nt, TOKEN_ADDRESSES as At, Token as St, addChain as dt, allChains as gt, bob as Et, bobSepolia as Ct, getChain as Tt, getLlamaChainName as pt, getSolanaTokenAddress as mt, getStarknetTokenAddress as lt, getSuiTokenAddress as ct, getTokenAddressForChain as _t, getTokenByAddress as Nt, isEthereumChain as ut, isKatanaChain as Bt, isMegaethChain as It, isMonadChain as Dt, isSolanaChain as ht, isStableChain as kt, isStarknetChainId as ft, isSuiChain as vt, isValidChain as xt, katana as Lt, megaeth as Rt, monad as Mt, stable as Ot, tac as yt } from "./chunks/token-addresses-Ddar0FyS.js";
|
|
10
10
|
import { AUTO_MINT_FEE_CHAINS as Ut, requiresAutoMintFee as Vt } from "./chunks/fee-requirements-CCNsxAvJ.js";
|
|
11
|
-
import { getLbtcContractAddresses as Ht } from "./chunks/lbtc-addresses-
|
|
12
|
-
import { RPC_URL as wt, TokenContractAddressNotFoundError as Kt, UnsupportedTokenFlow as Wt, fromBaseDenomination as Gt, getErrorMessage as qt, getRpcUrlConfig as Yt, getTokenContractInfo as zt, isUpgradedAbi as Qt, makePublicClient as jt, retrieveTokenProperties as Jt, rpcUrlConfig as Xt, toBaseDenomination as Zt } from "./chunks/tokens-
|
|
11
|
+
import { getLbtcContractAddresses as Ht } from "./chunks/lbtc-addresses-BlyGFWnW.js";
|
|
12
|
+
import { RPC_URL as wt, TokenContractAddressNotFoundError as Kt, UnsupportedTokenFlow as Wt, fromBaseDenomination as Gt, getErrorMessage as qt, getRpcUrlConfig as Yt, getTokenContractInfo as zt, isUpgradedAbi as Qt, makePublicClient as jt, retrieveTokenProperties as Jt, rpcUrlConfig as Xt, toBaseDenomination as Zt } from "./chunks/tokens-HhVpKe3K.js";
|
|
13
13
|
import { BTC_DECIMALS as eo, SATOSHI_SCALE as to, fromSatoshi as oo, toSatoshi as ro, toSatoshiBigInt as ao } from "./chunks/satoshi-CSoJBXc6.js";
|
|
14
|
-
import { getAdditionalRewards as io, getApy as no, getEstimatedApy as Ao, getLBTCStats as So, getPositionsSummary as go } from "./chunks/get-positions-summary-
|
|
15
|
-
import { ENotarizationStatus as Co, ESessionState as To, PayoutTxStatus as po, ReferralsClient as mo, fetchBTCbDeposits as lo, fetchDirectDeposits as co, fetchUnstakesByAddress as _o, getDepositBtcAddress as No, getDepositBtcAddresses as uo, getDepositsByAddress as Bo, getLuxSeason1Points as Io, getLuxSeason2Points as Do, getPointsByAddress as
|
|
16
|
-
import { SANCTIONED_ADDRESS as xo, generateDepositBtcAddress as Lo, getUserStakeAndBakeSignature as Ro } from "./chunks/getUserStakeAndBakeSignature-
|
|
17
|
-
import { getExchangeRatio as Oo } from "./chunks/get-exchange-ratio-
|
|
18
|
-
import { MIN_CLAIM_AMOUNT_BTC as Po, REQUIRED_CONFIRMATIONS as Uo, calcConfirmations as Vo, depositRequiresAction as Fo, getConfirmationProgress as Ho, getDepositStatus as bo, getDepositStatusDisplay as wo, getLBTCExchangeRate as Ko, isDepositClaimable as Wo, isDepositPending as Go, isDepositTerminal as qo, setReferral as Yo } from "./chunks/depositStatus-
|
|
19
|
-
import { getNetworkFeeSignature as Qo, storeNetworkFeeSignature as jo } from "./chunks/storeNetworkFeeSignature-
|
|
20
|
-
import { BasculeDepositStatus as Xo, SignerError as Zo, approveToken as $o, claimLBTC as er, createAccountFromSigner as tr, createWalletClientFromSigner as or, depositToken as rr, getAddressConfirmationMessage as ar, getAssetRouterAddress as sr, getBasculeDepositStatus as ir, getLBTCBurningFee as nr, getLBTCMintingFee as Ar, getMinRedeemAmount as Sr, getMinRedeemAmountWithFee as dr, getMintingFee as gr, getPermitNonce as Er, getRedeemFee as Cr, getStakeAndBakeConfig as Tr, getStakeAndBakeFee as pr, getTokenAllowance as mr, mintToken as lr, redeemToken as cr, signLbtcDestinationAddr as _r, signNetworkFee as Nr, signStakeAndBake as ur, unstakeLBTC as Br, validateTransactionRequest as Ir } from "./chunks/unstakeLBTC-
|
|
21
|
-
import { claimUnstakeRedeem as
|
|
22
|
-
import { approveLBTC as yr } from "./chunks/approveLBTC-
|
|
14
|
+
import { getAdditionalRewards as io, getApy as no, getEstimatedApy as Ao, getLBTCStats as So, getPositionsSummary as go } from "./chunks/get-positions-summary-CaX2BCHp.js";
|
|
15
|
+
import { ENotarizationStatus as Co, ESessionState as To, PayoutTxStatus as po, ReferralsClient as mo, fetchBTCbDeposits as lo, fetchDirectDeposits as co, fetchUnstakesByAddress as _o, getDepositBtcAddress as No, getDepositBtcAddresses as uo, getDepositsByAddress as Bo, getLuxSeason1Points as Io, getLuxSeason2Points as Do, getPointsByAddress as ho, getUnstakesByAddress as ko, storeStakeAndBakeSignature as fo } from "./chunks/ReferralsClient-W-0-383w.js";
|
|
16
|
+
import { SANCTIONED_ADDRESS as xo, generateDepositBtcAddress as Lo, getUserStakeAndBakeSignature as Ro } from "./chunks/getUserStakeAndBakeSignature-CqlrwA0t.js";
|
|
17
|
+
import { getExchangeRatio as Oo } from "./chunks/get-exchange-ratio-Bl6pt546.js";
|
|
18
|
+
import { MIN_CLAIM_AMOUNT_BTC as Po, REQUIRED_CONFIRMATIONS as Uo, calcConfirmations as Vo, depositRequiresAction as Fo, getConfirmationProgress as Ho, getDepositStatus as bo, getDepositStatusDisplay as wo, getLBTCExchangeRate as Ko, isDepositClaimable as Wo, isDepositPending as Go, isDepositTerminal as qo, setReferral as Yo } from "./chunks/depositStatus-HosfExLl.js";
|
|
19
|
+
import { getNetworkFeeSignature as Qo, storeNetworkFeeSignature as jo } from "./chunks/storeNetworkFeeSignature-tprCigR1.js";
|
|
20
|
+
import { BasculeDepositStatus as Xo, SignerError as Zo, approveToken as $o, claimLBTC as er, createAccountFromSigner as tr, createWalletClientFromSigner as or, depositToken as rr, getAddressConfirmationMessage as ar, getAssetRouterAddress as sr, getBasculeDepositStatus as ir, getLBTCBurningFee as nr, getLBTCMintingFee as Ar, getMinRedeemAmount as Sr, getMinRedeemAmountWithFee as dr, getMintingFee as gr, getPermitNonce as Er, getRedeemFee as Cr, getStakeAndBakeConfig as Tr, getStakeAndBakeFee as pr, getTokenAllowance as mr, mintToken as lr, redeemToken as cr, signLbtcDestinationAddr as _r, signNetworkFee as Nr, signStakeAndBake as ur, unstakeLBTC as Br, validateTransactionRequest as Ir } from "./chunks/unstakeLBTC-Bg8OsAMV.js";
|
|
21
|
+
import { claimUnstakeRedeem as hr, getBtceShares as kr, getEarnPosition as fr, getLBTCTotalSupply as vr, getShareValue as xr, getSharesByAddress as Lr, unwrapBtceToLbtcv as Rr, wrapToBtce as Mr } from "./chunks/wrapToBtce-By2mh503.js";
|
|
22
|
+
import { approveLBTC as yr } from "./chunks/approveLBTC-BkdT1N3V.js";
|
|
23
23
|
import { isProviderFlow as Ur, isSignerFlow as Vr } from "./chunks/parameters-C_16L5ft.js";
|
|
24
24
|
import { fetchBtcScriptToAddress as Hr, fetchBtcTxInfo as br, fetchEvmByBtcAddress as wr } from "./chunks/evm-by-btc-address-CZvE15lx.js";
|
|
25
25
|
import { DAY as Wr, HOUR as Gr, MINUTE as qr, SECOND as Yr, ensureHex as zr, isHex as Qr, now as jr, toUnix as Jr } from "./chunks/time-Sa5gggPG.js";
|
|
26
|
-
import { AssetId as Zr, DEFI_REGISTRY as $r, DefiProtocol as ea, DefiProtocols as ta, DefiProtocol as oa, assetValueToKey as ra, getAvailableProtocols as aa, getAvailableProtocolsWithMetadata as sa, getStakeAndBakeSupportedChains as ia, getSupportedProtocols as na, isAssetId as Aa } from "./chunks/defi-registry-
|
|
27
|
-
import { BTCE_VAULT_CHAINS as da, BTCE_VAULT_CONTRACTS as ga, VEDA_VAULT_STAKE_AND_BAKE_CHAINS as Ea, Vault as Ca, isBtceVaultChain as Ta, isVedaVaultStakeAndBakeChain as pa } from "./chunks/config-
|
|
28
|
-
import { OFT_GAS_LIMIT as la, OFT_HI_GAS_LIMIT as ca, OFT_HI_GAS_LIMIT_CHAINS as _a, bridge as Na, bridgeCCIP as ua, bridgeOFT as Ba, getBridgeInfo as Ia } from "./chunks/bridge-
|
|
29
|
-
import { cancelWithdraw as
|
|
30
|
-
import { getVaultApy as xa, getVaultDeposits as La, getVaultDepositsAllChains as Ra, getVaultPoints as Ma, getVaultTVL as Oa } from "./chunks/get-vault-tvl-
|
|
31
|
-
import { getVaultWithdrawals as Pa, getVaultWithdrawalsAllChains as Ua } from "./chunks/get-vault-withdrawals-
|
|
26
|
+
import { AssetId as Zr, DEFI_REGISTRY as $r, DefiProtocol as ea, DefiProtocols as ta, DefiProtocol as oa, assetValueToKey as ra, getAvailableProtocols as aa, getAvailableProtocolsWithMetadata as sa, getStakeAndBakeSupportedChains as ia, getSupportedProtocols as na, isAssetId as Aa } from "./chunks/defi-registry-CD8EUcNu.js";
|
|
27
|
+
import { BTCE_VAULT_CHAINS as da, BTCE_VAULT_CONTRACTS as ga, VEDA_VAULT_STAKE_AND_BAKE_CHAINS as Ea, Vault as Ca, isBtceVaultChain as Ta, isVedaVaultStakeAndBakeChain as pa } from "./chunks/config-C8BfN_9P.js";
|
|
28
|
+
import { OFT_GAS_LIMIT as la, OFT_HI_GAS_LIMIT as ca, OFT_HI_GAS_LIMIT_CHAINS as _a, bridge as Na, bridgeCCIP as ua, bridgeOFT as Ba, getBridgeInfo as Ia } from "./chunks/bridge-DbB23m2a.js";
|
|
29
|
+
import { cancelWithdraw as ha, deposit as ka, queueWithdraw as fa } from "./chunks/withdraw-kf8mYbYH.js";
|
|
30
|
+
import { getVaultApy as xa, getVaultDeposits as La, getVaultDepositsAllChains as Ra, getVaultPoints as Ma, getVaultTVL as Oa } from "./chunks/get-vault-tvl-CihHEkqK.js";
|
|
31
|
+
import { getVaultWithdrawals as Pa, getVaultWithdrawalsAllChains as Ua } from "./chunks/get-vault-withdrawals-QJOdxB5Z.js";
|
|
32
32
|
export {
|
|
33
33
|
Ut as AUTO_MINT_FEE_CHAINS,
|
|
34
34
|
We as AddressKind,
|
|
@@ -64,9 +64,9 @@ export {
|
|
|
64
64
|
ze as EVM_LBTC_ADDRESSES,
|
|
65
65
|
o as Env,
|
|
66
66
|
A as ErrorCode,
|
|
67
|
-
|
|
67
|
+
he as EvmActions,
|
|
68
68
|
S as EvmDeployStatus,
|
|
69
|
-
|
|
69
|
+
ke as EvmDepositStatus,
|
|
70
70
|
d as EvmOperationStatus,
|
|
71
71
|
g as EvmRedeemStatus,
|
|
72
72
|
E as EvmStakeStatus,
|
|
@@ -79,7 +79,7 @@ export {
|
|
|
79
79
|
Po as MIN_CLAIM_AMOUNT_BTC,
|
|
80
80
|
W as MIN_REDEEM_AMOUNT_BTC,
|
|
81
81
|
G as MIN_STAKE_AMOUNT_BTC,
|
|
82
|
-
m as
|
|
82
|
+
m as NonEvmOperationStatus,
|
|
83
83
|
la as OFT_GAS_LIMIT,
|
|
84
84
|
ca as OFT_HI_GAS_LIMIT,
|
|
85
85
|
_a as OFT_HI_GAS_LIMIT_CHAINS,
|
|
@@ -124,7 +124,7 @@ export {
|
|
|
124
124
|
oe as UnstakeEvent,
|
|
125
125
|
Wt as UnsupportedTokenFlow,
|
|
126
126
|
Ea as VEDA_VAULT_STAKE_AND_BAKE_CHAINS,
|
|
127
|
-
|
|
127
|
+
h as ValidationErrorCode,
|
|
128
128
|
Ca as Vault,
|
|
129
129
|
dt as addChain,
|
|
130
130
|
gt as allChains,
|
|
@@ -139,17 +139,17 @@ export {
|
|
|
139
139
|
Be as btcActions,
|
|
140
140
|
Ie as btcModule,
|
|
141
141
|
Vo as calcConfirmations,
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
ha as cancelWithdraw,
|
|
143
|
+
k as chainValueToKey,
|
|
144
144
|
er as claimLBTC,
|
|
145
|
-
|
|
145
|
+
hr as claimUnstakeRedeem,
|
|
146
146
|
tr as createAccountFromSigner,
|
|
147
147
|
re as createConfig,
|
|
148
148
|
ae as createConsoleLogger,
|
|
149
149
|
se as createLombardSDK,
|
|
150
150
|
ie as createSilentLogger,
|
|
151
151
|
or as createWalletClientFromSigner,
|
|
152
|
-
|
|
152
|
+
ka as deposit,
|
|
153
153
|
Fo as depositRequiresAction,
|
|
154
154
|
rr as depositToken,
|
|
155
155
|
zr as ensureHex,
|
|
@@ -180,7 +180,7 @@ export {
|
|
|
180
180
|
Oe as getBaseNetworkByEnv,
|
|
181
181
|
Ia as getBridgeInfo,
|
|
182
182
|
ye as getBscNetworkByEnv,
|
|
183
|
-
|
|
183
|
+
kr as getBtceShares,
|
|
184
184
|
Tt as getChain,
|
|
185
185
|
Pe as getChainIdByName,
|
|
186
186
|
M as getChainMetadata,
|
|
@@ -212,7 +212,7 @@ export {
|
|
|
212
212
|
gr as getMintingFee,
|
|
213
213
|
Qo as getNetworkFeeSignature,
|
|
214
214
|
Er as getPermitNonce,
|
|
215
|
-
|
|
215
|
+
ho as getPointsByAddress,
|
|
216
216
|
go as getPositionsSummary,
|
|
217
217
|
Cr as getRedeemFee,
|
|
218
218
|
Yt as getRpcUrlConfig,
|
|
@@ -234,7 +234,7 @@ export {
|
|
|
234
234
|
mr as getTokenAllowance,
|
|
235
235
|
Nt as getTokenByAddress,
|
|
236
236
|
zt as getTokenContractInfo,
|
|
237
|
-
|
|
237
|
+
ko as getUnstakesByAddress,
|
|
238
238
|
Ro as getUserStakeAndBakeSignature,
|
|
239
239
|
xa as getVaultApy,
|
|
240
240
|
La as getVaultDeposits,
|
|
@@ -262,9 +262,9 @@ export {
|
|
|
262
262
|
Dt as isMonadChain,
|
|
263
263
|
Ur as isProviderFlow,
|
|
264
264
|
Vr as isSignerFlow,
|
|
265
|
-
|
|
265
|
+
ht as isSolanaChain,
|
|
266
266
|
de as isSolanaProvider,
|
|
267
|
-
|
|
267
|
+
kt as isStableChain,
|
|
268
268
|
ft as isStarknetChainId,
|
|
269
269
|
ge as isStarknetProvider,
|
|
270
270
|
vt as isSuiChain,
|
package/dist/metrics.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/get-positions-summary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/get-positions-summary-DdZvBmCN.cjs");exports.getAdditionalRewards=t.getAdditionalRewards;exports.getApy=t.getApy;exports.getEstimatedApy=t.getEstimatedApy;exports.getLBTCStats=t.getLBTCStats;exports.getPositionsSummary=t.getPositionsSummary;
|
|
2
2
|
//# sourceMappingURL=metrics.cjs.map
|
package/dist/metrics.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAdditionalRewards as a, getApy as g, getEstimatedApy as i, getLBTCStats as o, getPositionsSummary as s } from "./chunks/get-positions-summary-
|
|
1
|
+
import { getAdditionalRewards as a, getApy as g, getEstimatedApy as i, getLBTCStats as o, getPositionsSummary as s } from "./chunks/get-positions-summary-CaX2BCHp.js";
|
|
2
2
|
export {
|
|
3
3
|
a as getAdditionalRewards,
|
|
4
4
|
g as getApy,
|
|
@@ -80,13 +80,17 @@ export declare const EvmOperationStatus: {
|
|
|
80
80
|
};
|
|
81
81
|
export type EvmOperationStatus = (typeof EvmOperationStatus)[keyof typeof EvmOperationStatus];
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Non-EVM operation statuses
|
|
84
|
+
*
|
|
85
|
+
* Shared by all non-EVM actions (Solana Stake/Unstake/Redeem, Sui Unstake,
|
|
86
|
+
* Starknet Unstake). Non-EVM flows don't require fee authorization or token
|
|
87
|
+
* approval, so the state machine is a simple IDLE → READY → CONFIRMING → COMPLETED.
|
|
84
88
|
*/
|
|
85
|
-
export declare const
|
|
89
|
+
export declare const NonEvmOperationStatus: {
|
|
86
90
|
readonly IDLE: "idle";
|
|
87
91
|
readonly READY: "ready";
|
|
88
92
|
readonly CONFIRMING: "confirming";
|
|
89
93
|
readonly COMPLETED: "completed";
|
|
90
94
|
};
|
|
91
|
-
export type
|
|
95
|
+
export type NonEvmOperationStatus = (typeof NonEvmOperationStatus)[keyof typeof NonEvmOperationStatus];
|
|
92
96
|
//# sourceMappingURL=statusConstants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusConstants.d.ts","sourceRoot":"","sources":["../../../src/shared/constants/statusConstants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,eAAe;IAC1B,0CAA0C;;IAI1C,2EAA2E;;IAE3E,4EAA4E;;IAE5E,2FAA2F;;IAG3F,yDAAyD;;IAGzD,uDAAuD;;CAE/C,CAAC;AAEX,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB;;IAE7B,mEAAmE;;IAEnE,2CAA2C;;;;;CAKnC,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"statusConstants.d.ts","sourceRoot":"","sources":["../../../src/shared/constants/statusConstants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,eAAe;IAC1B,0CAA0C;;IAI1C,2EAA2E;;IAE3E,4EAA4E;;IAE5E,2FAA2F;;IAG3F,yDAAyD;;IAGzD,uDAAuD;;CAE/C,CAAC;AAEX,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB;;IAE7B,mEAAmE;;IAEnE,2CAA2C;;;;;CAKnC,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depositStatus.d.ts","sourceRoot":"","sources":["../../../src/shared/deposits/depositStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,OAAO,EAGb,MAAM,+DAA+D,CAAC;AAOvE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,SAAuB,CAAC;AAMzD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,uBAAuB,GACvB,sBAAsB,GACtB,WAAW,GACX,UAAU,GACV,SAAS,GACT,cAAc,GACd,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,QAAQ,EAAE,cAAc,CAAC;IACzB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,EAAE,OAAO,CAAC;CACrB;AAMD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,kBAAkB,CAAC,EAAE,MAAM,EAC3B,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CAMR;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,kBAAkB,CAAC,EAAE,MAAM,EAC3B,qBAAqB,GAAE,MAA+B,GACrD,oBAAoB,GAAG,IAAI,CAiB7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,MAAM,EAC3B,qBAAqB,GAAE,MAA+B,GACrD,aAAa,
|
|
1
|
+
{"version":3,"file":"depositStatus.d.ts","sourceRoot":"","sources":["../../../src/shared/deposits/depositStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,OAAO,EAGb,MAAM,+DAA+D,CAAC;AAOvE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,SAAuB,CAAC;AAMzD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,uBAAuB,GACvB,sBAAsB,GACtB,WAAW,GACX,UAAU,GACV,SAAS,GACT,cAAc,GACd,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,QAAQ,EAAE,cAAc,CAAC;IACzB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,EAAE,OAAO,CAAC;CACrB;AAMD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,kBAAkB,CAAC,EAAE,MAAM,EAC3B,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CAMR;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,kBAAkB,CAAC,EAAE,MAAM,EAC3B,qBAAqB,GAAE,MAA+B,GACrD,oBAAoB,GAAG,IAAI,CAiB7B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,MAAM,EAC3B,qBAAqB,GAAE,MAA+B,GACrD,aAAa,CA+Ef;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,GACpB,oBAAoB,CAoFtB;AAMD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAET;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAKT;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAIT;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAIT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-addresses.d.ts","sourceRoot":"","sources":["../../src/tokens/token-addresses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAe,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,"file":"token-addresses.d.ts","sourceRoot":"","sources":["../../src/tokens/token-addresses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAe,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EACL,OAAO,EAOP,WAAW,EAGX,eAAe,EAGf,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG5D,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,oBAAY,KAAK;IAEf,oCAAoC;IACpC,IAAI,SAAS;IACb;;;OAGG;IACH,IAAI,SAAS;IACb,oDAAoD;IACpD,IAAI,UAAU;IAGd,UAAU,SAAS;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AASD,MAAM,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAC/C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,CAErD,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAC9B,KAAK,SAAS,KAAK,EACnB,KAAK,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,IACvE,OAAO,CACT,MAAM,CACJ,GAAG,EACH,OAAO,CACL,MAAM,CACJ,KAAK,EACH,CAAC,KAAK,SAAS,KAAK,CAAC,IAAI,GACrB,KAAK,SACD,OAAO,OAAO,CAAC,SAAS,GACxB,OAAO,OAAO,CAAC,aAAa,GAC9B,oBAAoB,GACpB,OAAO,GACT,KAAK,SAAS,OAAO,GAAG,QAAQ,GAAG,eAAe,GAChD,OAAO,GACP,MAAM,CAAC,GACb,SAAS,CACZ,CACF,CACF,CACF,CAAC;AAEF,MAAM,MAAM,cAAc,CACxB,KAAK,SAAS,KAAK,EACnB,KAAK,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,IACvE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAyF/D,eAAO,MAAM,kBAAkB,EAAE,oBAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAsExE,CAAC;AA2BF,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,KAAK,EAAE,OAAO,CAK1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAepE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,QAAQ,EACjB,SAAiB,KAChB,OAAO,GAAG,SAEZ,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,cAAc,CACjD,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,EACvB,WAAW,CA8BZ,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,SAAS,WAAW,EACpB,SAAiB,EACjB,QAAO,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAiB,KAC1C,MAAM,GAAG,SAEX,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,eAAe,MAAM,EACrB,UAAU,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,EAC5D,SAAiB,EACjB,cAAa,WAA+B,sBA4B7C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,SAAS,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,eAAe,EAC3D,UAAS,WAA+B,EACxC,MAAK,GAAiB,KACrB,MAAM,GAAG,SAiBX,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,cAAc,CACnD,KAAK,CAAC,IAAI,EACV,eAAe,CAwBP,CAAC;AAEX,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAC1D,KAAK,CAAC,IAAI,EACV,eAAe,CAwBP,CAAC;AAEX,eAAO,MAAM,uBAAuB,GAClC,SAAS,eAAe,EACxB,SAAiB,EACjB,UAAS,OAAO,GAAG,aAAuB,KACzC,OAAO,GAAG,SAOZ,CAAC"}
|
package/dist/utils.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./chunks/index-BKzxeh1Y.cjs"),S=require("./chunks/api-config-DkXqqfCK.cjs"),t=require("./chunks/blockchain-identifier-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./chunks/index-BKzxeh1Y.cjs"),S=require("./chunks/api-config-DkXqqfCK.cjs"),t=require("./chunks/blockchain-identifier-Bp-LTIdG.cjs"),e=require("./chunks/token-addresses-DvY-Mw7b.cjs"),a=require("./chunks/fee-requirements-CICSxYYL.cjs"),s=require("./chunks/lbtc-addresses-DjsipX5Q.cjs"),n=require("./chunks/tokens-CBsz6l_2.cjs"),o=require("./chunks/satoshi-CZEsHl5X.cjs"),r=require("./chunks/parameters-DK9cYCAH.cjs"),i=require("./chunks/time-I-BeyUkG.cjs");exports.Env=A.r;exports.getApiConfig=S.getApiConfig;exports.BlockchainIdentifier=t.BlockchainIdentifier;exports.getBaseNetworkByEnv=t.getBaseNetworkByEnv;exports.getBscNetworkByEnv=t.getBscNetworkByEnv;exports.getChainIdByName=t.getChainIdByName;exports.getChainNameById=t.getChainNameById;exports.getEthNetworkByEnv=t.getEthNetworkByEnv;exports.getSolanaNetworkByEnv=t.getSolanaNetworkByEnv;exports.getSonicNetworkByEnv=t.getSonicNetworkByEnv;exports.getStarknetNetworkByEnv=t.getStarknetNetworkByEnv;exports.getSuiNetworkByEnv=t.getSuiNetworkByEnv;exports.AddressKind=e.AddressKind;exports.CHAIN_ID_TO_LLAMA_CHAIN_NAME_MAP=e.CHAIN_ID_TO_LLAMA_CHAIN_NAME_MAP;exports.CHAIN_ID_TO_VIEM_CHAIN_MAP=e.CHAIN_ID_TO_VIEM_CHAIN_MAP;exports.ChainId=e.ChainId;exports.EVM_LBTC_ADDRESSES=e.EVM_LBTC_ADDRESSES;exports.RATIO_TOKEN_MAP=e.RATIO_TOKEN_MAP;exports.SOLANA_DEVNET_CHAIN=e.SOLANA_DEVNET_CHAIN;exports.SOLANA_MAINNET_CHAIN=e.SOLANA_MAINNET_CHAIN;exports.SOLANA_TESTNET_CHAIN=e.SOLANA_TESTNET_CHAIN;exports.SOLANA_TOKEN_ADDRESSES=e.SOLANA_TOKEN_ADDRESSES;exports.STARKNET_ASSET_ROUTER_ADDRESSES=e.STARKNET_ASSET_ROUTER_ADDRESSES;exports.STARKNET_MAINNET_CHAIN=e.STARKNET_MAINNET_CHAIN;exports.STARKNET_SEPOLIA_CHAIN=e.STARKNET_SEPOLIA_CHAIN;exports.STARKNET_TOKEN_ADDRESSES=e.STARKNET_TOKEN_ADDRESSES;exports.SUI_DEVNET_CHAIN=e.SUI_DEVNET_CHAIN;exports.SUI_LOCALNET_CHAIN=e.SUI_LOCALNET_CHAIN;exports.SUI_MAINNET_CHAIN=e.SUI_MAINNET_CHAIN;exports.SUI_TESTNET_CHAIN=e.SUI_TESTNET_CHAIN;exports.SUI_TOKEN_ADDRESSES=e.SUI_TOKEN_ADDRESSES;exports.TOKEN_ADDRESSES=e.TOKEN_ADDRESSES;exports.Token=e.Token;exports.addChain=e.addChain;exports.allChains=e.allChains;exports.bob=e.bob;exports.bobSepolia=e.bobSepolia;exports.getChain=e.getChain;exports.getLlamaChainName=e.getLlamaChainName;exports.getSolanaTokenAddress=e.getSolanaTokenAddress;exports.getStarknetTokenAddress=e.getStarknetTokenAddress;exports.getSuiTokenAddress=e.getSuiTokenAddress;exports.getTokenAddressForChain=e.getTokenAddressForChain;exports.getTokenByAddress=e.getTokenByAddress;exports.isEthereumChain=e.isEthereumChain;exports.isKatanaChain=e.isKatanaChain;exports.isMegaethChain=e.isMegaethChain;exports.isMonadChain=e.isMonadChain;exports.isSolanaChain=e.isSolanaChain;exports.isStableChain=e.isStableChain;exports.isStarknetChainId=e.isStarknetChainId;exports.isSuiChain=e.isSuiChain;exports.isValidChain=e.isValidChain;exports.katana=e.katana;exports.megaeth=e.megaeth;exports.monad=e.monad;exports.stable=e.stable;exports.tac=e.tac;exports.AUTO_MINT_FEE_CHAINS=a.AUTO_MINT_FEE_CHAINS;exports.requiresAutoMintFee=a.requiresAutoMintFee;exports.getLbtcContractAddresses=s.getLbtcContractAddresses;exports.RPC_URL=n.RPC_URL;exports.TokenContractAddressNotFoundError=n.TokenContractAddressNotFoundError;exports.UnsupportedTokenFlow=n.UnsupportedTokenFlow;exports.fromBaseDenomination=n.fromBaseDenomination;exports.getErrorMessage=n.getErrorMessage;exports.getRpcUrlConfig=n.getRpcUrlConfig;exports.getTokenContractInfo=n.getTokenContractInfo;exports.isUpgradedAbi=n.isUpgradedAbi;exports.retrieveTokenProperties=n.retrieveTokenProperties;exports.rpcUrlConfig=n.rpcUrlConfig;exports.toBaseDenomination=n.toBaseDenomination;exports.BTC_DECIMALS=o.BTC_DECIMALS;exports.SATOSHI_SCALE=o.SATOSHI_SCALE;exports.fromSatoshi=o.fromSatoshi;exports.toSatoshi=o.toSatoshi;exports.toSatoshiBigInt=o.toSatoshiBigInt;exports.isProviderFlow=r.isProviderFlow;exports.isSignerFlow=r.isSignerFlow;exports.DAY=i.DAY;exports.HOUR=i.HOUR;exports.MINUTE=i.MINUTE;exports.SECOND=i.SECOND;exports.ensureHex=i.ensureHex;exports.isHex=i.isHex;exports.now=i.now;exports.toUnix=i.toUnix;
|
|
2
2
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as t } from "./chunks/index-CfcQ_g3t.js";
|
|
2
2
|
import { getApiConfig as r } from "./chunks/api-config-Dm6dR85f.js";
|
|
3
|
-
import { BlockchainIdentifier as A, getBaseNetworkByEnv as i, getBscNetworkByEnv as S, getChainIdByName as E, getChainNameById as N, getEthNetworkByEnv as _, getSolanaNetworkByEnv as s, getSonicNetworkByEnv as T, getStarknetNetworkByEnv as C, getSuiNetworkByEnv as I } from "./chunks/blockchain-identifier-
|
|
4
|
-
import { AddressKind as g, CHAIN_ID_TO_LLAMA_CHAIN_NAME_MAP as h, CHAIN_ID_TO_VIEM_CHAIN_MAP as k, ChainId as m, EVM_LBTC_ADDRESSES as D, RATIO_TOKEN_MAP as O, SOLANA_DEVNET_CHAIN as p, SOLANA_MAINNET_CHAIN as B, SOLANA_TESTNET_CHAIN as H, SOLANA_TOKEN_ADDRESSES as f, STARKNET_ASSET_ROUTER_ADDRESSES as M, STARKNET_MAINNET_CHAIN as R, STARKNET_SEPOLIA_CHAIN as l, STARKNET_TOKEN_ADDRESSES as L, SUI_DEVNET_CHAIN as U, SUI_LOCALNET_CHAIN as x, SUI_MAINNET_CHAIN as c, SUI_TESTNET_CHAIN as w, SUI_TOKEN_ADDRESSES as K, TOKEN_ADDRESSES as v, Token as y, addChain as u, allChains as b, bob as F, bobSepolia as P, getChain as V, getLlamaChainName as q, getSolanaTokenAddress as Y, getStarknetTokenAddress as j, getSuiTokenAddress as z, getTokenAddressForChain as G, getTokenByAddress as J, isEthereumChain as Q, isKatanaChain as W, isMegaethChain as X, isMonadChain as Z, isSolanaChain as $, isStableChain as ee, isStarknetChainId as oe, isSuiChain as te, isValidChain as ne, katana as re, megaeth as ae, monad as Ae, stable as ie, tac as Se } from "./chunks/token-addresses-
|
|
3
|
+
import { BlockchainIdentifier as A, getBaseNetworkByEnv as i, getBscNetworkByEnv as S, getChainIdByName as E, getChainNameById as N, getEthNetworkByEnv as _, getSolanaNetworkByEnv as s, getSonicNetworkByEnv as T, getStarknetNetworkByEnv as C, getSuiNetworkByEnv as I } from "./chunks/blockchain-identifier-BLPnwbIN.js";
|
|
4
|
+
import { AddressKind as g, CHAIN_ID_TO_LLAMA_CHAIN_NAME_MAP as h, CHAIN_ID_TO_VIEM_CHAIN_MAP as k, ChainId as m, EVM_LBTC_ADDRESSES as D, RATIO_TOKEN_MAP as O, SOLANA_DEVNET_CHAIN as p, SOLANA_MAINNET_CHAIN as B, SOLANA_TESTNET_CHAIN as H, SOLANA_TOKEN_ADDRESSES as f, STARKNET_ASSET_ROUTER_ADDRESSES as M, STARKNET_MAINNET_CHAIN as R, STARKNET_SEPOLIA_CHAIN as l, STARKNET_TOKEN_ADDRESSES as L, SUI_DEVNET_CHAIN as U, SUI_LOCALNET_CHAIN as x, SUI_MAINNET_CHAIN as c, SUI_TESTNET_CHAIN as w, SUI_TOKEN_ADDRESSES as K, TOKEN_ADDRESSES as v, Token as y, addChain as u, allChains as b, bob as F, bobSepolia as P, getChain as V, getLlamaChainName as q, getSolanaTokenAddress as Y, getStarknetTokenAddress as j, getSuiTokenAddress as z, getTokenAddressForChain as G, getTokenByAddress as J, isEthereumChain as Q, isKatanaChain as W, isMegaethChain as X, isMonadChain as Z, isSolanaChain as $, isStableChain as ee, isStarknetChainId as oe, isSuiChain as te, isValidChain as ne, katana as re, megaeth as ae, monad as Ae, stable as ie, tac as Se } from "./chunks/token-addresses-Ddar0FyS.js";
|
|
5
5
|
import { AUTO_MINT_FEE_CHAINS as Ne, requiresAutoMintFee as _e } from "./chunks/fee-requirements-CCNsxAvJ.js";
|
|
6
|
-
import { getLbtcContractAddresses as Te } from "./chunks/lbtc-addresses-
|
|
7
|
-
import { RPC_URL as Ie, TokenContractAddressNotFoundError as de, UnsupportedTokenFlow as ge, fromBaseDenomination as he, getErrorMessage as ke, getRpcUrlConfig as me, getTokenContractInfo as De, isUpgradedAbi as Oe, retrieveTokenProperties as pe, rpcUrlConfig as Be, toBaseDenomination as He } from "./chunks/tokens-
|
|
6
|
+
import { getLbtcContractAddresses as Te } from "./chunks/lbtc-addresses-BlyGFWnW.js";
|
|
7
|
+
import { RPC_URL as Ie, TokenContractAddressNotFoundError as de, UnsupportedTokenFlow as ge, fromBaseDenomination as he, getErrorMessage as ke, getRpcUrlConfig as me, getTokenContractInfo as De, isUpgradedAbi as Oe, retrieveTokenProperties as pe, rpcUrlConfig as Be, toBaseDenomination as He } from "./chunks/tokens-HhVpKe3K.js";
|
|
8
8
|
import { BTC_DECIMALS as Me, SATOSHI_SCALE as Re, fromSatoshi as le, toSatoshi as Le, toSatoshiBigInt as Ue } from "./chunks/satoshi-CSoJBXc6.js";
|
|
9
9
|
import { isProviderFlow as ce, isSignerFlow as we } from "./chunks/parameters-C_16L5ft.js";
|
|
10
10
|
import { DAY as ve, HOUR as ye, MINUTE as ue, SECOND as be, ensureHex as Fe, isHex as Pe, now as Ve, toUnix as qe } from "./chunks/time-Sa5gggPG.js";
|
package/dist/vaults.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./chunks/config-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./chunks/config-ow9X5H0c.cjs"),E=require("./chunks/withdraw-Bkp5-2dG.cjs"),A=require("./chunks/get-vault-tvl-DZ-xzehy.cjs"),a=require("./chunks/tokens-CBsz6l_2.cjs"),e=require("./chunks/token-addresses-DvY-Mw7b.cjs"),q=require("./chunks/get-vault-withdrawals-DLwFMQEB.cjs"),S=require("bignumber.js"),y=require("./chunks/numbers-3LtmxfD8.cjs");async function W({vaultKey:f,token:n=e.Token.LBTC,chainId:r=e.ChainId.ethereum,rpcUrl:u,env:m}){const o=b.VAULTS[f];if(!o)throw new Error(`Unknown vault key: ${f}`);if(!b.isVedaVaultChain(r))throw new Error(`Unsupported chain id: ${r}. Supported chains: ${o.chains.join(", ")}`);const s=o.tokens[n];if(!s||!s.includes(r))throw new Error(`Token ${n} is not supported on chain ${r} for vault ${f}`);let c,l;if(r===e.ChainId.ethereum){const t=await a.getTokenInfo(n,e.ChainId.ethereum,m,u);if(!t)throw new Error(`Could not resolve token info for ${n} on Ethereum`);c=t.address,l=t.decimals}else{const t=await a.getTokenInfo(n,e.ChainId.ethereum,m);if(!t)throw new Error(`Cannot determine minimum deposit for ${n}: token not available on Ethereum. The Lens and Accountant contracts are Ethereum-only.`);c=t.address,l=t.decimals}const d=a.makePublicClient({chainId:e.ChainId.ethereum,rpcUrl:r===e.ChainId.ethereum?u:void 0,env:m}),h=o.vaultContract.address,w=o.accountantContract.address,p=o.lensContract.address,g=o.lensContract.abi,T=o.accountantContract.abi,[C,V]=await d.multicall({contracts:[{address:w,abi:T,functionName:"getRateInQuote",args:[c]},{address:p,abi:g,functionName:"previewDeposit",args:[c,1n,h,w]}]});if(C.status!=="success")throw new Error(`Failed to get exchange rate for ${n}: ${C.error}`);if(V.status!=="success")throw new Error(`Failed to preview deposit for ${n}: ${V.error}`);if(V.result>0n)return a.fromBaseDenomination("1",l);const $=C.result,i=BigInt(10)**BigInt(o.decimals),D=($+i-1n)/i;if(await d.readContract({address:p,abi:g,functionName:"previewDeposit",args:[c,D,h,w]})>0n)return a.fromBaseDenomination(D.toString(),l);const I=10,k=Array.from({length:I},(t,v)=>D+BigInt(v+1)),B=await d.multicall({contracts:k.map(t=>({address:p,abi:g,functionName:"previewDeposit",args:[c,t,h,w]}))});for(let t=0;t<B.length;t++){const v=B[t];if(v.status==="success"&&v.result>0n)return a.fromBaseDenomination(k[t].toString(),l)}throw new Error(`Could not determine minimum deposit amount for ${n} after ${I} attempts`)}async function L({amount:f,vaultKey:n,token:r=e.Token.LBTC,chainId:u=e.ChainId.ethereum,rpcUrl:m,env:o}){const s=b.VAULTS[n];if(!s)throw new Error(`Unknown vault key: ${n}`);if(!b.isVedaVaultChain(u))throw new Error(`Unsupported chain id: ${u}. Supported chains: ${s.chains.join(", ")}`);const c=s.tokens[r];if(!c||!c.includes(u))throw new Error(`Token ${r} is not supported on chain ${u} for vault ${n}`);const l=S(f);if(l.isNegative()||l.isZero())throw new Error("Deposit amount must be greater than zero");let d,h;if(u===e.ChainId.ethereum){const i=await a.getTokenInfo(r,e.ChainId.ethereum,o,m);if(!i)throw new Error(`Could not resolve token info for ${r} on Ethereum`);d=i.address,h=i.decimals}else{const i=await a.getTokenInfo(r,e.ChainId.ethereum,o);if(!i)throw new Error(`Cannot preview deposit for ${r}: token not available on Ethereum. The Lens contract is Ethereum-only.`);d=i.address,h=i.decimals}const w=y.toBigInt(a.toBaseDenomination(l,h)),p=a.makePublicClient({chainId:e.ChainId.ethereum,rpcUrl:u===e.ChainId.ethereum?m:void 0,env:o}),g=s.vaultContract.address,T=s.accountantContract.address,C=s.lensContract.address,V=s.lensContract.abi,$=await p.readContract({address:C,abi:V,functionName:"previewDeposit",args:[d,w,g,T]});return a.fromBaseDenomination($.toString(),s.decimals)}exports.Vault=b.Vault;exports.cancelWithdraw=E.cancelWithdraw;exports.deposit=E.deposit;exports.queueWithdraw=E.queueWithdraw;exports.getVaultApy=A.getVaultApy;exports.getVaultDeposits=A.getVaultDeposits;exports.getVaultDepositsAllChains=A.getVaultDepositsAllChains;exports.getVaultPoints=A.getVaultPoints;exports.getVaultTVL=A.getVaultTVL;exports.getVaultWithdrawals=q.getVaultWithdrawals;exports.getVaultWithdrawalsAllChains=q.getVaultWithdrawalsAllChains;exports.getVaultMinimumDeposit=W;exports.previewVaultDeposit=L;
|
|
2
2
|
//# sourceMappingURL=vaults.cjs.map
|
package/dist/vaults.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isVedaVaultChain as B, VAULTS as x } from "./chunks/config-
|
|
2
|
-
import { Vault as O } from "./chunks/config-
|
|
3
|
-
import { cancelWithdraw as _, deposit as G, queueWithdraw as H } from "./chunks/withdraw-
|
|
4
|
-
import { getVaultApy as X, getVaultDeposits as Y, getVaultDepositsAllChains as K, getVaultPoints as tt, getVaultTVL as et } from "./chunks/get-vault-tvl-
|
|
5
|
-
import { getTokenInfo as b, makePublicClient as N, fromBaseDenomination as E, toBaseDenomination as y } from "./chunks/tokens-
|
|
6
|
-
import { ChainId as n, Token as S } from "./chunks/token-addresses-
|
|
7
|
-
import { getVaultWithdrawals as ot, getVaultWithdrawalsAllChains as nt } from "./chunks/get-vault-withdrawals-
|
|
1
|
+
import { isVedaVaultChain as B, VAULTS as x } from "./chunks/config-C8BfN_9P.js";
|
|
2
|
+
import { Vault as O } from "./chunks/config-C8BfN_9P.js";
|
|
3
|
+
import { cancelWithdraw as _, deposit as G, queueWithdraw as H } from "./chunks/withdraw-kf8mYbYH.js";
|
|
4
|
+
import { getVaultApy as X, getVaultDeposits as Y, getVaultDepositsAllChains as K, getVaultPoints as tt, getVaultTVL as et } from "./chunks/get-vault-tvl-CihHEkqK.js";
|
|
5
|
+
import { getTokenInfo as b, makePublicClient as N, fromBaseDenomination as E, toBaseDenomination as y } from "./chunks/tokens-HhVpKe3K.js";
|
|
6
|
+
import { ChainId as n, Token as S } from "./chunks/token-addresses-Ddar0FyS.js";
|
|
7
|
+
import { getVaultWithdrawals as ot, getVaultWithdrawalsAllChains as nt } from "./chunks/get-vault-withdrawals-QJOdxB5Z.js";
|
|
8
8
|
import L from "bignumber.js";
|
|
9
9
|
import { toBigInt as R } from "./chunks/numbers-CclN2Ohk.js";
|
|
10
10
|
async function M({
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lombard.finance/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "TypeScript SDK for the Lombard protocol - stake BTC, mint LBTC, and interact with DeFi",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@lombard.finance/sdk-common": "
|
|
6
|
+
"@lombard.finance/sdk-common": "4.0.0",
|
|
7
7
|
"isows": "^1.0.7"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BTC Destination Configuration for Solana Unstake
|
|
3
|
-
*
|
|
4
|
-
* Handles unstaking LBTC from Solana to BTC on Bitcoin.
|
|
5
|
-
*
|
|
6
|
-
* @module chains/solana/actions/unstake/config/btc
|
|
7
|
-
*/
|
|
8
|
-
import { Env } from '@lombard.finance/sdk-common';
|
|
9
|
-
import { Chain } from '../../../../../core';
|
|
10
|
-
import type { ChainConfig } from './types';
|
|
11
|
-
/**
|
|
12
|
-
* Solana → BTC configuration
|
|
13
|
-
*
|
|
14
|
-
* Burns LBTC on Solana, releases BTC on Bitcoin network.
|
|
15
|
-
*/
|
|
16
|
-
export declare const solanaToBtcConfig: ChainConfig;
|
|
17
|
-
/**
|
|
18
|
-
* Check if unstake to BTC is supported from this Solana chain
|
|
19
|
-
*/
|
|
20
|
-
export declare function isBtcUnstakeSupported(sourceChain: Chain, env: Env): boolean;
|
|
21
|
-
//# sourceMappingURL=solana.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../../../src/chains/solana/actions/unstake/config/solana.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAmB/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAK3E"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var z=Object.defineProperty;var H=(s,r,i)=>r in s?z(s,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[r]=i;var p=(s,r,i)=>H(s,typeof r!="symbol"?r+"":r,i);const Y=require("axios"),t=require("./statusConstants-CCKi5qUm.cjs"),A=require("./token-addresses-nzvTOi24.cjs"),u=require("./index-BKzxeh1Y.cjs"),l=require("./tokens-BkvA0Gp1.cjs"),D=require("./satoshi-CZEsHl5X.cjs"),c=require("./defi-registry-hHpGoh1m.cjs"),R=require("./getUserStakeAndBakeSignature-CSEyzgMc.cjs"),$=require("./config-CSo0k7gN.cjs"),q=require("viem"),U="ERR_NETWORK",G="This may be due to your Adblocker. Please disable any Adblocker and refresh the page to restore full functionality.";function j(s){const{code:r,message:i}=s;throw r===U?new Error(G):new Error(i)}const K={mempoolApiUrl:"https://mempool.space/signet"},Z={mempoolApiUrl:"https://mempool.space"},W=s=>s==="mainnet"?Z:K;async function X(s){const{mempoolApiUrl:r}=W(s),i=Math.floor(Date.now()/1e3),e=`${r}/api/v1/mining/blocks/timestamp/${i}`;try{const{data:a}=await Y.get(e);return a.height}catch(a){j(a)}}class J{async getCurrentBlockHeight(r){return X(r)}}function Q(){return{id:"btc",chain:"btc",register(){return new J}}}async function y(s){const{fetchDeposit:r,network:i,btcService:e,requiredConfirmations:a=6,onProgress:n,onComplete:o}=s,h=await r();if(!h)return;const d=h.blockHeight;if(typeof d!="number")return;const T=await e.getCurrentBlockHeight(i),_=Math.max(0,T-d),N=_>=a,w=h.isClaimed??!1,B={confirmations:_,requiredConfirmations:a,hasEnoughConfirmations:N,isClaimed:w,steps:{created:t.StepStatus.COMPLETE,verifying:N?t.StepStatus.COMPLETE:t.StepStatus.PENDING,issuing:w?t.StepStatus.COMPLETE:t.StepStatus.PENDING}};return n==null||n(B),w&&(o==null||o()),B}function f(s){if(s===R.SANCTIONED_ADDRESS)throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,"Destination address is under sanctions")}class I extends t.BaseAction{constructor(i,e,a){super(a);p(this,"_amount");p(this,"_recipient");p(this,"_depositAddress");p(this,"_referralCode");p(this,"_chainId");this.ctx=i,this.params=e}get amount(){return this._amount}get recipient(){return this._recipient}get depositAddress(){return this._depositAddress}get referralCode(){return this._referralCode}get bitcoinNetwork(){return this.params.sourceChain===t.Chain.BITCOIN_MAINNET?"mainnet":"testnet"}get prepareSchema(){return t.objectType({amount:t.btcStakeAmountSchema,recipient:this.getAddressSchema(),referralCode:t.referralCodeSchema})}validatePrepareParams(i){return t.validatePrepareParams(this.prepareSchema,i,{destChain:this.params.destChain})}ensureRecipient(){if(!this._recipient)throw t.LombardError.missingParameter("recipient");return this._recipient}ensureAmount(){if(!this._amount)throw t.LombardError.missingParameter("amount");return this._amount}ensureDepositAddress(){if(!this._depositAddress)throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,"Deposit address not generated. Call generateDepositAddress() first.");return this._depositAddress}getAuthRequiredMessage(){return"Authorization required. Complete the authorization step first."}ensureAuthorized(){if(!this.isAuthorized())throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,this.getAuthRequiredMessage())}async resumeFromExistingDeposit(i){try{const e=await this.ctx.api.getDepositAddress({address:i,chainId:this.getChainId(),token:this.getExpectedToken(),partnerId:this.ctx.partner.getPartnerId()});return e?(this._depositAddress=e,!0):!1}catch{return!1}}async generateDepositAddressImpl(i){const e=this.getStatusConfig();return this.assertStatus(e.ready,"generateDepositAddress"),this.ensureAuthorized(),this._depositAddress?this._depositAddress:this.act(async()=>{const a=this.getDepositAddressParams(i),n=await this.ctx.api.generateDepositAddress(a);f(n),this._depositAddress=n;const o=this.getInitialSteps(),h=Object.fromEntries(Object.entries(o).map(([d],T)=>[d,T===0?t.StepStatus.COMPLETE:t.StepStatus.IDLE]));return this.emitProgress({status:e.addressReady,steps:h,metadata:{depositAddress:n}}),n},e.addressReady)}async executeImpl(){const i=this.getStatusConfig();return this.act(async()=>{this.assertStatus(i.addressReady,"execute"),this._depositAddress||await this.generateDepositAddressImpl();const e=this.ensureDepositAddress(),a=await this.trySendBitcoin(e);return a?{depositAddress:e,txHash:a}:{depositAddress:e}})}emitInitialProgress(){this.emitProgress({status:this.status,steps:this.getInitialSteps()})}async monitorDeposit(){const i=this._depositAddress,e=this._recipient;if(!i||!e)throw t.LombardError.missingParameter("depositAddress or recipient");return await y({network:this.bitcoinNetwork,btcService:this.ctx.btc,fetchDeposit:async()=>{const o=(await this.ctx.api.getDeposits(e)).find(h=>h.depositAddress===i);if(o)return{blockHeight:o.blockHeight,isClaimed:o.isClaimed}},onProgress:n=>{this.emitProgress({status:this.status,steps:n.steps,confirmations:n.confirmations,requiredConfirmations:n.requiredConfirmations,metadata:{isClaimed:n.isClaimed}})},onComplete:()=>{this.emitCompleted()}})}async trySendBitcoin(i){const e=this._amount;if(e)try{const a=await this.ctx.getProvider("bitcoin");if(!a)return;const n=a;if(n.sendBitcoin){const o=D.toSatoshi(e).toNumber();return n.sendBitcoin(i,o)}}catch{}}}function E(s,r=A.Token.LBTC){switch(s){case c.AssetId.LBTC:return A.Token.LBTC;case c.AssetId.BTCb:return A.Token.BTCb;default:return r}}async function tt(s,r){try{await s.request({method:"wallet_switchEthereumChain",params:[{chainId:`0x${r.toString(16)}`}]})}catch(i){const e=i;if(e.code===4902)try{await A.addChain({provider:s,chainId:r}),await s.request({method:"wallet_switchEthereumChain",params:[{chainId:`0x${r.toString(16)}`}]});return}catch(a){const n=a;throw n.code===4001?new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,"User rejected adding chain to wallet."):new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Failed to add chain ${r} to wallet: ${n.message||"Unknown error"}`)}throw e.code===4001?new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,"User rejected chain switch request."):new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Failed to switch to chain ${r}: ${e.message||"Unknown error"}`)}}async function et(s){const r=await s.request({method:"eth_chainId"});return parseInt(r,16)}async function C(s,r){await et(s)!==r&&await tt(s,r)}const st=[t.Chain.ETHEREUM,t.Chain.SEPOLIA],it={async getMintingFee(s,r){return s.capabilities.require("evm").getMintingFee(r,A.Token.BTCb)},async restoreFeeSignature(s,r,i){const e=await l.getTokenContractInfo(A.Token.BTCb,r,s.env),a=await s.api.getFeeSignature({address:i,chainId:r,tokenAddress:e.address});return!a.hasSignature||a.expirationDate&&new Date(Number(a.expirationDate)*1e3)<new Date?null:{hasSignature:!0,signature:a.signature,typedData:a.typedData}},async authorizeFee(s,{chainId:r,recipient:i,fee:e}){const a=s.capabilities.require("evm"),n=await s.getProvider("evm");if(!n)throw t.LombardError.providerMissing(String(r),"evm");await C(n,r);const o=D.toSatoshi(e).toString(),h=await l.getTokenContractInfo(A.Token.BTCb,r,s.env),d=await a.signNetworkFee({fee:o,account:i,chainId:r,provider:n,token:A.Token.BTCb});return await s.api.storeFeeSignature({address:i,signature:d.signature,typedData:d.typedData,tokenAddress:h.address}),{signature:d.signature,typedData:d.typedData}}},rt={chainType:"evm",routes:[{sourceChains:[t.Chain.BITCOIN_MAINNET],envs:[u.r.prod]},{sourceChains:[t.Chain.BITCOIN_SIGNET],envs:[u.r.stage,u.r.dev,u.r.testnet,u.r.ibc]}],destChains:t.getAllAssetChains(c.AssetId.BTCb).filter(s=>t.isEvmChain(s)),supportedAssetsOut:[c.AssetId.BTCb],addressSchema:t.evmAddressSchema,getFeeAuthConfig(s){return st.includes(s)?it:null},async signDestination(s,r,i){const e=s.capabilities.require("evm"),a=await s.getProvider("evm");if(!a)throw t.LombardError.providerMissing(String(i),"evm");return await C(a,i),{signature:(await e.signLbtcDestination({address:r,chainId:i,provider:a})).signature}}},m=s=>`${s}${t.CAIP2_SEPARATOR}`;function nt(s){return String(s).startsWith(m(t.CHAIN_PREFIXES.EIP155))}function b(s){return String(s).startsWith(m(t.CHAIN_PREFIXES.SOLANA))}function at(s){return String(s).startsWith(m(t.CHAIN_PREFIXES.SUI))}function ot(s){return String(s).startsWith(m(t.CHAIN_PREFIXES.STARKNET))}function ut(s){const r={[t.Chain.SOLANA_MAINNET]:"mainnet-beta",[t.Chain.SOLANA_DEVNET]:"devnet",[t.Chain.SOLANA_TESTNET]:"testnet","solana:mainnet-beta":"mainnet-beta","solana:devnet":"devnet","solana:testnet":"testnet"},i=r[s];if(!i)throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Unknown Solana chain: ${s}. Expected one of: ${Object.keys(r).join(", ")}`);return i}const dt={chainType:"solana",routes:[{sourceChains:[t.Chain.BITCOIN_SIGNET],envs:[u.r.stage,u.r.dev]}],destChains:t.getAllAssetChains(c.AssetId.BTCb).filter(s=>b(s)),supportedAssetsOut:[c.AssetId.BTCb],addressSchema:t.solanaAddressSchema,getFeeAuthConfig:()=>null,async signDestination(s,r,i){const e=s.capabilities.require("solana"),a=ut(i),{signature:n}=await e.signLbtcDestination({network:a});return{signature:n}}},ct={evm:rt,solana:dt};function ht(s){return ct[s]}function pt(s,r){return s.destChains.includes(r)}function At(s,r){return s.supportedAssetsOut.includes(r)}function St(s,r,i){return s.routes.some(e=>e.envs.includes(i)&&(!r||e.sourceChains.includes(r)))}class k extends I{constructor(i,e){super(i,e,t.BtcActionStatus.IDLE);p(this,"config");p(this,"chainId");p(this,"authState",{authorized:!1});p(this,"feeAuthConfig",null);const a=t.getChainType(e.destChain),n=ht(a);if(!n)throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Unsupported destination chain type: ${a} (${e.destChain})`);if(!At(n,e.assetOut))throw new t.LombardError(t.ValidationErrorCode.INVALID_ASSET,`Asset ${e.assetOut} is not supported for BTC deposits. BTC Deposit produces BTC.b. For LBTC, use BtcStake instead.`);if(!pt(n,e.destChain))throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Destination chain ${e.destChain} is not supported for ${a} BTC deposits`);if(!St(n,e.sourceChain,i.env))throw t.LombardError.routeNotFound({assetOut:e.assetOut,sourceChain:e.sourceChain,destChain:e.destChain,env:i.env});this.config=n,this.chainId=t.parseChainIdentifier(e.destChain)}getAddressSchema(){return this.config.addressSchema}getStatusConfig(){return{idle:t.BtcActionStatus.IDLE,ready:t.BtcActionStatus.READY,addressReady:t.BtcActionStatus.ADDRESS_READY}}getInitialSteps(){return{created:t.StepStatus.IDLE,verifying:t.StepStatus.IDLE,issuing:t.StepStatus.IDLE}}isAuthorized(){return this.authState.authorized}getChainId(){return this.chainId}get mintingFee(){return this.authState.mintingFee}getDepositAddressParams(i){return{address:this.ensureRecipient(),chainId:this.chainId,signature:this.authState.signature,token:this.getExpectedToken(),eip712Data:this.authState.typedData,partnerId:this.ctx.partner.getPartnerId(),referrerCode:this._referralCode,captchaToken:i}}async generateDepositAddress(i){if(!this.authState.signature){const e=await this.config.signDestination(this.ctx,this.ensureRecipient(),this.chainId);this.authState.signature=e.signature,this.authState.typedData=e.typedData}return this.generateDepositAddressImpl(i)}getExpectedToken(){return E(this.params.assetOut,A.Token.BTCb)}getAuthRequiredMessage(){return this.feeAuthConfig?"Fee authorization required. Call authorizeFee() first.":"Address confirmation required. Call confirmAddress() first."}async prepare(i){return this.assertStatus(t.BtcActionStatus.IDLE,"prepare"),this.act(async()=>{const e=this.validatePrepareParams(i);if(this._amount=e.amount,this._recipient=e.recipient,this._referralCode=e.referralCode,this.feeAuthConfig=this.config.getFeeAuthConfig(this.params.destChain),await this.resumeFromExistingDeposit(e.recipient)){if(this.feeAuthConfig){const n=await this.feeAuthConfig.restoreFeeSignature(this.ctx,this.chainId,e.recipient);if(!(n!=null&&n.hasSignature)){this.authState.mintingFee=await this.feeAuthConfig.getMintingFee(this.ctx,this.chainId),this.updateStatus(t.BtcActionStatus.NEEDS_FEE_AUTHORIZATION),this.emitInitialProgress();return}n.signature&&(this.authState.signature=n.signature,this.authState.typedData=n.typedData),this.authState.authorized=!0}this.updateStatus(t.BtcActionStatus.ADDRESS_READY),this.emitInitialProgress();return}if(this.feeAuthConfig){const n=await this.feeAuthConfig.restoreFeeSignature(this.ctx,this.chainId,e.recipient);if(n!=null&&n.hasSignature){n.signature&&(this.authState.signature=n.signature,this.authState.typedData=n.typedData),this.authState.authorized=!0,this.updateStatus(t.BtcActionStatus.READY),this.emitInitialProgress();return}this.authState.mintingFee=await this.feeAuthConfig.getMintingFee(this.ctx,this.chainId),this.updateStatus(t.BtcActionStatus.NEEDS_FEE_AUTHORIZATION)}else this.updateStatus(t.BtcActionStatus.NEEDS_ADDRESS_CONFIRMATION);this.emitInitialProgress()})}async authorizeFee(){if(this.assertStatus([t.BtcActionStatus.NEEDS_FEE_AUTHORIZATION,t.BtcActionStatus.READY],"authorizeFee"),this.status===t.BtcActionStatus.READY)return;if(!this.feeAuthConfig)throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,"Fee authorization is not required for this destination chain. Use confirmAddress() instead.");const i=this.ensureRecipient();if(!this.authState.mintingFee)throw new t.LombardError(t.ValidationErrorCode.INVALID_STATE,"Minting fee not available. Call prepare() first.");return this.act(async()=>{const e=await this.feeAuthConfig.authorizeFee(this.ctx,{chainId:this.chainId,recipient:i,fee:this.authState.mintingFee});this.authState.signature=e.signature,this.authState.typedData=e.typedData,this.authState.authorized=!0},t.BtcActionStatus.READY)}async confirmAddress(){if(this.assertStatus([t.BtcActionStatus.NEEDS_ADDRESS_CONFIRMATION,t.BtcActionStatus.READY],"confirmAddress"),this.status===t.BtcActionStatus.READY)return;if(this.feeAuthConfig)throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,"This destination chain requires fee authorization. Use authorizeFee() instead.");const i=this.ensureRecipient();return this.act(async()=>{const e=await this.config.signDestination(this.ctx,i,this.chainId);this.authState.signature=e.signature,this.authState.typedData=e.typedData,this.authState.authorized=!0},t.BtcActionStatus.READY)}async execute(){return this.executeImpl()}async monitorDeposit(){return super.monitorDeposit()}}const gt=$.VEDA_VAULT_STAKE_AND_BAKE_CHAINS.map(s=>t.evmChainIdToChain(s)),Ct={chainType:"evm",routes:[{sourceChains:[t.Chain.BITCOIN_MAINNET],envs:[u.r.prod]},{sourceChains:[t.Chain.BITCOIN_SIGNET],envs:[u.r.stage,u.r.dev,u.r.testnet,u.r.ibc]}],destChains:gt,supportedAssetsOut:[c.AssetId.LBTC],supportedProtocols:yt(c.AssetId.LBTC),addressSchema:t.evmAddressSchema,async getStakeAndBakeFee(s,r,i){return s.capabilities.require("evm").getStakeAndBakeFee(r,i)},async authorizeStakeAndBake(s,{chainId:r,recipient:i,amount:e,vaultKey:a,token:n}){const o=s.capabilities.require("evm"),h=await s.getProvider("evm");if(!h)throw t.LombardError.providerMissing(String(r),"evm");await C(h,r);const d=await o.signStakeAndBake({value:e,account:i,chainId:r,provider:h,vaultKey:a,token:n});return await s.api.storeStakeAndBakeSignature({signature:d.signature,typedData:d.typedData}),{signature:d.signature,typedData:d.typedData}},async restoreStakeAndBakeSignature(s,r,i){try{const e=await R.getUserStakeAndBakeSignature({userDestinationAddress:i,chainId:r,env:s.env});return!(e.signature||e.expirationDate)||e.expirationDate&&Number(e.expirationDate)*1e3<Date.now()?null:{hasSignature:!0,signature:e.signature,depositAmount:e.depositAmount,expirationDate:e.expirationDate}}catch{return null}}},S=Ct;function Et(s){return S.destChains.includes(s)}function Dt(s){return S.supportedAssetsOut.includes(s)}function lt(s,r){return s?S.routes.some(i=>i.sourceChains.includes(s)&&i.envs.includes(r)):!0}function O(s){return s in c.DEFI_REGISTRY}function ft(s){if(!O(s)){const r=Object.keys(c.DEFI_REGISTRY).join(", ");throw new Error(`Unsupported protocol: ${s}. Supported protocols: ${r}`)}return s}function It(s){return Object.entries(c.DEFI_REGISTRY).filter(([r,i])=>s in i).map(([r])=>r)}const v={mainnet:[t.Chain.AVALANCHE],testnet:[t.Chain.AVALANCHE_FUJI]},mt={chainType:"evm",routes:[{sourceChains:[t.Chain.BITCOIN_MAINNET],envs:[u.r.prod]},{sourceChains:[t.Chain.BITCOIN_SIGNET],envs:[u.r.stage,u.r.dev,u.r.testnet,u.r.ibc]}],destChains:[...v.mainnet,...v.testnet],supportedAssetsOut:[c.AssetId.BTCb],supportedProtocols:It(c.AssetId.BTCb),addressSchema:t.evmAddressSchema,async getDepositAndDeployFee(s,r,i){return s.capabilities.require("evm").getStakeAndBakeFee(r,i)},async authorizeDepositAndDeploy(s,{chainId:r,recipient:i,amount:e,vaultKey:a,token:n}){const o=s.capabilities.require("evm"),h=await s.getProvider("evm");if(!h)throw t.LombardError.providerMissing(String(r),"evm");await C(h,r);const d=await o.signStakeAndBake({value:e,account:i,chainId:r,provider:h,vaultKey:a,token:n});return await s.api.storeStakeAndBakeSignature({signature:d.signature,typedData:d.typedData}),{signature:d.signature,typedData:d.typedData,approvalTxHash:d.approvalTxHash}}},g=mt;function Tt(s){return g.destChains.includes(s)}function wt(s){return g.supportedAssetsOut.includes(s)}function P(s){return s in c.DEFI_REGISTRY}function L(s){if(!P(s)){const r=Object.keys(c.DEFI_REGISTRY).join(", ");throw new Error(`Unsupported protocol: ${s}. Supported protocols: ${r}`)}return s}function yt(s){return Object.entries(c.DEFI_REGISTRY).filter(([r,i])=>s in i).map(([r])=>r)}function _t(s,r){return g.routes.some(i=>i.sourceChains.includes(s)&&i.envs.includes(r))}class F extends I{constructor(i,e){super(i,e,t.BtcActionStatus.IDLE);p(this,"chainId");p(this,"authState",{authorized:!1});if(!wt(e.assetOut))throw new t.LombardError(t.ValidationErrorCode.INVALID_ASSET,`Asset ${e.assetOut} is not supported for deposit and deploy. DepositAndDeploy produces BTC.b which is then deployed to a vault like Silo.`);if(!Tt(e.destChain))throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Destination chain ${e.destChain} is not supported for deposit and deploy. Supported chains: Avalanche, Avalanche Fuji`);if(!P(e.protocol))throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,`Protocol ${e.protocol} is not supported for deposit and deploy. DepositAndDeploy with BTC.b only supports Silo protocol.`);const a=e.sourceChain??t.Chain.BITCOIN_MAINNET;if(!_t(a,i.env))throw t.LombardError.routeNotFound({assetOut:e.assetOut,sourceChain:a,destChain:e.destChain,env:i.env});const n=t.parseChainIdentifier(e.destChain);if(typeof n!="number"||!A.isValidChain(n))throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Unsupported EVM chain: ${e.destChain}`);this.chainId=n}getAddressSchema(){return g.addressSchema}getStatusConfig(){return{idle:t.BtcActionStatus.IDLE,ready:t.BtcActionStatus.READY,addressReady:t.BtcActionStatus.ADDRESS_READY}}getInitialSteps(){return{created:t.StepStatus.IDLE,verifying:t.StepStatus.IDLE,wrapping:t.StepStatus.IDLE,depositing:t.StepStatus.IDLE}}isAuthorized(){return this.authState.authorized}getChainId(){return this.chainId}getDepositAddressParams(i){return{address:this.ensureRecipient(),chainId:this.chainId,signature:this.authState.signature,token:this.getExpectedToken(),signatureData:this.authState.typedData,partnerId:this.ctx.partner.getPartnerId(),referrerCode:this._referralCode,captchaToken:i}}getExpectedToken(){return E(this.params.assetOut,A.Token.BTCb)}getAuthRequiredMessage(){return"Deposit authorization required. Call authorizeDeposit() first."}get fee(){return this.authState.fee}async prepare(i){return this.assertStatus(t.BtcActionStatus.IDLE,"prepare"),this.act(async()=>{const e=this.validatePrepareParams(i);this._amount=e.amount,this._recipient=e.recipient,this._referralCode=e.referralCode,this.authState.fee=await g.getDepositAndDeployFee(this.ctx,this.chainId,L(this.params.protocol)),this.updateStatus(t.BtcActionStatus.NEEDS_DEPLOY_AUTHORIZATION),this.emitInitialProgress()},t.BtcActionStatus.NEEDS_DEPLOY_AUTHORIZATION)}async authorizeDeposit(){if(this.assertStatus([t.BtcActionStatus.NEEDS_DEPLOY_AUTHORIZATION,t.BtcActionStatus.READY],"authorizeDeposit"),this.status===t.BtcActionStatus.READY)return;const i=this.ensureRecipient(),e=this.ensureAmount();return this.act(async()=>{const a=D.toSatoshi(e),n=E(this.params.assetOut,A.Token.BTCb),o=await g.authorizeDepositAndDeploy(this.ctx,{chainId:this.chainId,recipient:i,amount:a.toString(),vaultKey:L(this.params.protocol),token:n});this.authState.signature=o.signature,this.authState.typedData=o.typedData,this.authState.authorized=!0},t.BtcActionStatus.READY)}async generateDepositAddress(i){return this.assertStatus(t.BtcActionStatus.READY,"generateDepositAddress"),this.ensureAuthorized(),this._depositAddress?this._depositAddress:this.act(async()=>{const e=this.getDepositAddressParams(i),a=await this.ctx.api.generateDepositAddress(e);return f(a),this._depositAddress=a,this.emitProgress({status:t.BtcActionStatus.ADDRESS_READY,steps:{created:t.StepStatus.COMPLETE,verifying:t.StepStatus.IDLE,wrapping:t.StepStatus.IDLE,depositing:t.StepStatus.IDLE},metadata:{depositAddress:a}}),a},t.BtcActionStatus.ADDRESS_READY)}async execute(){return this.act(async()=>{this.assertStatus(t.BtcActionStatus.ADDRESS_READY,"execute"),this._depositAddress||await this.generateDepositAddress();const i=this.ensureDepositAddress(),e=await this.trySendBitcoin(i);return e?{depositAddress:i,txHash:e}:{depositAddress:i}})}async monitorDeposit(){const i=this._depositAddress,e=this._recipient;if(!i||!e)throw t.LombardError.missingParameter("depositAddress or recipient");return await y({network:this.bitcoinNetwork,btcService:this.ctx.btc,fetchDeposit:async()=>{const o=(await this.ctx.api.getDeposits(e)).find(h=>h.depositAddress===i);if(o)return{blockHeight:o.blockHeight,isClaimed:o.isClaimed}},onProgress:n=>{this.emitProgress({status:this.status,steps:{created:t.StepStatus.COMPLETE,verifying:n.hasEnoughConfirmations?t.StepStatus.COMPLETE:t.StepStatus.PENDING,wrapping:n.isClaimed?t.StepStatus.COMPLETE:t.StepStatus.PENDING,depositing:t.StepStatus.PENDING},confirmations:n.confirmations,requiredConfirmations:n.requiredConfirmations,metadata:{isClaimed:n.isClaimed}})},onComplete:()=>{this.emitCompleted()}})}}const Nt=[t.Chain.ETHEREUM,t.Chain.SEPOLIA],Bt={async getMintingFee(s,r){return s.capabilities.require("evm").getMintingFee(r)},async restoreFeeSignature(s,r,i){const e=await l.getTokenContractInfo(A.Token.LBTC,r,s.env),a=await s.api.getFeeSignature({address:i,chainId:r,tokenAddress:e.address});return!a.hasSignature||a.expirationDate&&new Date(Number(a.expirationDate)*1e3)<new Date?null:{hasSignature:!0,signature:a.signature,typedData:a.typedData}},async authorizeFee(s,{chainId:r,recipient:i,fee:e}){const a=s.capabilities.require("evm"),n=await s.getProvider("evm");if(!n)throw t.LombardError.providerMissing(String(r),"evm");await C(n,r);const o=D.toSatoshi(e).toString(),h=await l.getTokenContractInfo(A.Token.LBTC,r,s.env),d=await a.signNetworkFee({fee:o,account:i,chainId:r,provider:n,token:A.Token.LBTC});return await s.api.storeFeeSignature({address:i,signature:d.signature,typedData:d.typedData,tokenAddress:h.address}),{signature:d.signature,typedData:d.typedData}}},vt={chainType:"evm",routes:[{sourceChains:[t.Chain.BITCOIN_MAINNET],envs:[u.r.prod]},{sourceChains:[t.Chain.BITCOIN_SIGNET],envs:[u.r.testnet,u.r.stage,u.r.dev,u.r.ibc]}],destChains:t.getAllAssetChains(c.AssetId.LBTC).filter(s=>nt(s)),supportedAssetsOut:[c.AssetId.LBTC],addressSchema:t.evmAddressSchema,getFeeAuthConfig(s){return Nt.includes(s)?Bt:null},async getSignature(s,r,i){const e=s.capabilities.require("evm"),a=await s.getProvider("evm");if(!a)throw t.LombardError.providerMissing(String(i),"evm");return await C(a,i),e.signLbtcDestination({chainId:i,address:r,provider:a})}};function Lt(s){const r={[t.Chain.SOLANA_MAINNET]:"mainnet-beta",[t.Chain.SOLANA_DEVNET]:"devnet",[t.Chain.SOLANA_TESTNET]:"testnet","solana:mainnet-beta":"mainnet-beta","solana:devnet":"devnet","solana:testnet":"testnet"},i=r[s];if(!i)throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Unknown Solana chain: ${s}. Expected one of: ${Object.keys(r).join(", ")}`);return i}const Rt={chainType:"solana",routes:[{sourceChains:[t.Chain.BITCOIN_MAINNET],envs:[u.r.prod]},{sourceChains:[t.Chain.BITCOIN_SIGNET],envs:[u.r.testnet,u.r.stage,u.r.dev,u.r.ibc]}],destChains:t.getAllAssetChains(c.AssetId.LBTC).filter(s=>b(s)),supportedAssetsOut:[c.AssetId.LBTC],addressSchema:t.solanaAddressSchema,getFeeAuthConfig:()=>null,async getSignature(s,r,i){const e=s.capabilities.require("solana"),a=Lt(i),{signature:n}=await e.signLbtcDestination({network:a});return{signature:n}}},bt={chainType:"starknet",routes:[{sourceChains:[t.Chain.BITCOIN_MAINNET],envs:[u.r.prod]},{sourceChains:[t.Chain.BITCOIN_SIGNET],envs:[u.r.testnet,u.r.stage,u.r.dev,u.r.ibc]}],destChains:t.getAllAssetChains(c.AssetId.LBTC).filter(s=>ot(s)),supportedAssetsOut:[c.AssetId.LBTC],addressSchema:t.starknetAddressSchema,getFeeAuthConfig:()=>null,async getSignature(s,r,i){const e=s.capabilities.require("starknet"),{signature:a,pubKey:n}=await e.signLbtcDestination({chainId:i}),o=q.pad(r,{size:32});return{signature:a,pubKey:n,paddedAddress:o}}},kt={chainType:"sui",routes:[{sourceChains:[t.Chain.BITCOIN_MAINNET],envs:[u.r.prod]},{sourceChains:[t.Chain.BITCOIN_SIGNET],envs:[u.r.testnet,u.r.stage,u.r.dev,u.r.ibc]}],destChains:t.getAllAssetChains(c.AssetId.LBTC).filter(s=>at(s)),supportedAssetsOut:[c.AssetId.LBTC],addressSchema:t.suiAddressSchema,getFeeAuthConfig:()=>null,async getSignature(s,r,i){const e=s.capabilities.require("sui"),{signature:a}=await e.signLbtcDestination({chainId:i});return{signature:a}}},Ot={evm:vt,solana:Rt,sui:kt,starknet:bt};function Pt(s){return Ot[s]}function Ft(s,r,i){return r?s.routes.some(e=>e.sourceChains.includes(r)&&e.envs.includes(i)):!0}function xt(s,r){return s.destChains.includes(r)}function Mt(s,r){return s.supportedAssetsOut.includes(r)}class x extends I{constructor(i,e){super(i,e,t.BtcActionStatus.IDLE);p(this,"config");p(this,"chainId");p(this,"authState",{authorized:!1});p(this,"feeAuthConfig",null);const a=t.getChainType(e.destChain),n=Pt(a);if(!n)throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Unsupported destination chain type: ${a} (${e.destChain})`);if(!Mt(n,e.assetOut))throw new t.LombardError(t.ValidationErrorCode.INVALID_ASSET,`Asset ${e.assetOut} is not supported for BTC staking. BTC Stake produces LBTC. For BTC.b, use BtcDeposit instead.`);if(!xt(n,e.destChain))throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Destination chain ${e.destChain} is not supported for ${a}`);if(!Ft(n,e.sourceChain,i.env))throw t.LombardError.routeNotFound({assetOut:e.assetOut,sourceChain:e.sourceChain,destChain:e.destChain,env:i.env});this.config=n,this.chainId=t.parseChainIdentifier(e.destChain)}getAddressSchema(){return this.config.addressSchema}getStatusConfig(){return{idle:t.BtcActionStatus.IDLE,ready:t.BtcActionStatus.READY,addressReady:t.BtcActionStatus.ADDRESS_READY}}getInitialSteps(){return{created:t.StepStatus.IDLE,verifying:t.StepStatus.IDLE,issuing:t.StepStatus.IDLE}}isAuthorized(){return this.authState.authorized}getChainId(){return this.chainId}getDepositAddressParams(i){var n;const e=this.ensureRecipient(),a=this.getActiveSignature();if(!a)throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,"Missing signature. Complete authorization first.");return{address:a.paddedAddress??e,chainId:this.chainId,signature:a.signature,token:this.getExpectedToken(),eip712Data:(n=this.authState.networkFee)==null?void 0:n.typedData,pubKey:a.pubKey,partnerId:this.ctx.partner.getPartnerId(),referrerCode:this._referralCode,captchaToken:i}}getExpectedToken(){return E(this.params.assetOut,A.Token.LBTC)}getAuthRequiredMessage(){return"Authorization required. Call authorize() first."}get mintingFee(){return this.authState.mintingFee}async prepare(i){return this.assertStatus(t.BtcActionStatus.IDLE,"prepare"),this.act(async()=>{const e=this.validatePrepareParams(i);if(this._amount=e.amount,this._recipient=e.recipient,this._referralCode=e.referralCode,this.feeAuthConfig=this.config.getFeeAuthConfig(this.params.destChain),await this.resumeFromExistingDeposit(e.recipient)){if(this.feeAuthConfig){const n=await this.feeAuthConfig.restoreFeeSignature(this.ctx,this.chainId,e.recipient);if(!(n!=null&&n.hasSignature)){this.authState.mintingFee=await this.feeAuthConfig.getMintingFee(this.ctx,this.chainId),this.updateStatus(t.BtcActionStatus.NEEDS_FEE_AUTHORIZATION),this.emitInitialProgress();return}n.signature&&(this.authState.networkFee={signature:n.signature,typedData:n.typedData}),this.authState.authorized=!0}this.updateStatus(t.BtcActionStatus.ADDRESS_READY),this.emitInitialProgress();return}if(this.feeAuthConfig){const n=await this.feeAuthConfig.restoreFeeSignature(this.ctx,this.chainId,e.recipient);if(n!=null&&n.hasSignature){n.signature&&(this.authState.networkFee={signature:n.signature,typedData:n.typedData}),this.authState.authorized=!0,this.updateStatus(t.BtcActionStatus.READY),this.emitInitialProgress();return}this.authState.mintingFee=await this.feeAuthConfig.getMintingFee(this.ctx,this.chainId),this.updateStatus(t.BtcActionStatus.NEEDS_FEE_AUTHORIZATION)}else this.updateStatus(t.BtcActionStatus.NEEDS_ADDRESS_CONFIRMATION);this.emitInitialProgress()})}async authorize(){if(this.assertStatus([t.BtcActionStatus.NEEDS_FEE_AUTHORIZATION,t.BtcActionStatus.NEEDS_ADDRESS_CONFIRMATION,t.BtcActionStatus.READY],"authorize"),this.status===t.BtcActionStatus.READY)return;const i=this.ensureRecipient(),e=this.feeAuthConfig!==null;return this.act(async()=>{if(e){const a=this.ensureMintingFee(),n=await this.feeAuthConfig.authorizeFee(this.ctx,{chainId:this.chainId,recipient:i,fee:a});this.authState.networkFee={signature:n.signature,typedData:n.typedData}}else this.authState.destinationSignature=await this.config.getSignature(this.ctx,i,this.chainId);this.authState.authorized=!0},t.BtcActionStatus.READY)}async generateDepositAddress(i){if(this.assertStatus(t.BtcActionStatus.READY,"generateDepositAddress"),this.ensureAuthorized(),this._depositAddress)return this._depositAddress;if(!this.getActiveSignature()){const e=await this.config.getSignature(this.ctx,this.ensureRecipient(),this.chainId);this.authState.destinationSignature=e}return this.act(async()=>{const e=this.getDepositAddressParams(i),a=await this.ctx.api.generateDepositAddress(e);return f(a),this._depositAddress=a,this.emitProgress({status:t.BtcActionStatus.ADDRESS_READY,steps:{created:t.StepStatus.COMPLETE,verifying:t.StepStatus.IDLE,issuing:t.StepStatus.IDLE},metadata:{depositAddress:a}}),a},t.BtcActionStatus.ADDRESS_READY)}async execute(){return this.executeImpl()}async monitorDeposit(){return super.monitorDeposit()}ensureMintingFee(){if(!this.authState.mintingFee)throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,"Minting fee not fetched. Call prepare() first.");return this.authState.mintingFee}getActiveSignature(){var i;return(i=this.authState.networkFee)!=null&&i.signature?{signature:this.authState.networkFee.signature}:this.authState.destinationSignature}}class M extends I{constructor(i,e){super(i,e,t.BtcActionStatus.IDLE);p(this,"chainId");p(this,"authState",{authorized:!1});if(!Dt(e.assetOut))throw new t.LombardError(t.ValidationErrorCode.INVALID_ASSET,`Asset ${e.assetOut} is not supported for stake and deploy. StakeAndDeploy produces LBTC which is then deployed to a vault.`);if(!Et(e.destChain))throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Destination chain ${e.destChain} is not supported for stake and deploy`);if(!O(e.protocol))throw new t.LombardError(t.ValidationErrorCode.INVALID_PARAMETER,`Protocol ${e.protocol} is not supported for stake and deploy`);if(!lt(e.sourceChain,i.env))throw t.LombardError.routeNotFound({assetOut:e.assetOut,sourceChain:e.sourceChain,destChain:e.destChain,env:i.env});const a=t.parseChainIdentifier(e.destChain);if(typeof a!="number"||!A.isValidChain(a))throw new t.LombardError(t.ValidationErrorCode.INVALID_CHAIN,`Unsupported EVM chain: ${e.destChain}`);this.chainId=a}getAddressSchema(){return S.addressSchema}getStatusConfig(){return{idle:t.BtcActionStatus.IDLE,ready:t.BtcActionStatus.READY,addressReady:t.BtcActionStatus.ADDRESS_READY}}getInitialSteps(){return{created:t.StepStatus.IDLE,verifying:t.StepStatus.IDLE,issuing:t.StepStatus.IDLE,depositing:t.StepStatus.IDLE}}isAuthorized(){return this.authState.authorized}getChainId(){return this.chainId}getDepositAddressParams(i){return{address:this.ensureRecipient(),chainId:this.chainId,signature:this.authState.signature,token:this.getExpectedToken(),signatureData:this.authState.typedData,partnerId:this.ctx.partner.getPartnerId(),referrerCode:this._referralCode,captchaToken:i}}getExpectedToken(){return E(this.params.assetOut,A.Token.LBTC)}getAuthRequiredMessage(){return"Deposit authorization required. Call authorizeDeposit() first."}get fee(){return this.authState.fee}async prepare(i){return this.assertStatus(t.BtcActionStatus.IDLE,"prepare"),this.act(async()=>{const e=this.validatePrepareParams(i);if(this._amount=e.amount,this._recipient=e.recipient,this._referralCode=e.referralCode,this.authState.fee=await S.getStakeAndBakeFee(this.ctx,this.chainId,this.params.protocol),await this.resumeFromExistingDeposit(e.recipient)){const o=await S.restoreStakeAndBakeSignature(this.ctx,this.chainId,e.recipient);if(o!=null&&o.hasSignature){o.signature&&(this.authState.signature=o.signature),this.authState.authorized=!0,this.updateStatus(t.BtcActionStatus.ADDRESS_READY),this.emitInitialProgress();return}this.updateStatus(t.BtcActionStatus.NEEDS_DEPLOY_AUTHORIZATION),this.emitInitialProgress();return}const n=await S.restoreStakeAndBakeSignature(this.ctx,this.chainId,e.recipient);if(n!=null&&n.hasSignature){n.signature&&(this.authState.signature=n.signature),this.authState.authorized=!0,this.updateStatus(t.BtcActionStatus.READY),this.emitInitialProgress();return}this.updateStatus(t.BtcActionStatus.NEEDS_DEPLOY_AUTHORIZATION),this.emitInitialProgress()})}async authorizeDeposit(){if(this.assertStatus([t.BtcActionStatus.NEEDS_DEPLOY_AUTHORIZATION,t.BtcActionStatus.READY],"authorizeDeposit"),this.status===t.BtcActionStatus.READY)return;const i=this.ensureRecipient(),e=this.ensureAmount();return this.act(async()=>{const a=D.toSatoshi(e),n=this.params.assetIn??c.AssetId.BTC,o=await S.authorizeStakeAndBake(this.ctx,{chainId:this.chainId,recipient:i,amount:a.toString(),vaultKey:ft(this.params.protocol),token:n});this.authState.signature=o.signature,this.authState.typedData=o.typedData,this.authState.authorized=!0},t.BtcActionStatus.READY)}async generateDepositAddress(i){return this.assertStatus(t.BtcActionStatus.READY,"generateDepositAddress"),this.ensureAuthorized(),this._depositAddress?this._depositAddress:this.act(async()=>{const e=this.getDepositAddressParams(i),a=await this.ctx.api.generateDepositAddress(e);return f(a),this._depositAddress=a,this.emitProgress({status:t.BtcActionStatus.ADDRESS_READY,steps:{created:t.StepStatus.COMPLETE,verifying:t.StepStatus.IDLE,issuing:t.StepStatus.IDLE,depositing:t.StepStatus.IDLE},metadata:{depositAddress:a}}),a},t.BtcActionStatus.ADDRESS_READY)}async execute(){return this.act(async()=>{this.assertStatus(t.BtcActionStatus.ADDRESS_READY,"execute"),this._depositAddress||await this.generateDepositAddress();const i=this.ensureDepositAddress(),e=await this.trySendBitcoin(i);return e?{depositAddress:i,txHash:e}:{depositAddress:i}})}async monitorDeposit(){const i=this._depositAddress,e=this._recipient;if(!i||!e)throw t.LombardError.missingParameter("depositAddress or recipient");return await y({network:this.bitcoinNetwork,btcService:this.ctx.btc,fetchDeposit:async()=>{const o=(await this.ctx.api.getDeposits(e)).find(h=>h.depositAddress===i);if(o)return{blockHeight:o.blockHeight,isClaimed:o.isClaimed}},onProgress:n=>{this.emitProgress({status:this.status,steps:{created:t.StepStatus.COMPLETE,verifying:n.hasEnoughConfirmations?t.StepStatus.COMPLETE:t.StepStatus.PENDING,issuing:n.isClaimed?t.StepStatus.COMPLETE:t.StepStatus.PENDING,depositing:t.StepStatus.PENDING},confirmations:n.confirmations,requiredConfirmations:n.requiredConfirmations,metadata:{isClaimed:n.isClaimed}})},onComplete:()=>{this.emitCompleted()}})}}class V{constructor(r){p(this,"ctx");this.ctx=t.createBtcCoreContext(r)}stake(r){return new x(this.ctx,r)}stakeAndDeploy(r){return new M(this.ctx,r)}deposit(r){return new k(this.ctx,r)}depositAndDeploy(r){return new F(this.ctx,r)}}function Vt(s){return new V(s)}exports.BtcActions=V;exports.BtcDeposit=k;exports.BtcDepositAndDeploy=F;exports.BtcStake=x;exports.BtcStakeAndDeploy=M;exports.btcActions=Vt;exports.btcModule=Q;
|
|
2
|
-
//# sourceMappingURL=BtcActions-Bic_HKkw.cjs.map
|