@lombard.finance/sdk 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +8 -4
  3. package/dist/api-functions/getDepositsByAddress/getDepositsByAddress.d.ts +4 -0
  4. package/dist/api-functions/getDepositsByAddress/getDepositsByAddress.d.ts.map +1 -1
  5. package/dist/api.cjs +1 -1
  6. package/dist/api.js +5 -5
  7. package/dist/bridge.cjs +1 -1
  8. package/dist/bridge.js +1 -1
  9. package/dist/btc.cjs +1 -1
  10. package/dist/btc.js +2 -2
  11. package/dist/chains/btc/actions/deposit/config/solana.d.ts.map +1 -1
  12. package/dist/chains/solana/SolanaActions.d.ts +24 -6
  13. package/dist/chains/solana/SolanaActions.d.ts.map +1 -1
  14. package/dist/chains/solana/actions/index.d.ts +1 -0
  15. package/dist/chains/solana/actions/index.d.ts.map +1 -1
  16. package/dist/chains/solana/actions/redeem/SolanaRedeem.d.ts +5 -9
  17. package/dist/chains/solana/actions/redeem/SolanaRedeem.d.ts.map +1 -1
  18. package/dist/chains/solana/actions/redeem/config/solana.d.ts +1 -10
  19. package/dist/chains/solana/actions/redeem/config/solana.d.ts.map +1 -1
  20. package/dist/chains/solana/actions/redeem/config/types.d.ts +0 -14
  21. package/dist/chains/solana/actions/redeem/config/types.d.ts.map +1 -1
  22. package/dist/chains/solana/actions/redeem/factory.d.ts +0 -3
  23. package/dist/chains/solana/actions/redeem/factory.d.ts.map +1 -1
  24. package/dist/chains/solana/actions/redeem/types.d.ts +5 -17
  25. package/dist/chains/solana/actions/redeem/types.d.ts.map +1 -1
  26. package/dist/chains/solana/actions/stake/SolanaStake.d.ts +33 -0
  27. package/dist/chains/solana/actions/stake/SolanaStake.d.ts.map +1 -0
  28. package/dist/chains/solana/actions/stake/config/index.d.ts +8 -0
  29. package/dist/chains/solana/actions/stake/config/index.d.ts.map +1 -0
  30. package/dist/chains/solana/actions/stake/config/solana.d.ts +13 -0
  31. package/dist/chains/solana/actions/stake/config/solana.d.ts.map +1 -0
  32. package/dist/chains/solana/actions/stake/config/types.d.ts +20 -0
  33. package/dist/chains/solana/actions/stake/config/types.d.ts.map +1 -0
  34. package/dist/chains/solana/actions/stake/factory.d.ts +9 -0
  35. package/dist/chains/solana/actions/stake/factory.d.ts.map +1 -0
  36. package/dist/chains/solana/actions/stake/index.d.ts +9 -0
  37. package/dist/chains/solana/actions/stake/index.d.ts.map +1 -0
  38. package/dist/chains/solana/actions/stake/types.d.ts +39 -0
  39. package/dist/chains/solana/actions/stake/types.d.ts.map +1 -0
  40. package/dist/chains/solana/actions/unstake/SolanaUnstake.d.ts +7 -4
  41. package/dist/chains/solana/actions/unstake/SolanaUnstake.d.ts.map +1 -1
  42. package/dist/chains/solana/actions/unstake/config/btc.d.ts +13 -7
  43. package/dist/chains/solana/actions/unstake/config/btc.d.ts.map +1 -1
  44. package/dist/chains/solana/actions/unstake/config/index.d.ts +1 -1
  45. package/dist/chains/solana/actions/unstake/config/index.d.ts.map +1 -1
  46. package/dist/chains/solana/actions/unstake/config/types.d.ts +6 -2
  47. package/dist/chains/solana/actions/unstake/config/types.d.ts.map +1 -1
  48. package/dist/chains/solana/actions/unstake/types.d.ts +4 -4
  49. package/dist/chains/solana/actions/unstake/types.d.ts.map +1 -1
  50. package/dist/chains/solana/utils.d.ts +2 -0
  51. package/dist/chains/solana/utils.d.ts.map +1 -1
  52. package/dist/chains/starknet/actions/unstake/StarknetUnstake.d.ts +2 -2
  53. package/dist/chains/starknet/actions/unstake/StarknetUnstake.d.ts.map +1 -1
  54. package/dist/chains/starknet/actions/unstake/types.d.ts +4 -4
  55. package/dist/chains/starknet/actions/unstake/types.d.ts.map +1 -1
  56. package/dist/chains/sui/actions/unstake/SuiUnstake.d.ts +2 -2
  57. package/dist/chains/sui/actions/unstake/SuiUnstake.d.ts.map +1 -1
  58. package/dist/chains/sui/actions/unstake/types.d.ts +4 -4
  59. package/dist/chains/sui/actions/unstake/types.d.ts.map +1 -1
  60. package/dist/chunks/BtcActions-CWFHlbUP.cjs +2 -0
  61. package/dist/chunks/BtcActions-CWFHlbUP.cjs.map +1 -0
  62. package/dist/chunks/{BtcActions-CI5XotUx.js → BtcActions-jvzGFmpz.js} +12 -8
  63. package/dist/chunks/BtcActions-jvzGFmpz.js.map +1 -0
  64. package/dist/chunks/{EvmActions-D_sFfTAK.cjs → EvmActions-BTKQAXTE.cjs} +2 -2
  65. package/dist/chunks/{EvmActions-D_sFfTAK.cjs.map → EvmActions-BTKQAXTE.cjs.map} +1 -1
  66. package/dist/chunks/{EvmActions-C7EKF3jb.js → EvmActions-hb-FhsLJ.js} +9 -9
  67. package/dist/chunks/{EvmActions-C7EKF3jb.js.map → EvmActions-hb-FhsLJ.js.map} +1 -1
  68. package/dist/chunks/ReferralsClient-D8dHEk_X.cjs +2 -0
  69. package/dist/chunks/ReferralsClient-D8dHEk_X.cjs.map +1 -0
  70. package/dist/chunks/{ReferralsClient-AxhLoWRT.js → ReferralsClient-W-0-383w.js} +58 -58
  71. package/dist/chunks/ReferralsClient-W-0-383w.js.map +1 -0
  72. package/dist/chunks/{approveLBTC-CUXEC3kw.cjs → approveLBTC-BMC4cZEk.cjs} +2 -2
  73. package/dist/chunks/{approveLBTC-CUXEC3kw.cjs.map → approveLBTC-BMC4cZEk.cjs.map} +1 -1
  74. package/dist/chunks/{approveLBTC-Du2El1tW.js → approveLBTC-BkdT1N3V.js} +3 -3
  75. package/dist/chunks/{approveLBTC-Du2El1tW.js.map → approveLBTC-BkdT1N3V.js.map} +1 -1
  76. package/dist/chunks/{blockchain-identifier-CTVaEPpY.js → blockchain-identifier-BLPnwbIN.js} +2 -2
  77. package/dist/chunks/{blockchain-identifier-CTVaEPpY.js.map → blockchain-identifier-BLPnwbIN.js.map} +1 -1
  78. package/dist/chunks/{blockchain-identifier-BTPGxLio.cjs → blockchain-identifier-Bp-LTIdG.cjs} +2 -2
  79. package/dist/chunks/{blockchain-identifier-BTPGxLio.cjs.map → blockchain-identifier-Bp-LTIdG.cjs.map} +1 -1
  80. package/dist/chunks/{bridge-dWaKrMKm.cjs → bridge-7Eq_Jmi2.cjs} +2 -2
  81. package/dist/chunks/{bridge-dWaKrMKm.cjs.map → bridge-7Eq_Jmi2.cjs.map} +1 -1
  82. package/dist/chunks/{bridge-DqGabhIY.js → bridge-DbB23m2a.js} +4 -4
  83. package/dist/chunks/{bridge-DqGabhIY.js.map → bridge-DbB23m2a.js.map} +1 -1
  84. package/dist/chunks/{config-JT3GvwPB.js → config-C8BfN_9P.js} +2 -2
  85. package/dist/chunks/{config-JT3GvwPB.js.map → config-C8BfN_9P.js.map} +1 -1
  86. package/dist/chunks/{config-CSo0k7gN.cjs → config-ow9X5H0c.cjs} +2 -2
  87. package/dist/chunks/{config-CSo0k7gN.cjs.map → config-ow9X5H0c.cjs.map} +1 -1
  88. package/dist/chunks/{defi-registry-hHpGoh1m.cjs → defi-registry-B8V6dRVB.cjs} +2 -2
  89. package/dist/chunks/{defi-registry-hHpGoh1m.cjs.map → defi-registry-B8V6dRVB.cjs.map} +1 -1
  90. package/dist/chunks/{defi-registry-ig-wro_O.js → defi-registry-CD8EUcNu.js} +3 -3
  91. package/dist/chunks/{defi-registry-ig-wro_O.js.map → defi-registry-CD8EUcNu.js.map} +1 -1
  92. package/dist/chunks/depositStatus-BJA7tNqc.cjs +2 -0
  93. package/dist/chunks/{depositStatus-D5t8HN_A.cjs.map → depositStatus-BJA7tNqc.cjs.map} +1 -1
  94. package/dist/chunks/{depositStatus-BrrE4n4B.js → depositStatus-HosfExLl.js} +38 -37
  95. package/dist/chunks/{depositStatus-BrrE4n4B.js.map → depositStatus-HosfExLl.js.map} +1 -1
  96. package/dist/chunks/events-BTPDrUUu.cjs +2 -0
  97. package/dist/chunks/events-BTPDrUUu.cjs.map +1 -0
  98. package/dist/chunks/events-DAiXVdGv.js +1274 -0
  99. package/dist/chunks/events-DAiXVdGv.js.map +1 -0
  100. package/dist/chunks/{get-exchange-ratio-B-xzYND1.js → get-exchange-ratio-Bl6pt546.js} +2 -2
  101. package/dist/chunks/{get-exchange-ratio-B-xzYND1.js.map → get-exchange-ratio-Bl6pt546.js.map} +1 -1
  102. package/dist/chunks/{get-exchange-ratio-BEhD4gLB.cjs → get-exchange-ratio-t1PW8I6_.cjs} +2 -2
  103. package/dist/chunks/{get-exchange-ratio-BEhD4gLB.cjs.map → get-exchange-ratio-t1PW8I6_.cjs.map} +1 -1
  104. package/dist/chunks/{get-positions-summary-iYshN1RQ.js → get-positions-summary-CaX2BCHp.js} +2 -2
  105. package/dist/chunks/{get-positions-summary-iYshN1RQ.js.map → get-positions-summary-CaX2BCHp.js.map} +1 -1
  106. package/dist/chunks/{get-positions-summary-Dh1QPLYO.cjs → get-positions-summary-DdZvBmCN.cjs} +2 -2
  107. package/dist/chunks/{get-positions-summary-Dh1QPLYO.cjs.map → get-positions-summary-DdZvBmCN.cjs.map} +1 -1
  108. package/dist/chunks/{get-vault-tvl-C3Yr4MI4.js → get-vault-tvl-CihHEkqK.js} +4 -4
  109. package/dist/chunks/{get-vault-tvl-C3Yr4MI4.js.map → get-vault-tvl-CihHEkqK.js.map} +1 -1
  110. package/dist/chunks/{get-vault-tvl-CRbxkHmr.cjs → get-vault-tvl-DZ-xzehy.cjs} +2 -2
  111. package/dist/chunks/{get-vault-tvl-CRbxkHmr.cjs.map → get-vault-tvl-DZ-xzehy.cjs.map} +1 -1
  112. package/dist/chunks/{get-vault-withdrawals-QqvpZnxA.cjs → get-vault-withdrawals-DLwFMQEB.cjs} +2 -2
  113. package/dist/chunks/{get-vault-withdrawals-QqvpZnxA.cjs.map → get-vault-withdrawals-DLwFMQEB.cjs.map} +1 -1
  114. package/dist/chunks/{get-vault-withdrawals-CQwNiILS.js → get-vault-withdrawals-QJOdxB5Z.js} +3 -3
  115. package/dist/chunks/{get-vault-withdrawals-CQwNiILS.js.map → get-vault-withdrawals-QJOdxB5Z.js.map} +1 -1
  116. package/dist/chunks/{getUserStakeAndBakeSignature-CSEyzgMc.cjs → getUserStakeAndBakeSignature-BmY5j0OM.cjs} +2 -2
  117. package/dist/chunks/{getUserStakeAndBakeSignature-CSEyzgMc.cjs.map → getUserStakeAndBakeSignature-BmY5j0OM.cjs.map} +1 -1
  118. package/dist/chunks/{getUserStakeAndBakeSignature-Su-k10ap.js → getUserStakeAndBakeSignature-CqlrwA0t.js} +4 -4
  119. package/dist/chunks/{getUserStakeAndBakeSignature-Su-k10ap.js.map → getUserStakeAndBakeSignature-CqlrwA0t.js.map} +1 -1
  120. package/dist/chunks/{lbtc-addresses-D8MYCdsx.js → lbtc-addresses-BlyGFWnW.js} +2 -2
  121. package/dist/chunks/{lbtc-addresses-D8MYCdsx.js.map → lbtc-addresses-BlyGFWnW.js.map} +1 -1
  122. package/dist/chunks/{lbtc-addresses-Kil252DX.cjs → lbtc-addresses-DjsipX5Q.cjs} +2 -2
  123. package/dist/chunks/{lbtc-addresses-Kil252DX.cjs.map → lbtc-addresses-DjsipX5Q.cjs.map} +1 -1
  124. package/dist/chunks/statusConstants-BTQAvx1I.cjs +2 -0
  125. package/dist/chunks/statusConstants-BTQAvx1I.cjs.map +1 -0
  126. package/dist/chunks/{statusConstants-BU4PglPs.js → statusConstants-D9eSk91U.js} +53 -43
  127. package/dist/chunks/statusConstants-D9eSk91U.js.map +1 -0
  128. package/dist/chunks/{storeNetworkFeeSignature-Buk4091C.cjs → storeNetworkFeeSignature-CLm8I2pf.cjs} +2 -2
  129. package/dist/chunks/{storeNetworkFeeSignature-Buk4091C.cjs.map → storeNetworkFeeSignature-CLm8I2pf.cjs.map} +1 -1
  130. package/dist/chunks/{storeNetworkFeeSignature-BODIpq3Y.js → storeNetworkFeeSignature-tprCigR1.js} +2 -2
  131. package/dist/chunks/{storeNetworkFeeSignature-BODIpq3Y.js.map → storeNetworkFeeSignature-tprCigR1.js.map} +1 -1
  132. package/dist/chunks/{token-addresses-D0v5cR1j.js → token-addresses-Ddar0FyS.js} +130 -124
  133. package/dist/chunks/token-addresses-Ddar0FyS.js.map +1 -0
  134. package/dist/chunks/{token-addresses-nzvTOi24.cjs → token-addresses-DvY-Mw7b.cjs} +2 -2
  135. package/dist/chunks/token-addresses-DvY-Mw7b.cjs.map +1 -0
  136. package/dist/chunks/{tokens-BkvA0Gp1.cjs → tokens-CBsz6l_2.cjs} +2 -2
  137. package/dist/chunks/{tokens-BkvA0Gp1.cjs.map → tokens-CBsz6l_2.cjs.map} +1 -1
  138. package/dist/chunks/{tokens-DgC1hfkm.js → tokens-HhVpKe3K.js} +2 -2
  139. package/dist/chunks/{tokens-DgC1hfkm.js.map → tokens-HhVpKe3K.js.map} +1 -1
  140. package/dist/chunks/{unstakeLBTC-BrVLnaac.js → unstakeLBTC-Bg8OsAMV.js} +5 -5
  141. package/dist/chunks/{unstakeLBTC-BrVLnaac.js.map → unstakeLBTC-Bg8OsAMV.js.map} +1 -1
  142. package/dist/chunks/{unstakeLBTC-3bwLj1qT.cjs → unstakeLBTC-BmHvDxBN.cjs} +2 -2
  143. package/dist/chunks/{unstakeLBTC-3bwLj1qT.cjs.map → unstakeLBTC-BmHvDxBN.cjs.map} +1 -1
  144. package/dist/chunks/{withdraw-BKEovicU.cjs → withdraw-Bkp5-2dG.cjs} +2 -2
  145. package/dist/chunks/{withdraw-BKEovicU.cjs.map → withdraw-Bkp5-2dG.cjs.map} +1 -1
  146. package/dist/chunks/{withdraw-rndehhDn.js → withdraw-kf8mYbYH.js} +4 -4
  147. package/dist/chunks/{withdraw-rndehhDn.js.map → withdraw-kf8mYbYH.js.map} +1 -1
  148. package/dist/chunks/{wrapToBtce-CML1FYEZ.js → wrapToBtce-By2mh503.js} +5 -5
  149. package/dist/chunks/{wrapToBtce-CML1FYEZ.js.map → wrapToBtce-By2mh503.js.map} +1 -1
  150. package/dist/chunks/{wrapToBtce-BVu8ALEo.cjs → wrapToBtce-DDeIlv3d.cjs} +2 -2
  151. package/dist/chunks/{wrapToBtce-BVu8ALEo.cjs.map → wrapToBtce-DDeIlv3d.cjs.map} +1 -1
  152. package/dist/contracts.cjs +1 -1
  153. package/dist/contracts.js +3 -3
  154. package/dist/core/assets/catalog.d.ts.map +1 -1
  155. package/dist/core/types.d.ts +2 -0
  156. package/dist/core/types.d.ts.map +1 -1
  157. package/dist/core.cjs +1 -1
  158. package/dist/core.js +32 -32
  159. package/dist/defi.cjs +1 -1
  160. package/dist/defi.js +2 -2
  161. package/dist/entries/core.d.ts +1 -1
  162. package/dist/entries/core.d.ts.map +1 -1
  163. package/dist/evm.cjs +1 -1
  164. package/dist/evm.js +4 -4
  165. package/dist/index.cjs +1 -1
  166. package/dist/index.d.ts +1 -1
  167. package/dist/index.d.ts.map +1 -1
  168. package/dist/index.js +36 -36
  169. package/dist/metrics.cjs +1 -1
  170. package/dist/metrics.js +1 -1
  171. package/dist/shared/constants/statusConstants.d.ts +7 -3
  172. package/dist/shared/constants/statusConstants.d.ts.map +1 -1
  173. package/dist/shared/deposits/depositStatus.d.ts.map +1 -1
  174. package/dist/tokens/token-addresses.d.ts.map +1 -1
  175. package/dist/utils.cjs +1 -1
  176. package/dist/utils.js +4 -4
  177. package/dist/vaults.cjs +1 -1
  178. package/dist/vaults.js +7 -7
  179. package/package.json +2 -2
  180. package/dist/chains/solana/actions/unstake/config/solana.d.ts +0 -21
  181. package/dist/chains/solana/actions/unstake/config/solana.d.ts.map +0 -1
  182. package/dist/chunks/BtcActions-Bic_HKkw.cjs +0 -2
  183. package/dist/chunks/BtcActions-Bic_HKkw.cjs.map +0 -1
  184. package/dist/chunks/BtcActions-CI5XotUx.js.map +0 -1
  185. package/dist/chunks/ReferralsClient-AxhLoWRT.js.map +0 -1
  186. package/dist/chunks/ReferralsClient-bZo9Jpg6.cjs +0 -2
  187. package/dist/chunks/ReferralsClient-bZo9Jpg6.cjs.map +0 -1
  188. package/dist/chunks/depositStatus-D5t8HN_A.cjs +0 -2
  189. package/dist/chunks/events-BfRsYM_-.cjs +0 -2
  190. package/dist/chunks/events-BfRsYM_-.cjs.map +0 -1
  191. package/dist/chunks/events-LMs7IA1e.js +0 -1108
  192. package/dist/chunks/events-LMs7IA1e.js.map +0 -1
  193. package/dist/chunks/statusConstants-BU4PglPs.js.map +0 -1
  194. package/dist/chunks/statusConstants-CCKi5qUm.cjs +0 -2
  195. package/dist/chunks/statusConstants-CCKi5qUm.cjs.map +0 -1
  196. package/dist/chunks/token-addresses-D0v5cR1j.js.map +0 -1
  197. package/dist/chunks/token-addresses-nzvTOi24.cjs.map +0 -1
@@ -1,1108 +0,0 @@
1
- var F = Object.defineProperty;
2
- var U = (t, e, s) => e in t ? F(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
- var a = (t, e, s) => U(t, typeof e != "symbol" ? e + "" : e, s);
4
- import "axios";
5
- import { SDK_RUNTIME as G, SDK_VERSION as Y, LombardError as g, bitcoinAddressSchema as v, Chain as d, BaseAction as f, NonEvmUnstakeStatus as r, validatePrepareParams as C, StepStatus as o, objectType as E, amountSchema as I, CapabilityRegistry as S, PartnerConfiguration as A, getProviderGetter as D, ASSET_CATALOG as x, getAssetAddress as K, getAssetDecimals as V, getAssetMetadata as j, usesAssetRouter as $, getAssetRouter as q, getBridgeAdapter as z, getPublicMarketMaker as W, getAssetByAddress as X, isAssetDeployed as Z, getAssetChains as J, getAssetEnvironments as Q, getSupportedAssets as ee, ProviderErrorCode as te } from "./statusConstants-BU4PglPs.js";
6
- import { generateDepositBtcAddress as se } from "./getUserStakeAndBakeSignature-Su-k10ap.js";
7
- import { getDepositsByAddress as P, getUnstakesByAddress as ne, getPointsByAddress as re, getDepositBtcAddress as N, storeStakeAndBakeSignature as ie, ReferralsClient as ae } from "./ReferralsClient-AxhLoWRT.js";
8
- import { storeNetworkFeeSignature as oe, getNetworkFeeSignature as ce } from "./storeNetworkFeeSignature-BODIpq3Y.js";
9
- import { btcModule as ue, BtcActions as he } from "./BtcActions-CI5XotUx.js";
10
- import { evmModule as de, EvmActions as ge } from "./EvmActions-C7EKF3jb.js";
11
- import { toSatoshi as b } from "./satoshi-CSoJBXc6.js";
12
- import { p as k, r as u } from "./index-CfcQ_g3t.js";
13
- import { AssetId as w } from "./defi-registry-ig-wro_O.js";
14
- import { getExchangeRatio as le } from "./get-exchange-ratio-B-xzYND1.js";
15
- import { Vault as pe } from "./config-JT3GvwPB.js";
16
- import { getVaultWithdrawals as me, getVaultWithdrawalsAllChains as ve } from "./get-vault-withdrawals-CQwNiILS.js";
17
- const y = ["debug", "info", "warn", "error", "none"];
18
- function fe(t = {}) {
19
- const { level: e = "debug", prefix: s = "[Lombard SDK]", timestamp: n = !1 } = t, i = y.indexOf(e), c = (h) => y.indexOf(h) >= i && e !== "none", l = (h) => {
20
- if (n) {
21
- const p = (/* @__PURE__ */ new Date()).toISOString();
22
- return `${s} ${p} ${h}`;
23
- }
24
- return `${s} ${h}`;
25
- }, m = (h) => !h || Object.keys(h).length === 0 ? [] : [h];
26
- return {
27
- debug(h, p) {
28
- c("debug") && console.debug(l(h), ...m(p));
29
- },
30
- info(h, p) {
31
- c("info") && console.info(l(h), ...m(p));
32
- },
33
- warn(h, p) {
34
- c("warn") && console.warn(l(h), ...m(p));
35
- },
36
- error(h, p) {
37
- c("error") && console.error(l(h), ...m(p));
38
- }
39
- };
40
- }
41
- function rt() {
42
- return {
43
- debug: () => {
44
- },
45
- info: () => {
46
- },
47
- warn: () => {
48
- },
49
- error: () => {
50
- }
51
- };
52
- }
53
- function it() {
54
- return {
55
- "X-SDK-Version": Y,
56
- "X-SDK-Runtime": G
57
- };
58
- }
59
- class Ce {
60
- constructor(e = k) {
61
- /**
62
- * Internal API version flag for future v2 migration.
63
- * When v2 is ready, we can switch implementations transparently.
64
- */
65
- a(this, "apiVersion", "v1");
66
- this.env = e;
67
- }
68
- /* -------------------------------------------------------------------------- */
69
- /* Deposits */
70
- /* -------------------------------------------------------------------------- */
71
- /**
72
- * Fetch all deposits for an address.
73
- *
74
- * Returns deposits from both Direct BTC Deposits and Native Deposits APIs,
75
- * unified into a single list sorted by block time (newest first).
76
- *
77
- * @param address - The EVM/BTC address to fetch deposits for
78
- * @returns Promise resolving to array of Deposit objects
79
- *
80
- * @example
81
- * ```ts
82
- * const deposits = await sdk.api.deposits('0x1234...');
83
- * deposits.forEach(d => {
84
- * console.log(`${d.amount} BTC deposited at block ${d.blockHeight}`);
85
- * });
86
- * ```
87
- */
88
- async deposits(e) {
89
- return P({ address: e, env: this.env });
90
- }
91
- /* -------------------------------------------------------------------------- */
92
- /* Unstakes */
93
- /* -------------------------------------------------------------------------- */
94
- /**
95
- * Fetch all unstakes/redemptions for an address.
96
- *
97
- * Returns unstake records for both direct BTC unstakes and
98
- * native blockchain redemptions.
99
- *
100
- * @param address - The address that initiated the unstakes
101
- * @param options - Optional filters (show_redeems, show_unstakes, to_native)
102
- * @returns Promise resolving to array of Unstake objects
103
- *
104
- * @example
105
- * ```ts
106
- * // Get all unstakes
107
- * const unstakes = await sdk.api.unstakes('0x1234...');
108
- *
109
- * // Get only native chain redemptions
110
- * const redeems = await sdk.api.unstakes('0x1234...', { to_native: true });
111
- * ```
112
- */
113
- async unstakes(e, s) {
114
- return ne({ address: e, env: this.env, options: s });
115
- }
116
- async points(e, s) {
117
- return re({ address: e, env: this.env, season: s });
118
- }
119
- /* -------------------------------------------------------------------------- */
120
- /* Token Exchange Ratios */
121
- /* -------------------------------------------------------------------------- */
122
- /**
123
- * Fetch the current exchange ratios for all supported tokens.
124
- *
125
- * Returns Token:BTC and BTC:Token ratios for LBTC and other supported tokens.
126
- * This is the recommended method for getting exchange rate information.
127
- *
128
- * @returns Promise resolving to exchange ratio info for each token
129
- *
130
- * @example
131
- * ```ts
132
- * const ratios = await sdk.api.exchangeRatio();
133
- *
134
- * // Access LBTC ratios
135
- * const lbtcRatio = ratios.LBTC;
136
- * console.log(`LBTC:BTC = ${lbtcRatio.tokenBTCRatio}`); // How many LBTC per 1 BTC
137
- * console.log(`BTC:LBTC = ${lbtcRatio.BTCTokenRatio}`); // How many BTC per 1 LBTC
138
- * ```
139
- */
140
- async exchangeRatio() {
141
- return le({ env: this.env });
142
- }
143
- /* -------------------------------------------------------------------------- */
144
- /* Deposit Address */
145
- /* -------------------------------------------------------------------------- */
146
- /**
147
- * Get an existing BTC deposit address for a recipient.
148
- *
149
- * Returns the most recent non-deprecated deposit address for the
150
- * given recipient address and destination chain.
151
- *
152
- * @param address - The destination address where LBTC will be claimed
153
- * @param chainId - The destination chain
154
- * @param options - Optional partner ID and token type
155
- * @returns Promise resolving to the BTC deposit address
156
- * @throws Error if no deposit address found
157
- *
158
- * @example
159
- * ```ts
160
- * try {
161
- * const btcAddr = await sdk.api.depositAddress('0x1234...', ChainId.ethereum);
162
- * console.log(`Send BTC to: ${btcAddr}`);
163
- * } catch (e) {
164
- * console.log('No deposit address found - need to generate one');
165
- * }
166
- * ```
167
- */
168
- async depositAddress(e, s, n) {
169
- return N({
170
- address: e,
171
- chainId: s,
172
- env: this.env,
173
- partnerId: n == null ? void 0 : n.partnerId,
174
- token: n == null ? void 0 : n.token
175
- });
176
- }
177
- /* -------------------------------------------------------------------------- */
178
- /* Vault Withdrawals */
179
- /* -------------------------------------------------------------------------- */
180
- /**
181
- * Fetch all vault withdrawals for an address.
182
- *
183
- * Returns withdrawal objects categorized by status (cancelled, expired,
184
- * fulfilled, open). If chainId is not provided, fetches from all supported chains.
185
- *
186
- * @param address - The address to fetch withdrawals for
187
- * @param options - Optional filters (chainId, vault, rpcUrl)
188
- * @returns Promise resolving to categorized vault withdrawals
189
- *
190
- * @example
191
- * ```ts
192
- * // Get all withdrawals from all chains
193
- * const result = await sdk.api.vaultWithdrawals('0x1234...');
194
- * console.log(`Open: ${result.open.length}, Fulfilled: ${result.fulfilled.length}`);
195
- *
196
- * // Filter by specific chain
197
- * const ethereumOnly = await sdk.api.vaultWithdrawals('0x1234...', {
198
- * chainId: ChainId.ethereum,
199
- * });
200
- *
201
- * // Display withdrawal info
202
- * result.open.forEach(w => {
203
- * console.log(`Amount: ${w.shareAmount.toFixed()}, Deadline: ${new Date(w.deadline * 1000)}`);
204
- * });
205
- * ```
206
- */
207
- async vaultWithdrawals(e, s) {
208
- const n = e, i = (s == null ? void 0 : s.vault) ?? pe.Veda;
209
- return s != null && s.chainId ? me({
210
- account: n,
211
- chainId: s.chainId,
212
- vaultKey: i,
213
- rpcUrl: s.rpcUrl,
214
- env: this.env
215
- }) : ve({
216
- account: n,
217
- vaultKey: i,
218
- rpcUrl: s == null ? void 0 : s.rpcUrl
219
- });
220
- }
221
- /* -------------------------------------------------------------------------- */
222
- /* Utility Methods */
223
- /* -------------------------------------------------------------------------- */
224
- /**
225
- * Get the current API version being used.
226
- *
227
- * @returns The API version string ('v1' or 'v2')
228
- */
229
- getApiVersion() {
230
- return this.apiVersion;
231
- }
232
- }
233
- function Ee(t) {
234
- if (!t.env)
235
- throw g.missingParameter("env");
236
- const e = {
237
- env: t.env,
238
- providers: t.providers || {}
239
- };
240
- return t.partner && (Ie(t.partner), e.partner = t.partner), e;
241
- }
242
- function Ie(t) {
243
- if (typeof t != "object" || t === null)
244
- throw g.invalidConfiguration(
245
- "Partner configuration must be an object"
246
- );
247
- const e = t;
248
- if (!e.partnerId || typeof e.partnerId != "string")
249
- throw g.missingParameter("partner.partnerId");
250
- if (e.partnerId.trim().length === 0)
251
- throw g.invalidConfiguration("Partner ID cannot be empty");
252
- }
253
- class Se {
254
- constructor(e) {
255
- this.env = e;
256
- }
257
- /**
258
- * Generate a new BTC deposit address
259
- */
260
- async generateDepositAddress(e) {
261
- return se({
262
- address: e.address,
263
- chainId: e.chainId,
264
- signature: e.signature,
265
- token: e.token,
266
- eip712Data: e.eip712Data,
267
- signatureData: e.signatureData,
268
- pubKey: e.pubKey,
269
- env: this.env,
270
- partnerId: e.partnerId,
271
- referrerCode: e.referrerCode,
272
- captchaToken: e.captchaToken
273
- });
274
- }
275
- /**
276
- * Get existing deposit address for a recipient
277
- */
278
- async getDepositAddress(e) {
279
- try {
280
- return await N({
281
- address: e.address,
282
- chainId: e.chainId,
283
- token: e.token,
284
- env: this.env,
285
- partnerId: e.partnerId
286
- }) || void 0;
287
- } catch {
288
- return;
289
- }
290
- }
291
- /**
292
- * Get deposits for an address
293
- */
294
- async getDeposits(e) {
295
- return (await P({
296
- address: e,
297
- env: this.env
298
- })).map((n) => {
299
- var i;
300
- return {
301
- depositAddress: n.depositAddress ?? "",
302
- blockHeight: n.blockHeight,
303
- isClaimed: n.isClaimed,
304
- txid: n.txHash,
305
- amount: (i = n.amount) == null ? void 0 : i.toString()
306
- };
307
- });
308
- }
309
- /**
310
- * Store network fee signature
311
- */
312
- async storeFeeSignature(e) {
313
- await oe({
314
- address: e.address,
315
- signature: e.signature,
316
- typedData: e.typedData,
317
- env: this.env,
318
- tokenAddress: e.tokenAddress
319
- });
320
- }
321
- /**
322
- * Get stored network fee signature
323
- */
324
- async getFeeSignature(e) {
325
- return ce({
326
- address: e.address,
327
- chainId: e.chainId,
328
- env: this.env,
329
- tokenAddress: e.tokenAddress
330
- });
331
- }
332
- /**
333
- * Store stake and bake signature
334
- */
335
- async storeStakeAndBakeSignature(e) {
336
- await ie({
337
- signature: e.signature,
338
- typedData: e.typedData,
339
- env: this.env
340
- });
341
- }
342
- }
343
- function Ae() {
344
- return {
345
- id: "api",
346
- register(t) {
347
- return new Se(t.env);
348
- }
349
- };
350
- }
351
- function De(t) {
352
- const e = /* @__PURE__ */ new Map(), s = [ue(), de(), Ae()];
353
- for (const n of s)
354
- e.set(n.id, n);
355
- if (t)
356
- for (const n of t)
357
- e.set(n.id, n);
358
- return Array.from(e.values());
359
- }
360
- function _e(t, e) {
361
- for (const s of t)
362
- for (const n of s.requiresProviders ?? [])
363
- if (!we(e, n))
364
- throw g.providerMissing(n, n);
365
- }
366
- function we(t, e) {
367
- var s;
368
- return !!((s = t.providers) != null && s[e]);
369
- }
370
- function ye(t) {
371
- const e = Ee(t), s = De(
372
- t.modules
373
- );
374
- _e(s, e);
375
- let n = t.logger;
376
- return !n && t.debug && (n = fe({ level: "debug" })), {
377
- ...e,
378
- modules: s,
379
- logger: n
380
- };
381
- }
382
- function xe(t) {
383
- switch (t) {
384
- case "prod":
385
- return "mainnet-beta";
386
- case "testnet":
387
- return "testnet";
388
- case "stage":
389
- case "dev":
390
- case "ibc":
391
- default:
392
- return "devnet";
393
- }
394
- }
395
- const T = {
396
- routes: [
397
- {
398
- sourceChains: [d.SOLANA_DEVNET],
399
- destChain: d.BITCOIN_SIGNET,
400
- assetIn: w.BTCb,
401
- assetOut: w.BTC,
402
- envs: [u.stage, u.dev]
403
- }
404
- ],
405
- recipientSchema: v
406
- };
407
- function Pe(t, e, s, n, i) {
408
- return T.routes.some(
409
- (c) => c.sourceChains.includes(t) && c.destChain === e && c.assetIn === s && c.assetOut === n && c.envs.includes(i)
410
- );
411
- }
412
- class Ne extends f {
413
- constructor(s, n) {
414
- super(r.IDLE);
415
- a(this, "_amount");
416
- a(this, "_recipient");
417
- a(this, "_txHash");
418
- a(this, "env");
419
- if (this.ctx = s, this.params = n, this.env = s.env, !Pe(
420
- n.sourceChain,
421
- n.destChain,
422
- n.assetIn,
423
- n.assetOut,
424
- this.env
425
- ))
426
- throw g.routeNotFound({
427
- assetOut: n.assetOut,
428
- sourceChain: n.sourceChain,
429
- destChain: n.destChain,
430
- env: this.env
431
- });
432
- }
433
- get amount() {
434
- return this._amount;
435
- }
436
- get recipient() {
437
- return this._recipient;
438
- }
439
- get txHash() {
440
- return this._txHash;
441
- }
442
- async prepare(s) {
443
- return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
444
- const n = C(this.prepareSchema, s, {
445
- destChain: this.params.destChain
446
- });
447
- this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
448
- status: r.READY,
449
- steps: { burning: o.IDLE, releasing: o.IDLE }
450
- });
451
- }, r.READY);
452
- }
453
- async execute() {
454
- return this.assertStatus(r.READY, "execute"), this.act(async () => {
455
- const s = this._amount, n = this._recipient;
456
- if (!s || !n)
457
- throw g.missingParameter("amount or recipient");
458
- this.emitProgress({
459
- status: r.READY,
460
- steps: { burning: o.PENDING, releasing: o.IDLE }
461
- });
462
- const i = b(s).toString(), c = xe(this.env), { txHash: l } = await this.ctx.solana.redeemForBtc({
463
- amount: i,
464
- btcAddress: n,
465
- network: c,
466
- env: this.env
467
- });
468
- return this._txHash = l, this.emitProgress({
469
- status: r.CONFIRMING,
470
- steps: { burning: o.COMPLETE, releasing: o.PENDING }
471
- }), { txHash: l };
472
- }, r.CONFIRMING);
473
- }
474
- get prepareSchema() {
475
- return E({
476
- amount: I,
477
- recipient: T.recipientSchema
478
- });
479
- }
480
- }
481
- const L = {
482
- routes: [
483
- // Production: Solana Mainnet → Bitcoin Mainnet
484
- {
485
- sourceChains: [d.SOLANA_MAINNET],
486
- destChain: d.BITCOIN_MAINNET,
487
- envs: [u.prod]
488
- },
489
- // Testnet: Solana Devnet → Bitcoin Signet
490
- {
491
- sourceChains: [d.SOLANA_DEVNET],
492
- destChain: d.BITCOIN_SIGNET,
493
- envs: [u.testnet, u.stage, u.dev, u.ibc]
494
- }
495
- ],
496
- recipientSchema: v
497
- };
498
- function be(t, e) {
499
- return L.routes.some(
500
- (s) => s.sourceChains.includes(t) && s.envs.includes(e)
501
- );
502
- }
503
- function ke(t) {
504
- switch (t) {
505
- case "prod":
506
- return "mainnet-beta";
507
- case "testnet":
508
- return "testnet";
509
- case "stage":
510
- case "dev":
511
- case "ibc":
512
- default:
513
- return "devnet";
514
- }
515
- }
516
- class Te extends f {
517
- constructor(s, n) {
518
- super(r.IDLE);
519
- a(this, "_amount");
520
- a(this, "_recipient");
521
- a(this, "_txHash");
522
- a(this, "env");
523
- if (this.ctx = s, this.params = n, this.env = s.env, !be(n.sourceChain, this.env))
524
- throw g.routeNotFound({
525
- assetOut: n.assetOut,
526
- sourceChain: n.sourceChain,
527
- destChain: n.destChain,
528
- env: this.env
529
- });
530
- }
531
- get amount() {
532
- return this._amount;
533
- }
534
- get recipient() {
535
- return this._recipient;
536
- }
537
- get txHash() {
538
- return this._txHash;
539
- }
540
- async prepare(s) {
541
- return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
542
- const n = C(this.prepareSchema, s, {
543
- destChain: this.params.destChain
544
- });
545
- this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
546
- status: r.READY,
547
- steps: { burning: o.IDLE, releasing: o.IDLE }
548
- });
549
- }, r.READY);
550
- }
551
- async execute() {
552
- return this.assertStatus(r.READY, "execute"), this.act(async () => {
553
- const s = this._amount, n = this._recipient;
554
- if (!s || !n)
555
- throw g.missingParameter("amount or recipient");
556
- this.emitProgress({
557
- status: r.READY,
558
- steps: { burning: o.PENDING, releasing: o.IDLE }
559
- });
560
- const i = b(s).toString(), c = ke(this.env), { txHash: l } = await this.ctx.solana.unstake({
561
- amount: i,
562
- btcAddress: n,
563
- network: c
564
- });
565
- return this._txHash = l, this.emitProgress({
566
- status: r.COMPLETED,
567
- steps: { burning: o.COMPLETE, releasing: o.PENDING }
568
- }), this.emitCompleted(), { txHash: l };
569
- }, r.COMPLETED);
570
- }
571
- get prepareSchema() {
572
- return E({
573
- amount: I,
574
- recipient: L.recipientSchema
575
- });
576
- }
577
- }
578
- function Le(t) {
579
- const s = new S(t.modules, t).require("solana");
580
- return {
581
- env: t.env,
582
- partner: new A(t.partner),
583
- getProvider: async (n) => {
584
- const i = D(t.providers, n);
585
- if (i)
586
- return i();
587
- },
588
- solana: s
589
- };
590
- }
591
- class O {
592
- constructor(e) {
593
- a(this, "_ctx", null);
594
- this.config = e;
595
- }
596
- get ctx() {
597
- return this._ctx || (this._ctx = Le(this.config)), this._ctx;
598
- }
599
- /**
600
- * Unstake LBTC → BTC
601
- *
602
- * Burns LBTC on Solana and releases BTC on Bitcoin.
603
- *
604
- * @throws LombardError if solana module is not registered
605
- */
606
- unstake(e) {
607
- return new Te(this.ctx, e);
608
- }
609
- /**
610
- * Redeem BTC.b → BTC
611
- *
612
- * Burns BTC.b on Solana and releases BTC to a Bitcoin address via GMP.
613
- *
614
- * @throws LombardError if solana module is not registered
615
- * @throws LombardError if route is not supported
616
- */
617
- redeem(e) {
618
- return new Ne(this.ctx, e);
619
- }
620
- }
621
- function at(t) {
622
- return new O(t);
623
- }
624
- const M = {
625
- routes: [
626
- {
627
- sourceChains: [d.STARKNET_MAINNET],
628
- destChain: d.BITCOIN_MAINNET,
629
- envs: [u.prod]
630
- },
631
- {
632
- sourceChains: [d.STARKNET_SEPOLIA],
633
- destChain: d.BITCOIN_SIGNET,
634
- envs: [u.testnet, u.stage, u.dev, u.ibc]
635
- }
636
- ],
637
- recipientSchema: v
638
- };
639
- function Oe(t, e) {
640
- return M.routes.some(
641
- (s) => s.sourceChains.includes(t) && s.envs.includes(e)
642
- );
643
- }
644
- class Me extends f {
645
- constructor(s, n) {
646
- super(r.IDLE);
647
- a(this, "_amount");
648
- a(this, "_recipient");
649
- a(this, "_txHash");
650
- a(this, "env");
651
- if (this.ctx = s, this.params = n, this.env = s.env, !Oe(n.sourceChain, this.env))
652
- throw g.routeNotFound({
653
- assetOut: n.assetOut,
654
- sourceChain: n.sourceChain,
655
- destChain: n.destChain,
656
- env: this.env
657
- });
658
- }
659
- get amount() {
660
- return this._amount;
661
- }
662
- get recipient() {
663
- return this._recipient;
664
- }
665
- get txHash() {
666
- return this._txHash;
667
- }
668
- async prepare(s) {
669
- return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
670
- const n = C(this.prepareSchema, s, {
671
- destChain: this.params.destChain
672
- });
673
- this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
674
- status: r.READY,
675
- steps: { burning: o.IDLE, releasing: o.IDLE }
676
- });
677
- }, r.READY);
678
- }
679
- async execute() {
680
- return this.assertStatus(r.READY, "execute"), this.act(async () => {
681
- const s = this._amount, n = this._recipient;
682
- if (!s || !n)
683
- throw g.missingParameter("amount or recipient");
684
- this.emitProgress({
685
- status: r.READY,
686
- steps: { burning: o.PENDING, releasing: o.IDLE }
687
- });
688
- const { txHash: i } = await this.ctx.starknet.unstake({
689
- amount: s,
690
- btcAddress: n,
691
- env: this.env
692
- });
693
- return this._txHash = i, this.emitProgress({
694
- status: r.COMPLETED,
695
- steps: { burning: o.COMPLETE, releasing: o.PENDING }
696
- }), this.emitCompleted(), { txHash: i };
697
- }, r.COMPLETED);
698
- }
699
- get prepareSchema() {
700
- return E({
701
- amount: I,
702
- recipient: M.recipientSchema
703
- });
704
- }
705
- }
706
- function Re(t) {
707
- const s = new S(t.modules, t).require("starknet");
708
- return {
709
- env: t.env,
710
- partner: new A(t.partner),
711
- getProvider: async (n) => {
712
- const i = D(t.providers, n);
713
- if (i)
714
- return i();
715
- },
716
- starknet: s
717
- };
718
- }
719
- class R {
720
- constructor(e) {
721
- a(this, "_ctx", null);
722
- this.config = e;
723
- }
724
- get ctx() {
725
- return this._ctx || (this._ctx = Re(this.config)), this._ctx;
726
- }
727
- /**
728
- * Unstake LBTC → BTC
729
- *
730
- * Burns LBTC on Starknet and releases BTC on Bitcoin.
731
- *
732
- * @throws LombardError if starknet module is not registered
733
- */
734
- unstake(e) {
735
- return new Me(this.ctx, e);
736
- }
737
- }
738
- function ot(t) {
739
- return new R(t);
740
- }
741
- const B = {
742
- routes: [
743
- {
744
- sourceChains: [d.SUI_MAINNET],
745
- destChain: d.BITCOIN_MAINNET,
746
- envs: [u.prod]
747
- },
748
- {
749
- sourceChains: [d.SUI_TESTNET],
750
- destChain: d.BITCOIN_SIGNET,
751
- envs: [u.testnet, u.stage, u.dev, u.ibc]
752
- }
753
- ],
754
- recipientSchema: v
755
- };
756
- function Be(t, e) {
757
- return B.routes.some(
758
- (s) => s.sourceChains.includes(t) && s.envs.includes(e)
759
- );
760
- }
761
- function He(t) {
762
- switch (t) {
763
- case d.SUI_MAINNET:
764
- return "sui:mainnet";
765
- case d.SUI_TESTNET:
766
- return "sui:testnet";
767
- default:
768
- return "sui:testnet";
769
- }
770
- }
771
- class Fe extends f {
772
- constructor(s, n) {
773
- super(r.IDLE);
774
- a(this, "_amount");
775
- a(this, "_recipient");
776
- a(this, "_txHash");
777
- a(this, "env");
778
- if (this.ctx = s, this.params = n, this.env = s.env, !Be(n.sourceChain, this.env))
779
- throw g.routeNotFound({
780
- assetOut: n.assetOut,
781
- sourceChain: n.sourceChain,
782
- destChain: n.destChain,
783
- env: this.env
784
- });
785
- }
786
- get amount() {
787
- return this._amount;
788
- }
789
- get recipient() {
790
- return this._recipient;
791
- }
792
- get txHash() {
793
- return this._txHash;
794
- }
795
- async prepare(s) {
796
- return this.assertStatus(r.IDLE, "prepare"), this.act(async () => {
797
- const n = C(this.prepareSchema, s, {
798
- destChain: this.params.destChain
799
- });
800
- this._amount = n.amount, this._recipient = n.recipient, this.emitProgress({
801
- status: r.READY,
802
- steps: { burning: o.IDLE, releasing: o.IDLE }
803
- });
804
- }, r.READY);
805
- }
806
- async execute() {
807
- return this.assertStatus(r.READY, "execute"), this.act(async () => {
808
- const s = this._amount, n = this._recipient;
809
- if (!s || !n)
810
- throw g.missingParameter("amount or recipient");
811
- this.emitProgress({
812
- status: r.READY,
813
- steps: { burning: o.PENDING, releasing: o.IDLE }
814
- });
815
- const i = He(this.params.sourceChain), { txHash: c } = await this.ctx.sui.unstake({
816
- amount: s,
817
- btcAddress: n,
818
- chainId: i,
819
- env: this.env
820
- });
821
- return this._txHash = c, this.emitProgress({
822
- status: r.COMPLETED,
823
- steps: { burning: o.COMPLETE, releasing: o.PENDING }
824
- }), this.emitCompleted(), { txHash: c };
825
- }, r.COMPLETED);
826
- }
827
- get prepareSchema() {
828
- return E({
829
- amount: I,
830
- recipient: B.recipientSchema
831
- });
832
- }
833
- }
834
- function Ue(t) {
835
- const s = new S(t.modules, t).require("sui");
836
- return {
837
- env: t.env,
838
- partner: new A(t.partner),
839
- getProvider: async (n) => {
840
- const i = D(t.providers, n);
841
- if (i)
842
- return i();
843
- },
844
- sui: s
845
- };
846
- }
847
- class H {
848
- constructor(e) {
849
- a(this, "_ctx", null);
850
- this.config = e;
851
- }
852
- get ctx() {
853
- return this._ctx || (this._ctx = Ue(this.config)), this._ctx;
854
- }
855
- /**
856
- * Unstake LBTC → BTC
857
- *
858
- * Burns LBTC on Sui and releases BTC on Bitcoin.
859
- *
860
- * @throws LombardError if sui module is not registered
861
- */
862
- unstake(e) {
863
- return new Fe(this.ctx, e);
864
- }
865
- }
866
- function ct(t) {
867
- return new H(t);
868
- }
869
- class Ge {
870
- constructor(e = k, s) {
871
- a(this, "catalog");
872
- this.env = e, this.catalog = s ?? x;
873
- }
874
- /** Get token contract address */
875
- getAddress(e, s) {
876
- return K(e, this.env, s, this.catalog);
877
- }
878
- /** Get token decimals */
879
- getDecimals(e) {
880
- return V(e, this.catalog);
881
- }
882
- /** Get asset metadata (decimals, symbol, name) */
883
- getMetadata(e) {
884
- return j(e, this.catalog);
885
- }
886
- /** Check if asset uses an asset router contract */
887
- usesAssetRouter(e, s) {
888
- return $(e, this.env, s, this.catalog);
889
- }
890
- /** Get asset router contract address */
891
- getAssetRouter(e, s) {
892
- return q(e, this.env, s, this.catalog);
893
- }
894
- /** Get bridge adapter address */
895
- getBridgeAdapter(e, s) {
896
- return z(e, this.env, s, this.catalog);
897
- }
898
- /** Get public market maker address */
899
- getPublicMarketMaker(e, s) {
900
- return W(e, this.env, s, this.catalog);
901
- }
902
- /** Find asset by contract address (reverse lookup) */
903
- getByAddress(e, s) {
904
- return X(e, this.env, s, this.catalog);
905
- }
906
- /** Check if asset is deployed on a chain */
907
- isDeployed(e, s) {
908
- return Z(e, this.env, s, this.catalog);
909
- }
910
- /** Get all chains where asset is deployed */
911
- getChains(e) {
912
- return J(e, this.env, this.catalog);
913
- }
914
- /** Get all environments where asset is deployed on a chain */
915
- getEnvironments(e, s) {
916
- return Q(e, s, this.catalog);
917
- }
918
- /** Get all supported assets */
919
- getSupportedAssets() {
920
- return ee(this.catalog);
921
- }
922
- /** Direct access to the asset catalog */
923
- getCatalog() {
924
- return this.catalog;
925
- }
926
- }
927
- class Ye {
928
- constructor(e) {
929
- a(this, "config");
930
- a(this, "env");
931
- /** Partner configuration manager */
932
- a(this, "partnerConfig");
933
- /** Provider cache */
934
- a(this, "providerCache", /* @__PURE__ */ new Map());
935
- /**
936
- * Chain actions (user-facing API)
937
- *
938
- * Access operations for each supported chain:
939
- * - btc: Bitcoin operations (stake, stakeAndDeploy, deposit)
940
- * - evm: EVM operations (deposit, stake, unstake, deploy, redeem)
941
- * - solana: Solana operations (unstake)
942
- * - sui: Sui operations (unstake)
943
- * - starknet: Starknet operations (unstake)
944
- */
945
- a(this, "chain");
946
- a(this, "assets");
947
- /**
948
- * API namespace for data-fetching operations
949
- *
950
- * Provides convenient access to Lombard API read operations:
951
- * - deposits: Fetch deposit history
952
- * - unstakes: Fetch unstake/redemption history
953
- * - points: Fetch Lux points
954
- * - exchangeRatio: Get exchange ratios for all supported tokens
955
- * - depositAddress: Get existing BTC deposit address
956
- */
957
- a(this, "api");
958
- /** Feature clients */
959
- a(this, "referrals");
960
- /** Capability registry (manages optional module services) */
961
- a(this, "capabilities");
962
- this.config = e, this.env = e.env, this.partnerConfig = new A(e.partner), this.capabilities = new S(
963
- this.config.modules,
964
- this.config
965
- ), this.chain = {
966
- btc: new he(this.config),
967
- evm: new ge(this.config),
968
- solana: new O(this.config),
969
- sui: new H(this.config),
970
- starknet: new R(this.config)
971
- }, this.referrals = new ae(this), this.assets = new Ge(this.env), this.api = new Ce(this.env);
972
- }
973
- async getProvider(e) {
974
- const s = e;
975
- if (this.providerCache.has(s))
976
- return this.providerCache.get(s);
977
- const n = D(this.config.providers, e);
978
- if (!n)
979
- throw g.providerMissing(e, e);
980
- const i = await n();
981
- if (!i)
982
- throw new g(
983
- te.PROVIDER_INITIALIZATION_FAILED,
984
- `Failed to initialize ${e} provider`
985
- );
986
- return this.providerCache.set(s, i), i;
987
- }
988
- /**
989
- * Configure partner settings
990
- *
991
- * @param config - Partner configuration
992
- */
993
- configure(e) {
994
- this.partnerConfig.update(e);
995
- }
996
- /**
997
- * Register a custom asset
998
- *
999
- * TODO: Implement asset registration
1000
- */
1001
- registerAsset(e) {
1002
- throw new Error("Not implemented yet");
1003
- }
1004
- /**
1005
- * Get partner configuration
1006
- */
1007
- getPartnerConfig() {
1008
- return this.partnerConfig;
1009
- }
1010
- getPartnerId() {
1011
- return this.partnerConfig.getPartnerId();
1012
- }
1013
- }
1014
- const _ = /* @__PURE__ */ new Map();
1015
- function Ke(t) {
1016
- return _.has(t) || _.set(t, Promise.resolve(x)), _.get(t);
1017
- }
1018
- async function ut(t) {
1019
- const e = "modules" in t && Array.isArray(t.modules) ? t : ye(t), s = await Ke(e.env), n = {
1020
- ...e,
1021
- catalog: s
1022
- };
1023
- return new Ye(n);
1024
- }
1025
- function ht(t) {
1026
- return typeof t == "object" && t !== null && "request" in t && typeof t.request == "function";
1027
- }
1028
- function dt(t) {
1029
- return typeof t == "object" && t !== null && "getAddresses" in t && typeof t.getAddresses == "function";
1030
- }
1031
- function gt(t) {
1032
- return typeof t == "object" && t !== null && "publicKey" in t && "signAndSendTransaction" in t;
1033
- }
1034
- function lt(t) {
1035
- return typeof t == "object" && t !== null && "getAddress" in t && "signAndExecuteTransactionBlock" in t;
1036
- }
1037
- function pt(t) {
1038
- return typeof t == "object" && t !== null && "address" in t && "execute" in t;
1039
- }
1040
- const mt = {
1041
- /** Progress update with detailed step information */
1042
- Progress: "progress",
1043
- /** Status change (e.g., 'idle' → 'preparing' → 'ready') */
1044
- StatusChange: "status-change",
1045
- /** Operation completed successfully */
1046
- Completed: "completed",
1047
- /** Operation failed */
1048
- Failed: "failed",
1049
- /** Error occurred */
1050
- Error: "error"
1051
- }, vt = {
1052
- Progress: "progress",
1053
- StatusChange: "status-change",
1054
- Completed: "completed",
1055
- Failed: "failed",
1056
- Error: "error"
1057
- }, ft = {
1058
- Progress: "progress",
1059
- StatusChange: "status-change",
1060
- Completed: "completed",
1061
- Failed: "failed",
1062
- Error: "error"
1063
- }, Ct = {
1064
- Progress: "progress",
1065
- StatusChange: "status-change",
1066
- Completed: "completed",
1067
- Failed: "failed",
1068
- Error: "error"
1069
- }, Et = {
1070
- Progress: "progress",
1071
- StatusChange: "status-change",
1072
- Completed: "completed",
1073
- Failed: "failed",
1074
- Error: "error"
1075
- }, It = {
1076
- Progress: "progress",
1077
- StatusChange: "status-change",
1078
- Completed: "completed",
1079
- Failed: "failed",
1080
- Error: "error"
1081
- };
1082
- export {
1083
- Ce as ApiNamespace,
1084
- It as BridgeEvent,
1085
- Et as DeployEvent,
1086
- vt as DepositEvent,
1087
- Ye as LombardSDK,
1088
- ft as RedeemEvent,
1089
- O as SolanaActions,
1090
- mt as StakeEvent,
1091
- R as StarknetActions,
1092
- H as SuiActions,
1093
- Ct as UnstakeEvent,
1094
- ye as createConfig,
1095
- fe as createConsoleLogger,
1096
- ut as createLombardSDK,
1097
- rt as createSilentLogger,
1098
- it as getSdkHeaders,
1099
- dt as isBtcProvider,
1100
- ht as isEvmProvider,
1101
- gt as isSolanaProvider,
1102
- pt as isStarknetProvider,
1103
- lt as isSuiProvider,
1104
- at as solanaActions,
1105
- ot as starknetActions,
1106
- ct as suiActions
1107
- };
1108
- //# sourceMappingURL=events-LMs7IA1e.js.map