@lombard.finance/sdk 4.1.0 → 4.2.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 +100 -0
- package/README.md +59 -10
- package/dist/api-functions/getUserStakeAndBakeSignature/getUserStakeAndBakeSignature.d.ts +5 -1
- package/dist/api-functions/getUserStakeAndBakeSignature/getUserStakeAndBakeSignature.d.ts.map +1 -1
- package/dist/api.cjs +2 -0
- package/dist/api.cjs.map +1 -0
- package/dist/api.js +41 -0
- package/dist/api.js.map +1 -0
- package/dist/bridge/lib/ccip-config.d.ts.map +1 -1
- package/dist/bridge/lib/config.d.ts +3 -3
- package/dist/bridge/lib/config.d.ts.map +1 -1
- package/dist/bridge.cjs +2 -0
- package/dist/bridge.cjs.map +1 -0
- package/dist/bridge.js +11 -0
- package/dist/bridge.js.map +1 -0
- package/dist/btc.cjs +2 -0
- package/dist/btc.cjs.map +1 -0
- package/dist/btc.js +13 -0
- package/dist/btc.js.map +1 -0
- package/dist/chains/btc/actions/deposit/config/index.d.ts +2 -1
- package/dist/chains/btc/actions/deposit/config/index.d.ts.map +1 -1
- package/dist/chains/btc/actions/deposit/config/types.d.ts +2 -1
- package/dist/chains/btc/actions/deposit/config/types.d.ts.map +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/BtcDepositAndDeploy.d.ts +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/BtcDepositAndDeploy.d.ts.map +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/config/evm.d.ts.map +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/config/index.d.ts +2 -1
- package/dist/chains/btc/actions/depositAndDeploy/config/index.d.ts.map +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/config/types.d.ts +2 -1
- package/dist/chains/btc/actions/depositAndDeploy/config/types.d.ts.map +1 -1
- package/dist/chains/btc/actions/shared/validation.d.ts +2 -1
- package/dist/chains/btc/actions/shared/validation.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/config/evm.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/config/index.d.ts +2 -1
- package/dist/chains/btc/actions/stake/config/index.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/config/solana.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/config/starknet.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/config/sui.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/config/types.d.ts +2 -1
- package/dist/chains/btc/actions/stake/config/types.d.ts.map +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/BtcStakeAndDeploy.d.ts +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/BtcStakeAndDeploy.d.ts.map +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/config/evm.d.ts.map +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/config/index.d.ts +2 -1
- package/dist/chains/btc/actions/stakeAndDeploy/config/index.d.ts.map +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/config/types.d.ts +2 -1
- package/dist/chains/btc/actions/stakeAndDeploy/config/types.d.ts.map +1 -1
- package/dist/chains/evm/EvmActions.d.ts +39 -0
- package/dist/chains/evm/EvmActions.d.ts.map +1 -1
- package/dist/chains/evm/actions/deploy/config/evm.d.ts +2 -1
- package/dist/chains/evm/actions/deploy/config/evm.d.ts.map +1 -1
- package/dist/chains/evm/actions/deploy/config/types.d.ts +2 -1
- package/dist/chains/evm/actions/deploy/config/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/deposit/config/evm.d.ts +2 -1
- package/dist/chains/evm/actions/deposit/config/evm.d.ts.map +1 -1
- package/dist/chains/evm/actions/deposit/config/types.d.ts +2 -1
- package/dist/chains/evm/actions/deposit/config/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/index.d.ts +1 -0
- package/dist/chains/evm/actions/index.d.ts.map +1 -1
- package/dist/chains/evm/actions/redeem/config/evm.d.ts +2 -1
- package/dist/chains/evm/actions/redeem/config/evm.d.ts.map +1 -1
- package/dist/chains/evm/actions/redeem/config/types.d.ts +2 -1
- package/dist/chains/evm/actions/redeem/config/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/stake/config/evm.d.ts +2 -1
- package/dist/chains/evm/actions/stake/config/evm.d.ts.map +1 -1
- package/dist/chains/evm/actions/stake/config/types.d.ts +2 -1
- package/dist/chains/evm/actions/stake/config/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/unstake/config/evm.d.ts +2 -1
- package/dist/chains/evm/actions/unstake/config/evm.d.ts.map +1 -1
- package/dist/chains/evm/actions/unstake/config/types.d.ts +2 -1
- package/dist/chains/evm/actions/unstake/config/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/withdraw/EvmCancelWithdraw.d.ts +27 -0
- package/dist/chains/evm/actions/withdraw/EvmCancelWithdraw.d.ts.map +1 -0
- package/dist/chains/evm/actions/withdraw/EvmWithdraw.d.ts +39 -0
- package/dist/chains/evm/actions/withdraw/EvmWithdraw.d.ts.map +1 -0
- package/dist/chains/evm/actions/withdraw/config/evm.d.ts +22 -0
- package/dist/chains/evm/actions/withdraw/config/evm.d.ts.map +1 -0
- package/dist/chains/evm/actions/withdraw/config/index.d.ts +8 -0
- package/dist/chains/evm/actions/withdraw/config/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/withdraw/config/types.d.ts +31 -0
- package/dist/chains/evm/actions/withdraw/config/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/withdraw/factory.d.ts +53 -0
- package/dist/chains/evm/actions/withdraw/factory.d.ts.map +1 -0
- package/dist/chains/evm/actions/withdraw/index.d.ts +12 -0
- package/dist/chains/evm/actions/withdraw/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/withdraw/types.d.ts +87 -0
- package/dist/chains/evm/actions/withdraw/types.d.ts.map +1 -0
- package/dist/chains/evm/shared/feeAuth.d.ts +1 -1
- package/dist/chains/evm/shared/feeAuth.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/config/btc.d.ts +2 -1
- package/dist/chains/solana/actions/unstake/config/btc.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/config/solana.d.ts +2 -1
- package/dist/chains/solana/actions/unstake/config/solana.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/config/types.d.ts +2 -1
- package/dist/chains/solana/actions/unstake/config/types.d.ts.map +1 -1
- package/dist/chains/starknet/actions/unstake/config/btc.d.ts +2 -1
- package/dist/chains/starknet/actions/unstake/config/btc.d.ts.map +1 -1
- package/dist/chains/starknet/actions/unstake/config/starknet.d.ts +2 -1
- package/dist/chains/starknet/actions/unstake/config/starknet.d.ts.map +1 -1
- package/dist/chains/starknet/actions/unstake/config/types.d.ts +2 -1
- package/dist/chains/starknet/actions/unstake/config/types.d.ts.map +1 -1
- package/dist/chains/sui/actions/unstake/config/btc.d.ts +2 -1
- package/dist/chains/sui/actions/unstake/config/btc.d.ts.map +1 -1
- package/dist/chains/sui/actions/unstake/config/sui.d.ts +2 -1
- package/dist/chains/sui/actions/unstake/config/sui.d.ts.map +1 -1
- package/dist/chains/sui/actions/unstake/config/types.d.ts +2 -1
- package/dist/chains/sui/actions/unstake/config/types.d.ts.map +1 -1
- package/dist/chunks/BtcActions-D9eBmDj6.cjs +2 -0
- package/dist/chunks/BtcActions-D9eBmDj6.cjs.map +1 -0
- package/dist/chunks/BtcActions-DGqmtxjd.js +1791 -0
- package/dist/chunks/BtcActions-DGqmtxjd.js.map +1 -0
- package/dist/chunks/EvmActions-BOwYPThp.cjs +2 -0
- package/dist/chunks/EvmActions-BOwYPThp.cjs.map +1 -0
- package/dist/chunks/EvmActions-MW5mNmqs.js +1351 -0
- package/dist/chunks/EvmActions-MW5mNmqs.js.map +1 -0
- package/dist/chunks/ReferralsClient-DUwyIUe3.cjs +2 -0
- package/dist/chunks/ReferralsClient-DUwyIUe3.cjs.map +1 -0
- package/dist/chunks/ReferralsClient-JjWLlIO4.js +462 -0
- package/dist/chunks/ReferralsClient-JjWLlIO4.js.map +1 -0
- package/dist/chunks/api-config-CtcP3TVl.js +35 -0
- package/dist/chunks/api-config-CtcP3TVl.js.map +1 -0
- package/dist/chunks/api-config-DkXqqfCK.cjs +2 -0
- package/dist/chunks/api-config-DkXqqfCK.cjs.map +1 -0
- package/dist/chunks/approveLBTC-CN6rJF6_.cjs +2 -0
- package/dist/chunks/approveLBTC-CN6rJF6_.cjs.map +1 -0
- package/dist/chunks/approveLBTC-DOP0wsm3.js +26 -0
- package/dist/chunks/approveLBTC-DOP0wsm3.js.map +1 -0
- package/dist/chunks/array-Cev6kyLJ.js +15 -0
- package/dist/chunks/array-Cev6kyLJ.js.map +1 -0
- package/dist/chunks/array-DKG6Pz4i.cjs +2 -0
- package/dist/chunks/array-DKG6Pz4i.cjs.map +1 -0
- package/dist/chunks/blockchain-identifier-DtIGGlIi.cjs +2 -0
- package/dist/chunks/blockchain-identifier-DtIGGlIi.cjs.map +1 -0
- package/dist/chunks/blockchain-identifier-PNEhu-QU.js +113 -0
- package/dist/chunks/blockchain-identifier-PNEhu-QU.js.map +1 -0
- package/dist/chunks/bridge-DkZMwO7c.cjs +12 -0
- package/dist/chunks/bridge-DkZMwO7c.cjs.map +1 -0
- package/dist/chunks/bridge-DyAiDpxD.js +693 -0
- package/dist/chunks/bridge-DyAiDpxD.js.map +1 -0
- package/dist/chunks/config-DqbLaiRi.cjs +2 -0
- package/dist/chunks/config-DqbLaiRi.cjs.map +1 -0
- package/dist/chunks/config-_8X_2sG4.js +374 -0
- package/dist/chunks/config-_8X_2sG4.js.map +1 -0
- package/dist/chunks/constants-BBK-JNcY.cjs +2 -0
- package/dist/chunks/constants-BBK-JNcY.cjs.map +1 -0
- package/dist/chunks/constants-CuT4axsy.js +5 -0
- package/dist/chunks/constants-CuT4axsy.js.map +1 -0
- package/dist/chunks/defi-registry-NGWlyxAY.cjs +2 -0
- package/dist/chunks/defi-registry-NGWlyxAY.cjs.map +1 -0
- package/dist/chunks/defi-registry-dhrQMy94.js +172 -0
- package/dist/chunks/defi-registry-dhrQMy94.js.map +1 -0
- package/dist/chunks/depositStatus-DeCO-K5Q.js +205 -0
- package/dist/chunks/depositStatus-DeCO-K5Q.js.map +1 -0
- package/dist/chunks/depositStatus-K6gky8zH.cjs +2 -0
- package/dist/chunks/depositStatus-K6gky8zH.cjs.map +1 -0
- package/dist/chunks/events-CLVUaKQS.js +996 -0
- package/dist/chunks/events-CLVUaKQS.js.map +1 -0
- package/dist/chunks/events-DIKZG4SZ.cjs +2 -0
- package/dist/chunks/events-DIKZG4SZ.cjs.map +1 -0
- package/dist/chunks/evm-by-btc-address-CwLiENtM.js +39 -0
- package/dist/chunks/evm-by-btc-address-CwLiENtM.js.map +1 -0
- package/dist/chunks/evm-by-btc-address-DiQoIWsr.cjs +2 -0
- package/dist/chunks/evm-by-btc-address-DiQoIWsr.cjs.map +1 -0
- package/dist/chunks/fee-requirements-CICSxYYL.cjs +2 -0
- package/dist/chunks/fee-requirements-CICSxYYL.cjs.map +1 -0
- package/dist/chunks/fee-requirements-x8-8mpJ7.js +14 -0
- package/dist/chunks/fee-requirements-x8-8mpJ7.js.map +1 -0
- package/dist/chunks/get-exchange-ratio-B0CNEGOB.js +20 -0
- package/dist/chunks/get-exchange-ratio-B0CNEGOB.js.map +1 -0
- package/dist/chunks/get-exchange-ratio-CM8W0jTw.cjs +2 -0
- package/dist/chunks/get-exchange-ratio-CM8W0jTw.cjs.map +1 -0
- package/dist/chunks/get-positions-summary-Cled5YPA.js +103 -0
- package/dist/chunks/get-positions-summary-Cled5YPA.js.map +1 -0
- package/dist/chunks/get-positions-summary-Co7RZBiK.cjs +2 -0
- package/dist/chunks/get-positions-summary-Co7RZBiK.cjs.map +1 -0
- package/dist/chunks/get-vault-tvl-Bydlvlrv.cjs +2 -0
- package/dist/chunks/get-vault-tvl-Bydlvlrv.cjs.map +1 -0
- package/dist/chunks/get-vault-tvl-DxjO9xDs.js +226 -0
- package/dist/chunks/get-vault-tvl-DxjO9xDs.js.map +1 -0
- package/dist/chunks/get-vault-withdrawals-CSQqKFB8.js +161 -0
- package/dist/chunks/get-vault-withdrawals-CSQqKFB8.js.map +1 -0
- package/dist/chunks/get-vault-withdrawals-DBA3ok0m.cjs +2 -0
- package/dist/chunks/get-vault-withdrawals-DBA3ok0m.cjs.map +1 -0
- package/dist/chunks/getSharesByAddress-CK2q7gBI.js +121 -0
- package/dist/chunks/getSharesByAddress-CK2q7gBI.js.map +1 -0
- package/dist/chunks/getSharesByAddress-De7as74h.cjs +2 -0
- package/dist/chunks/getSharesByAddress-De7as74h.cjs.map +1 -0
- package/dist/chunks/getUserStakeAndBakeSignature--XsK93Lb.cjs +2 -0
- package/dist/chunks/getUserStakeAndBakeSignature--XsK93Lb.cjs.map +1 -0
- package/dist/chunks/getUserStakeAndBakeSignature-2xPkL9v_.js +120 -0
- package/dist/chunks/getUserStakeAndBakeSignature-2xPkL9v_.js.map +1 -0
- package/dist/chunks/index-BKzxeh1Y.cjs +2 -0
- package/dist/chunks/index-BKzxeh1Y.cjs.map +1 -0
- package/dist/chunks/index-CfcQ_g3t.js +37 -0
- package/dist/chunks/index-CfcQ_g3t.js.map +1 -0
- package/dist/chunks/lbtc-addresses-NHg9Gk5y.js +10 -0
- package/dist/chunks/lbtc-addresses-NHg9Gk5y.js.map +1 -0
- package/dist/chunks/lbtc-addresses-bj--zuK9.cjs +2 -0
- package/dist/chunks/lbtc-addresses-bj--zuK9.cjs.map +1 -0
- package/dist/chunks/numbers-3LtmxfD8.cjs +2 -0
- package/dist/chunks/numbers-3LtmxfD8.cjs.map +1 -0
- package/dist/chunks/numbers-CM-lcmt4.js +15 -0
- package/dist/chunks/numbers-CM-lcmt4.js.map +1 -0
- package/dist/chunks/parameters-CDV-6Hk5.js +11 -0
- package/dist/chunks/parameters-CDV-6Hk5.js.map +1 -0
- package/dist/chunks/parameters-DK9cYCAH.cjs +2 -0
- package/dist/chunks/parameters-DK9cYCAH.cjs.map +1 -0
- package/dist/chunks/satoshi-CZEsHl5X.cjs +2 -0
- package/dist/chunks/satoshi-CZEsHl5X.cjs.map +1 -0
- package/dist/chunks/satoshi-Ch6y8aYG.js +19 -0
- package/dist/chunks/satoshi-Ch6y8aYG.js.map +1 -0
- package/dist/chunks/statusConstants-DTDi_4Go.cjs +2 -0
- package/dist/chunks/statusConstants-DTDi_4Go.cjs.map +1 -0
- package/dist/chunks/statusConstants-ZJia15m2.js +4446 -0
- package/dist/chunks/statusConstants-ZJia15m2.js.map +1 -0
- package/dist/chunks/storeNetworkFeeSignature-BZUZOxns.js +65 -0
- package/dist/chunks/storeNetworkFeeSignature-BZUZOxns.js.map +1 -0
- package/dist/chunks/storeNetworkFeeSignature-pV7xUOSo.cjs +2 -0
- package/dist/chunks/storeNetworkFeeSignature-pV7xUOSo.cjs.map +1 -0
- package/dist/chunks/time-I-BeyUkG.cjs +2 -0
- package/dist/chunks/time-I-BeyUkG.cjs.map +1 -0
- package/dist/chunks/time-QPeEEEnQ.js +24 -0
- package/dist/chunks/time-QPeEEEnQ.js.map +1 -0
- package/dist/chunks/token-addresses-D859i6tX.cjs +2 -0
- package/dist/chunks/token-addresses-D859i6tX.cjs.map +1 -0
- package/dist/chunks/token-addresses-DmAr89jP.js +579 -0
- package/dist/chunks/token-addresses-DmAr89jP.js.map +1 -0
- package/dist/chunks/tokens-Bw35TZqd.js +6663 -0
- package/dist/chunks/tokens-Bw35TZqd.js.map +1 -0
- package/dist/chunks/tokens-DLGMNeqZ.cjs +2 -0
- package/dist/chunks/tokens-DLGMNeqZ.cjs.map +1 -0
- package/dist/chunks/unstakeLBTC-CqZzj9WL.cjs +2 -0
- package/dist/chunks/unstakeLBTC-CqZzj9WL.cjs.map +1 -0
- package/dist/chunks/unstakeLBTC-Huy_ncVl.js +3866 -0
- package/dist/chunks/unstakeLBTC-Huy_ncVl.js.map +1 -0
- package/dist/chunks/withdraw-CVNVJ7-x.js +209 -0
- package/dist/chunks/withdraw-CVNVJ7-x.js.map +1 -0
- package/dist/chunks/withdraw-Z77x7Hj4.cjs +12 -0
- package/dist/chunks/withdraw-Z77x7Hj4.cjs.map +1 -0
- package/dist/client/ApiNamespace.d.ts +39 -0
- package/dist/client/ApiNamespace.d.ts.map +1 -1
- package/dist/client/createLombardSDK.d.ts.map +1 -1
- package/dist/clients/rpc-url-config.d.ts.map +1 -1
- package/dist/common/chains.d.ts +2 -2
- package/dist/common/chains.d.ts.map +1 -1
- package/dist/common/feature-config.d.ts +7 -7
- package/dist/contract-functions/getBasculeDepositStatus/getBasculeDepositStatus.d.ts.map +1 -1
- package/dist/contracts.cjs +2 -0
- package/dist/contracts.cjs.map +1 -0
- package/dist/contracts.js +32 -0
- package/dist/contracts.js.map +1 -0
- package/dist/core/assets/catalog.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/types.d.ts +0 -4
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core.cjs +2 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.js +101 -0
- package/dist/core.js.map +1 -0
- package/dist/debug.cjs +2 -0
- package/dist/debug.cjs.map +1 -0
- package/dist/debug.js +7 -0
- package/dist/debug.js.map +1 -0
- package/dist/defi.cjs +2 -0
- package/dist/defi.cjs.map +1 -0
- package/dist/defi.js +14 -0
- package/dist/defi.js.map +1 -0
- package/dist/entries/api.d.ts +26 -0
- package/dist/entries/api.d.ts.map +1 -0
- package/dist/entries/bridge.d.ts +7 -0
- package/dist/entries/bridge.d.ts.map +1 -0
- package/dist/entries/btc.d.ts +11 -0
- package/dist/entries/btc.d.ts.map +1 -0
- package/dist/entries/contracts.d.ts +23 -0
- package/dist/entries/contracts.d.ts.map +1 -0
- package/dist/entries/core.d.ts +45 -0
- package/dist/entries/core.d.ts.map +1 -0
- package/dist/entries/debug.d.ts +9 -0
- package/dist/entries/debug.d.ts.map +1 -0
- package/dist/entries/defi.d.ts +7 -0
- package/dist/entries/defi.d.ts.map +1 -0
- package/dist/entries/evm.d.ts +17 -0
- package/dist/entries/evm.d.ts.map +1 -0
- package/dist/entries/metrics.d.ts +10 -0
- package/dist/entries/metrics.d.ts.map +1 -0
- package/dist/entries/utils.d.ts +21 -0
- package/dist/entries/utils.d.ts.map +1 -0
- package/dist/entries/vaults.d.ts +7 -0
- package/dist/entries/vaults.d.ts.map +1 -0
- package/dist/evm.cjs +2 -0
- package/dist/evm.cjs.map +1 -0
- package/dist/evm.js +48 -0
- package/dist/evm.js.map +1 -0
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +49 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +293 -267
- package/dist/index.js.map +1 -0
- package/dist/metrics.cjs +2 -0
- package/dist/metrics.cjs.map +1 -0
- package/dist/metrics.js +9 -0
- package/dist/metrics.js.map +1 -0
- package/dist/shared/errors.d.ts +14 -1
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/events.d.ts +25 -2
- package/dist/shared/events.d.ts.map +1 -1
- package/dist/tokens/token-addresses.d.ts +2 -2
- package/dist/tokens/token-addresses.d.ts.map +1 -1
- package/dist/utils.cjs +2 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.js +101 -0
- package/dist/utils.js.map +1 -0
- package/dist/vaults/lib/config.d.ts +1 -1
- package/dist/vaults.cjs +2 -0
- package/dist/vaults.cjs.map +1 -0
- package/dist/vaults.js +18 -0
- package/dist/vaults.js.map +1 -0
- package/package.json +98 -6
- package/dist/ccip.cjs +0 -1
- package/dist/ccip.js +0 -149
- package/dist/index2.cjs +0 -66
- package/dist/index2.js +0 -48300
|
@@ -0,0 +1,996 @@
|
|
|
1
|
+
var B = Object.defineProperty;
|
|
2
|
+
var R = (t, e, s) => e in t ? B(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var a = (t, e, s) => R(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import "axios";
|
|
5
|
+
import { a as H, b as U, L as d, x as A, C as h, y as S, N as i, z as I, q as o, A as D, D as y, F as f, P as m, G as C, H as _, f as F, I as K, J as G, K as V, M as Y, O as j, Q as $, T as q, l as z, h as W, U as X, W as J, v as Q } from "./statusConstants-ZJia15m2.js";
|
|
6
|
+
import { g as Z } from "./getUserStakeAndBakeSignature-2xPkL9v_.js";
|
|
7
|
+
import { d as P, k as ee, i as te, g as x, s as se, R as re } from "./ReferralsClient-JjWLlIO4.js";
|
|
8
|
+
import { s as ne, g as ae } from "./storeNetworkFeeSignature-BZUZOxns.js";
|
|
9
|
+
import { a as ie, B as oe } from "./BtcActions-DGqmtxjd.js";
|
|
10
|
+
import { a as ce, E as ue } from "./EvmActions-MW5mNmqs.js";
|
|
11
|
+
import { t as he } from "./satoshi-Ch6y8aYG.js";
|
|
12
|
+
import { p as k, r as u } from "./index-CfcQ_g3t.js";
|
|
13
|
+
import { g as de } from "./get-exchange-ratio-B0CNEGOB.js";
|
|
14
|
+
import { a as ge } from "./config-_8X_2sG4.js";
|
|
15
|
+
import { g as le, a as pe } from "./get-vault-withdrawals-CSQqKFB8.js";
|
|
16
|
+
const w = ["debug", "info", "warn", "error", "none"];
|
|
17
|
+
function ve(t = {}) {
|
|
18
|
+
const { level: e = "debug", prefix: s = "[Lombard SDK]", timestamp: r = !1 } = t, n = w.indexOf(e), l = (c) => w.indexOf(c) >= n && e !== "none", p = (c) => {
|
|
19
|
+
if (r) {
|
|
20
|
+
const g = (/* @__PURE__ */ new Date()).toISOString();
|
|
21
|
+
return `${s} ${g} ${c}`;
|
|
22
|
+
}
|
|
23
|
+
return `${s} ${c}`;
|
|
24
|
+
}, v = (c) => !c || Object.keys(c).length === 0 ? [] : [c];
|
|
25
|
+
return {
|
|
26
|
+
debug(c, g) {
|
|
27
|
+
l("debug") && console.debug(p(c), ...v(g));
|
|
28
|
+
},
|
|
29
|
+
info(c, g) {
|
|
30
|
+
l("info") && console.info(p(c), ...v(g));
|
|
31
|
+
},
|
|
32
|
+
warn(c, g) {
|
|
33
|
+
l("warn") && console.warn(p(c), ...v(g));
|
|
34
|
+
},
|
|
35
|
+
error(c, g) {
|
|
36
|
+
l("error") && console.error(p(c), ...v(g));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function Qe() {
|
|
41
|
+
return {
|
|
42
|
+
debug: () => {
|
|
43
|
+
},
|
|
44
|
+
info: () => {
|
|
45
|
+
},
|
|
46
|
+
warn: () => {
|
|
47
|
+
},
|
|
48
|
+
error: () => {
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function Ze() {
|
|
53
|
+
return {
|
|
54
|
+
"X-SDK-Version": U,
|
|
55
|
+
"X-SDK-Runtime": H
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
class fe {
|
|
59
|
+
constructor(e = k) {
|
|
60
|
+
/**
|
|
61
|
+
* Internal API version flag for future v2 migration.
|
|
62
|
+
* When v2 is ready, we can switch implementations transparently.
|
|
63
|
+
*/
|
|
64
|
+
a(this, "apiVersion", "v1");
|
|
65
|
+
this.env = e;
|
|
66
|
+
}
|
|
67
|
+
/* -------------------------------------------------------------------------- */
|
|
68
|
+
/* Deposits */
|
|
69
|
+
/* -------------------------------------------------------------------------- */
|
|
70
|
+
/**
|
|
71
|
+
* Fetch all deposits for an address.
|
|
72
|
+
*
|
|
73
|
+
* Returns deposits from both Direct BTC Deposits and Native Deposits APIs,
|
|
74
|
+
* unified into a single list sorted by block time (newest first).
|
|
75
|
+
*
|
|
76
|
+
* @param address - The EVM/BTC address to fetch deposits for
|
|
77
|
+
* @returns Promise resolving to array of Deposit objects
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const deposits = await sdk.api.deposits('0x1234...');
|
|
82
|
+
* deposits.forEach(d => {
|
|
83
|
+
* console.log(`${d.amount} BTC deposited at block ${d.blockHeight}`);
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
async deposits(e) {
|
|
88
|
+
return P({ address: e, env: this.env });
|
|
89
|
+
}
|
|
90
|
+
/* -------------------------------------------------------------------------- */
|
|
91
|
+
/* Unstakes */
|
|
92
|
+
/* -------------------------------------------------------------------------- */
|
|
93
|
+
/**
|
|
94
|
+
* Fetch all unstakes/redemptions for an address.
|
|
95
|
+
*
|
|
96
|
+
* Returns unstake records for both direct BTC unstakes and
|
|
97
|
+
* native blockchain redemptions.
|
|
98
|
+
*
|
|
99
|
+
* @param address - The address that initiated the unstakes
|
|
100
|
+
* @param options - Optional filters (show_redeems, show_unstakes, to_native)
|
|
101
|
+
* @returns Promise resolving to array of Unstake objects
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* // Get all unstakes
|
|
106
|
+
* const unstakes = await sdk.api.unstakes('0x1234...');
|
|
107
|
+
*
|
|
108
|
+
* // Get only native chain redemptions
|
|
109
|
+
* const redeems = await sdk.api.unstakes('0x1234...', { to_native: true });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
async unstakes(e, s) {
|
|
113
|
+
return ee({ address: e, env: this.env, options: s });
|
|
114
|
+
}
|
|
115
|
+
async points(e, s) {
|
|
116
|
+
return te({ address: e, env: this.env, season: s });
|
|
117
|
+
}
|
|
118
|
+
/* -------------------------------------------------------------------------- */
|
|
119
|
+
/* Token Exchange Ratios */
|
|
120
|
+
/* -------------------------------------------------------------------------- */
|
|
121
|
+
/**
|
|
122
|
+
* Fetch the current exchange ratios for all supported tokens.
|
|
123
|
+
*
|
|
124
|
+
* Returns Token:BTC and BTC:Token ratios for LBTC and other supported tokens.
|
|
125
|
+
* This is the recommended method for getting exchange rate information.
|
|
126
|
+
*
|
|
127
|
+
* @returns Promise resolving to exchange ratio info for each token
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* const ratios = await sdk.api.exchangeRatio();
|
|
132
|
+
*
|
|
133
|
+
* // Access LBTC ratios
|
|
134
|
+
* const lbtcRatio = ratios.LBTC;
|
|
135
|
+
* console.log(`LBTC:BTC = ${lbtcRatio.tokenBTCRatio}`); // How many LBTC per 1 BTC
|
|
136
|
+
* console.log(`BTC:LBTC = ${lbtcRatio.BTCTokenRatio}`); // How many BTC per 1 LBTC
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
async exchangeRatio() {
|
|
140
|
+
return de({ env: this.env });
|
|
141
|
+
}
|
|
142
|
+
/* -------------------------------------------------------------------------- */
|
|
143
|
+
/* Deposit Address */
|
|
144
|
+
/* -------------------------------------------------------------------------- */
|
|
145
|
+
/**
|
|
146
|
+
* Get an existing BTC deposit address for a recipient.
|
|
147
|
+
*
|
|
148
|
+
* Returns the most recent non-deprecated deposit address for the
|
|
149
|
+
* given recipient address and destination chain.
|
|
150
|
+
*
|
|
151
|
+
* @param address - The destination address where LBTC will be claimed
|
|
152
|
+
* @param chainId - The destination chain
|
|
153
|
+
* @param options - Optional partner ID and token type
|
|
154
|
+
* @returns Promise resolving to the BTC deposit address
|
|
155
|
+
* @throws Error if no deposit address found
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* try {
|
|
160
|
+
* const btcAddr = await sdk.api.depositAddress('0x1234...', ChainId.ethereum);
|
|
161
|
+
* console.log(`Send BTC to: ${btcAddr}`);
|
|
162
|
+
* } catch (e) {
|
|
163
|
+
* console.log('No deposit address found - need to generate one');
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
async depositAddress(e, s, r) {
|
|
168
|
+
return x({
|
|
169
|
+
address: e,
|
|
170
|
+
chainId: s,
|
|
171
|
+
env: this.env,
|
|
172
|
+
partnerId: r == null ? void 0 : r.partnerId,
|
|
173
|
+
token: r == null ? void 0 : r.token
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/* -------------------------------------------------------------------------- */
|
|
177
|
+
/* Vault Withdrawals */
|
|
178
|
+
/* -------------------------------------------------------------------------- */
|
|
179
|
+
/**
|
|
180
|
+
* Fetch all vault withdrawals for an address.
|
|
181
|
+
*
|
|
182
|
+
* Returns withdrawal objects categorized by status (cancelled, expired,
|
|
183
|
+
* fulfilled, open). If chainId is not provided, fetches from all supported chains.
|
|
184
|
+
*
|
|
185
|
+
* @param address - The address to fetch withdrawals for
|
|
186
|
+
* @param options - Optional filters (chainId, vault, rpcUrl)
|
|
187
|
+
* @returns Promise resolving to categorized vault withdrawals
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```ts
|
|
191
|
+
* // Get all withdrawals from all chains
|
|
192
|
+
* const result = await sdk.api.vaultWithdrawals('0x1234...');
|
|
193
|
+
* console.log(`Open: ${result.open.length}, Fulfilled: ${result.fulfilled.length}`);
|
|
194
|
+
*
|
|
195
|
+
* // Filter by specific chain
|
|
196
|
+
* const ethereumOnly = await sdk.api.vaultWithdrawals('0x1234...', {
|
|
197
|
+
* chainId: ChainId.ethereum,
|
|
198
|
+
* });
|
|
199
|
+
*
|
|
200
|
+
* // Display withdrawal info
|
|
201
|
+
* result.open.forEach(w => {
|
|
202
|
+
* console.log(`Amount: ${w.shareAmount.toFixed()}, Deadline: ${new Date(w.deadline * 1000)}`);
|
|
203
|
+
* });
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
async vaultWithdrawals(e, s) {
|
|
207
|
+
const r = e, n = (s == null ? void 0 : s.vault) ?? ge.Veda;
|
|
208
|
+
return s != null && s.chainId ? le({
|
|
209
|
+
account: r,
|
|
210
|
+
chainId: s.chainId,
|
|
211
|
+
vaultKey: n,
|
|
212
|
+
rpcUrl: s.rpcUrl,
|
|
213
|
+
env: this.env
|
|
214
|
+
}) : pe({
|
|
215
|
+
account: r,
|
|
216
|
+
vaultKey: n,
|
|
217
|
+
rpcUrl: s == null ? void 0 : s.rpcUrl
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/* -------------------------------------------------------------------------- */
|
|
221
|
+
/* Utility Methods */
|
|
222
|
+
/* -------------------------------------------------------------------------- */
|
|
223
|
+
/**
|
|
224
|
+
* Get the current API version being used.
|
|
225
|
+
*
|
|
226
|
+
* @returns The API version string ('v1' or 'v2')
|
|
227
|
+
*/
|
|
228
|
+
getApiVersion() {
|
|
229
|
+
return this.apiVersion;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function me(t) {
|
|
233
|
+
if (!t.env)
|
|
234
|
+
throw d.missingParameter("env");
|
|
235
|
+
const e = {
|
|
236
|
+
env: t.env,
|
|
237
|
+
providers: t.providers || {}
|
|
238
|
+
};
|
|
239
|
+
return t.partner && (Ce(t.partner), e.partner = t.partner), e;
|
|
240
|
+
}
|
|
241
|
+
function Ce(t) {
|
|
242
|
+
if (typeof t != "object" || t === null)
|
|
243
|
+
throw d.invalidConfiguration(
|
|
244
|
+
"Partner configuration must be an object"
|
|
245
|
+
);
|
|
246
|
+
const e = t;
|
|
247
|
+
if (!e.partnerId || typeof e.partnerId != "string")
|
|
248
|
+
throw d.missingParameter("partner.partnerId");
|
|
249
|
+
if (e.partnerId.trim().length === 0)
|
|
250
|
+
throw d.invalidConfiguration("Partner ID cannot be empty");
|
|
251
|
+
}
|
|
252
|
+
class Ee {
|
|
253
|
+
constructor(e) {
|
|
254
|
+
this.env = e;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Generate a new BTC deposit address
|
|
258
|
+
*/
|
|
259
|
+
async generateDepositAddress(e) {
|
|
260
|
+
return Z({
|
|
261
|
+
address: e.address,
|
|
262
|
+
chainId: e.chainId,
|
|
263
|
+
signature: e.signature,
|
|
264
|
+
token: e.token,
|
|
265
|
+
eip712Data: e.eip712Data,
|
|
266
|
+
signatureData: e.signatureData,
|
|
267
|
+
pubKey: e.pubKey,
|
|
268
|
+
env: this.env,
|
|
269
|
+
partnerId: e.partnerId,
|
|
270
|
+
referrerCode: e.referrerCode
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get existing deposit address for a recipient
|
|
275
|
+
*/
|
|
276
|
+
async getDepositAddress(e) {
|
|
277
|
+
try {
|
|
278
|
+
return await x({
|
|
279
|
+
address: e.address,
|
|
280
|
+
chainId: e.chainId,
|
|
281
|
+
token: e.token,
|
|
282
|
+
env: this.env,
|
|
283
|
+
partnerId: e.partnerId
|
|
284
|
+
}) || void 0;
|
|
285
|
+
} catch {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Get deposits for an address
|
|
291
|
+
*/
|
|
292
|
+
async getDeposits(e) {
|
|
293
|
+
return (await P({
|
|
294
|
+
address: e,
|
|
295
|
+
env: this.env
|
|
296
|
+
})).map((r) => {
|
|
297
|
+
var n;
|
|
298
|
+
return {
|
|
299
|
+
depositAddress: r.depositAddress ?? "",
|
|
300
|
+
blockHeight: r.blockHeight,
|
|
301
|
+
isClaimed: r.isClaimed,
|
|
302
|
+
txid: r.txHash,
|
|
303
|
+
amount: (n = r.amount) == null ? void 0 : n.toString()
|
|
304
|
+
};
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Store network fee signature
|
|
309
|
+
*/
|
|
310
|
+
async storeFeeSignature(e) {
|
|
311
|
+
await ne({
|
|
312
|
+
address: e.address,
|
|
313
|
+
signature: e.signature,
|
|
314
|
+
typedData: e.typedData,
|
|
315
|
+
env: this.env,
|
|
316
|
+
tokenAddress: e.tokenAddress
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Get stored network fee signature
|
|
321
|
+
*/
|
|
322
|
+
async getFeeSignature(e) {
|
|
323
|
+
return ae({
|
|
324
|
+
address: e.address,
|
|
325
|
+
chainId: e.chainId,
|
|
326
|
+
env: this.env,
|
|
327
|
+
tokenAddress: e.tokenAddress
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Store stake and bake signature
|
|
332
|
+
*/
|
|
333
|
+
async storeStakeAndBakeSignature(e) {
|
|
334
|
+
await se({
|
|
335
|
+
signature: e.signature,
|
|
336
|
+
typedData: e.typedData,
|
|
337
|
+
env: this.env
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
function Ae() {
|
|
342
|
+
return {
|
|
343
|
+
id: "api",
|
|
344
|
+
register(t) {
|
|
345
|
+
return new Ee(t.env);
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
function Se(t) {
|
|
350
|
+
const e = /* @__PURE__ */ new Map(), s = [ie(), ce(), Ae()];
|
|
351
|
+
for (const r of s)
|
|
352
|
+
e.set(r.id, r);
|
|
353
|
+
if (t)
|
|
354
|
+
for (const r of t)
|
|
355
|
+
e.set(r.id, r);
|
|
356
|
+
return Array.from(e.values());
|
|
357
|
+
}
|
|
358
|
+
function Ie(t, e) {
|
|
359
|
+
for (const s of t)
|
|
360
|
+
for (const r of s.requiresProviders ?? [])
|
|
361
|
+
if (!De(e, r))
|
|
362
|
+
throw d.providerMissing(r, r);
|
|
363
|
+
}
|
|
364
|
+
function De(t, e) {
|
|
365
|
+
var s;
|
|
366
|
+
return !!((s = t.providers) != null && s[e]);
|
|
367
|
+
}
|
|
368
|
+
function ye(t) {
|
|
369
|
+
const e = me(t), s = Se(
|
|
370
|
+
t.modules
|
|
371
|
+
);
|
|
372
|
+
Ie(s, e);
|
|
373
|
+
let r = t.logger;
|
|
374
|
+
return !r && t.debug && (r = ve({ level: "debug" })), {
|
|
375
|
+
...e,
|
|
376
|
+
modules: s,
|
|
377
|
+
logger: r
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
const N = {
|
|
381
|
+
routes: [
|
|
382
|
+
// Production: Solana Mainnet → Bitcoin Mainnet
|
|
383
|
+
{
|
|
384
|
+
sourceChains: [h.SOLANA_MAINNET],
|
|
385
|
+
destChain: h.BITCOIN_MAINNET,
|
|
386
|
+
envs: [u.prod]
|
|
387
|
+
},
|
|
388
|
+
// Testnet: Solana Devnet → Bitcoin Signet
|
|
389
|
+
{
|
|
390
|
+
sourceChains: [h.SOLANA_DEVNET],
|
|
391
|
+
destChain: h.BITCOIN_SIGNET,
|
|
392
|
+
envs: [u.testnet, u.stage, u.dev, u.ibc]
|
|
393
|
+
}
|
|
394
|
+
],
|
|
395
|
+
recipientSchema: A
|
|
396
|
+
};
|
|
397
|
+
function we(t, e) {
|
|
398
|
+
return N.routes.some(
|
|
399
|
+
(s) => s.sourceChains.includes(t) && s.envs.includes(e)
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
function _e(t) {
|
|
403
|
+
switch (t) {
|
|
404
|
+
case "prod":
|
|
405
|
+
return "mainnet-beta";
|
|
406
|
+
case "testnet":
|
|
407
|
+
return "testnet";
|
|
408
|
+
case "stage":
|
|
409
|
+
case "dev":
|
|
410
|
+
case "ibc":
|
|
411
|
+
default:
|
|
412
|
+
return "devnet";
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
class Pe extends S {
|
|
416
|
+
constructor(s, r) {
|
|
417
|
+
super(i.IDLE);
|
|
418
|
+
a(this, "_amount");
|
|
419
|
+
a(this, "_recipient");
|
|
420
|
+
a(this, "_txHash");
|
|
421
|
+
a(this, "env");
|
|
422
|
+
if (this.ctx = s, this.params = r, this.env = s.env, !we(r.sourceChain, this.env))
|
|
423
|
+
throw d.routeNotFound({
|
|
424
|
+
assetOut: r.assetOut,
|
|
425
|
+
sourceChain: r.sourceChain,
|
|
426
|
+
destChain: r.destChain,
|
|
427
|
+
env: this.env
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
get amount() {
|
|
431
|
+
return this._amount;
|
|
432
|
+
}
|
|
433
|
+
get recipient() {
|
|
434
|
+
return this._recipient;
|
|
435
|
+
}
|
|
436
|
+
get txHash() {
|
|
437
|
+
return this._txHash;
|
|
438
|
+
}
|
|
439
|
+
async prepare(s) {
|
|
440
|
+
return this.assertStatus(i.IDLE, "prepare"), this.act(async () => {
|
|
441
|
+
const r = I(this.prepareSchema, s, {
|
|
442
|
+
destChain: this.params.destChain
|
|
443
|
+
});
|
|
444
|
+
this._amount = r.amount, this._recipient = r.recipient, this.emitProgress({
|
|
445
|
+
status: i.READY,
|
|
446
|
+
steps: { burning: o.IDLE, releasing: o.IDLE }
|
|
447
|
+
});
|
|
448
|
+
}, i.READY);
|
|
449
|
+
}
|
|
450
|
+
async execute() {
|
|
451
|
+
return this.assertStatus(i.READY, "execute"), this.act(async () => {
|
|
452
|
+
const s = this._amount, r = this._recipient;
|
|
453
|
+
if (!s || !r)
|
|
454
|
+
throw d.missingParameter("amount or recipient");
|
|
455
|
+
this.emitProgress({
|
|
456
|
+
status: i.READY,
|
|
457
|
+
steps: { burning: o.PENDING, releasing: o.IDLE }
|
|
458
|
+
});
|
|
459
|
+
const n = he(s).toString(), l = _e(this.env), { txHash: p } = await this.ctx.solana.unstake({
|
|
460
|
+
amount: n,
|
|
461
|
+
btcAddress: r,
|
|
462
|
+
network: l
|
|
463
|
+
});
|
|
464
|
+
return this._txHash = p, this.emitProgress({
|
|
465
|
+
status: i.COMPLETED,
|
|
466
|
+
steps: { burning: o.COMPLETE, releasing: o.PENDING }
|
|
467
|
+
}), this.emitCompleted(), { txHash: p };
|
|
468
|
+
}, i.COMPLETED);
|
|
469
|
+
}
|
|
470
|
+
get prepareSchema() {
|
|
471
|
+
return D({
|
|
472
|
+
amount: y,
|
|
473
|
+
recipient: N.recipientSchema
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
function xe(t) {
|
|
478
|
+
const s = new f(t.modules, t).require("solana");
|
|
479
|
+
return {
|
|
480
|
+
env: t.env,
|
|
481
|
+
partner: new m(t.partner),
|
|
482
|
+
getProvider: async (r) => {
|
|
483
|
+
const n = C(t.providers, r);
|
|
484
|
+
if (n)
|
|
485
|
+
return n();
|
|
486
|
+
},
|
|
487
|
+
solana: s
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
class b {
|
|
491
|
+
constructor(e) {
|
|
492
|
+
a(this, "_ctx", null);
|
|
493
|
+
this.config = e;
|
|
494
|
+
}
|
|
495
|
+
get ctx() {
|
|
496
|
+
return this._ctx || (this._ctx = xe(this.config)), this._ctx;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Unstake LBTC → BTC
|
|
500
|
+
*
|
|
501
|
+
* Burns LBTC on Solana and releases BTC on Bitcoin.
|
|
502
|
+
*
|
|
503
|
+
* @throws LombardError if solana module is not registered
|
|
504
|
+
*/
|
|
505
|
+
unstake(e) {
|
|
506
|
+
return new Pe(this.ctx, e);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
function et(t) {
|
|
510
|
+
return new b(t);
|
|
511
|
+
}
|
|
512
|
+
const T = {
|
|
513
|
+
routes: [
|
|
514
|
+
{
|
|
515
|
+
sourceChains: [h.STARKNET_MAINNET],
|
|
516
|
+
destChain: h.BITCOIN_MAINNET,
|
|
517
|
+
envs: [u.prod]
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
sourceChains: [h.STARKNET_SEPOLIA],
|
|
521
|
+
destChain: h.BITCOIN_SIGNET,
|
|
522
|
+
envs: [u.testnet, u.stage, u.dev, u.ibc]
|
|
523
|
+
}
|
|
524
|
+
],
|
|
525
|
+
recipientSchema: A
|
|
526
|
+
};
|
|
527
|
+
function ke(t, e) {
|
|
528
|
+
return T.routes.some(
|
|
529
|
+
(s) => s.sourceChains.includes(t) && s.envs.includes(e)
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
class Ne extends S {
|
|
533
|
+
constructor(s, r) {
|
|
534
|
+
super(i.IDLE);
|
|
535
|
+
a(this, "_amount");
|
|
536
|
+
a(this, "_recipient");
|
|
537
|
+
a(this, "_txHash");
|
|
538
|
+
a(this, "env");
|
|
539
|
+
if (this.ctx = s, this.params = r, this.env = s.env, !ke(r.sourceChain, this.env))
|
|
540
|
+
throw d.routeNotFound({
|
|
541
|
+
assetOut: r.assetOut,
|
|
542
|
+
sourceChain: r.sourceChain,
|
|
543
|
+
destChain: r.destChain,
|
|
544
|
+
env: this.env
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
get amount() {
|
|
548
|
+
return this._amount;
|
|
549
|
+
}
|
|
550
|
+
get recipient() {
|
|
551
|
+
return this._recipient;
|
|
552
|
+
}
|
|
553
|
+
get txHash() {
|
|
554
|
+
return this._txHash;
|
|
555
|
+
}
|
|
556
|
+
async prepare(s) {
|
|
557
|
+
return this.assertStatus(i.IDLE, "prepare"), this.act(async () => {
|
|
558
|
+
const r = I(this.prepareSchema, s, {
|
|
559
|
+
destChain: this.params.destChain
|
|
560
|
+
});
|
|
561
|
+
this._amount = r.amount, this._recipient = r.recipient, this.emitProgress({
|
|
562
|
+
status: i.READY,
|
|
563
|
+
steps: { burning: o.IDLE, releasing: o.IDLE }
|
|
564
|
+
});
|
|
565
|
+
}, i.READY);
|
|
566
|
+
}
|
|
567
|
+
async execute() {
|
|
568
|
+
return this.assertStatus(i.READY, "execute"), this.act(async () => {
|
|
569
|
+
const s = this._amount, r = this._recipient;
|
|
570
|
+
if (!s || !r)
|
|
571
|
+
throw d.missingParameter("amount or recipient");
|
|
572
|
+
this.emitProgress({
|
|
573
|
+
status: i.READY,
|
|
574
|
+
steps: { burning: o.PENDING, releasing: o.IDLE }
|
|
575
|
+
});
|
|
576
|
+
const { txHash: n } = await this.ctx.starknet.unstake({
|
|
577
|
+
amount: s,
|
|
578
|
+
btcAddress: r,
|
|
579
|
+
env: this.env
|
|
580
|
+
});
|
|
581
|
+
return this._txHash = n, this.emitProgress({
|
|
582
|
+
status: i.COMPLETED,
|
|
583
|
+
steps: { burning: o.COMPLETE, releasing: o.PENDING }
|
|
584
|
+
}), this.emitCompleted(), { txHash: n };
|
|
585
|
+
}, i.COMPLETED);
|
|
586
|
+
}
|
|
587
|
+
get prepareSchema() {
|
|
588
|
+
return D({
|
|
589
|
+
amount: y,
|
|
590
|
+
recipient: T.recipientSchema
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
function be(t) {
|
|
595
|
+
const s = new f(t.modules, t).require("starknet");
|
|
596
|
+
return {
|
|
597
|
+
env: t.env,
|
|
598
|
+
partner: new m(t.partner),
|
|
599
|
+
getProvider: async (r) => {
|
|
600
|
+
const n = C(t.providers, r);
|
|
601
|
+
if (n)
|
|
602
|
+
return n();
|
|
603
|
+
},
|
|
604
|
+
starknet: s
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
class L {
|
|
608
|
+
constructor(e) {
|
|
609
|
+
a(this, "_ctx", null);
|
|
610
|
+
this.config = e;
|
|
611
|
+
}
|
|
612
|
+
get ctx() {
|
|
613
|
+
return this._ctx || (this._ctx = be(this.config)), this._ctx;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Unstake LBTC → BTC
|
|
617
|
+
*
|
|
618
|
+
* Burns LBTC on Starknet and releases BTC on Bitcoin.
|
|
619
|
+
*
|
|
620
|
+
* @throws LombardError if starknet module is not registered
|
|
621
|
+
*/
|
|
622
|
+
unstake(e) {
|
|
623
|
+
return new Ne(this.ctx, e);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
function tt(t) {
|
|
627
|
+
return new L(t);
|
|
628
|
+
}
|
|
629
|
+
const M = {
|
|
630
|
+
routes: [
|
|
631
|
+
{
|
|
632
|
+
sourceChains: [h.SUI_MAINNET],
|
|
633
|
+
destChain: h.BITCOIN_MAINNET,
|
|
634
|
+
envs: [u.prod]
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
sourceChains: [h.SUI_TESTNET],
|
|
638
|
+
destChain: h.BITCOIN_SIGNET,
|
|
639
|
+
envs: [u.testnet, u.stage, u.dev, u.ibc]
|
|
640
|
+
}
|
|
641
|
+
],
|
|
642
|
+
recipientSchema: A
|
|
643
|
+
};
|
|
644
|
+
function Te(t, e) {
|
|
645
|
+
return M.routes.some(
|
|
646
|
+
(s) => s.sourceChains.includes(t) && s.envs.includes(e)
|
|
647
|
+
);
|
|
648
|
+
}
|
|
649
|
+
function Le(t) {
|
|
650
|
+
switch (t) {
|
|
651
|
+
case h.SUI_MAINNET:
|
|
652
|
+
return "sui:mainnet";
|
|
653
|
+
case h.SUI_TESTNET:
|
|
654
|
+
return "sui:testnet";
|
|
655
|
+
default:
|
|
656
|
+
return "sui:testnet";
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
class Me extends S {
|
|
660
|
+
constructor(s, r) {
|
|
661
|
+
super(i.IDLE);
|
|
662
|
+
a(this, "_amount");
|
|
663
|
+
a(this, "_recipient");
|
|
664
|
+
a(this, "_txHash");
|
|
665
|
+
a(this, "env");
|
|
666
|
+
if (this.ctx = s, this.params = r, this.env = s.env, !Te(r.sourceChain, this.env))
|
|
667
|
+
throw d.routeNotFound({
|
|
668
|
+
assetOut: r.assetOut,
|
|
669
|
+
sourceChain: r.sourceChain,
|
|
670
|
+
destChain: r.destChain,
|
|
671
|
+
env: this.env
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
get amount() {
|
|
675
|
+
return this._amount;
|
|
676
|
+
}
|
|
677
|
+
get recipient() {
|
|
678
|
+
return this._recipient;
|
|
679
|
+
}
|
|
680
|
+
get txHash() {
|
|
681
|
+
return this._txHash;
|
|
682
|
+
}
|
|
683
|
+
async prepare(s) {
|
|
684
|
+
return this.assertStatus(i.IDLE, "prepare"), this.act(async () => {
|
|
685
|
+
const r = I(this.prepareSchema, s, {
|
|
686
|
+
destChain: this.params.destChain
|
|
687
|
+
});
|
|
688
|
+
this._amount = r.amount, this._recipient = r.recipient, this.emitProgress({
|
|
689
|
+
status: i.READY,
|
|
690
|
+
steps: { burning: o.IDLE, releasing: o.IDLE }
|
|
691
|
+
});
|
|
692
|
+
}, i.READY);
|
|
693
|
+
}
|
|
694
|
+
async execute() {
|
|
695
|
+
return this.assertStatus(i.READY, "execute"), this.act(async () => {
|
|
696
|
+
const s = this._amount, r = this._recipient;
|
|
697
|
+
if (!s || !r)
|
|
698
|
+
throw d.missingParameter("amount or recipient");
|
|
699
|
+
this.emitProgress({
|
|
700
|
+
status: i.READY,
|
|
701
|
+
steps: { burning: o.PENDING, releasing: o.IDLE }
|
|
702
|
+
});
|
|
703
|
+
const n = Le(this.params.sourceChain), { txHash: l } = await this.ctx.sui.unstake({
|
|
704
|
+
amount: s,
|
|
705
|
+
btcAddress: r,
|
|
706
|
+
chainId: n,
|
|
707
|
+
env: this.env
|
|
708
|
+
});
|
|
709
|
+
return this._txHash = l, this.emitProgress({
|
|
710
|
+
status: i.COMPLETED,
|
|
711
|
+
steps: { burning: o.COMPLETE, releasing: o.PENDING }
|
|
712
|
+
}), this.emitCompleted(), { txHash: l };
|
|
713
|
+
}, i.COMPLETED);
|
|
714
|
+
}
|
|
715
|
+
get prepareSchema() {
|
|
716
|
+
return D({
|
|
717
|
+
amount: y,
|
|
718
|
+
recipient: M.recipientSchema
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
function Oe(t) {
|
|
723
|
+
const s = new f(t.modules, t).require("sui");
|
|
724
|
+
return {
|
|
725
|
+
env: t.env,
|
|
726
|
+
partner: new m(t.partner),
|
|
727
|
+
getProvider: async (r) => {
|
|
728
|
+
const n = C(t.providers, r);
|
|
729
|
+
if (n)
|
|
730
|
+
return n();
|
|
731
|
+
},
|
|
732
|
+
sui: s
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
class O {
|
|
736
|
+
constructor(e) {
|
|
737
|
+
a(this, "_ctx", null);
|
|
738
|
+
this.config = e;
|
|
739
|
+
}
|
|
740
|
+
get ctx() {
|
|
741
|
+
return this._ctx || (this._ctx = Oe(this.config)), this._ctx;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Unstake LBTC → BTC
|
|
745
|
+
*
|
|
746
|
+
* Burns LBTC on Sui and releases BTC on Bitcoin.
|
|
747
|
+
*
|
|
748
|
+
* @throws LombardError if sui module is not registered
|
|
749
|
+
*/
|
|
750
|
+
unstake(e) {
|
|
751
|
+
return new Me(this.ctx, e);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
function st(t) {
|
|
755
|
+
return new O(t);
|
|
756
|
+
}
|
|
757
|
+
class Be {
|
|
758
|
+
constructor(e = k, s) {
|
|
759
|
+
a(this, "catalog");
|
|
760
|
+
this.env = e, this.catalog = s ?? _;
|
|
761
|
+
}
|
|
762
|
+
/** Get token contract address */
|
|
763
|
+
getAddress(e, s) {
|
|
764
|
+
return F(e, this.env, s, this.catalog);
|
|
765
|
+
}
|
|
766
|
+
/** Get token decimals */
|
|
767
|
+
getDecimals(e) {
|
|
768
|
+
return K(e, this.catalog);
|
|
769
|
+
}
|
|
770
|
+
/** Get asset metadata (decimals, symbol, name) */
|
|
771
|
+
getMetadata(e) {
|
|
772
|
+
return G(e, this.catalog);
|
|
773
|
+
}
|
|
774
|
+
/** Check if asset uses an asset router contract */
|
|
775
|
+
usesAssetRouter(e, s) {
|
|
776
|
+
return V(e, this.env, s, this.catalog);
|
|
777
|
+
}
|
|
778
|
+
/** Get asset router contract address */
|
|
779
|
+
getAssetRouter(e, s) {
|
|
780
|
+
return Y(e, this.env, s, this.catalog);
|
|
781
|
+
}
|
|
782
|
+
/** Get bridge adapter address */
|
|
783
|
+
getBridgeAdapter(e, s) {
|
|
784
|
+
return j(e, this.env, s, this.catalog);
|
|
785
|
+
}
|
|
786
|
+
/** Get public market maker address */
|
|
787
|
+
getPublicMarketMaker(e, s) {
|
|
788
|
+
return $(e, this.env, s, this.catalog);
|
|
789
|
+
}
|
|
790
|
+
/** Find asset by contract address (reverse lookup) */
|
|
791
|
+
getByAddress(e, s) {
|
|
792
|
+
return q(e, this.env, s, this.catalog);
|
|
793
|
+
}
|
|
794
|
+
/** Check if asset is deployed on a chain */
|
|
795
|
+
isDeployed(e, s) {
|
|
796
|
+
return z(e, this.env, s, this.catalog);
|
|
797
|
+
}
|
|
798
|
+
/** Get all chains where asset is deployed */
|
|
799
|
+
getChains(e) {
|
|
800
|
+
return W(e, this.env, this.catalog);
|
|
801
|
+
}
|
|
802
|
+
/** Get all environments where asset is deployed on a chain */
|
|
803
|
+
getEnvironments(e, s) {
|
|
804
|
+
return X(e, s, this.catalog);
|
|
805
|
+
}
|
|
806
|
+
/** Get all supported assets */
|
|
807
|
+
getSupportedAssets() {
|
|
808
|
+
return J(this.catalog);
|
|
809
|
+
}
|
|
810
|
+
/** Direct access to the asset catalog */
|
|
811
|
+
getCatalog() {
|
|
812
|
+
return this.catalog;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
class Re {
|
|
816
|
+
constructor(e) {
|
|
817
|
+
a(this, "config");
|
|
818
|
+
a(this, "env");
|
|
819
|
+
/** Partner configuration manager */
|
|
820
|
+
a(this, "partnerConfig");
|
|
821
|
+
/** Provider cache */
|
|
822
|
+
a(this, "providerCache", /* @__PURE__ */ new Map());
|
|
823
|
+
/**
|
|
824
|
+
* Chain actions (user-facing API)
|
|
825
|
+
*
|
|
826
|
+
* Access operations for each supported chain:
|
|
827
|
+
* - btc: Bitcoin operations (stake, stakeAndDeploy, deposit)
|
|
828
|
+
* - evm: EVM operations (deposit, stake, unstake, deploy, redeem)
|
|
829
|
+
* - solana: Solana operations (unstake)
|
|
830
|
+
* - sui: Sui operations (unstake)
|
|
831
|
+
* - starknet: Starknet operations (unstake)
|
|
832
|
+
*/
|
|
833
|
+
a(this, "chain");
|
|
834
|
+
a(this, "assets");
|
|
835
|
+
/**
|
|
836
|
+
* API namespace for data-fetching operations
|
|
837
|
+
*
|
|
838
|
+
* Provides convenient access to Lombard API read operations:
|
|
839
|
+
* - deposits: Fetch deposit history
|
|
840
|
+
* - unstakes: Fetch unstake/redemption history
|
|
841
|
+
* - points: Fetch Lux points
|
|
842
|
+
* - exchangeRatio: Get exchange ratios for all supported tokens
|
|
843
|
+
* - depositAddress: Get existing BTC deposit address
|
|
844
|
+
*/
|
|
845
|
+
a(this, "api");
|
|
846
|
+
/** Feature clients */
|
|
847
|
+
a(this, "referrals");
|
|
848
|
+
/** Capability registry (manages optional module services) */
|
|
849
|
+
a(this, "capabilities");
|
|
850
|
+
this.config = e, this.env = e.env, this.partnerConfig = new m(e.partner), this.capabilities = new f(
|
|
851
|
+
this.config.modules,
|
|
852
|
+
this.config
|
|
853
|
+
), this.chain = {
|
|
854
|
+
btc: new oe(this.config),
|
|
855
|
+
evm: new ue(this.config),
|
|
856
|
+
solana: new b(this.config),
|
|
857
|
+
sui: new O(this.config),
|
|
858
|
+
starknet: new L(this.config)
|
|
859
|
+
}, this.referrals = new re(this), this.assets = new Be(this.env), this.api = new fe(this.env);
|
|
860
|
+
}
|
|
861
|
+
async getProvider(e) {
|
|
862
|
+
const s = e;
|
|
863
|
+
if (this.providerCache.has(s))
|
|
864
|
+
return this.providerCache.get(s);
|
|
865
|
+
const r = C(this.config.providers, e);
|
|
866
|
+
if (!r)
|
|
867
|
+
throw d.providerMissing(e, e);
|
|
868
|
+
const n = await r();
|
|
869
|
+
if (!n)
|
|
870
|
+
throw new d(
|
|
871
|
+
Q.PROVIDER_INITIALIZATION_FAILED,
|
|
872
|
+
`Failed to initialize ${e} provider`
|
|
873
|
+
);
|
|
874
|
+
return this.providerCache.set(s, n), n;
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Configure partner settings
|
|
878
|
+
*
|
|
879
|
+
* @param config - Partner configuration
|
|
880
|
+
*/
|
|
881
|
+
configure(e) {
|
|
882
|
+
this.partnerConfig.update(e);
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Register a custom asset
|
|
886
|
+
*
|
|
887
|
+
* TODO: Implement asset registration
|
|
888
|
+
*/
|
|
889
|
+
registerAsset(e) {
|
|
890
|
+
throw new Error("Not implemented yet");
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Get partner configuration
|
|
894
|
+
*/
|
|
895
|
+
getPartnerConfig() {
|
|
896
|
+
return this.partnerConfig;
|
|
897
|
+
}
|
|
898
|
+
getPartnerId() {
|
|
899
|
+
return this.partnerConfig.getPartnerId();
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
const E = /* @__PURE__ */ new Map();
|
|
903
|
+
function He(t) {
|
|
904
|
+
return E.has(t) || E.set(t, Promise.resolve(_)), E.get(t);
|
|
905
|
+
}
|
|
906
|
+
async function rt(t) {
|
|
907
|
+
const e = "modules" in t && Array.isArray(t.modules) ? t : ye(t), s = await He(e.env), r = {
|
|
908
|
+
...e,
|
|
909
|
+
catalog: s
|
|
910
|
+
};
|
|
911
|
+
return new Re(r);
|
|
912
|
+
}
|
|
913
|
+
function nt(t) {
|
|
914
|
+
return typeof t == "object" && t !== null && "request" in t && typeof t.request == "function";
|
|
915
|
+
}
|
|
916
|
+
function at(t) {
|
|
917
|
+
return typeof t == "object" && t !== null && "getAddresses" in t && typeof t.getAddresses == "function";
|
|
918
|
+
}
|
|
919
|
+
function it(t) {
|
|
920
|
+
return typeof t == "object" && t !== null && "publicKey" in t && "signAndSendTransaction" in t;
|
|
921
|
+
}
|
|
922
|
+
function ot(t) {
|
|
923
|
+
return typeof t == "object" && t !== null && "getAddress" in t && "signAndExecuteTransactionBlock" in t;
|
|
924
|
+
}
|
|
925
|
+
function ct(t) {
|
|
926
|
+
return typeof t == "object" && t !== null && "address" in t && "execute" in t;
|
|
927
|
+
}
|
|
928
|
+
const ut = {
|
|
929
|
+
/** Progress update with detailed step information */
|
|
930
|
+
Progress: "progress",
|
|
931
|
+
/** Status change (e.g., 'idle' → 'preparing' → 'ready') */
|
|
932
|
+
StatusChange: "status-change",
|
|
933
|
+
/** Operation completed successfully */
|
|
934
|
+
Completed: "completed",
|
|
935
|
+
/** Operation failed */
|
|
936
|
+
Failed: "failed",
|
|
937
|
+
/** Error occurred */
|
|
938
|
+
Error: "error"
|
|
939
|
+
}, ht = {
|
|
940
|
+
Progress: "progress",
|
|
941
|
+
StatusChange: "status-change",
|
|
942
|
+
Completed: "completed",
|
|
943
|
+
Failed: "failed",
|
|
944
|
+
Error: "error"
|
|
945
|
+
}, dt = {
|
|
946
|
+
Progress: "progress",
|
|
947
|
+
StatusChange: "status-change",
|
|
948
|
+
Completed: "completed",
|
|
949
|
+
Failed: "failed",
|
|
950
|
+
Error: "error"
|
|
951
|
+
}, gt = {
|
|
952
|
+
Progress: "progress",
|
|
953
|
+
StatusChange: "status-change",
|
|
954
|
+
Completed: "completed",
|
|
955
|
+
Failed: "failed",
|
|
956
|
+
Error: "error"
|
|
957
|
+
}, lt = {
|
|
958
|
+
Progress: "progress",
|
|
959
|
+
StatusChange: "status-change",
|
|
960
|
+
Completed: "completed",
|
|
961
|
+
Failed: "failed",
|
|
962
|
+
Error: "error"
|
|
963
|
+
}, pt = {
|
|
964
|
+
Progress: "progress",
|
|
965
|
+
StatusChange: "status-change",
|
|
966
|
+
Completed: "completed",
|
|
967
|
+
Failed: "failed",
|
|
968
|
+
Error: "error"
|
|
969
|
+
};
|
|
970
|
+
export {
|
|
971
|
+
fe as A,
|
|
972
|
+
pt as B,
|
|
973
|
+
lt as D,
|
|
974
|
+
Re as L,
|
|
975
|
+
dt as R,
|
|
976
|
+
b as S,
|
|
977
|
+
gt as U,
|
|
978
|
+
Qe as a,
|
|
979
|
+
ye as b,
|
|
980
|
+
ve as c,
|
|
981
|
+
rt as d,
|
|
982
|
+
L as e,
|
|
983
|
+
tt as f,
|
|
984
|
+
Ze as g,
|
|
985
|
+
O as h,
|
|
986
|
+
st as i,
|
|
987
|
+
at as j,
|
|
988
|
+
nt as k,
|
|
989
|
+
it as l,
|
|
990
|
+
ct as m,
|
|
991
|
+
ot as n,
|
|
992
|
+
ht as o,
|
|
993
|
+
ut as p,
|
|
994
|
+
et as s
|
|
995
|
+
};
|
|
996
|
+
//# sourceMappingURL=events-CLVUaKQS.js.map
|