@lombard.finance/sdk 4.7.2 → 5.0.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 +83 -2
- package/README.md +22 -21
- package/dist/api-functions/generateDepositBtcAddress/generateDepositBtcAddress.d.ts.map +1 -1
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddress.d.ts.map +1 -1
- package/dist/api.js +5 -5
- package/dist/bridge.js +1 -1
- package/dist/btc.cjs +1 -1
- package/dist/btc.js +2 -2
- package/dist/chains/btc/actions/deposit/BtcDeposit.d.ts.map +1 -1
- package/dist/chains/btc/actions/deposit/config/evm.d.ts.map +1 -1
- package/dist/chains/btc/actions/deposit/config/solana.d.ts.map +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/config/index.d.ts.map +1 -1
- package/dist/chains/btc/actions/depositAndDeploy/types.d.ts.map +1 -1
- package/dist/chains/btc/actions/stake/BtcStake.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/solana.d.ts.map +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/config/index.d.ts.map +1 -1
- package/dist/chains/btc/actions/stakeAndDeploy/types.d.ts.map +1 -1
- package/dist/chains/btc/client/getCurrentBlockHeight.d.ts.map +1 -1
- package/dist/chains/evm/actions/deploy/EvmDeploy.d.ts +19 -4
- package/dist/chains/evm/actions/deploy/EvmDeploy.d.ts.map +1 -1
- package/dist/chains/evm/actions/deploy/index.d.ts.map +1 -1
- package/dist/chains/evm/actions/deploy/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/deposit/config/evm.d.ts.map +1 -1
- package/dist/chains/evm/actions/deposit/index.d.ts.map +1 -1
- package/dist/chains/evm/actions/redeem/EvmRedeem.d.ts.map +1 -1
- package/dist/chains/evm/actions/redeem/config/evm.d.ts.map +1 -1
- package/dist/chains/evm/actions/redeem/index.d.ts.map +1 -1
- package/dist/chains/evm/actions/redeem/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/stake/config/index.d.ts.map +1 -1
- package/dist/chains/evm/actions/stake/config/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/stake/index.d.ts.map +1 -1
- package/dist/chains/evm/actions/stake/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/unstake/EvmUnstake.d.ts.map +1 -1
- package/dist/chains/evm/actions/unstake/index.d.ts.map +1 -1
- package/dist/chains/evm/actions/unstake/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/withdraw/EvmCancelWithdraw.d.ts.map +1 -1
- package/dist/chains/evm/actions/withdraw/EvmWithdraw.d.ts +6 -0
- package/dist/chains/evm/actions/withdraw/EvmWithdraw.d.ts.map +1 -1
- package/dist/chains/evm/actions/withdraw/config/types.d.ts.map +1 -1
- package/dist/chains/evm/actions/withdraw/types.d.ts.map +1 -1
- package/dist/chains/solana/SolanaActions.d.ts.map +1 -1
- package/dist/chains/solana/actions/redeem/SolanaRedeem.d.ts.map +1 -1
- package/dist/chains/solana/actions/redeem/types.d.ts.map +1 -1
- package/dist/chains/solana/actions/stake/SolanaStake.d.ts.map +1 -1
- package/dist/chains/solana/actions/stake/types.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/SolanaUnstake.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/factory.d.ts.map +1 -1
- package/dist/chains/solana/actions/unstake/types.d.ts.map +1 -1
- package/dist/chains/solana/utils.d.ts.map +1 -1
- package/dist/chains/starknet/actions/unstake/config/index.d.ts.map +1 -1
- package/dist/chains/starknet/actions/unstake/factory.d.ts.map +1 -1
- package/dist/chains/starknet/actions/unstake/types.d.ts.map +1 -1
- package/dist/chains/sui/actions/unstake/config/index.d.ts.map +1 -1
- package/dist/chains/sui/actions/unstake/factory.d.ts.map +1 -1
- package/dist/chains/sui/actions/unstake/types.d.ts.map +1 -1
- package/dist/chunks/{BtcActions-Ds6YrAKZ.js → BtcActions-CFGiDxtv.js} +20 -22
- package/dist/chunks/BtcActions-CFGiDxtv.js.map +1 -0
- package/dist/chunks/BtcActions-DJJmmyzi.cjs +2 -0
- package/dist/chunks/BtcActions-DJJmmyzi.cjs.map +1 -0
- package/dist/chunks/EvmActions-CUKBeiUw.js +1508 -0
- package/dist/chunks/EvmActions-CUKBeiUw.js.map +1 -0
- package/dist/chunks/EvmActions-CxipDb7X.cjs +7 -0
- package/dist/chunks/EvmActions-CxipDb7X.cjs.map +1 -0
- package/dist/chunks/{ReferralsClient-DT3qvRXP.js → ReferralsClient-BRa26dYS.js} +4 -4
- package/dist/chunks/ReferralsClient-BRa26dYS.js.map +1 -0
- package/dist/chunks/ReferralsClient-o-3AUm7s.cjs.map +1 -1
- package/dist/chunks/{approveLBTC-DZQpza0E.js → approveLBTC-DnCt6ZZF.js} +3 -3
- package/dist/chunks/{approveLBTC-DZQpza0E.js.map → approveLBTC-DnCt6ZZF.js.map} +1 -1
- package/dist/chunks/{blockchain-identifier-C2GkWxmw.js → blockchain-identifier-BkASqCgZ.js} +2 -2
- package/dist/chunks/blockchain-identifier-BkASqCgZ.js.map +1 -0
- package/dist/chunks/blockchain-identifier-DWfC3Es2.cjs.map +1 -1
- package/dist/chunks/{bridge-62Nuzkt6.js → bridge-DV4fOcHe.js} +4 -4
- package/dist/chunks/bridge-DV4fOcHe.js.map +1 -0
- package/dist/chunks/bridge-DZp5x4Yb.cjs.map +1 -1
- package/dist/chunks/{config-8IroHCdP.cjs → config-BfX8lrdO.cjs} +2 -2
- package/dist/chunks/config-BfX8lrdO.cjs.map +1 -0
- package/dist/chunks/{config-ej-tsP3s.js → config-wnjPtnjd.js} +46 -53
- package/dist/chunks/config-wnjPtnjd.js.map +1 -0
- package/dist/chunks/{defi-registry-QwFZR4oK.cjs → defi-registry-CyMKVT3z.cjs} +2 -2
- package/dist/chunks/defi-registry-CyMKVT3z.cjs.map +1 -0
- package/dist/chunks/{defi-registry-DLP7nuRn.js → defi-registry-DULXbu3D.js} +9 -9
- package/dist/chunks/defi-registry-DULXbu3D.js.map +1 -0
- package/dist/chunks/depositStatus-B9P1YXEU.cjs.map +1 -1
- package/dist/chunks/{depositStatus-DMDUj1Zi.js → depositStatus-Cgd_GDUt.js} +5 -5
- package/dist/chunks/depositStatus-Cgd_GDUt.js.map +1 -0
- package/dist/chunks/events-B9b3YdgM.cjs +2 -0
- package/dist/chunks/events-B9b3YdgM.cjs.map +1 -0
- package/dist/chunks/{events-DmrU6jV2.js → events-DU2wYlt_.js} +189 -191
- package/dist/chunks/events-DU2wYlt_.js.map +1 -0
- package/dist/chunks/{get-exchange-ratio-D_5R035-.js → get-exchange-ratio-BvPUfcIQ.js} +2 -2
- package/dist/chunks/{get-exchange-ratio-D_5R035-.js.map → get-exchange-ratio-BvPUfcIQ.js.map} +1 -1
- package/dist/chunks/get-exchange-ratio-DGztGO7i.cjs.map +1 -1
- package/dist/chunks/get-positions-summary-CC7BDtlY.cjs.map +1 -1
- package/dist/chunks/{get-positions-summary-CSTG4Ni0.js → get-positions-summary-DxAgmaMl.js} +2 -2
- package/dist/chunks/get-positions-summary-DxAgmaMl.js.map +1 -0
- package/dist/chunks/get-vault-tvl-B6rSrGi_.js +203 -0
- package/dist/chunks/get-vault-tvl-B6rSrGi_.js.map +1 -0
- package/dist/chunks/get-vault-tvl-dvEPPxvT.cjs +2 -0
- package/dist/chunks/get-vault-tvl-dvEPPxvT.cjs.map +1 -0
- package/dist/chunks/get-vault-withdrawals-Cgx7VsM1.cjs +2 -0
- package/dist/chunks/get-vault-withdrawals-Cgx7VsM1.cjs.map +1 -0
- package/dist/chunks/get-vault-withdrawals-W5CgNbqE.js +154 -0
- package/dist/chunks/get-vault-withdrawals-W5CgNbqE.js.map +1 -0
- package/dist/chunks/{getUserStakeAndBakeSignature-Bqp_BTOt.js → getUserStakeAndBakeSignature-BRhWFYyY.js} +4 -4
- package/dist/chunks/getUserStakeAndBakeSignature-BRhWFYyY.js.map +1 -0
- package/dist/chunks/getUserStakeAndBakeSignature-VlC_GHmz.cjs.map +1 -1
- package/dist/chunks/hex-BiCL4CPh.js +11 -0
- package/dist/chunks/hex-BiCL4CPh.js.map +1 -0
- package/dist/chunks/hex-DeJtv8eu.cjs +2 -0
- package/dist/chunks/hex-DeJtv8eu.cjs.map +1 -0
- package/dist/chunks/{lbtc-addresses-BzalXq8D.js → lbtc-addresses-ClXt-tuB.js} +2 -2
- package/dist/chunks/{lbtc-addresses-BzalXq8D.js.map → lbtc-addresses-ClXt-tuB.js.map} +1 -1
- package/dist/chunks/parameters-CcpaKGU2.js +24 -0
- package/dist/chunks/parameters-CcpaKGU2.js.map +1 -0
- package/dist/chunks/parameters-YNWmaAho.cjs +2 -0
- package/dist/chunks/parameters-YNWmaAho.cjs.map +1 -0
- package/dist/chunks/{statusConstants-C4MCQQX7.cjs → statusConstants-B-7VEYgO.cjs} +2 -2
- package/dist/chunks/statusConstants-B-7VEYgO.cjs.map +1 -0
- package/dist/chunks/{statusConstants-DAn1Atsp.js → statusConstants-C3JHNUTC.js} +15 -17
- package/dist/chunks/statusConstants-C3JHNUTC.js.map +1 -0
- package/dist/chunks/{storeNetworkFeeSignature-B4xx2WLI.js → storeNetworkFeeSignature-CY_Z-Wtn.js} +2 -2
- package/dist/chunks/{storeNetworkFeeSignature-B4xx2WLI.js.map → storeNetworkFeeSignature-CY_Z-Wtn.js.map} +1 -1
- package/dist/chunks/token-addresses-C7H9E4qz.cjs.map +1 -1
- package/dist/chunks/{token-addresses-J-EuQVP6.js → token-addresses-DVnRPyu4.js} +4 -2
- package/dist/chunks/token-addresses-DVnRPyu4.js.map +1 -0
- package/dist/chunks/{tokens-CwbSzyK9.js → tokens-Btl3GXbc.js} +3 -3
- package/dist/chunks/tokens-Btl3GXbc.js.map +1 -0
- package/dist/chunks/tokens-DEYY7W7O.cjs.map +1 -1
- package/dist/chunks/unwrapBtceToLbtcv-C4OxoVVU.js +321 -0
- package/dist/chunks/unwrapBtceToLbtcv-C4OxoVVU.js.map +1 -0
- package/dist/chunks/unwrapBtceToLbtcv-Dg-yUGpg.cjs +2 -0
- package/dist/chunks/unwrapBtceToLbtcv-Dg-yUGpg.cjs.map +1 -0
- package/dist/chunks/withdrawEarn-CTtVruit.cjs +7 -0
- package/dist/chunks/withdrawEarn-CTtVruit.cjs.map +1 -0
- package/dist/chunks/{unstakeLBTC-CEqb4N-_.js → withdrawEarn-QFaMhs0t.js} +965 -612
- package/dist/chunks/withdrawEarn-QFaMhs0t.js.map +1 -0
- package/dist/client/ApiNamespace.d.ts +3 -6
- package/dist/client/ApiNamespace.d.ts.map +1 -1
- package/dist/common/blockchain-identifier.d.ts.map +1 -1
- package/dist/common/chains.d.ts.map +1 -1
- package/dist/common/feature-config.d.ts.map +1 -1
- package/dist/contract-functions/cancelEarnWithdrawal/cancelEarnWithdrawal.d.ts +19 -0
- package/dist/contract-functions/cancelEarnWithdrawal/cancelEarnWithdrawal.d.ts.map +1 -0
- package/dist/contract-functions/cancelEarnWithdrawal/index.d.ts +2 -0
- package/dist/contract-functions/cancelEarnWithdrawal/index.d.ts.map +1 -0
- package/dist/contract-functions/depositEarn/depositEarn.d.ts +36 -0
- package/dist/contract-functions/depositEarn/depositEarn.d.ts.map +1 -0
- package/dist/contract-functions/depositEarn/index.d.ts +2 -0
- package/dist/contract-functions/depositEarn/index.d.ts.map +1 -0
- package/dist/contract-functions/getBasculeDepositStatus/getBasculeDepositStatus.d.ts.map +1 -1
- package/dist/contract-functions/getEarnPosition/getEarnPosition.d.ts +17 -16
- package/dist/contract-functions/getEarnPosition/getEarnPosition.d.ts.map +1 -1
- package/dist/contract-functions/getShareValue/getShareValue.d.ts +5 -15
- package/dist/contract-functions/getShareValue/getShareValue.d.ts.map +1 -1
- package/dist/contract-functions/getSharesByAddress/getSharesByAddress.d.ts +5 -20
- package/dist/contract-functions/getSharesByAddress/getSharesByAddress.d.ts.map +1 -1
- package/dist/contract-functions/index.d.ts +4 -2
- package/dist/contract-functions/index.d.ts.map +1 -1
- package/dist/contract-functions/previewWithdrawEarn/index.d.ts +2 -0
- package/dist/contract-functions/previewWithdrawEarn/index.d.ts.map +1 -0
- package/dist/contract-functions/previewWithdrawEarn/previewWithdrawEarn.d.ts +38 -0
- package/dist/contract-functions/previewWithdrawEarn/previewWithdrawEarn.d.ts.map +1 -0
- package/dist/contract-functions/signStakeAndBake/validation.d.ts.map +1 -1
- package/dist/contract-functions/withdrawEarn/index.d.ts +2 -0
- package/dist/contract-functions/withdrawEarn/index.d.ts.map +1 -0
- package/dist/contract-functions/withdrawEarn/withdrawEarn.d.ts +46 -0
- package/dist/contract-functions/withdrawEarn/withdrawEarn.d.ts.map +1 -0
- package/dist/contract-functions/wrapToBtce/wrapToBtce.d.ts.map +1 -1
- package/dist/contracts.cjs +1 -1
- package/dist/contracts.js +32 -30
- package/dist/core/assets/catalog.d.ts.map +1 -1
- package/dist/core/assets/utils.d.ts.map +1 -1
- package/dist/core/chains/utils.d.ts.map +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.js +19 -19
- package/dist/defi/defi-registry.d.ts.map +1 -1
- package/dist/defi/index.d.ts +1 -1
- package/dist/defi/index.d.ts.map +1 -1
- package/dist/defi.cjs +1 -1
- package/dist/defi.js +4 -4
- package/dist/entries/api.d.ts +14 -14
- package/dist/entries/api.d.ts.map +1 -1
- package/dist/entries/contracts.d.ts +4 -2
- package/dist/entries/contracts.d.ts.map +1 -1
- package/dist/entries/defi.d.ts +1 -1
- package/dist/entries/defi.d.ts.map +1 -1
- package/dist/entries/evm.d.ts +7 -7
- package/dist/entries/evm.d.ts.map +1 -1
- package/dist/entries/utils.d.ts +9 -9
- package/dist/entries/utils.d.ts.map +1 -1
- package/dist/entries/vaults.d.ts +1 -1
- package/dist/entries/vaults.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 +67 -65
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +171 -174
- package/dist/index.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/services/EvmService.d.ts.map +1 -1
- package/dist/shared/actions/BaseAction.d.ts.map +1 -1
- package/dist/shared/deposits/depositStatus.d.ts.map +1 -1
- package/dist/shared/validation/index.d.ts.map +1 -1
- package/dist/tokens/tokens.d.ts.map +1 -1
- package/dist/utils/chain.d.ts.map +1 -1
- package/dist/utils/consoleLogger.d.ts.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +16 -16
- package/dist/vaults/index.d.ts +8 -10
- package/dist/vaults/index.d.ts.map +1 -1
- package/dist/vaults/lib/config.d.ts +148 -150
- package/dist/vaults/lib/config.d.ts.map +1 -1
- package/dist/vaults/lib/metrics/get-vault-apy.d.ts +2 -4
- package/dist/vaults/lib/metrics/get-vault-apy.d.ts.map +1 -1
- package/dist/vaults/lib/metrics/get-vault-points.d.ts +2 -5
- package/dist/vaults/lib/metrics/get-vault-points.d.ts.map +1 -1
- package/dist/vaults/lib/metrics/get-vault-tvl.d.ts +5 -8
- package/dist/vaults/lib/metrics/get-vault-tvl.d.ts.map +1 -1
- package/dist/vaults/lib/ops/deposit.d.ts +5 -14
- package/dist/vaults/lib/ops/deposit.d.ts.map +1 -1
- package/dist/vaults/lib/ops/get-vault-deposits.d.ts +9 -13
- package/dist/vaults/lib/ops/get-vault-deposits.d.ts.map +1 -1
- package/dist/vaults/lib/ops/get-vault-minimum-deposit.d.ts +4 -7
- package/dist/vaults/lib/ops/get-vault-minimum-deposit.d.ts.map +1 -1
- package/dist/vaults/lib/ops/get-vault-withdrawals.d.ts +14 -18
- package/dist/vaults/lib/ops/get-vault-withdrawals.d.ts.map +1 -1
- package/dist/vaults/lib/ops/preview-vault-deposit.d.ts +4 -8
- package/dist/vaults/lib/ops/preview-vault-deposit.d.ts.map +1 -1
- package/dist/vaults/lib/ops/withdraw.d.ts +11 -27
- package/dist/vaults/lib/ops/withdraw.d.ts.map +1 -1
- package/dist/vaults.cjs +1 -1
- package/dist/vaults.cjs.map +1 -1
- package/dist/vaults.js +91 -103
- package/dist/vaults.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/BtcActions-Ds6YrAKZ.js.map +0 -1
- package/dist/chunks/BtcActions-DywyNv3O.cjs +0 -2
- package/dist/chunks/BtcActions-DywyNv3O.cjs.map +0 -1
- package/dist/chunks/EvmActions-BDk1vvRY.js +0 -1341
- package/dist/chunks/EvmActions-BDk1vvRY.js.map +0 -1
- package/dist/chunks/EvmActions-BzlEACJk.cjs +0 -2
- package/dist/chunks/EvmActions-BzlEACJk.cjs.map +0 -1
- package/dist/chunks/ReferralsClient-DT3qvRXP.js.map +0 -1
- package/dist/chunks/blockchain-identifier-C2GkWxmw.js.map +0 -1
- package/dist/chunks/bridge-62Nuzkt6.js.map +0 -1
- package/dist/chunks/config-8IroHCdP.cjs.map +0 -1
- package/dist/chunks/config-ej-tsP3s.js.map +0 -1
- package/dist/chunks/defi-registry-DLP7nuRn.js.map +0 -1
- package/dist/chunks/defi-registry-QwFZR4oK.cjs.map +0 -1
- package/dist/chunks/depositStatus-DMDUj1Zi.js.map +0 -1
- package/dist/chunks/events-DADaEsss.cjs +0 -2
- package/dist/chunks/events-DADaEsss.cjs.map +0 -1
- package/dist/chunks/events-DmrU6jV2.js.map +0 -1
- package/dist/chunks/get-positions-summary-CSTG4Ni0.js.map +0 -1
- package/dist/chunks/get-vault-tvl-D6XcYucx.cjs +0 -2
- package/dist/chunks/get-vault-tvl-D6XcYucx.cjs.map +0 -1
- package/dist/chunks/get-vault-tvl-DwdB1FA1.js +0 -226
- package/dist/chunks/get-vault-tvl-DwdB1FA1.js.map +0 -1
- package/dist/chunks/get-vault-withdrawals-BLwcsT0Q.js +0 -161
- package/dist/chunks/get-vault-withdrawals-BLwcsT0Q.js.map +0 -1
- package/dist/chunks/get-vault-withdrawals-CuSwGy0M.cjs +0 -2
- package/dist/chunks/get-vault-withdrawals-CuSwGy0M.cjs.map +0 -1
- package/dist/chunks/getUserStakeAndBakeSignature-Bqp_BTOt.js.map +0 -1
- package/dist/chunks/parameters-C_16L5ft.js +0 -11
- package/dist/chunks/parameters-C_16L5ft.js.map +0 -1
- package/dist/chunks/parameters-DK9cYCAH.cjs +0 -2
- package/dist/chunks/parameters-DK9cYCAH.cjs.map +0 -1
- package/dist/chunks/statusConstants-C4MCQQX7.cjs.map +0 -1
- package/dist/chunks/statusConstants-DAn1Atsp.js.map +0 -1
- package/dist/chunks/time-I-BeyUkG.cjs +0 -2
- package/dist/chunks/time-I-BeyUkG.cjs.map +0 -1
- package/dist/chunks/time-Sa5gggPG.js +0 -24
- package/dist/chunks/time-Sa5gggPG.js.map +0 -1
- package/dist/chunks/token-addresses-J-EuQVP6.js.map +0 -1
- package/dist/chunks/tokens-CwbSzyK9.js.map +0 -1
- package/dist/chunks/unstakeLBTC-CEqb4N-_.js.map +0 -1
- package/dist/chunks/unstakeLBTC-DMI79XHm.cjs +0 -2
- package/dist/chunks/unstakeLBTC-DMI79XHm.cjs.map +0 -1
- package/dist/chunks/withdraw-CYUXQ9HY.js +0 -209
- package/dist/chunks/withdraw-CYUXQ9HY.js.map +0 -1
- package/dist/chunks/withdraw-D-FlPc10.cjs +0 -12
- package/dist/chunks/withdraw-D-FlPc10.cjs.map +0 -1
- package/dist/chunks/wrapToBtce-D-TaAhqb.cjs +0 -2
- package/dist/chunks/wrapToBtce-D-TaAhqb.cjs.map +0 -1
- package/dist/chunks/wrapToBtce-yEQfbDAw.js +0 -298
- package/dist/chunks/wrapToBtce-yEQfbDAw.js.map +0 -1
- package/dist/contract-functions/getShareValue/index.d.ts +0 -2
- package/dist/contract-functions/getShareValue/index.d.ts.map +0 -1
- package/dist/contract-functions/getSharesByAddress/index.d.ts +0 -2
- package/dist/contract-functions/getSharesByAddress/index.d.ts.map +0 -1
|
@@ -2,22 +2,25 @@ var $ = Object.defineProperty;
|
|
|
2
2
|
var q = (s, t, e) => t in s ? $(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
3
|
var a = (s, t, e) => q(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import "axios";
|
|
5
|
-
import { SDK_RUNTIME as z, SDK_VERSION as W, LombardError as d, bitcoinAddressSchema as I, Chain as h, BaseAction as C, NonEvmOperationStatus as
|
|
6
|
-
import { generateDepositBtcAddress as ut } from "./getUserStakeAndBakeSignature-
|
|
7
|
-
import { getDepositsByAddress as
|
|
8
|
-
import { storeNetworkFeeSignature as pt, getNetworkFeeSignature as mt } from "./storeNetworkFeeSignature-
|
|
9
|
-
import { btcModule as vt, BtcActions as Ct } from "./BtcActions-
|
|
10
|
-
import { evmModule as ft, EvmActions as Et } from "./EvmActions-
|
|
11
|
-
import { SOLANA_DEVNET_CHAIN as At, SOLANA_MAINNET_CHAIN as It, getSolanaTokenAddress as L, Token as k } from "./token-addresses-
|
|
5
|
+
import { SDK_RUNTIME as z, SDK_VERSION as W, LombardError as d, bitcoinAddressSchema as I, Chain as h, BaseAction as C, NonEvmOperationStatus as r, validatePrepareParams as f, StepStatus as o, objectType as E, amountSchema as A, solanaAddressSchema as w, CapabilityRegistry as S, PartnerConfiguration as _, getProviderGetter as D, ASSET_CATALOG as b, getAssetAddress as X, getAssetDecimals as Z, getAssetMetadata as J, usesAssetRouter as Q, getAssetRouter as tt, getBridgeAdapter as et, getPublicMarketMaker as st, getAssetByAddress as nt, isAssetDeployed as rt, getAssetChains as it, getAssetEnvironments as at, getSupportedAssets as ot, ProviderErrorCode as ct } from "./statusConstants-C3JHNUTC.js";
|
|
6
|
+
import { generateDepositBtcAddress as ut } from "./getUserStakeAndBakeSignature-BRhWFYyY.js";
|
|
7
|
+
import { getDepositsByAddress as O, getUnstakesByAddress as ht, getPointsByAddress as dt, getDepositBtcAddress as y, storeStakeAndBakeSignature as gt, ReferralsClient as lt } from "./ReferralsClient-BRa26dYS.js";
|
|
8
|
+
import { storeNetworkFeeSignature as pt, getNetworkFeeSignature as mt } from "./storeNetworkFeeSignature-CY_Z-Wtn.js";
|
|
9
|
+
import { btcModule as vt, BtcActions as Ct } from "./BtcActions-CFGiDxtv.js";
|
|
10
|
+
import { evmModule as ft, EvmActions as Et } from "./EvmActions-CUKBeiUw.js";
|
|
11
|
+
import { SOLANA_DEVNET_CHAIN as At, SOLANA_MAINNET_CHAIN as It, getSolanaTokenAddress as L, Token as k } from "./token-addresses-DVnRPyu4.js";
|
|
12
12
|
import { toSatoshi as T } from "./satoshi-CSoJBXc6.js";
|
|
13
13
|
import { p as B, r as c } from "./index-CfcQ_g3t.js";
|
|
14
|
-
import { AssetId as g } from "./defi-registry-
|
|
15
|
-
import { getExchangeRatio as St } from "./get-exchange-ratio-
|
|
16
|
-
import {
|
|
17
|
-
import { getVaultWithdrawals as Dt, getVaultWithdrawalsAllChains as Nt } from "./get-vault-withdrawals-BLwcsT0Q.js";
|
|
14
|
+
import { AssetId as g } from "./defi-registry-DULXbu3D.js";
|
|
15
|
+
import { getExchangeRatio as St } from "./get-exchange-ratio-BvPUfcIQ.js";
|
|
16
|
+
import { getEarnWithdrawals as _t, getEarnWithdrawalsAllChains as Dt } from "./get-vault-withdrawals-W5CgNbqE.js";
|
|
18
17
|
const P = ["debug", "info", "warn", "error", "none"];
|
|
19
|
-
function
|
|
20
|
-
const {
|
|
18
|
+
function Nt(s = {}) {
|
|
19
|
+
const {
|
|
20
|
+
level: t = "debug",
|
|
21
|
+
prefix: e = "[Lombard SDK]",
|
|
22
|
+
timestamp: n = !1
|
|
23
|
+
} = s, i = P.indexOf(t), u = (p) => P.indexOf(p) >= i && t !== "none", l = (p) => {
|
|
21
24
|
if (n) {
|
|
22
25
|
const v = (/* @__PURE__ */ new Date()).toISOString();
|
|
23
26
|
return `${e} ${v} ${p}`;
|
|
@@ -39,7 +42,7 @@ function Tt(s = {}) {
|
|
|
39
42
|
}
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
|
-
function
|
|
45
|
+
function le() {
|
|
43
46
|
return {
|
|
44
47
|
debug: () => {
|
|
45
48
|
},
|
|
@@ -51,13 +54,13 @@ function me() {
|
|
|
51
54
|
}
|
|
52
55
|
};
|
|
53
56
|
}
|
|
54
|
-
function
|
|
57
|
+
function pe() {
|
|
55
58
|
return {
|
|
56
59
|
"X-SDK-Version": W,
|
|
57
60
|
"X-SDK-Runtime": z
|
|
58
61
|
};
|
|
59
62
|
}
|
|
60
|
-
class
|
|
63
|
+
class Tt {
|
|
61
64
|
constructor(t = B) {
|
|
62
65
|
/**
|
|
63
66
|
* Internal API version flag for future v2 migration.
|
|
@@ -87,7 +90,7 @@ class xt {
|
|
|
87
90
|
* ```
|
|
88
91
|
*/
|
|
89
92
|
async deposits(t) {
|
|
90
|
-
return
|
|
93
|
+
return O({ address: t, env: this.env });
|
|
91
94
|
}
|
|
92
95
|
/* -------------------------------------------------------------------------- */
|
|
93
96
|
/* Unstakes */
|
|
@@ -167,7 +170,7 @@ class xt {
|
|
|
167
170
|
* ```
|
|
168
171
|
*/
|
|
169
172
|
async depositAddress(t, e, n) {
|
|
170
|
-
return
|
|
173
|
+
return y({
|
|
171
174
|
address: t,
|
|
172
175
|
chainId: e,
|
|
173
176
|
env: this.env,
|
|
@@ -206,16 +209,14 @@ class xt {
|
|
|
206
209
|
* ```
|
|
207
210
|
*/
|
|
208
211
|
async vaultWithdrawals(t, e) {
|
|
209
|
-
const n = t
|
|
210
|
-
return e != null && e.chainId ?
|
|
212
|
+
const n = t;
|
|
213
|
+
return e != null && e.chainId ? _t({
|
|
211
214
|
account: n,
|
|
212
215
|
chainId: e.chainId,
|
|
213
|
-
vaultKey: r,
|
|
214
216
|
rpcUrl: e.rpcUrl,
|
|
215
217
|
env: this.env
|
|
216
|
-
}) :
|
|
218
|
+
}) : Dt({
|
|
217
219
|
account: n,
|
|
218
|
-
vaultKey: r,
|
|
219
220
|
rpcUrl: e == null ? void 0 : e.rpcUrl
|
|
220
221
|
});
|
|
221
222
|
}
|
|
@@ -231,16 +232,16 @@ class xt {
|
|
|
231
232
|
return this.apiVersion;
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
|
-
function
|
|
235
|
+
function xt(s) {
|
|
235
236
|
if (!s.env)
|
|
236
237
|
throw d.missingParameter("env");
|
|
237
238
|
const t = {
|
|
238
239
|
env: s.env,
|
|
239
240
|
providers: s.providers || {}
|
|
240
241
|
};
|
|
241
|
-
return s.partner && (
|
|
242
|
+
return s.partner && (Pt(s.partner), t.partner = s.partner), t;
|
|
242
243
|
}
|
|
243
|
-
function
|
|
244
|
+
function Pt(s) {
|
|
244
245
|
if (typeof s != "object" || s === null)
|
|
245
246
|
throw d.invalidConfiguration(
|
|
246
247
|
"Partner configuration must be an object"
|
|
@@ -251,7 +252,7 @@ function wt(s) {
|
|
|
251
252
|
if (t.partnerId.trim().length === 0)
|
|
252
253
|
throw d.invalidConfiguration("Partner ID cannot be empty");
|
|
253
254
|
}
|
|
254
|
-
class
|
|
255
|
+
class wt {
|
|
255
256
|
constructor(t) {
|
|
256
257
|
this.env = t;
|
|
257
258
|
}
|
|
@@ -278,7 +279,7 @@ class bt {
|
|
|
278
279
|
*/
|
|
279
280
|
async getDepositAddress(t) {
|
|
280
281
|
try {
|
|
281
|
-
return await
|
|
282
|
+
return await y({
|
|
282
283
|
address: t.address,
|
|
283
284
|
chainId: t.chainId,
|
|
284
285
|
token: t.token,
|
|
@@ -293,17 +294,17 @@ class bt {
|
|
|
293
294
|
* Get deposits for an address
|
|
294
295
|
*/
|
|
295
296
|
async getDeposits(t) {
|
|
296
|
-
return (await
|
|
297
|
+
return (await O({
|
|
297
298
|
address: t,
|
|
298
299
|
env: this.env
|
|
299
300
|
})).map((n) => {
|
|
300
|
-
var
|
|
301
|
+
var i;
|
|
301
302
|
return {
|
|
302
303
|
depositAddress: n.depositAddress ?? "",
|
|
303
304
|
blockHeight: n.blockHeight,
|
|
304
305
|
isClaimed: n.isClaimed,
|
|
305
306
|
txid: n.txHash,
|
|
306
|
-
amount: (
|
|
307
|
+
amount: (i = n.amount) == null ? void 0 : i.toString()
|
|
307
308
|
};
|
|
308
309
|
});
|
|
309
310
|
}
|
|
@@ -341,16 +342,16 @@ class bt {
|
|
|
341
342
|
});
|
|
342
343
|
}
|
|
343
344
|
}
|
|
344
|
-
function
|
|
345
|
+
function bt() {
|
|
345
346
|
return {
|
|
346
347
|
id: "api",
|
|
347
348
|
register(s) {
|
|
348
|
-
return new
|
|
349
|
+
return new wt(s.env);
|
|
349
350
|
}
|
|
350
351
|
};
|
|
351
352
|
}
|
|
352
353
|
function Ot(s) {
|
|
353
|
-
const t = /* @__PURE__ */ new Map(), e = [vt(), ft(),
|
|
354
|
+
const t = /* @__PURE__ */ new Map(), e = [vt(), ft(), bt()];
|
|
354
355
|
for (const n of e)
|
|
355
356
|
t.set(n.id, n);
|
|
356
357
|
if (s)
|
|
@@ -358,23 +359,23 @@ function Ot(s) {
|
|
|
358
359
|
t.set(n.id, n);
|
|
359
360
|
return Array.from(t.values());
|
|
360
361
|
}
|
|
361
|
-
function
|
|
362
|
+
function yt(s, t) {
|
|
362
363
|
for (const e of s)
|
|
363
364
|
for (const n of e.requiresProviders ?? [])
|
|
364
|
-
if (!
|
|
365
|
+
if (!Lt(t, n))
|
|
365
366
|
throw d.providerMissing(n, n);
|
|
366
367
|
}
|
|
367
|
-
function
|
|
368
|
+
function Lt(s, t) {
|
|
368
369
|
var e;
|
|
369
370
|
return !!((e = s.providers) != null && e[t]);
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
-
const t =
|
|
372
|
+
function kt(s) {
|
|
373
|
+
const t = xt(s), e = Ot(
|
|
373
374
|
s.modules
|
|
374
375
|
);
|
|
375
|
-
|
|
376
|
+
yt(e, t);
|
|
376
377
|
let n = s.logger;
|
|
377
|
-
return !n && s.debug && (n =
|
|
378
|
+
return !n && s.debug && (n = Nt({ level: "debug" })), {
|
|
378
379
|
...t,
|
|
379
380
|
modules: e,
|
|
380
381
|
logger: n
|
|
@@ -423,18 +424,18 @@ const R = {
|
|
|
423
424
|
],
|
|
424
425
|
recipientSchema: I
|
|
425
426
|
};
|
|
426
|
-
function
|
|
427
|
+
function Bt(s, t, e, n, i) {
|
|
427
428
|
return R.routes.some(
|
|
428
|
-
(u) => u.sourceChains.includes(s) && u.destChain === t && u.assetIn === e && u.assetOut === n && u.envs.includes(
|
|
429
|
+
(u) => u.sourceChains.includes(s) && u.destChain === t && u.assetIn === e && u.assetOut === n && u.envs.includes(i)
|
|
429
430
|
);
|
|
430
431
|
}
|
|
431
|
-
class
|
|
432
|
+
class Mt extends C {
|
|
432
433
|
constructor(e, n) {
|
|
433
|
-
super(
|
|
434
|
+
super(r.IDLE);
|
|
434
435
|
a(this, "_amount");
|
|
435
436
|
a(this, "_recipient");
|
|
436
437
|
a(this, "_txHash");
|
|
437
|
-
if (this.ctx = e, this.params = n, !
|
|
438
|
+
if (this.ctx = e, this.params = n, !Bt(
|
|
438
439
|
n.sourceChain,
|
|
439
440
|
n.destChain,
|
|
440
441
|
n.assetIn,
|
|
@@ -458,44 +459,46 @@ class Rt extends C {
|
|
|
458
459
|
return this._txHash;
|
|
459
460
|
}
|
|
460
461
|
async prepare(e) {
|
|
461
|
-
return this.assertStatus(
|
|
462
|
+
return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
|
|
462
463
|
const n = f(this.prepareSchema, e, {
|
|
463
464
|
destChain: this.params.destChain
|
|
464
465
|
});
|
|
465
466
|
this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
|
|
466
|
-
status:
|
|
467
|
+
status: r.READY,
|
|
467
468
|
steps: { burning: o.IDLE, releasing: o.IDLE }
|
|
468
469
|
});
|
|
469
|
-
},
|
|
470
|
+
}, r.READY);
|
|
470
471
|
}
|
|
471
472
|
async execute() {
|
|
472
|
-
return this.assertStatus(
|
|
473
|
+
return this.assertStatus(r.READY, "execute"), this.act(async () => {
|
|
473
474
|
const e = this._amount, n = this._recipient;
|
|
474
475
|
if (!e || !n)
|
|
475
476
|
throw d.missingParameter("amount or recipient");
|
|
476
477
|
this.emitProgress({
|
|
477
|
-
status:
|
|
478
|
+
status: r.READY,
|
|
478
479
|
steps: { burning: o.PENDING, releasing: o.IDLE }
|
|
479
480
|
});
|
|
480
|
-
const
|
|
481
|
+
const i = T(e).toString(), u = x(this.ctx.env), l = L(
|
|
481
482
|
M(this.ctx.env),
|
|
482
483
|
this.ctx.env,
|
|
483
484
|
k.BTCb
|
|
484
485
|
);
|
|
485
486
|
if (!l)
|
|
486
|
-
throw d.missingParameter(
|
|
487
|
+
throw d.missingParameter(
|
|
488
|
+
"Solana BTC.b mint for this environment"
|
|
489
|
+
);
|
|
487
490
|
const { signature: m } = await this.ctx.solana.redeemForBtc({
|
|
488
|
-
amount:
|
|
491
|
+
amount: i,
|
|
489
492
|
btcAddress: n,
|
|
490
493
|
network: u,
|
|
491
494
|
env: this.ctx.env,
|
|
492
495
|
tokenMint: l
|
|
493
496
|
});
|
|
494
497
|
return this._txHash = m, this.emitProgress({
|
|
495
|
-
status:
|
|
498
|
+
status: r.COMPLETED,
|
|
496
499
|
steps: { burning: o.COMPLETE, releasing: o.COMPLETE }
|
|
497
500
|
}), this.emitCompleted(), { txHash: m };
|
|
498
|
-
},
|
|
501
|
+
}, r.COMPLETED);
|
|
499
502
|
}
|
|
500
503
|
get prepareSchema() {
|
|
501
504
|
return E({
|
|
@@ -521,24 +524,19 @@ const H = {
|
|
|
521
524
|
],
|
|
522
525
|
recipientSchema: w
|
|
523
526
|
};
|
|
524
|
-
function
|
|
527
|
+
function Rt(s, t, e, n) {
|
|
525
528
|
return H.routes.some(
|
|
526
|
-
(
|
|
529
|
+
(i) => i.chain === s && i.assetIn === t && i.assetOut === e && i.envs.includes(n)
|
|
527
530
|
);
|
|
528
531
|
}
|
|
529
|
-
class
|
|
532
|
+
class Ht extends C {
|
|
530
533
|
constructor(e, n) {
|
|
531
|
-
super(
|
|
534
|
+
super(r.IDLE);
|
|
532
535
|
a(this, "_amount");
|
|
533
536
|
a(this, "_recipient");
|
|
534
537
|
a(this, "_txHash");
|
|
535
538
|
a(this, "env");
|
|
536
|
-
if (this.ctx = e, this.params = n, this.env = e.env, !
|
|
537
|
-
n.chain,
|
|
538
|
-
n.assetIn,
|
|
539
|
-
n.assetOut,
|
|
540
|
-
this.env
|
|
541
|
-
))
|
|
539
|
+
if (this.ctx = e, this.params = n, this.env = e.env, !Rt(n.chain, n.assetIn, n.assetOut, this.env))
|
|
542
540
|
throw d.routeNotFound({
|
|
543
541
|
assetOut: n.assetOut,
|
|
544
542
|
chain: n.chain,
|
|
@@ -555,37 +553,37 @@ class Ft extends C {
|
|
|
555
553
|
return this._txHash;
|
|
556
554
|
}
|
|
557
555
|
async prepare(e) {
|
|
558
|
-
return this.assertStatus(
|
|
556
|
+
return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
|
|
559
557
|
const n = f(this.prepareSchema, e, {
|
|
560
558
|
destChain: this.params.chain
|
|
561
559
|
});
|
|
562
560
|
this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
|
|
563
|
-
status:
|
|
561
|
+
status: r.READY,
|
|
564
562
|
steps: { burning: o.IDLE, minting: o.IDLE }
|
|
565
563
|
});
|
|
566
|
-
},
|
|
564
|
+
}, r.READY);
|
|
567
565
|
}
|
|
568
566
|
async execute() {
|
|
569
|
-
return this.assertStatus(
|
|
567
|
+
return this.assertStatus(r.READY, "execute"), this.act(async () => {
|
|
570
568
|
const e = this._amount, n = this._recipient;
|
|
571
569
|
if (!e || !n)
|
|
572
570
|
throw d.missingParameter("amount or recipient");
|
|
573
571
|
this.emitProgress({
|
|
574
|
-
status:
|
|
572
|
+
status: r.READY,
|
|
575
573
|
steps: { burning: o.PENDING, minting: o.IDLE }
|
|
576
574
|
});
|
|
577
|
-
const
|
|
578
|
-
amount:
|
|
575
|
+
const i = T(e).toString(), u = x(this.env), { signature: l } = await this.ctx.solana.deposit({
|
|
576
|
+
amount: i,
|
|
579
577
|
recipient: n,
|
|
580
578
|
network: u,
|
|
581
579
|
env: this.env
|
|
582
580
|
});
|
|
583
581
|
return this._txHash = l, this.emitProgress({
|
|
584
|
-
status:
|
|
582
|
+
status: r.CONFIRMING,
|
|
585
583
|
steps: { burning: o.COMPLETE, minting: o.PENDING },
|
|
586
584
|
txHash: l
|
|
587
585
|
}), this.emitCompleted(), { txHash: l };
|
|
588
|
-
},
|
|
586
|
+
}, r.CONFIRMING);
|
|
589
587
|
}
|
|
590
588
|
get prepareSchema() {
|
|
591
589
|
return E({
|
|
@@ -630,20 +628,20 @@ const F = {
|
|
|
630
628
|
}
|
|
631
629
|
],
|
|
632
630
|
recipientSchema: w
|
|
633
|
-
},
|
|
634
|
-
function
|
|
635
|
-
return
|
|
636
|
-
(u) => u.sourceChains.includes(s) && u.destChain === t && u.assetIn === e && u.assetOut === n && u.envs.includes(
|
|
631
|
+
}, Ft = [...F.routes, ...Y.routes];
|
|
632
|
+
function Yt(s, t, e, n, i) {
|
|
633
|
+
return Ft.some(
|
|
634
|
+
(u) => u.sourceChains.includes(s) && u.destChain === t && u.assetIn === e && u.assetOut === n && u.envs.includes(i)
|
|
637
635
|
);
|
|
638
636
|
}
|
|
639
|
-
class
|
|
637
|
+
class Gt extends C {
|
|
640
638
|
constructor(e, n) {
|
|
641
|
-
super(
|
|
639
|
+
super(r.IDLE);
|
|
642
640
|
a(this, "_amount");
|
|
643
641
|
a(this, "_recipient");
|
|
644
642
|
a(this, "_txHash");
|
|
645
643
|
a(this, "isBtcbOutput");
|
|
646
|
-
if (this.ctx = e, this.params = n, this.isBtcbOutput = n.assetOut === g.BTCb, !
|
|
644
|
+
if (this.ctx = e, this.params = n, this.isBtcbOutput = n.assetOut === g.BTCb, !Yt(
|
|
647
645
|
n.sourceChain,
|
|
648
646
|
n.destChain,
|
|
649
647
|
n.assetIn,
|
|
@@ -667,30 +665,30 @@ class Ut extends C {
|
|
|
667
665
|
return this._txHash;
|
|
668
666
|
}
|
|
669
667
|
async prepare(e) {
|
|
670
|
-
return this.assertStatus(
|
|
668
|
+
return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
|
|
671
669
|
const n = f(this.prepareSchema, e, {
|
|
672
670
|
destChain: this.params.destChain
|
|
673
671
|
});
|
|
674
672
|
this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
|
|
675
|
-
status:
|
|
673
|
+
status: r.READY,
|
|
676
674
|
steps: { burning: o.IDLE, releasing: o.IDLE }
|
|
677
675
|
});
|
|
678
|
-
},
|
|
676
|
+
}, r.READY);
|
|
679
677
|
}
|
|
680
678
|
async execute() {
|
|
681
|
-
return this.assertStatus(
|
|
679
|
+
return this.assertStatus(r.READY, "execute"), this.act(async () => {
|
|
682
680
|
const e = this._amount, n = this._recipient;
|
|
683
681
|
if (!e || !n)
|
|
684
682
|
throw d.missingParameter("amount or recipient");
|
|
685
683
|
this.emitProgress({
|
|
686
|
-
status:
|
|
684
|
+
status: r.READY,
|
|
687
685
|
steps: { burning: o.PENDING, releasing: o.IDLE }
|
|
688
686
|
});
|
|
689
|
-
const
|
|
687
|
+
const i = T(e).toString(), u = x(this.ctx.env);
|
|
690
688
|
let l;
|
|
691
689
|
if (this.isBtcbOutput)
|
|
692
690
|
({ signature: l } = await this.ctx.solana.redeem({
|
|
693
|
-
amount:
|
|
691
|
+
amount: i,
|
|
694
692
|
recipient: n,
|
|
695
693
|
network: u,
|
|
696
694
|
env: this.ctx.env
|
|
@@ -706,7 +704,7 @@ class Ut extends C {
|
|
|
706
704
|
"Solana LBTC mint for this environment"
|
|
707
705
|
);
|
|
708
706
|
({ signature: l } = await this.ctx.solana.redeemForBtc({
|
|
709
|
-
amount:
|
|
707
|
+
amount: i,
|
|
710
708
|
btcAddress: n,
|
|
711
709
|
network: u,
|
|
712
710
|
env: this.ctx.env,
|
|
@@ -714,10 +712,10 @@ class Ut extends C {
|
|
|
714
712
|
}));
|
|
715
713
|
}
|
|
716
714
|
return this._txHash = l, this.emitProgress({
|
|
717
|
-
status:
|
|
715
|
+
status: r.COMPLETED,
|
|
718
716
|
steps: { burning: o.COMPLETE, releasing: o.COMPLETE }
|
|
719
717
|
}), this.emitCompleted(), { txHash: l };
|
|
720
|
-
},
|
|
718
|
+
}, r.COMPLETED);
|
|
721
719
|
}
|
|
722
720
|
get prepareSchema() {
|
|
723
721
|
const e = this.isBtcbOutput ? Y : F;
|
|
@@ -727,15 +725,15 @@ class Ut extends C {
|
|
|
727
725
|
});
|
|
728
726
|
}
|
|
729
727
|
}
|
|
730
|
-
function
|
|
728
|
+
function Ut(s) {
|
|
731
729
|
const e = new S(s.modules, s).require("solana");
|
|
732
730
|
return {
|
|
733
731
|
env: s.env,
|
|
734
732
|
partner: new _(s.partner),
|
|
735
733
|
getProvider: async (n) => {
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
return
|
|
734
|
+
const i = D(s.providers, n);
|
|
735
|
+
if (i)
|
|
736
|
+
return i();
|
|
739
737
|
},
|
|
740
738
|
solana: e
|
|
741
739
|
};
|
|
@@ -746,7 +744,7 @@ class G {
|
|
|
746
744
|
this.config = t;
|
|
747
745
|
}
|
|
748
746
|
get ctx() {
|
|
749
|
-
return this._ctx || (this._ctx =
|
|
747
|
+
return this._ctx || (this._ctx = Ut(this.config)), this._ctx;
|
|
750
748
|
}
|
|
751
749
|
/**
|
|
752
750
|
* Stake BTC.b → LBTC
|
|
@@ -757,7 +755,7 @@ class G {
|
|
|
757
755
|
* @throws LombardError if route is not supported
|
|
758
756
|
*/
|
|
759
757
|
stake(t) {
|
|
760
|
-
return new
|
|
758
|
+
return new Ht(this.ctx, t);
|
|
761
759
|
}
|
|
762
760
|
/**
|
|
763
761
|
* Unstake LBTC → BTC (cross-chain) or LBTC → BTC.b (same-chain)
|
|
@@ -770,7 +768,7 @@ class G {
|
|
|
770
768
|
* @throws LombardError if route is not supported
|
|
771
769
|
*/
|
|
772
770
|
unstake(t) {
|
|
773
|
-
return new
|
|
771
|
+
return new Gt(this.ctx, t);
|
|
774
772
|
}
|
|
775
773
|
/**
|
|
776
774
|
* Redeem BTC.b → BTC (cross-chain)
|
|
@@ -781,10 +779,10 @@ class G {
|
|
|
781
779
|
* @throws LombardError if route is not supported
|
|
782
780
|
*/
|
|
783
781
|
redeem(t) {
|
|
784
|
-
return new
|
|
782
|
+
return new Mt(this.ctx, t);
|
|
785
783
|
}
|
|
786
784
|
}
|
|
787
|
-
function
|
|
785
|
+
function me(s) {
|
|
788
786
|
return new G(s);
|
|
789
787
|
}
|
|
790
788
|
const U = {
|
|
@@ -807,9 +805,9 @@ function Kt(s, t) {
|
|
|
807
805
|
(e) => e.sourceChains.includes(s) && e.envs.includes(t)
|
|
808
806
|
);
|
|
809
807
|
}
|
|
810
|
-
class
|
|
808
|
+
class Vt extends C {
|
|
811
809
|
constructor(e, n) {
|
|
812
|
-
super(
|
|
810
|
+
super(r.IDLE);
|
|
813
811
|
a(this, "_amount");
|
|
814
812
|
a(this, "_recipient");
|
|
815
813
|
a(this, "_txHash");
|
|
@@ -832,35 +830,35 @@ class jt extends C {
|
|
|
832
830
|
return this._txHash;
|
|
833
831
|
}
|
|
834
832
|
async prepare(e) {
|
|
835
|
-
return this.assertStatus(
|
|
833
|
+
return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
|
|
836
834
|
const n = f(this.prepareSchema, e, {
|
|
837
835
|
destChain: this.params.destChain
|
|
838
836
|
});
|
|
839
837
|
this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
|
|
840
|
-
status:
|
|
838
|
+
status: r.READY,
|
|
841
839
|
steps: { burning: o.IDLE, releasing: o.IDLE }
|
|
842
840
|
});
|
|
843
|
-
},
|
|
841
|
+
}, r.READY);
|
|
844
842
|
}
|
|
845
843
|
async execute() {
|
|
846
|
-
return this.assertStatus(
|
|
844
|
+
return this.assertStatus(r.READY, "execute"), this.act(async () => {
|
|
847
845
|
const e = this._amount, n = this._recipient;
|
|
848
846
|
if (!e || !n)
|
|
849
847
|
throw d.missingParameter("amount or recipient");
|
|
850
848
|
this.emitProgress({
|
|
851
|
-
status:
|
|
849
|
+
status: r.READY,
|
|
852
850
|
steps: { burning: o.PENDING, releasing: o.IDLE }
|
|
853
851
|
});
|
|
854
|
-
const { txHash:
|
|
852
|
+
const { txHash: i } = await this.ctx.starknet.unstake({
|
|
855
853
|
amount: e,
|
|
856
854
|
btcAddress: n,
|
|
857
855
|
env: this.env
|
|
858
856
|
});
|
|
859
|
-
return this._txHash =
|
|
860
|
-
status:
|
|
857
|
+
return this._txHash = i, this.emitProgress({
|
|
858
|
+
status: r.COMPLETED,
|
|
861
859
|
steps: { burning: o.COMPLETE, releasing: o.PENDING }
|
|
862
|
-
}), this.emitCompleted(), { txHash:
|
|
863
|
-
},
|
|
860
|
+
}), this.emitCompleted(), { txHash: i };
|
|
861
|
+
}, r.COMPLETED);
|
|
864
862
|
}
|
|
865
863
|
get prepareSchema() {
|
|
866
864
|
return E({
|
|
@@ -869,26 +867,26 @@ class jt extends C {
|
|
|
869
867
|
});
|
|
870
868
|
}
|
|
871
869
|
}
|
|
872
|
-
function
|
|
870
|
+
function jt(s) {
|
|
873
871
|
const e = new S(s.modules, s).require("starknet");
|
|
874
872
|
return {
|
|
875
873
|
env: s.env,
|
|
876
874
|
partner: new _(s.partner),
|
|
877
875
|
getProvider: async (n) => {
|
|
878
|
-
const
|
|
879
|
-
if (
|
|
880
|
-
return
|
|
876
|
+
const i = D(s.providers, n);
|
|
877
|
+
if (i)
|
|
878
|
+
return i();
|
|
881
879
|
},
|
|
882
880
|
starknet: e
|
|
883
881
|
};
|
|
884
882
|
}
|
|
885
|
-
class
|
|
883
|
+
class K {
|
|
886
884
|
constructor(t) {
|
|
887
885
|
a(this, "_ctx", null);
|
|
888
886
|
this.config = t;
|
|
889
887
|
}
|
|
890
888
|
get ctx() {
|
|
891
|
-
return this._ctx || (this._ctx =
|
|
889
|
+
return this._ctx || (this._ctx = jt(this.config)), this._ctx;
|
|
892
890
|
}
|
|
893
891
|
/**
|
|
894
892
|
* Unstake LBTC → BTC
|
|
@@ -898,13 +896,13 @@ class V {
|
|
|
898
896
|
* @throws LombardError if starknet module is not registered
|
|
899
897
|
*/
|
|
900
898
|
unstake(t) {
|
|
901
|
-
return new
|
|
899
|
+
return new Vt(this.ctx, t);
|
|
902
900
|
}
|
|
903
901
|
}
|
|
904
|
-
function
|
|
905
|
-
return new
|
|
902
|
+
function ve(s) {
|
|
903
|
+
return new K(s);
|
|
906
904
|
}
|
|
907
|
-
const
|
|
905
|
+
const V = {
|
|
908
906
|
routes: [
|
|
909
907
|
{
|
|
910
908
|
sourceChains: [h.SUI_MAINNET],
|
|
@@ -919,12 +917,12 @@ const K = {
|
|
|
919
917
|
],
|
|
920
918
|
recipientSchema: I
|
|
921
919
|
};
|
|
922
|
-
function
|
|
923
|
-
return
|
|
920
|
+
function $t(s, t) {
|
|
921
|
+
return V.routes.some(
|
|
924
922
|
(e) => e.sourceChains.includes(s) && e.envs.includes(t)
|
|
925
923
|
);
|
|
926
924
|
}
|
|
927
|
-
function
|
|
925
|
+
function qt(s) {
|
|
928
926
|
switch (s) {
|
|
929
927
|
case h.SUI_MAINNET:
|
|
930
928
|
return "sui:mainnet";
|
|
@@ -934,14 +932,14 @@ function zt(s) {
|
|
|
934
932
|
return "sui:testnet";
|
|
935
933
|
}
|
|
936
934
|
}
|
|
937
|
-
class
|
|
935
|
+
class zt extends C {
|
|
938
936
|
constructor(e, n) {
|
|
939
|
-
super(
|
|
937
|
+
super(r.IDLE);
|
|
940
938
|
a(this, "_amount");
|
|
941
939
|
a(this, "_recipient");
|
|
942
940
|
a(this, "_txHash");
|
|
943
941
|
a(this, "env");
|
|
944
|
-
if (this.ctx = e, this.params = n, this.env = e.env,
|
|
942
|
+
if (this.ctx = e, this.params = n, this.env = e.env, !$t(n.sourceChain, this.env))
|
|
945
943
|
throw d.routeNotFound({
|
|
946
944
|
assetOut: n.assetOut,
|
|
947
945
|
sourceChain: n.sourceChain,
|
|
@@ -959,53 +957,53 @@ class Wt extends C {
|
|
|
959
957
|
return this._txHash;
|
|
960
958
|
}
|
|
961
959
|
async prepare(e) {
|
|
962
|
-
return this.assertStatus(
|
|
960
|
+
return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
|
|
963
961
|
const n = f(this.prepareSchema, e, {
|
|
964
962
|
destChain: this.params.destChain
|
|
965
963
|
});
|
|
966
964
|
this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
|
|
967
|
-
status:
|
|
965
|
+
status: r.READY,
|
|
968
966
|
steps: { burning: o.IDLE, releasing: o.IDLE }
|
|
969
967
|
});
|
|
970
|
-
},
|
|
968
|
+
}, r.READY);
|
|
971
969
|
}
|
|
972
970
|
async execute() {
|
|
973
|
-
return this.assertStatus(
|
|
971
|
+
return this.assertStatus(r.READY, "execute"), this.act(async () => {
|
|
974
972
|
const e = this._amount, n = this._recipient;
|
|
975
973
|
if (!e || !n)
|
|
976
974
|
throw d.missingParameter("amount or recipient");
|
|
977
975
|
this.emitProgress({
|
|
978
|
-
status:
|
|
976
|
+
status: r.READY,
|
|
979
977
|
steps: { burning: o.PENDING, releasing: o.IDLE }
|
|
980
978
|
});
|
|
981
|
-
const
|
|
979
|
+
const i = qt(this.params.sourceChain), { txHash: u } = await this.ctx.sui.unstake({
|
|
982
980
|
amount: e,
|
|
983
981
|
btcAddress: n,
|
|
984
|
-
chainId:
|
|
982
|
+
chainId: i,
|
|
985
983
|
env: this.env
|
|
986
984
|
});
|
|
987
985
|
return this._txHash = u, this.emitProgress({
|
|
988
|
-
status:
|
|
986
|
+
status: r.COMPLETED,
|
|
989
987
|
steps: { burning: o.COMPLETE, releasing: o.PENDING }
|
|
990
988
|
}), this.emitCompleted(), { txHash: u };
|
|
991
|
-
},
|
|
989
|
+
}, r.COMPLETED);
|
|
992
990
|
}
|
|
993
991
|
get prepareSchema() {
|
|
994
992
|
return E({
|
|
995
993
|
amount: A,
|
|
996
|
-
recipient:
|
|
994
|
+
recipient: V.recipientSchema
|
|
997
995
|
});
|
|
998
996
|
}
|
|
999
997
|
}
|
|
1000
|
-
function
|
|
998
|
+
function Wt(s) {
|
|
1001
999
|
const e = new S(s.modules, s).require("sui");
|
|
1002
1000
|
return {
|
|
1003
1001
|
env: s.env,
|
|
1004
1002
|
partner: new _(s.partner),
|
|
1005
1003
|
getProvider: async (n) => {
|
|
1006
|
-
const
|
|
1007
|
-
if (
|
|
1008
|
-
return
|
|
1004
|
+
const i = D(s.providers, n);
|
|
1005
|
+
if (i)
|
|
1006
|
+
return i();
|
|
1009
1007
|
},
|
|
1010
1008
|
sui: e
|
|
1011
1009
|
};
|
|
@@ -1016,7 +1014,7 @@ class j {
|
|
|
1016
1014
|
this.config = t;
|
|
1017
1015
|
}
|
|
1018
1016
|
get ctx() {
|
|
1019
|
-
return this._ctx || (this._ctx =
|
|
1017
|
+
return this._ctx || (this._ctx = Wt(this.config)), this._ctx;
|
|
1020
1018
|
}
|
|
1021
1019
|
/**
|
|
1022
1020
|
* Unstake LBTC → BTC
|
|
@@ -1026,13 +1024,13 @@ class j {
|
|
|
1026
1024
|
* @throws LombardError if sui module is not registered
|
|
1027
1025
|
*/
|
|
1028
1026
|
unstake(t) {
|
|
1029
|
-
return new
|
|
1027
|
+
return new zt(this.ctx, t);
|
|
1030
1028
|
}
|
|
1031
1029
|
}
|
|
1032
|
-
function
|
|
1030
|
+
function Ce(s) {
|
|
1033
1031
|
return new j(s);
|
|
1034
1032
|
}
|
|
1035
|
-
class
|
|
1033
|
+
class Xt {
|
|
1036
1034
|
constructor(t = B, e) {
|
|
1037
1035
|
a(this, "catalog");
|
|
1038
1036
|
this.env = t, this.catalog = e ?? b;
|
|
@@ -1090,7 +1088,7 @@ class Zt {
|
|
|
1090
1088
|
return this.catalog;
|
|
1091
1089
|
}
|
|
1092
1090
|
}
|
|
1093
|
-
class
|
|
1091
|
+
class Zt {
|
|
1094
1092
|
constructor(t) {
|
|
1095
1093
|
a(this, "config");
|
|
1096
1094
|
a(this, "env");
|
|
@@ -1133,8 +1131,8 @@ class Jt {
|
|
|
1133
1131
|
evm: new Et(this.config),
|
|
1134
1132
|
solana: new G(this.config),
|
|
1135
1133
|
sui: new j(this.config),
|
|
1136
|
-
starknet: new
|
|
1137
|
-
}, this.referrals = new lt(this), this.assets = new
|
|
1134
|
+
starknet: new K(this.config)
|
|
1135
|
+
}, this.referrals = new lt(this), this.assets = new Xt(this.env), this.api = new Tt(this.env);
|
|
1138
1136
|
}
|
|
1139
1137
|
async getProvider(t) {
|
|
1140
1138
|
const e = t;
|
|
@@ -1143,13 +1141,13 @@ class Jt {
|
|
|
1143
1141
|
const n = D(this.config.providers, t);
|
|
1144
1142
|
if (!n)
|
|
1145
1143
|
throw d.providerMissing(t, t);
|
|
1146
|
-
const
|
|
1147
|
-
if (!
|
|
1144
|
+
const i = await n();
|
|
1145
|
+
if (!i)
|
|
1148
1146
|
throw new d(
|
|
1149
1147
|
ct.PROVIDER_INITIALIZATION_FAILED,
|
|
1150
1148
|
`Failed to initialize ${t} provider`
|
|
1151
1149
|
);
|
|
1152
|
-
return this.providerCache.set(e,
|
|
1150
|
+
return this.providerCache.set(e, i), i;
|
|
1153
1151
|
}
|
|
1154
1152
|
/**
|
|
1155
1153
|
* Configure partner settings
|
|
@@ -1178,32 +1176,32 @@ class Jt {
|
|
|
1178
1176
|
}
|
|
1179
1177
|
}
|
|
1180
1178
|
const N = /* @__PURE__ */ new Map();
|
|
1181
|
-
function
|
|
1179
|
+
function Jt(s) {
|
|
1182
1180
|
return N.has(s) || N.set(s, Promise.resolve(b)), N.get(s);
|
|
1183
1181
|
}
|
|
1184
|
-
async function
|
|
1185
|
-
const t = "modules" in s && Array.isArray(s.modules) ? s :
|
|
1182
|
+
async function fe(s) {
|
|
1183
|
+
const t = "modules" in s && Array.isArray(s.modules) ? s : kt(s), e = await Jt(t.env), n = {
|
|
1186
1184
|
...t,
|
|
1187
1185
|
catalog: e
|
|
1188
1186
|
};
|
|
1189
|
-
return new
|
|
1187
|
+
return new Zt(n);
|
|
1190
1188
|
}
|
|
1191
|
-
function
|
|
1189
|
+
function Ee(s) {
|
|
1192
1190
|
return typeof s == "object" && s !== null && "request" in s && typeof s.request == "function";
|
|
1193
1191
|
}
|
|
1194
|
-
function
|
|
1192
|
+
function Ae(s) {
|
|
1195
1193
|
return typeof s == "object" && s !== null && "getAddresses" in s && typeof s.getAddresses == "function";
|
|
1196
1194
|
}
|
|
1197
|
-
function
|
|
1195
|
+
function Ie(s) {
|
|
1198
1196
|
return typeof s == "object" && s !== null && "publicKey" in s && "signAndSendTransaction" in s;
|
|
1199
1197
|
}
|
|
1200
|
-
function
|
|
1198
|
+
function Se(s) {
|
|
1201
1199
|
return typeof s == "object" && s !== null && "getAddress" in s && "signAndExecuteTransactionBlock" in s;
|
|
1202
1200
|
}
|
|
1203
|
-
function
|
|
1201
|
+
function _e(s) {
|
|
1204
1202
|
return typeof s == "object" && s !== null && "address" in s && "execute" in s;
|
|
1205
1203
|
}
|
|
1206
|
-
const
|
|
1204
|
+
const De = {
|
|
1207
1205
|
/** Progress update with detailed step information */
|
|
1208
1206
|
Progress: "progress",
|
|
1209
1207
|
/** Status change (e.g., 'idle' → 'preparing' → 'ready') */
|
|
@@ -1214,31 +1212,31 @@ const Te = {
|
|
|
1214
1212
|
Failed: "failed",
|
|
1215
1213
|
/** Error occurred */
|
|
1216
1214
|
Error: "error"
|
|
1217
|
-
},
|
|
1215
|
+
}, Ne = {
|
|
1218
1216
|
Progress: "progress",
|
|
1219
1217
|
StatusChange: "status-change",
|
|
1220
1218
|
Completed: "completed",
|
|
1221
1219
|
Failed: "failed",
|
|
1222
1220
|
Error: "error"
|
|
1223
|
-
},
|
|
1221
|
+
}, Te = {
|
|
1224
1222
|
Progress: "progress",
|
|
1225
1223
|
StatusChange: "status-change",
|
|
1226
1224
|
Completed: "completed",
|
|
1227
1225
|
Failed: "failed",
|
|
1228
1226
|
Error: "error"
|
|
1229
|
-
},
|
|
1227
|
+
}, xe = {
|
|
1230
1228
|
Progress: "progress",
|
|
1231
1229
|
StatusChange: "status-change",
|
|
1232
1230
|
Completed: "completed",
|
|
1233
1231
|
Failed: "failed",
|
|
1234
1232
|
Error: "error"
|
|
1235
|
-
},
|
|
1233
|
+
}, Pe = {
|
|
1236
1234
|
Progress: "progress",
|
|
1237
1235
|
StatusChange: "status-change",
|
|
1238
1236
|
Completed: "completed",
|
|
1239
1237
|
Failed: "failed",
|
|
1240
1238
|
Error: "error"
|
|
1241
|
-
},
|
|
1239
|
+
}, we = {
|
|
1242
1240
|
Progress: "progress",
|
|
1243
1241
|
StatusChange: "status-change",
|
|
1244
1242
|
Completed: "completed",
|
|
@@ -1246,29 +1244,29 @@ const Te = {
|
|
|
1246
1244
|
Error: "error"
|
|
1247
1245
|
};
|
|
1248
1246
|
export {
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1247
|
+
Tt as ApiNamespace,
|
|
1248
|
+
we as BridgeEvent,
|
|
1249
|
+
Pe as DeployEvent,
|
|
1250
|
+
Ne as DepositEvent,
|
|
1251
|
+
Zt as LombardSDK,
|
|
1252
|
+
Te as RedeemEvent,
|
|
1255
1253
|
G as SolanaActions,
|
|
1256
|
-
|
|
1257
|
-
|
|
1254
|
+
De as StakeEvent,
|
|
1255
|
+
K as StarknetActions,
|
|
1258
1256
|
j as SuiActions,
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1257
|
+
xe as UnstakeEvent,
|
|
1258
|
+
kt as createConfig,
|
|
1259
|
+
Nt as createConsoleLogger,
|
|
1260
|
+
fe as createLombardSDK,
|
|
1261
|
+
le as createSilentLogger,
|
|
1262
|
+
pe as getSdkHeaders,
|
|
1263
|
+
Ae as isBtcProvider,
|
|
1264
|
+
Ee as isEvmProvider,
|
|
1265
|
+
Ie as isSolanaProvider,
|
|
1266
|
+
_e as isStarknetProvider,
|
|
1267
|
+
Se as isSuiProvider,
|
|
1268
|
+
me as solanaActions,
|
|
1269
|
+
ve as starknetActions,
|
|
1270
|
+
Ce as suiActions
|
|
1273
1271
|
};
|
|
1274
|
-
//# sourceMappingURL=events-
|
|
1272
|
+
//# sourceMappingURL=events-DU2wYlt_.js.map
|