@lombard.finance/sdk 3.7.4 → 4.1.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 +52 -0
- package/README.md +102 -698
- package/dist/api-functions/getDepositAddressReferrer/getDepositAddressReferrer.d.ts +15 -0
- package/dist/api-functions/getDepositAddressReferrer/getDepositAddressReferrer.d.ts.map +1 -0
- package/dist/api-functions/getDepositAddressReferrer/index.d.ts +2 -0
- package/dist/api-functions/getDepositAddressReferrer/index.d.ts.map +1 -0
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddress.d.ts +1 -1
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddress.d.ts.map +1 -1
- package/dist/api-functions/getLBTCExchangeRate/getLBTCExchangeRate.d.ts +3 -0
- package/dist/api-functions/getLBTCExchangeRate/getLBTCExchangeRate.d.ts.map +1 -1
- package/dist/api-functions/getNetworkFeeSignature/getNetworkFeeSignature.d.ts +8 -0
- package/dist/api-functions/getNetworkFeeSignature/getNetworkFeeSignature.d.ts.map +1 -1
- package/dist/api-functions/setReferral/setReferral.d.ts +5 -1
- package/dist/api-functions/setReferral/setReferral.d.ts.map +1 -1
- package/dist/api-functions/storeNetworkFeeSignature/storeNetworkFeeSignature.d.ts +5 -1
- package/dist/api-functions/storeNetworkFeeSignature/storeNetworkFeeSignature.d.ts.map +1 -1
- package/dist/bridge/lib/config.d.ts +5 -5
- package/dist/chains/btc/BtcActions.d.ts +155 -0
- package/dist/chains/btc/BtcActions.d.ts.map +1 -0
- package/dist/chains/btc/actions/deposit/BtcDeposit.d.ts +83 -0
- package/dist/chains/btc/actions/deposit/BtcDeposit.d.ts.map +1 -0
- package/dist/chains/btc/actions/deposit/config/evm.d.ts +22 -0
- package/dist/chains/btc/actions/deposit/config/evm.d.ts.map +1 -0
- package/dist/chains/btc/actions/deposit/config/index.d.ts +27 -0
- package/dist/chains/btc/actions/deposit/config/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/deposit/config/types.d.ts +90 -0
- package/dist/chains/btc/actions/deposit/config/types.d.ts.map +1 -0
- package/dist/chains/btc/actions/deposit/factory.d.ts +39 -0
- package/dist/chains/btc/actions/deposit/factory.d.ts.map +1 -0
- package/dist/chains/btc/actions/deposit/index.d.ts +11 -0
- package/dist/chains/btc/actions/deposit/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/deposit/types.d.ts +94 -0
- package/dist/chains/btc/actions/deposit/types.d.ts.map +1 -0
- package/dist/chains/btc/actions/depositAndDeploy/BtcDepositAndDeploy.d.ts +69 -0
- package/dist/chains/btc/actions/depositAndDeploy/BtcDepositAndDeploy.d.ts.map +1 -0
- package/dist/chains/btc/actions/depositAndDeploy/config/evm.d.ts +19 -0
- package/dist/chains/btc/actions/depositAndDeploy/config/evm.d.ts.map +1 -0
- package/dist/chains/btc/actions/depositAndDeploy/config/index.d.ts +54 -0
- package/dist/chains/btc/actions/depositAndDeploy/config/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/depositAndDeploy/config/types.d.ts +54 -0
- package/dist/chains/btc/actions/depositAndDeploy/config/types.d.ts.map +1 -0
- package/dist/chains/btc/actions/depositAndDeploy/factory.d.ts +32 -0
- package/dist/chains/btc/actions/depositAndDeploy/factory.d.ts.map +1 -0
- package/dist/chains/btc/actions/depositAndDeploy/index.d.ts +12 -0
- package/dist/chains/btc/actions/depositAndDeploy/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/depositAndDeploy/types.d.ts +93 -0
- package/dist/chains/btc/actions/depositAndDeploy/types.d.ts.map +1 -0
- package/dist/chains/btc/actions/index.d.ts +9 -0
- package/dist/chains/btc/actions/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/shared/BaseBtcAction.d.ts +201 -0
- package/dist/chains/btc/actions/shared/BaseBtcAction.d.ts.map +1 -0
- package/dist/chains/btc/actions/shared/index.d.ts +13 -0
- package/dist/chains/btc/actions/shared/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/shared/tokenUtils.d.ts +54 -0
- package/dist/chains/btc/actions/shared/tokenUtils.d.ts.map +1 -0
- package/dist/chains/btc/actions/shared/validation.d.ts +90 -0
- package/dist/chains/btc/actions/shared/validation.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/BtcStake.d.ts +82 -0
- package/dist/chains/btc/actions/stake/BtcStake.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/config/evm.d.ts +20 -0
- package/dist/chains/btc/actions/stake/config/evm.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/config/index.d.ts +63 -0
- package/dist/chains/btc/actions/stake/config/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/config/solana.d.ts +20 -0
- package/dist/chains/btc/actions/stake/config/solana.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/config/starknet.d.ts +21 -0
- package/dist/chains/btc/actions/stake/config/starknet.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/config/sui.d.ts +20 -0
- package/dist/chains/btc/actions/stake/config/sui.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/config/types.d.ts +127 -0
- package/dist/chains/btc/actions/stake/config/types.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/factory.d.ts +39 -0
- package/dist/chains/btc/actions/stake/factory.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/index.d.ts +11 -0
- package/dist/chains/btc/actions/stake/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/stake/types.d.ts +152 -0
- package/dist/chains/btc/actions/stake/types.d.ts.map +1 -0
- package/dist/chains/btc/actions/stakeAndDeploy/BtcStakeAndDeploy.d.ts +68 -0
- package/dist/chains/btc/actions/stakeAndDeploy/BtcStakeAndDeploy.d.ts.map +1 -0
- package/dist/chains/btc/actions/stakeAndDeploy/config/evm.d.ts +19 -0
- package/dist/chains/btc/actions/stakeAndDeploy/config/evm.d.ts.map +1 -0
- package/dist/chains/btc/actions/stakeAndDeploy/config/index.d.ts +54 -0
- package/dist/chains/btc/actions/stakeAndDeploy/config/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/stakeAndDeploy/config/types.d.ts +74 -0
- package/dist/chains/btc/actions/stakeAndDeploy/config/types.d.ts.map +1 -0
- package/dist/chains/btc/actions/stakeAndDeploy/factory.d.ts +40 -0
- package/dist/chains/btc/actions/stakeAndDeploy/factory.d.ts.map +1 -0
- package/dist/chains/btc/actions/stakeAndDeploy/index.d.ts +11 -0
- package/dist/chains/btc/actions/stakeAndDeploy/index.d.ts.map +1 -0
- package/dist/chains/btc/actions/stakeAndDeploy/types.d.ts +91 -0
- package/dist/chains/btc/actions/stakeAndDeploy/types.d.ts.map +1 -0
- package/dist/chains/btc/client/getCurrentBlockHeight.d.ts +6 -0
- package/dist/chains/btc/client/getCurrentBlockHeight.d.ts.map +1 -0
- package/dist/chains/btc/client/mempool/error.d.ts +10 -0
- package/dist/chains/btc/client/mempool/error.d.ts.map +1 -0
- package/dist/chains/btc/client/mempool/mempool.d.ts +14 -0
- package/dist/chains/btc/client/mempool/mempool.d.ts.map +1 -0
- package/dist/chains/btc/index.d.ts +18 -0
- package/dist/chains/btc/index.d.ts.map +1 -0
- package/dist/chains/evm/EvmActions.d.ts +140 -0
- package/dist/chains/evm/EvmActions.d.ts.map +1 -0
- package/dist/chains/evm/actions/deploy/EvmDeploy.d.ts +40 -0
- package/dist/chains/evm/actions/deploy/EvmDeploy.d.ts.map +1 -0
- package/dist/chains/evm/actions/deploy/config/evm.d.ts +22 -0
- package/dist/chains/evm/actions/deploy/config/evm.d.ts.map +1 -0
- package/dist/chains/evm/actions/deploy/config/index.d.ts +8 -0
- package/dist/chains/evm/actions/deploy/config/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/deploy/config/types.d.ts +32 -0
- package/dist/chains/evm/actions/deploy/config/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/deploy/factory.d.ts +30 -0
- package/dist/chains/evm/actions/deploy/factory.d.ts.map +1 -0
- package/dist/chains/evm/actions/deploy/index.d.ts +11 -0
- package/dist/chains/evm/actions/deploy/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/deploy/types.d.ts +62 -0
- package/dist/chains/evm/actions/deploy/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/deposit/EvmDeposit.d.ts +38 -0
- package/dist/chains/evm/actions/deposit/EvmDeposit.d.ts.map +1 -0
- package/dist/chains/evm/actions/deposit/config/evm.d.ts +23 -0
- package/dist/chains/evm/actions/deposit/config/evm.d.ts.map +1 -0
- package/dist/chains/evm/actions/deposit/config/index.d.ts +8 -0
- package/dist/chains/evm/actions/deposit/config/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/deposit/config/types.d.ts +34 -0
- package/dist/chains/evm/actions/deposit/config/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/deposit/factory.d.ts +30 -0
- package/dist/chains/evm/actions/deposit/factory.d.ts.map +1 -0
- package/dist/chains/evm/actions/deposit/index.d.ts +11 -0
- package/dist/chains/evm/actions/deposit/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/deposit/types.d.ts +78 -0
- package/dist/chains/evm/actions/deposit/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/index.d.ts +13 -0
- package/dist/chains/evm/actions/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/redeem/EvmRedeem.d.ts +57 -0
- package/dist/chains/evm/actions/redeem/EvmRedeem.d.ts.map +1 -0
- package/dist/chains/evm/actions/redeem/config/evm.d.ts +24 -0
- package/dist/chains/evm/actions/redeem/config/evm.d.ts.map +1 -0
- package/dist/chains/evm/actions/redeem/config/index.d.ts +8 -0
- package/dist/chains/evm/actions/redeem/config/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/redeem/config/types.d.ts +34 -0
- package/dist/chains/evm/actions/redeem/config/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/redeem/factory.d.ts +29 -0
- package/dist/chains/evm/actions/redeem/factory.d.ts.map +1 -0
- package/dist/chains/evm/actions/redeem/index.d.ts +11 -0
- package/dist/chains/evm/actions/redeem/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/redeem/types.d.ts +81 -0
- package/dist/chains/evm/actions/redeem/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/stake/EvmStake.d.ts +62 -0
- package/dist/chains/evm/actions/stake/EvmStake.d.ts.map +1 -0
- package/dist/chains/evm/actions/stake/config/evm.d.ts +28 -0
- package/dist/chains/evm/actions/stake/config/evm.d.ts.map +1 -0
- package/dist/chains/evm/actions/stake/config/index.d.ts +8 -0
- package/dist/chains/evm/actions/stake/config/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/stake/config/types.d.ts +60 -0
- package/dist/chains/evm/actions/stake/config/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/stake/factory.d.ts +38 -0
- package/dist/chains/evm/actions/stake/factory.d.ts.map +1 -0
- package/dist/chains/evm/actions/stake/index.d.ts +13 -0
- package/dist/chains/evm/actions/stake/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/stake/types.d.ts +94 -0
- package/dist/chains/evm/actions/stake/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/unstake/EvmUnstake.d.ts +54 -0
- package/dist/chains/evm/actions/unstake/EvmUnstake.d.ts.map +1 -0
- package/dist/chains/evm/actions/unstake/config/evm.d.ts +34 -0
- package/dist/chains/evm/actions/unstake/config/evm.d.ts.map +1 -0
- package/dist/chains/evm/actions/unstake/config/index.d.ts +8 -0
- package/dist/chains/evm/actions/unstake/config/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/unstake/config/types.d.ts +32 -0
- package/dist/chains/evm/actions/unstake/config/types.d.ts.map +1 -0
- package/dist/chains/evm/actions/unstake/factory.d.ts +30 -0
- package/dist/chains/evm/actions/unstake/factory.d.ts.map +1 -0
- package/dist/chains/evm/actions/unstake/index.d.ts +11 -0
- package/dist/chains/evm/actions/unstake/index.d.ts.map +1 -0
- package/dist/chains/evm/actions/unstake/types.d.ts +75 -0
- package/dist/chains/evm/actions/unstake/types.d.ts.map +1 -0
- package/dist/chains/evm/index.d.ts +11 -0
- package/dist/chains/evm/index.d.ts.map +1 -0
- package/dist/chains/evm/shared/feeAuth.d.ts +88 -0
- package/dist/chains/evm/shared/feeAuth.d.ts.map +1 -0
- package/dist/chains/evm/shared/index.d.ts +7 -0
- package/dist/chains/evm/shared/index.d.ts.map +1 -0
- package/dist/chains/solana/SolanaActions.d.ts +42 -0
- package/dist/chains/solana/SolanaActions.d.ts.map +1 -0
- package/dist/chains/solana/actions/index.d.ts +7 -0
- package/dist/chains/solana/actions/index.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/SolanaUnstake.d.ts +30 -0
- package/dist/chains/solana/actions/unstake/SolanaUnstake.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/config/btc.d.ts +20 -0
- package/dist/chains/solana/actions/unstake/config/btc.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/config/index.d.ts +8 -0
- package/dist/chains/solana/actions/unstake/config/index.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/config/solana.d.ts +20 -0
- package/dist/chains/solana/actions/unstake/config/solana.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/config/types.d.ts +30 -0
- package/dist/chains/solana/actions/unstake/config/types.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/factory.d.ts +19 -0
- package/dist/chains/solana/actions/unstake/factory.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/index.d.ts +9 -0
- package/dist/chains/solana/actions/unstake/index.d.ts.map +1 -0
- package/dist/chains/solana/actions/unstake/types.d.ts +49 -0
- package/dist/chains/solana/actions/unstake/types.d.ts.map +1 -0
- package/dist/chains/solana/index.d.ts +8 -0
- package/dist/chains/solana/index.d.ts.map +1 -0
- package/dist/chains/starknet/StarknetActions.d.ts +42 -0
- package/dist/chains/starknet/StarknetActions.d.ts.map +1 -0
- package/dist/chains/starknet/actions/index.d.ts +7 -0
- package/dist/chains/starknet/actions/index.d.ts.map +1 -0
- package/dist/chains/starknet/actions/unstake/StarknetUnstake.d.ts +30 -0
- package/dist/chains/starknet/actions/unstake/StarknetUnstake.d.ts.map +1 -0
- package/dist/chains/starknet/actions/unstake/config/btc.d.ts +18 -0
- package/dist/chains/starknet/actions/unstake/config/btc.d.ts.map +1 -0
- package/dist/chains/starknet/actions/unstake/config/index.d.ts +8 -0
- package/dist/chains/starknet/actions/unstake/config/index.d.ts.map +1 -0
- package/dist/chains/starknet/actions/unstake/config/starknet.d.ts +18 -0
- package/dist/chains/starknet/actions/unstake/config/starknet.d.ts.map +1 -0
- package/dist/chains/starknet/actions/unstake/config/types.d.ts +24 -0
- package/dist/chains/starknet/actions/unstake/config/types.d.ts.map +1 -0
- package/dist/chains/starknet/actions/unstake/factory.d.ts +17 -0
- package/dist/chains/starknet/actions/unstake/factory.d.ts.map +1 -0
- package/dist/chains/starknet/actions/unstake/index.d.ts +9 -0
- package/dist/chains/starknet/actions/unstake/index.d.ts.map +1 -0
- package/dist/chains/starknet/actions/unstake/types.d.ts +48 -0
- package/dist/chains/starknet/actions/unstake/types.d.ts.map +1 -0
- package/dist/chains/starknet/index.d.ts +8 -0
- package/dist/chains/starknet/index.d.ts.map +1 -0
- package/dist/chains/sui/SuiActions.d.ts +42 -0
- package/dist/chains/sui/SuiActions.d.ts.map +1 -0
- package/dist/chains/sui/actions/index.d.ts +7 -0
- package/dist/chains/sui/actions/index.d.ts.map +1 -0
- package/dist/chains/sui/actions/unstake/SuiUnstake.d.ts +30 -0
- package/dist/chains/sui/actions/unstake/SuiUnstake.d.ts.map +1 -0
- package/dist/chains/sui/actions/unstake/config/btc.d.ts +18 -0
- package/dist/chains/sui/actions/unstake/config/btc.d.ts.map +1 -0
- package/dist/chains/sui/actions/unstake/config/index.d.ts +8 -0
- package/dist/chains/sui/actions/unstake/config/index.d.ts.map +1 -0
- package/dist/chains/sui/actions/unstake/config/sui.d.ts +18 -0
- package/dist/chains/sui/actions/unstake/config/sui.d.ts.map +1 -0
- package/dist/chains/sui/actions/unstake/config/types.d.ts +24 -0
- package/dist/chains/sui/actions/unstake/config/types.d.ts.map +1 -0
- package/dist/chains/sui/actions/unstake/factory.d.ts +17 -0
- package/dist/chains/sui/actions/unstake/factory.d.ts.map +1 -0
- package/dist/chains/sui/actions/unstake/index.d.ts +9 -0
- package/dist/chains/sui/actions/unstake/index.d.ts.map +1 -0
- package/dist/chains/sui/actions/unstake/types.d.ts +48 -0
- package/dist/chains/sui/actions/unstake/types.d.ts.map +1 -0
- package/dist/chains/sui/index.d.ts +8 -0
- package/dist/chains/sui/index.d.ts.map +1 -0
- package/dist/client/ApiNamespace.d.ts +207 -0
- package/dist/client/ApiNamespace.d.ts.map +1 -0
- package/dist/client/AssetNamespace.d.ts +53 -0
- package/dist/client/AssetNamespace.d.ts.map +1 -0
- package/dist/client/LombardSDK.d.ts +122 -0
- package/dist/client/LombardSDK.d.ts.map +1 -0
- package/dist/client/PartnerConfiguration.d.ts +34 -0
- package/dist/client/PartnerConfiguration.d.ts.map +1 -0
- package/dist/client/createConfig.d.ts +30 -0
- package/dist/client/createConfig.d.ts.map +1 -0
- package/dist/client/createLombardSDK.d.ts +64 -0
- package/dist/client/createLombardSDK.d.ts.map +1 -0
- package/dist/clients/public-client.d.ts.map +1 -1
- package/dist/clients/rpc-url-config.d.ts.map +1 -1
- package/dist/common/api-config.d.ts +1 -2
- package/dist/common/api-config.d.ts.map +1 -1
- package/dist/common/chains.d.ts +745 -768
- package/dist/common/chains.d.ts.map +1 -1
- package/dist/common/feature-config.d.ts +44 -4
- package/dist/common/feature-config.d.ts.map +1 -1
- package/dist/common/fee-requirements.d.ts +27 -0
- package/dist/common/fee-requirements.d.ts.map +1 -0
- package/dist/config/defaults.d.ts +27 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/index.d.ts +12 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/providers.d.ts +23 -0
- package/dist/config/providers.d.ts.map +1 -0
- package/dist/config/types.d.ts +162 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/validation.d.ts +21 -0
- package/dist/config/validation.d.ts.map +1 -0
- package/dist/contract-functions/signStakeAndBake/signStakeAndBake.d.ts +1 -1
- package/dist/contract-functions/signStakeAndBake/signStakeAndBake.d.ts.map +1 -1
- package/dist/contract-functions/signStakeAndBake/validation.d.ts +3 -3
- package/dist/contracts/abis/index.d.ts +18 -0
- package/dist/contracts/abis/index.d.ts.map +1 -0
- package/dist/contracts/index.d.ts +43 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/types.d.ts +127 -0
- package/dist/contracts/types.d.ts.map +1 -0
- package/dist/contracts/utils.d.ts +106 -0
- package/dist/contracts/utils.d.ts.map +1 -0
- package/dist/core/assets/catalog.d.ts +11 -0
- package/dist/core/assets/catalog.d.ts.map +1 -0
- package/dist/core/assets/index.d.ts +12 -0
- package/dist/core/assets/index.d.ts.map +1 -0
- package/dist/core/assets/types.d.ts +93 -0
- package/dist/core/assets/types.d.ts.map +1 -0
- package/dist/core/assets/utils.d.ts +82 -0
- package/dist/core/assets/utils.d.ts.map +1 -0
- package/dist/core/chains/catalog.d.ts +14 -0
- package/dist/core/chains/catalog.d.ts.map +1 -0
- package/dist/core/chains/index.d.ts +13 -0
- package/dist/core/chains/index.d.ts.map +1 -0
- package/dist/core/chains/types.d.ts +106 -0
- package/dist/core/chains/types.d.ts.map +1 -0
- package/dist/core/chains/utils.d.ts +55 -0
- package/dist/core/chains/utils.d.ts.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/types.d.ts +86 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/defi/defi-registry.d.ts +63 -6
- package/dist/defi/defi-registry.d.ts.map +1 -1
- package/dist/defi/index.d.ts +2 -1
- package/dist/defi/index.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +61 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +268 -155
- package/dist/index2.cjs +66 -66
- package/dist/index2.js +19781 -14368
- package/dist/modules/CapabilityRegistry.d.ts +58 -0
- package/dist/modules/CapabilityRegistry.d.ts.map +1 -0
- package/dist/modules/apiModule.d.ts +33 -0
- package/dist/modules/apiModule.d.ts.map +1 -0
- package/dist/modules/btcModule.d.ts +28 -0
- package/dist/modules/btcModule.d.ts.map +1 -0
- package/dist/modules/evmModule.d.ts +29 -0
- package/dist/modules/evmModule.d.ts.map +1 -0
- package/dist/modules/index.d.ts +27 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/referrals/ReferralsClient.d.ts +24 -0
- package/dist/referrals/ReferralsClient.d.ts.map +1 -0
- package/dist/referrals/index.d.ts +2 -0
- package/dist/referrals/index.d.ts.map +1 -0
- package/dist/services/ApiService.d.ts +52 -0
- package/dist/services/ApiService.d.ts.map +1 -0
- package/dist/services/BtcService.d.ts +21 -0
- package/dist/services/BtcService.d.ts.map +1 -0
- package/dist/services/EvmService.d.ts +48 -0
- package/dist/services/EvmService.d.ts.map +1 -0
- package/dist/services/index.d.ts +21 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/shared/actions/BaseAction.d.ts +275 -0
- package/dist/shared/actions/BaseAction.d.ts.map +1 -0
- package/dist/shared/actions/index.d.ts +9 -0
- package/dist/shared/actions/index.d.ts.map +1 -0
- package/dist/shared/constants/statusConstants.d.ts +92 -0
- package/dist/shared/constants/statusConstants.d.ts.map +1 -0
- package/dist/shared/context/ContextBuilder.d.ts +46 -0
- package/dist/shared/context/ContextBuilder.d.ts.map +1 -0
- package/dist/shared/context/index.d.ts +8 -0
- package/dist/shared/context/index.d.ts.map +1 -0
- package/dist/shared/context/types.d.ts +122 -0
- package/dist/shared/context/types.d.ts.map +1 -0
- package/dist/shared/deposits/depositStatus.d.ts +138 -0
- package/dist/shared/deposits/depositStatus.d.ts.map +1 -0
- package/dist/shared/deposits/index.d.ts +10 -0
- package/dist/shared/deposits/index.d.ts.map +1 -0
- package/dist/shared/errors.d.ts +211 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/events.d.ts +209 -0
- package/dist/shared/events.d.ts.map +1 -0
- package/dist/shared/evm/switchChain.d.ts +35 -0
- package/dist/shared/evm/switchChain.d.ts.map +1 -0
- package/dist/shared/index.d.ts +12 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/monitoring/createEventEmitter.d.ts +68 -0
- package/dist/shared/monitoring/createEventEmitter.d.ts.map +1 -0
- package/dist/shared/monitoring/createProgressEmitter.d.ts +18 -0
- package/dist/shared/monitoring/createProgressEmitter.d.ts.map +1 -0
- package/dist/shared/monitoring/depositMonitor.d.ts +107 -0
- package/dist/shared/monitoring/depositMonitor.d.ts.map +1 -0
- package/dist/shared/monitoring/index.d.ts +9 -0
- package/dist/shared/monitoring/index.d.ts.map +1 -0
- package/dist/shared/validation/index.d.ts +188 -0
- package/dist/shared/validation/index.d.ts.map +1 -0
- package/dist/stories/arg-types.d.ts.map +1 -1
- package/dist/stories/components/Badge.d.ts +13 -0
- package/dist/stories/components/Badge.d.ts.map +1 -0
- package/dist/stories/components/Button/Button.d.ts +2 -2
- package/dist/stories/components/Button/Button.d.ts.map +1 -1
- package/dist/stories/components/Card.d.ts +12 -0
- package/dist/stories/components/Card.d.ts.map +1 -0
- package/dist/stories/components/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/stories/components/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/stories/components/ConnectButton/connect-button.d.ts.map +1 -1
- package/dist/stories/components/JsonPreview.d.ts +23 -0
- package/dist/stories/components/JsonPreview.d.ts.map +1 -0
- package/dist/stories/components/StatsCard.d.ts +13 -0
- package/dist/stories/components/StatsCard.d.ts.map +1 -0
- package/dist/stories/components/StatusIndicator.d.ts +13 -0
- package/dist/stories/components/StatusIndicator.d.ts.map +1 -0
- package/dist/stories/components/TreeNode.d.ts +15 -0
- package/dist/stories/components/TreeNode.d.ts.map +1 -0
- package/dist/stories/components/decorators/wagmi-decorator.d.ts.map +1 -1
- package/dist/stories/components/index.d.ts +11 -0
- package/dist/stories/components/index.d.ts.map +1 -0
- package/dist/stories/hooks/useConnection.d.ts.map +1 -1
- package/dist/stories/hooks/useQuery.d.ts.map +1 -1
- package/dist/tokens/token-addresses.d.ts +18 -0
- package/dist/tokens/token-addresses.d.ts.map +1 -1
- package/dist/tokens/tokens.d.ts +12 -0
- package/dist/tokens/tokens.d.ts.map +1 -1
- package/dist/utils/chain.d.ts +107 -0
- package/dist/utils/chain.d.ts.map +1 -0
- package/dist/utils/consoleLogger.d.ts +71 -0
- package/dist/utils/consoleLogger.d.ts.map +1 -0
- package/dist/utils/ensureNotSanctionedAddress.d.ts +2 -0
- package/dist/utils/ensureNotSanctionedAddress.d.ts.map +1 -0
- package/dist/utils/evmAccount.d.ts +13 -0
- package/dist/utils/evmAccount.d.ts.map +1 -0
- package/dist/utils/http.d.ts +95 -0
- package/dist/utils/http.d.ts.map +1 -0
- package/dist/utils/numbers.d.ts +20 -0
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/satoshi.d.ts +17 -4
- package/dist/utils/satoshi.d.ts.map +1 -1
- package/dist/vaults/index.d.ts +1 -1
- package/dist/vaults/index.d.ts.map +1 -1
- package/dist/vaults/lib/config.d.ts +3 -3
- package/dist/vaults/lib/config.d.ts.map +1 -1
- package/dist/version.d.ts +27 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +27 -11
- package/dist/api-functions/generateDepositBtcAddress/generateDepositBtcAddress.stories.d.ts +0 -16
- package/dist/api-functions/generateDepositBtcAddress/generateDepositBtcAddress.stories.d.ts.map +0 -1
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddress.stories.d.ts +0 -16
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddress.stories.d.ts.map +0 -1
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddress.test.d.ts +0 -2
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddress.test.d.ts.map +0 -1
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddresses.stories.d.ts +0 -16
- package/dist/api-functions/getDepositBtcAddress/getDepositBtcAddresses.stories.d.ts.map +0 -1
- package/dist/api-functions/getDepositsByAddress/getDepositsByAddress.stories.d.ts +0 -13
- package/dist/api-functions/getDepositsByAddress/getDepositsByAddress.stories.d.ts.map +0 -1
- package/dist/api-functions/getLBTCExchangeRate/get-exchange-ratio.stories.d.ts +0 -16
- package/dist/api-functions/getLBTCExchangeRate/get-exchange-ratio.stories.d.ts.map +0 -1
- package/dist/api-functions/getLBTCExchangeRate/getLBTCExchangeRate.stories.d.ts +0 -16
- package/dist/api-functions/getLBTCExchangeRate/getLBTCExchangeRate.stories.d.ts.map +0 -1
- package/dist/api-functions/getNetworkFeeSignature/getNetworkFeeSignature.stories.d.ts +0 -17
- package/dist/api-functions/getNetworkFeeSignature/getNetworkFeeSignature.stories.d.ts.map +0 -1
- package/dist/api-functions/getPointsByAddress/getPointsByAddress.stories.d.ts +0 -13
- package/dist/api-functions/getPointsByAddress/getPointsByAddress.stories.d.ts.map +0 -1
- package/dist/api-functions/getUnstakesByAddress/getUnstakesByAddress.stories.d.ts +0 -13
- package/dist/api-functions/getUnstakesByAddress/getUnstakesByAddress.stories.d.ts.map +0 -1
- package/dist/api-functions/getUserStakeAndBakeSignature/getUserStakeAndBakeSignature.stories.d.ts +0 -14
- package/dist/api-functions/getUserStakeAndBakeSignature/getUserStakeAndBakeSignature.stories.d.ts.map +0 -1
- package/dist/api-functions/storeNetworkFeeSignature/storeNetworkFeeSignature.stories.d.ts +0 -14
- package/dist/api-functions/storeNetworkFeeSignature/storeNetworkFeeSignature.stories.d.ts.map +0 -1
- package/dist/api-functions/storeStakeAndBakeSignature/storeStakeAndBakeSignature.stories.d.ts +0 -14
- package/dist/api-functions/storeStakeAndBakeSignature/storeStakeAndBakeSignature.stories.d.ts.map +0 -1
- package/dist/bridge/lib/bridge.stories.d.ts +0 -14
- package/dist/bridge/lib/bridge.stories.d.ts.map +0 -1
- package/dist/bridge/lib/ccip-bridge.stories.d.ts +0 -14
- package/dist/bridge/lib/ccip-bridge.stories.d.ts.map +0 -1
- package/dist/bridge/lib/oft-bridge.stories.d.ts +0 -14
- package/dist/bridge/lib/oft-bridge.stories.d.ts.map +0 -1
- package/dist/common/chains.stories.d.ts +0 -17
- package/dist/common/chains.stories.d.ts.map +0 -1
- package/dist/contract-functions/approveLBTC/approveLBTC.stories.d.ts +0 -17
- package/dist/contract-functions/approveLBTC/approveLBTC.stories.d.ts.map +0 -1
- package/dist/contract-functions/claimLBTC/claimLBTC.stories.d.ts +0 -17
- package/dist/contract-functions/claimLBTC/claimLBTC.stories.d.ts.map +0 -1
- package/dist/contract-functions/deposit/depositToken.stories.d.ts +0 -17
- package/dist/contract-functions/deposit/depositToken.stories.d.ts.map +0 -1
- package/dist/contract-functions/getBasculeDepositStatus/getBasculeDepositStatus.stories.d.ts +0 -16
- package/dist/contract-functions/getBasculeDepositStatus/getBasculeDepositStatus.stories.d.ts.map +0 -1
- package/dist/contract-functions/getLBTCMintingFee/getLBTCMintingFee.stories.d.ts +0 -17
- package/dist/contract-functions/getLBTCMintingFee/getLBTCMintingFee.stories.d.ts.map +0 -1
- package/dist/contract-functions/getLBTCTotalSupply/getLBTCTotalSupply.stories.d.ts +0 -17
- package/dist/contract-functions/getLBTCTotalSupply/getLBTCTotalSupply.stories.d.ts.map +0 -1
- package/dist/contract-functions/getPermitNonce/getPermitNonce.stories.d.ts +0 -14
- package/dist/contract-functions/getPermitNonce/getPermitNonce.stories.d.ts.map +0 -1
- package/dist/contract-functions/getShareValue/getShareValue.stories.d.ts +0 -13
- package/dist/contract-functions/getShareValue/getShareValue.stories.d.ts.map +0 -1
- package/dist/contract-functions/getSharesByAddress/getSharesByAddress.stories.d.ts +0 -13
- package/dist/contract-functions/getSharesByAddress/getSharesByAddress.stories.d.ts.map +0 -1
- package/dist/contract-functions/getStakeAndBakeFee/__tests__/getStakeAndBakeFee.test.d.ts +0 -2
- package/dist/contract-functions/getStakeAndBakeFee/__tests__/getStakeAndBakeFee.test.d.ts.map +0 -1
- package/dist/contract-functions/getStakeAndBakeFee/getStakeAndBakeFee.stories.d.ts +0 -17
- package/dist/contract-functions/getStakeAndBakeFee/getStakeAndBakeFee.stories.d.ts.map +0 -1
- package/dist/contract-functions/signLbtcDestionationAddr/signLbtcDestionationAddr.stories.d.ts +0 -9
- package/dist/contract-functions/signLbtcDestionationAddr/signLbtcDestionationAddr.stories.d.ts.map +0 -1
- package/dist/contract-functions/signNetworkFee/signNetworkFee.stories.d.ts +0 -14
- package/dist/contract-functions/signNetworkFee/signNetworkFee.stories.d.ts.map +0 -1
- package/dist/contract-functions/signStakeAndBake/__tests__/signStakeAndBake.test.d.ts +0 -17
- package/dist/contract-functions/signStakeAndBake/__tests__/signStakeAndBake.test.d.ts.map +0 -1
- package/dist/contract-functions/signStakeAndBake/signStakeAndBake.stories.d.ts +0 -50
- package/dist/contract-functions/signStakeAndBake/signStakeAndBake.stories.d.ts.map +0 -1
- package/dist/contract-functions/unstakeLBTC/unstakeLBTC.stories.d.ts +0 -17
- package/dist/contract-functions/unstakeLBTC/unstakeLBTC.stories.d.ts.map +0 -1
- package/dist/defi/defi-registry.stories.d.ts +0 -18
- package/dist/defi/defi-registry.stories.d.ts.map +0 -1
- package/dist/metrics/get-lbtc-stats.stories.d.ts +0 -17
- package/dist/metrics/get-lbtc-stats.stories.d.ts.map +0 -1
- package/dist/metrics/get-positions-summary.stories.d.ts +0 -17
- package/dist/metrics/get-positions-summary.stories.d.ts.map +0 -1
- package/dist/tokens/cross-chain-addresses.stories.d.ts +0 -60
- package/dist/tokens/cross-chain-addresses.stories.d.ts.map +0 -1
- package/dist/tokens/denomination-utils.stories.d.ts +0 -62
- package/dist/tokens/denomination-utils.stories.d.ts.map +0 -1
- package/dist/tokens/getLbtcContractAddresses.stories.d.ts +0 -59
- package/dist/tokens/getLbtcContractAddresses.stories.d.ts.map +0 -1
- package/dist/tokens/getTokenByAddress.stories.d.ts +0 -64
- package/dist/tokens/getTokenByAddress.stories.d.ts.map +0 -1
- package/dist/tokens/getTokenContractInfo.stories.d.ts +0 -52
- package/dist/tokens/getTokenContractInfo.stories.d.ts.map +0 -1
- package/dist/tokens/getTokenInfo.stories.d.ts +0 -42
- package/dist/tokens/getTokenInfo.stories.d.ts.map +0 -1
- package/dist/tokens/isUpgradedContract.stories.d.ts +0 -50
- package/dist/tokens/isUpgradedContract.stories.d.ts.map +0 -1
- package/dist/vaults/lib/metrics/get-vault-apy.stories.d.ts +0 -14
- package/dist/vaults/lib/metrics/get-vault-apy.stories.d.ts.map +0 -1
- package/dist/vaults/lib/metrics/get-vault-points.stories.d.ts +0 -14
- package/dist/vaults/lib/metrics/get-vault-points.stories.d.ts.map +0 -1
- package/dist/vaults/lib/metrics/get-vault-tvl.stories.d.ts +0 -14
- package/dist/vaults/lib/metrics/get-vault-tvl.stories.d.ts.map +0 -1
- package/dist/vaults/lib/ops/cancel-withdraw.stories.d.ts +0 -14
- package/dist/vaults/lib/ops/cancel-withdraw.stories.d.ts.map +0 -1
- package/dist/vaults/lib/ops/deposit.stories.d.ts +0 -14
- package/dist/vaults/lib/ops/deposit.stories.d.ts.map +0 -1
- package/dist/vaults/lib/ops/get-vault-deposits.stories.d.ts +0 -14
- package/dist/vaults/lib/ops/get-vault-deposits.stories.d.ts.map +0 -1
- package/dist/vaults/lib/ops/get-vault-withdrawals.stories.d.ts +0 -14
- package/dist/vaults/lib/ops/get-vault-withdrawals.stories.d.ts.map +0 -1
- package/dist/vaults/lib/ops/withdraw.stories.d.ts +0 -14
- package/dist/vaults/lib/ops/withdraw.stories.d.ts.map +0 -1
- package/src/api-functions/generateDepositBtcAddress/generateDepositBtcAddress.stories.tsx +0 -70
- package/src/api-functions/generateDepositBtcAddress/generateDepositBtcAddress.ts +0 -235
- package/src/api-functions/generateDepositBtcAddress/index.ts +0 -1
- package/src/api-functions/get-badges-by-address/get-badges-by-address.ts +0 -13
- package/src/api-functions/get-badges-by-address/index.ts +0 -1
- package/src/api-functions/getDepositBtcAddress/getDepositBtcAddress.stories.tsx +0 -58
- package/src/api-functions/getDepositBtcAddress/getDepositBtcAddress.test.ts +0 -265
- package/src/api-functions/getDepositBtcAddress/getDepositBtcAddress.ts +0 -166
- package/src/api-functions/getDepositBtcAddress/getDepositBtcAddresses.stories.tsx +0 -57
- package/src/api-functions/getDepositBtcAddress/index.ts +0 -1
- package/src/api-functions/getDepositBtcAddress/make-request.ts +0 -59
- package/src/api-functions/getDepositBtcAddress/types.ts +0 -106
- package/src/api-functions/getDepositsByAddress/getDepositsByAddress.stories.tsx +0 -50
- package/src/api-functions/getDepositsByAddress/getDepositsByAddress.ts +0 -502
- package/src/api-functions/getDepositsByAddress/index.ts +0 -1
- package/src/api-functions/getLBTCExchangeRate/get-exchange-ratio.stories.tsx +0 -47
- package/src/api-functions/getLBTCExchangeRate/get-exchange-ratio.ts +0 -59
- package/src/api-functions/getLBTCExchangeRate/getLBTCExchangeRate.stories.tsx +0 -54
- package/src/api-functions/getLBTCExchangeRate/getLBTCExchangeRate.ts +0 -72
- package/src/api-functions/getLBTCExchangeRate/index.ts +0 -2
- package/src/api-functions/getNetworkFeeSignature/getNetworkFeeSignature.stories.tsx +0 -58
- package/src/api-functions/getNetworkFeeSignature/getNetworkFeeSignature.ts +0 -98
- package/src/api-functions/getNetworkFeeSignature/index.ts +0 -1
- package/src/api-functions/getPointsByAddress/getPointsByAddress.stories.tsx +0 -50
- package/src/api-functions/getPointsByAddress/getPointsByAddress.ts +0 -304
- package/src/api-functions/getPointsByAddress/index.ts +0 -1
- package/src/api-functions/getUnstakesByAddress/getUnstakesByAddress.stories.tsx +0 -50
- package/src/api-functions/getUnstakesByAddress/getUnstakesByAddress.ts +0 -368
- package/src/api-functions/getUnstakesByAddress/index.ts +0 -1
- package/src/api-functions/getUserStakeAndBakeSignature/getUserStakeAndBakeSignature.stories.tsx +0 -69
- package/src/api-functions/getUserStakeAndBakeSignature/getUserStakeAndBakeSignature.ts +0 -91
- package/src/api-functions/getUserStakeAndBakeSignature/index.ts +0 -1
- package/src/api-functions/index.ts +0 -11
- package/src/api-functions/setReferral/index.ts +0 -1
- package/src/api-functions/setReferral/setReferral.ts +0 -61
- package/src/api-functions/storeNetworkFeeSignature/index.ts +0 -1
- package/src/api-functions/storeNetworkFeeSignature/storeNetworkFeeSignature.stories.tsx +0 -56
- package/src/api-functions/storeNetworkFeeSignature/storeNetworkFeeSignature.ts +0 -65
- package/src/api-functions/storeStakeAndBakeSignature/index.ts +0 -1
- package/src/api-functions/storeStakeAndBakeSignature/storeStakeAndBakeSignature.stories.tsx +0 -56
- package/src/api-functions/storeStakeAndBakeSignature/storeStakeAndBakeSignature.ts +0 -61
- package/src/bridge/abi/CCIP_BRIDGE_ADAPTER_ABI.json +0 -704
- package/src/bridge/abi/CCIP_ROUTER_ABI.json +0 -702
- package/src/bridge/abi/OFT_BRIDGE_ADAPTER_ABI.json +0 -912
- package/src/bridge/index.ts +0 -16
- package/src/bridge/lib/bridge.stories.tsx +0 -89
- package/src/bridge/lib/bridge.ts +0 -115
- package/src/bridge/lib/ccip-bridge.stories.tsx +0 -90
- package/src/bridge/lib/ccip-bridge.ts +0 -214
- package/src/bridge/lib/ccip-config.ts +0 -54
- package/src/bridge/lib/config.ts +0 -384
- package/src/bridge/lib/oft-bridge.stories.tsx +0 -89
- package/src/bridge/lib/oft-bridge.ts +0 -217
- package/src/clients/evm-signer-adapter.ts +0 -313
- package/src/clients/public-client.ts +0 -53
- package/src/clients/rpc-url-config.ts +0 -57
- package/src/clients/wallet-client.ts +0 -34
- package/src/common/api-config.ts +0 -48
- package/src/common/blockchain-identifier.ts +0 -217
- package/src/common/chains.stories.tsx +0 -67
- package/src/common/chains.ts +0 -436
- package/src/common/constants.ts +0 -1
- package/src/common/contract-info.ts +0 -9
- package/src/common/feature-config.ts +0 -18
- package/src/common/parameters.ts +0 -89
- package/src/contract-functions/approveLBTC/approveLBTC.stories.tsx +0 -78
- package/src/contract-functions/approveLBTC/approveLBTC.ts +0 -66
- package/src/contract-functions/approveLBTC/index.ts +0 -1
- package/src/contract-functions/approveToken/approveToken.ts +0 -126
- package/src/contract-functions/approveToken/index.ts +0 -1
- package/src/contract-functions/claimLBTC/claimLBTC.stories.tsx +0 -81
- package/src/contract-functions/claimLBTC/claimLBTC.ts +0 -159
- package/src/contract-functions/claimLBTC/index.ts +0 -1
- package/src/contract-functions/claimUnstakeRedeem/claimUnstakeRedeem.ts +0 -95
- package/src/contract-functions/claimUnstakeRedeem/index.ts +0 -1
- package/src/contract-functions/deposit/depositToken.stories.tsx +0 -82
- package/src/contract-functions/deposit/depositToken.ts +0 -214
- package/src/contract-functions/deposit/index.ts +0 -1
- package/src/contract-functions/getBasculeDepositStatus/decodeBasculeDepositStatus.ts +0 -170
- package/src/contract-functions/getBasculeDepositStatus/getBasculeDepositStatus.stories.tsx +0 -61
- package/src/contract-functions/getBasculeDepositStatus/getBasculeDepositStatus.ts +0 -211
- package/src/contract-functions/getBasculeDepositStatus/index.ts +0 -2
- package/src/contract-functions/getLBTCMintingFee/getLBTCMintingFee.stories.tsx +0 -60
- package/src/contract-functions/getLBTCMintingFee/getLBTCMintingFee.ts +0 -193
- package/src/contract-functions/getLBTCMintingFee/index.ts +0 -1
- package/src/contract-functions/getLBTCTotalSupply/getLBTCTotalSupply.stories.tsx +0 -50
- package/src/contract-functions/getLBTCTotalSupply/getLBTCTotalSupply.ts +0 -40
- package/src/contract-functions/getLBTCTotalSupply/index.ts +0 -1
- package/src/contract-functions/getPermitNonce/getPermitNonce.stories.tsx +0 -55
- package/src/contract-functions/getPermitNonce/getPermitNonce.ts +0 -50
- package/src/contract-functions/getPermitNonce/index.ts +0 -1
- package/src/contract-functions/getShareValue/getShareValue.stories.tsx +0 -56
- package/src/contract-functions/getShareValue/getShareValue.ts +0 -59
- package/src/contract-functions/getShareValue/index.ts +0 -1
- package/src/contract-functions/getSharesByAddress/getSharesByAddress.stories.tsx +0 -65
- package/src/contract-functions/getSharesByAddress/getSharesByAddress.ts +0 -86
- package/src/contract-functions/getSharesByAddress/index.ts +0 -4
- package/src/contract-functions/getStakeAndBakeFee/__tests__/getStakeAndBakeFee.test.ts +0 -167
- package/src/contract-functions/getStakeAndBakeFee/getStakeAndBakeFee.stories.tsx +0 -180
- package/src/contract-functions/getStakeAndBakeFee/getStakeAndBakeFee.tsx +0 -101
- package/src/contract-functions/getStakeAndBakeFee/index.ts +0 -1
- package/src/contract-functions/index.ts +0 -21
- package/src/contract-functions/signLbtcDestionationAddr/index.ts +0 -1
- package/src/contract-functions/signLbtcDestionationAddr/signLbtcDestinationAddr.ts +0 -32
- package/src/contract-functions/signLbtcDestionationAddr/signLbtcDestionationAddr.stories.tsx +0 -63
- package/src/contract-functions/signNetworkFee/getTypedData.ts +0 -41
- package/src/contract-functions/signNetworkFee/index.ts +0 -1
- package/src/contract-functions/signNetworkFee/signNetworkFee.stories.tsx +0 -93
- package/src/contract-functions/signNetworkFee/signNetworkFee.ts +0 -106
- package/src/contract-functions/signStakeAndBake/__tests__/signStakeAndBake.test.ts +0 -887
- package/src/contract-functions/signStakeAndBake/handleApprove.ts +0 -81
- package/src/contract-functions/signStakeAndBake/handlePermit.ts +0 -28
- package/src/contract-functions/signStakeAndBake/index.ts +0 -2
- package/src/contract-functions/signStakeAndBake/signStakeAndBake.stories.tsx +0 -201
- package/src/contract-functions/signStakeAndBake/signStakeAndBake.ts +0 -159
- package/src/contract-functions/signStakeAndBake/typed-data-builder.ts +0 -137
- package/src/contract-functions/signStakeAndBake/utils.ts +0 -61
- package/src/contract-functions/signStakeAndBake/validation.ts +0 -124
- package/src/contract-functions/unstakeLBTC/index.ts +0 -1
- package/src/contract-functions/unstakeLBTC/unstakeLBTC.stories.tsx +0 -91
- package/src/contract-functions/unstakeLBTC/unstakeLBTC.ts +0 -396
- package/src/debug-api/btc-script-to-address.ts +0 -20
- package/src/debug-api/btc-tx-info.ts +0 -32
- package/src/debug-api/evm-by-btc-address.ts +0 -26
- package/src/debug-api/index.ts +0 -3
- package/src/defi/README.md +0 -501
- package/src/defi/defi-registry.stories.tsx +0 -526
- package/src/defi/defi-registry.ts +0 -179
- package/src/defi/index.ts +0 -5
- package/src/index.ts +0 -84
- package/src/metrics/get-additional-rewards.ts +0 -69
- package/src/metrics/get-lbtc-apy.ts +0 -74
- package/src/metrics/get-lbtc-stats.stories.tsx +0 -56
- package/src/metrics/get-lbtc-stats.ts +0 -59
- package/src/metrics/get-positions-summary.stories.tsx +0 -57
- package/src/metrics/get-positions-summary.ts +0 -132
- package/src/stories/arg-types.ts +0 -37
- package/src/stories/components/Button/Button.css +0 -10
- package/src/stories/components/Button/Button.tsx +0 -50
- package/src/stories/components/Button/index.ts +0 -1
- package/src/stories/components/CodeBlock/CodeBlock.tsx +0 -26
- package/src/stories/components/CodeBlock/CodeBlockStyles.css +0 -3
- package/src/stories/components/CodeBlock/index.ts +0 -1
- package/src/stories/components/ConnectButton/connect-button.tsx +0 -247
- package/src/stories/components/ConnectButton/index.ts +0 -1
- package/src/stories/components/Spinner/Spinner.tsx +0 -27
- package/src/stories/components/Spinner/index.ts +0 -1
- package/src/stories/components/decorators/function-type.tsx +0 -63
- package/src/stories/components/decorators/index.ts +0 -2
- package/src/stories/components/decorators/wagmi-decorator.tsx +0 -91
- package/src/stories/components/error-block.tsx +0 -21
- package/src/stories/constants.ts +0 -3
- package/src/stories/hooks/useConnection.ts +0 -62
- package/src/stories/hooks/useQuery.ts +0 -56
- package/src/tokens/abi/ASSET_ROUTER_ABI.ts +0 -1966
- package/src/tokens/abi/BRIDGE_TOKEN_ADAPTER_ABI.ts +0 -1405
- package/src/tokens/abi/BTCK_ABI.ts +0 -1092
- package/src/tokens/abi/KATANA_BASCULE_ABI.ts +0 -653
- package/src/tokens/abi/LBTC_ABI.json +0 -1761
- package/src/tokens/abi/LBTC_ABI.ts +0 -1761
- package/src/tokens/abi/LBTC_BASCULE_ABI.json +0 -850
- package/src/tokens/abi/NATIVE_LBTC_ABI.ts +0 -1147
- package/src/tokens/abi/STLBTC_ABI.ts +0 -1062
- package/src/tokens/cross-chain-addresses.stories.tsx +0 -235
- package/src/tokens/denomination-utils.stories.tsx +0 -175
- package/src/tokens/getLbtcContractAddresses.stories.tsx +0 -157
- package/src/tokens/getTokenByAddress.stories.tsx +0 -171
- package/src/tokens/getTokenContractInfo.stories.tsx +0 -147
- package/src/tokens/getTokenInfo.stories.tsx +0 -132
- package/src/tokens/isUpgradedContract.stories.tsx +0 -123
- package/src/tokens/lbtc-addresses.ts +0 -18
- package/src/tokens/token-addresses.ts +0 -428
- package/src/tokens/tokens.ts +0 -235
- package/src/tokens/types.ts +0 -80
- package/src/utils/array.ts +0 -31
- package/src/utils/block.ts +0 -23
- package/src/utils/env.ts +0 -20
- package/src/utils/err.ts +0 -83
- package/src/utils/gas.ts +0 -36
- package/src/utils/hex.ts +0 -9
- package/src/utils/numbers.ts +0 -8
- package/src/utils/pagination.ts +0 -70
- package/src/utils/satoshi.ts +0 -25
- package/src/utils/time.ts +0 -12
- package/src/utils/transaction-executor.ts +0 -299
- package/src/vaults/abi/SILO_VAULT_SPENDER_ABI.json +0 -793
- package/src/vaults/abi/VEDA_VAULT_ABI.json +0 -452
- package/src/vaults/abi/VEDA_VAULT_ACCOUNTANT_ABI.json +0 -591
- package/src/vaults/abi/VEDA_VAULT_BASE_ASSET_ABI.json +0 -296
- package/src/vaults/abi/VEDA_VAULT_BORING_WITHDRAW_QUEUE_ABI.json +0 -502
- package/src/vaults/abi/VEDA_VAULT_LENS_ABI.json +0 -175
- package/src/vaults/abi/VEDA_VAULT_SPENDER_ABI.json +0 -408
- package/src/vaults/abi/VEDA_VAULT_TELLER_ABI.json +0 -700
- package/src/vaults/abi/index.ts +0 -4
- package/src/vaults/index.ts +0 -46
- package/src/vaults/lib/config.ts +0 -203
- package/src/vaults/lib/metrics/get-vault-apy.stories.tsx +0 -57
- package/src/vaults/lib/metrics/get-vault-apy.ts +0 -176
- package/src/vaults/lib/metrics/get-vault-points.stories.tsx +0 -59
- package/src/vaults/lib/metrics/get-vault-points.ts +0 -74
- package/src/vaults/lib/metrics/get-vault-tvl.stories.tsx +0 -57
- package/src/vaults/lib/metrics/get-vault-tvl.ts +0 -121
- package/src/vaults/lib/ops/cancel-withdraw.stories.tsx +0 -79
- package/src/vaults/lib/ops/deposit.stories.tsx +0 -81
- package/src/vaults/lib/ops/deposit.ts +0 -152
- package/src/vaults/lib/ops/get-vault-deposits.stories.tsx +0 -64
- package/src/vaults/lib/ops/get-vault-deposits.ts +0 -209
- package/src/vaults/lib/ops/get-vault-withdrawals.stories.tsx +0 -66
- package/src/vaults/lib/ops/get-vault-withdrawals.ts +0 -349
- package/src/vaults/lib/ops/withdraw.stories.tsx +0 -81
- package/src/vaults/lib/ops/withdraw.ts +0 -225
- package/src/vite-env.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,761 +1,165 @@
|
|
|
1
1
|
# @lombard.finance/sdk
|
|
2
2
|
|
|
3
|
-
The Lombard
|
|
4
|
-
|
|
5
|
-
Read more about Lombard's mission: https://www.lombard.finance
|
|
3
|
+
The official Lombard SDK for Bitcoin staking and LBTC operations across Bitcoin, EVM, Solana, Sui, and Starknet.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
|
-
### 1. Dependencies installation
|
|
10
|
-
|
|
11
|
-
The SDK depends on the following packages:
|
|
12
|
-
|
|
13
|
-
- axios
|
|
14
|
-
- viem@2.23
|
|
15
|
-
- bignumber.js@9
|
|
16
|
-
- @bitcoinerlab/secp256k1@1.2.0
|
|
17
|
-
- bitcoinjs-lib@6.1.5
|
|
18
|
-
- @layerzerolabs/lz-v2-utilities@3.0.17
|
|
19
|
-
|
|
20
|
-
You may install them by running the following command:
|
|
21
|
-
|
|
22
7
|
```bash
|
|
23
|
-
npm
|
|
8
|
+
npm install @lombard.finance/sdk
|
|
24
9
|
```
|
|
25
10
|
|
|
26
|
-
###
|
|
11
|
+
### Peer Dependencies
|
|
27
12
|
|
|
28
|
-
|
|
13
|
+
The SDK requires these peer dependencies:
|
|
29
14
|
|
|
30
15
|
```bash
|
|
31
|
-
npm
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Usage
|
|
35
|
-
|
|
36
|
-
All functions are documented with JSDoc comments. You can use your IDE's autocomplete feature to see the available methods and their parameters.
|
|
37
|
-
|
|
38
|
-
### 1. Depositing BTC in order to get LBTC (aka staking)
|
|
39
|
-
|
|
40
|
-
You can read more about LBTC here: [LBTC (Staked Bitcoin)](https://docs.lombard.finance/lbtc-liquid-bitcoin/lbtc-staked-bitcoin)
|
|
41
|
-
|
|
42
|
-
If you'd like to stake your BTC and get LBTC, follow the steps below.
|
|
43
|
-
|
|
44
|
-
#### 1.1. Generate the BTC deposit address
|
|
45
|
-
|
|
46
|
-
Use `signLbtcDestinationAddr` to generate a signature for the destination address and generate the deposit address:
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
const signature = await signLbtcDestinationAddr({
|
|
50
|
-
account,
|
|
51
|
-
chainId: ChainId.ethereum,
|
|
52
|
-
provider,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
let depositBtcAddress = await getDepositBtcAddress({ address, chainId });
|
|
56
|
-
if (!depositBtcAddress) {
|
|
57
|
-
depositBtcAddress = await generateDepositBtcAddress({
|
|
58
|
-
address,
|
|
59
|
-
chainId,
|
|
60
|
-
signature,
|
|
61
|
-
partnerId: 'YOUR_PARTNER_ID',
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
#### 1.2. Check and store the network fee (if fee > 0)
|
|
67
|
-
|
|
68
|
-
If the network fee is greater than 0, sign the fee and store the signature so the funds can be auto-minted:
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
const fee = await getLBTCMintingFee({ chainId: ChainId.ethereum }); // Fee in satoshis (BigNumber)
|
|
72
|
-
|
|
73
|
-
if (fee.gt(0)) {
|
|
74
|
-
const expiry = Math.round((Date.now() + 24 * 60 * 60 * 1000) / 1000);
|
|
75
|
-
const { signature, typedData } = await signNetworkFee({
|
|
76
|
-
fee,
|
|
77
|
-
expiry,
|
|
78
|
-
account,
|
|
79
|
-
chainId: ChainId.ethereum,
|
|
80
|
-
provider,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
await storeNetworkFeeSignature({ signature, typedData, address });
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### 1.3. Depositing
|
|
88
|
-
|
|
89
|
-
Deposit your BTC to the generated address. Funds will be claimed automatically by Lombard’s claimer and credited to your account (`address`).
|
|
90
|
-
|
|
91
|
-
If you hold `BTC.b` and want to deposit it to Lombard in order to receive `LBTC`, you can use the `depositToken` function.
|
|
92
|
-
|
|
93
|
-
```ts
|
|
94
|
-
const txHash = await depositToken({
|
|
95
|
-
account: accountAddress, // Your account address
|
|
96
|
-
chainId, // The chain ID
|
|
97
|
-
amount, // Amount of tokens to deposit (human-readable format)
|
|
98
|
-
tokenIn = Token.BTCb, // Input token to deposit (default: `Token.BTCb`)
|
|
99
|
-
tokenOut = Token.LBTC, // Output token to be minted (default: `Token.LBTC`)
|
|
100
|
-
provider, // Instance of an `EIP1193Provider`
|
|
101
|
-
env, // Optional environment setting
|
|
102
|
-
rpcUrl, // Optional RPC endpoint URL
|
|
103
|
-
});
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
> **Note**: If you are using the `BTC.b` deposit flow, you can skip generating a BTC deposit address. The `depositToken` function handles the deposit and conversion automatically.
|
|
107
|
-
|
|
108
|
-
#### 1.4. Check the status of your deposit
|
|
109
|
-
|
|
110
|
-
Use `getDepositsByAddress` to retrieve all deposits (Direct BTC + Native BTC.b Deposits) in a unified format:
|
|
111
|
-
|
|
112
|
-
```javascript
|
|
113
|
-
const deposits = await getDepositsByAddress({ address });
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Each deposit entry contains the following properties:
|
|
117
|
-
|
|
118
|
-
| Property | Description |
|
|
119
|
-
| --------------------- | --------------------------------------------------------------------------- |
|
|
120
|
-
| `txHash` | Transaction hash on the source blockchain. |
|
|
121
|
-
| `eventIndex` | Index of the deposit event within the transaction. |
|
|
122
|
-
| `amount` | Amount deposited (satoshis or smallest unit). |
|
|
123
|
-
| `depositAddress` | BTC/EVM deposit address (Direct BTC only). |
|
|
124
|
-
| `fromAddress` | Sender address (Native deposits). |
|
|
125
|
-
| `toAddress` | Receiver address on the destination chain (Native deposits). |
|
|
126
|
-
| `toTokenAddress` | Destination token contract (if applicable). |
|
|
127
|
-
| `toToken`. | Destination token (if applicable). |
|
|
128
|
-
| `toChainId` | Destination chain ID. |
|
|
129
|
-
| `fromChainId` | Source chain ID (Native deposits). |
|
|
130
|
-
| `blockHeight` | Block height of the confirmation. |
|
|
131
|
-
| `blockTime` | Unix timestamp of confirmation (seconds). |
|
|
132
|
-
| `payloadHash` | Hash of the payload proving the deposit details. |
|
|
133
|
-
| `rawPayload` | Hex-encoded raw payload (used for manual claiming). |
|
|
134
|
-
| `proof` | Cryptographic proof (hex-encoded). |
|
|
135
|
-
| `sessionId` | Notarization session ID. |
|
|
136
|
-
| `notarizationStatus` | Deposit notarization status (`pending`, `submitted`, `approved`, `failed`). |
|
|
137
|
-
| `sessionState` | Notarization session state (`pending`, `completed`, `expired`). |
|
|
138
|
-
| `claimTxHash` | Claim transaction hash if deposit has been claimed. |
|
|
139
|
-
| `isClaimed` | Boolean indicating whether the deposit has been claimed. |
|
|
140
|
-
| `sanctioned` | Boolean indicating if the deposit is restricted/sanctioned. |
|
|
141
|
-
| `auxVersion` | Optional auxiliary version (Direct BTC only). |
|
|
142
|
-
| `notarizationWaitDur` | Optional notarization wait duration in seconds (Direct BTC only). |
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
### 2. Minting
|
|
147
|
-
|
|
148
|
-
If a deposit has not been automatically claimed (e.g., expired signature), you can manually claim LBTC or other supported tokens using `mintToken`.
|
|
149
|
-
|
|
150
|
-
> **Note**: `mintToken` is the preferred function. `claimLBTC` (available in the SDK) is a convenience wrapper for LBTC.
|
|
151
|
-
|
|
152
|
-
```ts
|
|
153
|
-
const txHash = await mintToken({
|
|
154
|
-
data: rawPayload, // The rawPayload from the notarized deposit.
|
|
155
|
-
proofSignature: deposit.proof, // The proof signature of a notarized deposit.
|
|
156
|
-
account, // The account address/
|
|
157
|
-
chainId, // The chain id.
|
|
158
|
-
provider, // The EIP-1193 provider,
|
|
159
|
-
token: Token.LBTC, // The token to be minted, defaults to `Token.LBTC`
|
|
160
|
-
});
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
The successful execution of the above will result with the transaction id.
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
### 3. Depositing BTC and automatically staking LBTC into the DeFi vault
|
|
168
|
-
|
|
169
|
-
You can read more about the DeFi vaults here: https://docs.lombard.finance/lbtc-liquid-bitcoin/defi-vaults/lombard-defi-vault
|
|
170
|
-
|
|
171
|
-
If you'd wish to stake and bake your BTC follow the steps below. The SDK currently supports:
|
|
172
|
-
|
|
173
|
-
- **`DefiProtocol.Veda`** – the Lombard DeFi vault that accepts BTC/LBTC on Ethereum, BNB Chain, and Holesky.
|
|
174
|
-
- **`DefiProtocol.Silo`** – the Silo Finance vault (testnet) that accepts BTCb on Avalanche Fuji.
|
|
175
|
-
|
|
176
|
-
Pick the appropriate `vaultKey` (and token) to match the protocol you're targeting.
|
|
177
|
-
|
|
178
|
-
#### 3.1. See what's the current stake and bake fee.
|
|
179
|
-
|
|
180
|
-
To check the current stake and bake fee you may use the following function:
|
|
181
|
-
|
|
182
|
-
```javascript
|
|
183
|
-
const fee = await getStakeAndBakeFee({
|
|
184
|
-
protocol: DefiProtocol.Veda, // The DeFi protocol (Veda or Silo).
|
|
185
|
-
token: Token.LBTC, // Optional: The token to query fee for. Defaults to protocol's primary token.
|
|
186
|
-
chainId, // The chain id.
|
|
187
|
-
env, // Optional: Environment (prod, testnet, etc.).
|
|
188
|
-
rpcUrl, // Optional: RPC url.
|
|
189
|
-
});
|
|
190
|
-
const expectedLBTCAmount = BigNumber(amountToBeDeposited).minus(fee);
|
|
16
|
+
npm install axios@^1 bignumber.js@^9 @bitcoinerlab/secp256k1@1.2.0 bitcoinjs-lib@6.1.5 @layerzerolabs/lz-v2-utilities@3.0.17
|
|
191
17
|
```
|
|
192
18
|
|
|
193
|
-
**
|
|
19
|
+
> **Note:** `viem` is included as a direct dependency and does not need to be installed separately.
|
|
194
20
|
|
|
195
|
-
|
|
196
|
-
| ---------- | ------------------- | -------- | -------------------------------------------------------------------------------------------------- |
|
|
197
|
-
| `protocol` | `DefiProtocol` | ❌ | The DeFi protocol identifier. Defaults to `DefiProtocol.Veda`. |
|
|
198
|
-
| `token` | `StakeAndBakeToken` | ❌ | The token to query fee for. If not provided, defaults to the protocol's primary token (see below). |
|
|
199
|
-
| `chainId` | `number` | ✅ | The target chain ID. |
|
|
200
|
-
| `env` | `Env` | ❌ | Optional environment (prod, testnet, etc.). Defaults to production. |
|
|
201
|
-
| `rpcUrl` | `string` | ❌ | Optional RPC URL override. |
|
|
202
|
-
|
|
203
|
-
**Protocol Default Tokens:**
|
|
204
|
-
|
|
205
|
-
- `DefiProtocol.Veda` → `Token.LBTC` (also supports `'BTC'`)
|
|
206
|
-
- `DefiProtocol.Silo` → `Token.BTCb`
|
|
207
|
-
|
|
208
|
-
**Example: Query fee for Silo on Avalanche Fuji**
|
|
21
|
+
## Quick Start
|
|
209
22
|
|
|
210
23
|
```typescript
|
|
211
|
-
|
|
212
|
-
protocol: DefiProtocol.Silo,
|
|
213
|
-
chainId: ChainId.avalancheFuji,
|
|
214
|
-
env: Env.testnet,
|
|
215
|
-
// token defaults to Token.BTCb for Silo
|
|
216
|
-
});
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
The fee amount will be deducted from the claimed token automatically during stake and bake.
|
|
220
|
-
|
|
221
|
-
#### 3.2. Sign the stake and bake signature
|
|
222
|
-
|
|
223
|
-
```javascript
|
|
224
|
-
const { signature, typedData } = await signStakeAndBake({
|
|
225
|
-
account, // The connected account address.
|
|
226
|
-
expiry, // Optional expiration timestamp (unix). Defaults to 24h from now. Recommended: at least 8h from now.
|
|
227
|
-
value, // The amount of the token (see `token` param).
|
|
228
|
-
token, // The token to sign with. Defaults to "BTC": the value is converted to LBTC using the current ratio.
|
|
229
|
-
// If "LBTC" is chosen, no conversion is applied.
|
|
230
|
-
vaultKey: DefiProtocol.Veda, // Choose the DeFi protocol (e.g. Veda or Silo Finance).
|
|
231
|
-
chainId, // The chain ID.
|
|
232
|
-
provider, // The EIP-1193 provider.
|
|
233
|
-
rpcUrl, // Optional RPC URL.
|
|
234
|
-
});
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
| Param | Type | Required | Description |
|
|
238
|
-
| ---------- | ------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
239
|
-
| `account` | `string` | ✅ | The connected account address. |
|
|
240
|
-
| `expiry` | `number` | ❌ | Optional expiration time (Unix timestamp). Defaults to 24h from now. Recommended: set at least 8h from now. |
|
|
241
|
-
| `value` | `string`/`number` | ✅ | The token amount (interpreted based on the `token` param). |
|
|
242
|
-
| `token` | `"BTC"` \| `"LBTC"` | ❌ | The token to sign with. Defaults to `"BTC"`. If `"BTC"`, the amount is converted to LBTC using the current exchange ratio. If `"LBTC"`, the value is used as-is (no conversion). |
|
|
243
|
-
| `vaultKey` | `DefiProtocol` | ❌ | The DeFi protocol identifier. Use `DefiProtocol.Veda` for Lombard's vault or `DefiProtocol.Silo` for the Silo Finance integration. |
|
|
244
|
-
| `chainId` | `number` | ✅ | The target chain ID. |
|
|
245
|
-
| `provider` | `EIP-1193 provider` | ✅ | The connected Web3 provider. |
|
|
246
|
-
| `rpcUrl` | `string` | ❌ | Optional RPC URL override. |
|
|
247
|
-
|
|
248
|
-
**Note:**
|
|
249
|
-
|
|
250
|
-
- If token is `"BTC"`, the function automatically converts the value to the corresponding **LBTC** amount using the current exchange ratio.
|
|
251
|
-
- If token is `"LBTC"`, the value is used as-is (no conversion).
|
|
252
|
-
- `DefiProtocol.Veda` supports BTC/LBTC stake-and-bake on Ethereum, BSC, and Holesky. `DefiProtocol.Silo` currently targets the Silo Finance vault with BTCb on Avalanche Fuji (testnet) using the approval flow defined in the DeFi registry.
|
|
253
|
-
|
|
254
|
-
**Example: Silo Finance stake and bake on Avalanche Fuji**
|
|
255
|
-
|
|
256
|
-
```ts
|
|
257
|
-
import {
|
|
258
|
-
ChainId,
|
|
259
|
-
DefiProtocol,
|
|
260
|
-
signStakeAndBake,
|
|
261
|
-
Token,
|
|
262
|
-
} from '@lombard.finance/sdk';
|
|
263
|
-
|
|
264
|
-
const { signature, typedData } = await signStakeAndBake({
|
|
265
|
-
account,
|
|
266
|
-
chainId: ChainId.avalancheFuji,
|
|
267
|
-
provider,
|
|
268
|
-
token: Token.BTCb,
|
|
269
|
-
vaultKey: DefiProtocol.Silo,
|
|
270
|
-
value: '0.5', // BTCb amount in human-readable format
|
|
271
|
-
});
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
#### 3.3. Store the signature to the Lombard's systems.
|
|
24
|
+
import { createLombardSDK, Chain, AssetId } from '@lombard.finance/sdk';
|
|
275
25
|
|
|
276
|
-
|
|
277
|
-
await
|
|
278
|
-
|
|
279
|
-
|
|
26
|
+
// Initialize SDK
|
|
27
|
+
const sdk = await createLombardSDK({
|
|
28
|
+
env: 'prod',
|
|
29
|
+
providers: {
|
|
30
|
+
evm: () => window.ethereum,
|
|
31
|
+
bitcoin: () => window.btc,
|
|
32
|
+
},
|
|
280
33
|
});
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
It is recommended to verify if the signature has been stored.
|
|
284
34
|
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
35
|
+
// Create a BTC Stake action
|
|
36
|
+
const stake = sdk.chain.btc.stake({
|
|
37
|
+
assetOut: AssetId.LBTC,
|
|
38
|
+
destChain: Chain.ETHEREUM,
|
|
289
39
|
});
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
#### 3.4. Get or generate the BTC deposit address.
|
|
293
|
-
|
|
294
|
-
```javascript
|
|
295
|
-
let depositBtcAddress = await getDepositBtcAddress({ address, chainId });
|
|
296
|
-
if (!depositBtcAddress) {
|
|
297
|
-
depositBtcAddress = await generateDepositBtcAddress({
|
|
298
|
-
address,
|
|
299
|
-
chainId,
|
|
300
|
-
signature, // Pass here the signature from step 2.
|
|
301
|
-
signatureData: typedData, // Pass here the typed data from step 2.
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
```
|
|
305
40
|
|
|
306
|
-
|
|
41
|
+
// Listen to events
|
|
42
|
+
stake.on('status-change', (status) => console.log('Status:', status));
|
|
43
|
+
stake.on('progress', (progress) => console.log('Progress:', progress));
|
|
307
44
|
|
|
308
|
-
|
|
45
|
+
// Execute the action lifecycle
|
|
46
|
+
await stake.prepare({ partnerConfig: { partnerId: 'your-partner-id' } });
|
|
47
|
+
await stake.authorizeFee(); // If required
|
|
48
|
+
await stake.generateDepositAddress();
|
|
309
49
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
```javascript
|
|
313
|
-
const deposits = await getDepositsByAddress({ address });
|
|
50
|
+
// User sends BTC to stake.depositAddress
|
|
51
|
+
// Funds auto-mint to LBTC
|
|
314
52
|
```
|
|
315
53
|
|
|
316
|
-
|
|
54
|
+
## Configuration
|
|
317
55
|
|
|
318
|
-
|
|
319
|
-
const { balance, exchangeRate, balanceLbtc } = await getSharesByAddress({
|
|
320
|
-
vaultKey: Vault.Veda, // Lombard DeFi vault identifier (stake & bake deposits that land in Veda).
|
|
321
|
-
address, // The account address.
|
|
322
|
-
chainId, // The chain id.
|
|
323
|
-
rpcUrl, // The optional RPC url
|
|
324
|
-
});
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
The above code results with:
|
|
328
|
-
|
|
329
|
-
- `balance` - The amount of LBTCv shares owned by the account,
|
|
330
|
-
- `exchangeRate` - The current LBTCv to LBTC exchange rate,
|
|
331
|
-
- `balanceLbtc` - The value of the owned shares is LBTC.
|
|
332
|
-
|
|
333
|
-
---
|
|
334
|
-
|
|
335
|
-
### 4. Redeeming LBTC to BTC or other supported tokens.
|
|
56
|
+
The SDK provides two approaches:
|
|
336
57
|
|
|
337
|
-
|
|
58
|
+
### Full SDK (Recommended)
|
|
338
59
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
```javascript
|
|
345
|
-
import { redeemToken, Token } from '@lombard.finance/sdk';
|
|
346
|
-
|
|
347
|
-
// Redeem LBTC into BTC
|
|
348
|
-
const txHash = await redeemToken({
|
|
349
|
-
btcAddress, // The BTC address to receive the redeemed funds.
|
|
350
|
-
amount, // Amount of LBTC to redeem (e.g. "1.23").
|
|
351
|
-
account, // Your EVM account address.
|
|
352
|
-
chainId, // The chain ID where LBTC is deployed.
|
|
353
|
-
provider, // The EIP-1193 provider (e.g. from MetaMask).
|
|
354
|
-
rpcUrl, // (Optional) Custom RPC URL.
|
|
355
|
-
tokenIn: Token.LBTC, // The token you are redeeming.
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
// Redeem LBTC into BTC.b
|
|
359
|
-
const txHash = await redeemToken({
|
|
360
|
-
amount, // Amount of LBTC to redeem (e.g. "1.23")
|
|
361
|
-
account, // Your EVM account address
|
|
362
|
-
chainId, // The chain ID where LBTC is deployed
|
|
363
|
-
provider, // The EIP-1193 provider (e.g. from MetaMask)
|
|
364
|
-
rpcUrl, // (Optional) Custom RPC URL
|
|
365
|
-
tokenIn: Token.LBTC, // The token you are redeeming
|
|
366
|
-
tokenOut: Token.BTCb, // The token to receive
|
|
367
|
-
});
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
#### 4.3. Check the status of your redemptions (unstakes).
|
|
371
|
-
|
|
372
|
-
If you'd like to get the list of all unstaked made by an address, use this:
|
|
373
|
-
|
|
374
|
-
```javascript
|
|
375
|
-
const unstakes = await getUnstakesByAddress({ address });
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
Every entry in the result of the above may consist of:
|
|
379
|
-
|
|
380
|
-
| Field | Type | Description |
|
|
381
|
-
| ------------------ | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
382
|
-
| **isNative** | `boolean` | `true` if the record originates from a **native-chain redemption** (e.g. BTC.b), `false` if it’s a direct BTC unstake. |
|
|
383
|
-
| **txHash** | `string` | Transaction hash of the unstake/redemption on the source chain. |
|
|
384
|
-
| **fromChainId** | `ChainId \| SuiChain \| SolanaChain` | Identifier of the **source chain** where the unstake was initiated. |
|
|
385
|
-
| **toChainId** | `ChainId \| SuiChain \| SolanaChain` _(optional)_ | Destination chain identifier (undefined for BTC unstakes). |
|
|
386
|
-
| **blockHeight** | `number` | Block height on the source chain where the unstake was confirmed. |
|
|
387
|
-
| **blockTime** | `number` (epoch seconds) | Timestamp (in epoch seconds) of the confirmation block. |
|
|
388
|
-
| **fromAddress** | `string` | Address of the initiator of the unstake transaction. |
|
|
389
|
-
| **toAddress** | `string` _(optional)_ | Destination address receiving the redeemed funds (BTC, EVM, or Solana). |
|
|
390
|
-
| **amount** | `BigNumber` | Amount unstaked, normalized to **satoshis / smallest unit**. |
|
|
391
|
-
| **payoutTxHash** | `string` _(optional)_ | Transaction hash of the payout on the **destination chain**, if the claim/payout has occurred. |
|
|
392
|
-
| **payoutTxIndex** | `number` _(optional)_ | Transaction index of the payout within the destination block, if applicable. |
|
|
393
|
-
| **payoutTxStatus** | `PayoutTxStatus` | Current status of the payout transaction (e.g. _pending_, _confirmed_, _failed_). |
|
|
394
|
-
| **sanctioned** | `boolean` _(optional)_ | `true` if the unstake transaction has been sanctioned or flagged. |
|
|
395
|
-
|
|
396
|
-
---
|
|
397
|
-
|
|
398
|
-
### 5. Depositing LBTC to the DeFi vault.
|
|
399
|
-
|
|
400
|
-
If a user already has LBTC depositing to the DeFi vault can be done via the `deposit` function.
|
|
401
|
-
|
|
402
|
-
#### 5.1. Making a deposit to the DeFi vault.
|
|
403
|
-
|
|
404
|
-
```javascript
|
|
405
|
-
const txHash = await deposit({
|
|
406
|
-
amount, // The deposit amount, e.g. 1.23 (LBTC)
|
|
407
|
-
approve = true, // The optional flag determining whether approval should be done within deposit execution.
|
|
408
|
-
token = 'LBTC', // The optional deposit token.
|
|
409
|
-
vaultKey = Vault.Veda, // The optional vault identifier.
|
|
410
|
-
account, // The account address.
|
|
411
|
-
chainId, // The chain id.
|
|
412
|
-
provider, // The EIP-1193 provider
|
|
413
|
-
rpcUrl, // The optional RPC url
|
|
414
|
-
})
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
#### 5.2. Checking the deposit history.
|
|
418
|
-
|
|
419
|
-
```javascript
|
|
420
|
-
const deposits = await getVaultDeposits({
|
|
421
|
-
account, // The account address.
|
|
422
|
-
chainId, // The chain id.
|
|
423
|
-
vaultKey = Vault.Veda // The optional vault identifier.
|
|
424
|
-
});
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
The above function returns an array of deposit data made by the specified user.
|
|
428
|
-
Each entry contains:
|
|
429
|
-
|
|
430
|
-
- `txHash` - the transaction hash,
|
|
431
|
-
- `blockNumber` - the transaction's block number,
|
|
432
|
-
- `chainId` - the chain id,
|
|
433
|
-
- `amount` - the deposited amount,
|
|
434
|
-
- `shareAmount` - the amount of shares received,
|
|
435
|
-
- `token` - the deposit token.
|
|
436
|
-
|
|
437
|
-
#### 5.3. Checking the user's DeFi vault balance.
|
|
438
|
-
|
|
439
|
-
In order to check the user's balance of the vault tokens, use this:
|
|
440
|
-
|
|
441
|
-
```javascript
|
|
442
|
-
const { balance, exchangeRate, balanceLbtc } = await getSharesByAddress({
|
|
443
|
-
vaultKey: Vault.Veda, // The vault identifier.
|
|
444
|
-
address, // The account address.
|
|
445
|
-
chainId, // The chain id.
|
|
446
|
-
rpcUrl, // The optional RPC url
|
|
447
|
-
});
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
The above function returns the:
|
|
451
|
-
|
|
452
|
-
- `balance` - balance of LBTCv,
|
|
453
|
-
- `exchangeRate` - the current exchange rate between LBTCv and LBTC,
|
|
454
|
-
- `balanceLbtc` - the value of LBTCv represented in LBTC.
|
|
455
|
-
|
|
456
|
-
---
|
|
457
|
-
|
|
458
|
-
### 6. Withdrawing LBTC from the DeFi vault.
|
|
459
|
-
|
|
460
|
-
#### 6.1. Requesting a withdrawal from the DeFi vault
|
|
461
|
-
|
|
462
|
-
Requesting a withdrawal from the DeFi vault can be done via:
|
|
463
|
-
|
|
464
|
-
```javascript
|
|
465
|
-
const txHash = await withdraw({
|
|
466
|
-
amount, // The amount of shares.
|
|
467
|
-
approve = true, // The optional flag determining if approve action should be done within this execution.
|
|
468
|
-
token = 'LBTC', // The optional withdraw token.
|
|
469
|
-
vaultKey = Vault.Veda, // The optional vault identifier.
|
|
470
|
-
account, // The account address.
|
|
471
|
-
chainId, // The chain id.
|
|
472
|
-
provider, // The EIP-1192 provider.
|
|
473
|
-
rpcUrl, // The optional RPC url
|
|
474
|
-
})
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
#### 6.2. Checking the withdrawal history (tracking the withdrawal request)
|
|
478
|
-
|
|
479
|
-
In order to check the whole history or to track the particular withdrawal please use the following function:
|
|
480
|
-
|
|
481
|
-
```javascript
|
|
482
|
-
const withdrawals = await getVaultWithdrawals({
|
|
483
|
-
account, // The account address.
|
|
484
|
-
chainId, // The chain id.
|
|
485
|
-
vaultKey = Vault.Veda, // The optional vault identifier.
|
|
486
|
-
rpcUrl, // The optional RPC url
|
|
487
|
-
})
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
The result of the above is an object with broken down withdrawals by their state:
|
|
491
|
-
|
|
492
|
-
```javascript
|
|
493
|
-
{
|
|
494
|
-
cancelled: [...], // The cancelled requests.
|
|
495
|
-
expired: [...], // The requests that expired.
|
|
496
|
-
fulfilled: [...], // The fulfilled requests (funds were transferred).
|
|
497
|
-
open: [...], // The open withdrawal requests (still to be processed).
|
|
498
|
-
}
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
Each of the arrays from above consist of:
|
|
502
|
-
|
|
503
|
-
- `token` - the withdrawal token (LBTC),
|
|
504
|
-
- `shareAmount` - the amount of shares withdrawn,
|
|
505
|
-
- `amount` - the amount of funds withdrawn,
|
|
506
|
-
- `minPrice` - the min price of a share,
|
|
507
|
-
- `deadline` - the expiration timestamp,
|
|
508
|
-
- `timestamp` - the request timestamp,
|
|
509
|
-
- `txHash` - the withdraw request transaction hash,
|
|
510
|
-
- `blockNumber` - the request block number,
|
|
511
|
-
- `fulfilledTimestamp` - the fulfilment timestamp,
|
|
512
|
-
- `fulfilledTxHash` - the funds transfer transaction hash,
|
|
513
|
-
- `fulfilledBlockNumber` - the fulfilment block number.
|
|
514
|
-
|
|
515
|
-
#### 6.3. Cancelling the withdrawal
|
|
516
|
-
|
|
517
|
-
If you wish to cancel you open withdrawal request use this:
|
|
518
|
-
|
|
519
|
-
```javascript
|
|
520
|
-
const txHash = await cancelWithdraw({
|
|
521
|
-
token = 'LBTC', // The optional withdrawal asset.
|
|
522
|
-
vaultKey = Vault.Veda, // The optional vault identifier.
|
|
523
|
-
account, // The account address.
|
|
524
|
-
chainId, // The chain id.
|
|
525
|
-
provider, // The EIP-1193 provider.
|
|
526
|
-
rpcUrl, // The optional RPC url.
|
|
527
|
-
});
|
|
528
|
-
```
|
|
529
|
-
|
|
530
|
-
---
|
|
531
|
-
|
|
532
|
-
### 7. Getting the points earned by an address
|
|
533
|
-
|
|
534
|
-
You can check the amount of Lux points earned by an address with:
|
|
535
|
-
|
|
536
|
-
```ts
|
|
537
|
-
import { getLuxSeason2Points } from '@lombard.finance/sdk';
|
|
538
|
-
const points = await getLuxSeason2Points({ address: '0x...YOUR_ADDRESS' });
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
#### Returned Object
|
|
542
|
-
|
|
543
|
-
```ts
|
|
544
|
-
{
|
|
545
|
-
/** Points earned by holding LBTC. */
|
|
546
|
-
holdingPoints: number;
|
|
547
|
-
/** Points earned by taking positions in DeFi vaults. */
|
|
548
|
-
protocolPoints: number;
|
|
549
|
-
/** Points earned from referrals. */
|
|
550
|
-
referralPoints: number;
|
|
551
|
-
/** Points earned from referees. */
|
|
552
|
-
refereePoints: number;
|
|
553
|
-
/** Points earned by checking in. */
|
|
554
|
-
checkinPoints: number;
|
|
555
|
-
/** Total points earned. */
|
|
556
|
-
totalPoints: number;
|
|
557
|
-
/** Breakdown of points earned from each protocol. */
|
|
558
|
-
protocolPointsBreakdown: IProtocolPointsBreakdown;
|
|
559
|
-
/** Lux points earned from badges. */
|
|
560
|
-
badgesPoints: number;
|
|
561
|
-
/** Total Lux points excluding badge points (same as total in Season 2). */
|
|
562
|
-
totalWithoutBadgesPoints: number;
|
|
563
|
-
}
|
|
564
|
-
```
|
|
565
|
-
|
|
566
|
-
---
|
|
567
|
-
|
|
568
|
-
### 8. Getting the DeFi vault points earned by an address.
|
|
569
|
-
|
|
570
|
-
```javascript
|
|
571
|
-
const {
|
|
572
|
-
totalPoints, // The total points earned in the DeFi vault.
|
|
573
|
-
pointsBreakdown, // The points breakdown by network (chain).
|
|
574
|
-
} = await getVaultPoints({
|
|
575
|
-
account, // The account address.
|
|
576
|
-
vaultKey, // The optional vault identifier.
|
|
60
|
+
```typescript
|
|
61
|
+
// SDK initialization is async (fetches config)
|
|
62
|
+
const sdk = await createLombardSDK({
|
|
63
|
+
env: 'prod',
|
|
64
|
+
providers: { evm: () => window.ethereum },
|
|
577
65
|
});
|
|
578
66
|
```
|
|
579
67
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
### 9. Metrics
|
|
583
|
-
|
|
584
|
-
#### 9.1. Getting the vault's TVL
|
|
68
|
+
## Architecture
|
|
585
69
|
|
|
586
|
-
The
|
|
70
|
+
The SDK uses an **action-based architecture** where each operation (stake, unstake, deploy, etc.) is represented as an action object with a consistent lifecycle:
|
|
587
71
|
|
|
588
|
-
```javascript
|
|
589
|
-
const data = await getVaultTVL({ vaultKey: Vault.Veda });
|
|
590
72
|
```
|
|
591
|
-
|
|
592
|
-
The above returns:
|
|
593
|
-
|
|
594
|
-
- `btcBalance` - the amount of BTC locked into the vault,
|
|
595
|
-
- `btcPrice` - the current price of BTC,
|
|
596
|
-
- `tvl` - the amount of USD locked into the vault.
|
|
597
|
-
|
|
598
|
-
#### 9.2. Getting the vault's performance data.
|
|
599
|
-
|
|
600
|
-
The performance of the vault can be checked via the `getVaultApy` function.
|
|
601
|
-
As in the example below:
|
|
602
|
-
|
|
603
|
-
```javascript
|
|
604
|
-
const APYs = await getVaultApy({
|
|
605
|
-
aggregationPeriod: 7, // The aggregation period in days, only 7, 14, and 30 are allowed.
|
|
606
|
-
chainId: ChainId.ethereum, // The vault's chain - can be omitted, defaults to `Ethereum`.
|
|
607
|
-
vaultKey: Vault.Veda, // The vault identifier - can be omitted, default to `Vault.Veda`
|
|
608
|
-
});
|
|
73
|
+
create → prepare → execute → complete
|
|
609
74
|
```
|
|
610
75
|
|
|
611
|
-
|
|
612
|
-
Each entry contains:
|
|
76
|
+
### Available Actions
|
|
613
77
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
78
|
+
| Chain | Action | Description |
|
|
79
|
+
|-------|--------|-------------|
|
|
80
|
+
| BTC | `sdk.chain.btc.stake()` | Stake BTC → LBTC |
|
|
81
|
+
| BTC | `sdk.chain.btc.deposit()` | Deposit BTC → BTC.b |
|
|
82
|
+
| EVM | `sdk.chain.evm.unstake()` | Burn LBTC → BTC |
|
|
83
|
+
| EVM | `sdk.chain.evm.stake()` | Stake BTC.b → LBTC |
|
|
84
|
+
| EVM | `sdk.chain.evm.redeem()` | Redeem from DeFi vaults |
|
|
85
|
+
| EVM | `sdk.chain.evm.deploy()` | Deploy to DeFi vaults |
|
|
86
|
+
| Solana | `sdk.chain.solana.unstake()` | Burn LBTC on Solana |
|
|
87
|
+
| Sui | `sdk.chain.sui.unstake()` | Burn LBTC on Sui |
|
|
88
|
+
| Starknet | `sdk.chain.starknet.unstake()` | Burn LBTC on Starknet |
|
|
618
89
|
|
|
619
|
-
|
|
90
|
+
### Data API
|
|
620
91
|
|
|
621
|
-
|
|
92
|
+
Query deposits, unstakes, points, and exchange rates:
|
|
622
93
|
|
|
623
|
-
```
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
});
|
|
94
|
+
```typescript
|
|
95
|
+
const deposits = await sdk.api.getDeposits({ address });
|
|
96
|
+
const unstakes = await sdk.api.getUnstakes({ address });
|
|
97
|
+
const points = await sdk.api.getPoints({ address });
|
|
98
|
+
const rate = await sdk.api.getExchangeRate();
|
|
629
99
|
```
|
|
630
100
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
- `historicalHolders` - the number of all-time LBTC holders,
|
|
634
|
-
- `holders` - the number of current LBTC holders,
|
|
635
|
-
- `price` - the current BTC price,
|
|
636
|
-
- `supply` - the number of LBTC minted,
|
|
637
|
-
- `tvl` - the Lombard's TVL in USD.
|
|
101
|
+
## Playground
|
|
638
102
|
|
|
639
|
-
|
|
103
|
+
Try the SDK interactively at **[lombard.finance/playground](https://lombard.finance/playground)**.
|
|
640
104
|
|
|
641
|
-
|
|
105
|
+
The playground provides:
|
|
106
|
+
- Live code examples for all actions
|
|
107
|
+
- Real wallet connections
|
|
108
|
+
- Testnet and mainnet environments
|
|
109
|
+
- Step-by-step action execution
|
|
642
110
|
|
|
643
|
-
|
|
111
|
+
## Documentation
|
|
644
112
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
//
|
|
650
|
-
// ratioData = {
|
|
651
|
-
// [Token.LBTC]: {
|
|
652
|
-
// tokenBTCRatio: BigNumber(1)
|
|
653
|
-
// BTCTokenRatio: BigNumber(1)
|
|
654
|
-
// }
|
|
655
|
-
// }
|
|
656
|
-
```
|
|
113
|
+
- [Getting Started](./docs/user-guides/QS-01-GETTING-STARTED.md)
|
|
114
|
+
- [Action Lifecycle](./docs/user-guides/DG-01-ACTION-LIFECYCLE.md)
|
|
115
|
+
- [Migration from v3.x](./docs/user-guides/MIGRATION-V4.md)
|
|
116
|
+
- [Full Documentation Index](./docs/user-guides/INDEX.md)
|
|
657
117
|
|
|
658
|
-
|
|
118
|
+
## Non-EVM Chains
|
|
659
119
|
|
|
660
|
-
|
|
661
|
-
- `BTCTokenRatio` - The BTC:Token ratio (1 / tokenBTCRatio) answering the question of how many BTC will I get for 1 Token.
|
|
120
|
+
For Solana, Sui, and Starknet, install the chain-specific modules:
|
|
662
121
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
122
|
+
```bash
|
|
123
|
+
# Solana
|
|
124
|
+
npm install @lombard.finance/sdk-solana
|
|
666
125
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
account, // The account address
|
|
670
|
-
env, // Optional env flag
|
|
671
|
-
});
|
|
672
|
-
```
|
|
126
|
+
# Sui
|
|
127
|
+
npm install @lombard.finance/sdk-sui
|
|
673
128
|
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
- **`btcPrice: { price: BigNumber; timestamp: Date; }`**
|
|
677
|
-
Contains the current price of BTC in USD and the time it was last fetched.
|
|
678
|
-
- **`price`** (`BigNumber`): The price of 1 BTC in USD.
|
|
679
|
-
- **`timestamp`** (`Date`): The timestamp when the price was last updated.
|
|
680
|
-
- **`btcValue: BigNumber`**
|
|
681
|
-
The total value of all holdings, expressed in BTC.
|
|
682
|
-
- **`btcPnl: BigNumber`**
|
|
683
|
-
The total profit or loss across all positions, represented in BTC.
|
|
684
|
-
- **`snapshot: Array<{ token, type, balance, pnl, rate }>`**
|
|
685
|
-
A list of individual positions used in PnL calculations. Each entry includes:
|
|
686
|
-
- **`token`** (`Token | undefined`): The token associated with the position (e.g., `Token.LBTC`). May be `undefined` if unspecified.
|
|
687
|
-
- **`type`** (`PositionType`): The classification or source of the position (e.g., staking, trading).
|
|
688
|
-
- **`balance`** (`BigNumber`): The quantity of the token held.
|
|
689
|
-
- **`pnl`** (`BigNumber`): The profit or loss for this specific position, in BTC.
|
|
690
|
-
- **`rate`** (`BigNumber`): The conversion rate from token to BTC.
|
|
691
|
-
_Formula: `balance * rate = BTC equivalent`_
|
|
692
|
-
- **`lastUpdated: Date`**
|
|
693
|
-
The timestamp when the position summary was last updated.
|
|
694
|
-
- **`inProgress: boolean`**
|
|
695
|
-
Indicates whether the backend is currently processing the PnL calculation.
|
|
696
|
-
- `true`: A new calculation request was received, but the backend is experiencing high load
|
|
697
|
-
or processing is not yet complete. The latest data is not yet available.
|
|
698
|
-
- `false`: The most recent calculation has been completed and cached.
|
|
699
|
-
Use `lastUpdated` to understand how fresh the data is:
|
|
700
|
-
- If `lastUpdated` is recent (e.g., within the last few seconds), you're seeing the latest data.
|
|
701
|
-
- If `lastUpdated` is up to 30 minutes old, you're seeing cached data from a recent request.
|
|
702
|
-
The backend avoids recalculating within this caching window.
|
|
703
|
-
|
|
704
|
-
#### 9.6. Getting the LBTC APY
|
|
705
|
-
|
|
706
|
-
To retrieve the current APY (annual percentage yield) for LBTC, call this function:
|
|
707
|
-
|
|
708
|
-
```javascript
|
|
709
|
-
const apy = await getApy({
|
|
710
|
-
account, // The optional account address. Pass it for more accurate APY data.
|
|
711
|
-
env, // Optional env flag
|
|
712
|
-
});
|
|
129
|
+
# Starknet
|
|
130
|
+
npm install @lombard.finance/sdk-starknet
|
|
713
131
|
```
|
|
714
132
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
- **`baseApy: BigNumber`**
|
|
718
|
-
The base APY for LBTC, representing the nominal yield without any bonuses or adjustments.
|
|
719
|
-
- **`effectiveApy: BigNumber`**
|
|
720
|
-
The effective APY for LBTC, including any additional rewards, compounding effects, or protocol-specific incentives.
|
|
133
|
+
Register modules when creating the SDK:
|
|
721
134
|
|
|
722
|
-
|
|
135
|
+
```typescript
|
|
136
|
+
import { solanaModule } from '@lombard.finance/sdk-solana';
|
|
137
|
+
import { suiModule } from '@lombard.finance/sdk-sui';
|
|
723
138
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
139
|
+
const sdk = await createLombardSDK({
|
|
140
|
+
env: 'prod',
|
|
141
|
+
modules: [solanaModule(), suiModule()],
|
|
142
|
+
providers: {
|
|
143
|
+
solana: () => window.solana,
|
|
144
|
+
sui: () => suiWallet,
|
|
145
|
+
},
|
|
728
146
|
});
|
|
729
147
|
```
|
|
730
148
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
- **`estimatedApy: BigNumber`**
|
|
734
|
-
The estimated APY for LBTC, taking into account partner-specific incentives, compounding assumptions, and projected rewards. This value may differ from the effective APY depending on the partner context.
|
|
735
|
-
|
|
736
|
-
> **Note**: If no `partnerId` is provided, the function returns a default estimate based on global assumptions.
|
|
149
|
+
## Requirements
|
|
737
150
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
```javascript
|
|
743
|
-
const rewards = await getAdditionalRewards({
|
|
744
|
-
account,
|
|
745
|
-
env,
|
|
746
|
-
});
|
|
747
|
-
```
|
|
151
|
+
- **TypeScript**: 5.0+
|
|
152
|
+
- **Node.js**: 18+ (ESM support required)
|
|
153
|
+
- **Browser**: Modern browsers with ES2020 support
|
|
748
154
|
|
|
749
|
-
|
|
155
|
+
## Environment
|
|
750
156
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
157
|
+
| Environment | Description | Use For |
|
|
158
|
+
|-------------|-------------|---------|
|
|
159
|
+
| `prod` | Production mainnet | Live deployments |
|
|
160
|
+
| `testnet` | Public testnet | Integration testing |
|
|
161
|
+
| `stage` | Staging environment | Internal testing |
|
|
755
162
|
|
|
756
|
-
|
|
757
|
-
A list of campaigns where BTC rewards are still pending distribution.
|
|
758
|
-
- **`name`** (`string`): Name of the reward campaign.
|
|
759
|
-
- **`amount`** (`BigNumber`): Amount of BTC yet to be distributed.
|
|
163
|
+
## License
|
|
760
164
|
|
|
761
|
-
|
|
165
|
+
MIT © [Lombard Finance](https://lombard.finance)
|