@lombard.finance/sdk 3.6.3 → 3.6.4
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/README.md +26 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +54 -53
- package/dist/index2.cjs +9 -9
- package/dist/index2.js +204 -193
- package/package.json +1 -1
- package/src/index.ts +6 -1
- package/src/metrics/get-lbtc-apy.ts +28 -2
- package/src/metrics/get-positions-summary.ts +15 -18
package/README.md
CHANGED
|
@@ -557,6 +557,16 @@ The results of the above includes:
|
|
|
557
557
|
_Formula: `balance * rate = BTC equivalent`_
|
|
558
558
|
* **`lastUpdated: Date`**
|
|
559
559
|
The timestamp when the position summary was last updated.
|
|
560
|
+
* **`inProgress: boolean`**
|
|
561
|
+
Indicates whether the backend is currently processing the PnL calculation.
|
|
562
|
+
- `true`: A new calculation request was received, but the backend is experiencing high load
|
|
563
|
+
or processing is not yet complete. The latest data is not yet available.
|
|
564
|
+
- `false`: The most recent calculation has been completed and cached.
|
|
565
|
+
Use `lastUpdated` to understand how fresh the data is:
|
|
566
|
+
- If `lastUpdated` is recent (e.g., within the last few seconds), you're seeing the latest data.
|
|
567
|
+
- If `lastUpdated` is up to 30 minutes old, you're seeing cached data from a recent request.
|
|
568
|
+
The backend avoids recalculating within this caching window.
|
|
569
|
+
|
|
560
570
|
|
|
561
571
|
#### 9.6. Getting the LBTC APY
|
|
562
572
|
|
|
@@ -575,6 +585,22 @@ The above returns:
|
|
|
575
585
|
* **`effectiveApy: BigNumber`**
|
|
576
586
|
The effective APY for LBTC, including any additional rewards, compounding effects, or protocol-specific incentives.
|
|
577
587
|
|
|
588
|
+
To retrieve the estimated APY (annual percentage yield) for LBTC in the context of a specific partner integration, use the `getEstimatedApy` function:
|
|
589
|
+
|
|
590
|
+
```javascript
|
|
591
|
+
const estimated = await getEstimatedApy({
|
|
592
|
+
partnerId, // Optional partner identifier. Influences the estimated APY.
|
|
593
|
+
env, // Optional env flag
|
|
594
|
+
});
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
The above returns:
|
|
598
|
+
|
|
599
|
+
* **`estimatedApy: BigNumber`**
|
|
600
|
+
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.
|
|
601
|
+
|
|
602
|
+
> **Note**: If no `partnerId` is provided, the function returns a default estimate based on global assumptions.
|
|
603
|
+
|
|
578
604
|
#### 9.7. Getting the additional rewards data
|
|
579
605
|
|
|
580
606
|
In order to retrieve the additional rewards that have been distributed or are pending use the below function:
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs");exports.BTC_DECIMALS=e.BTC_DECIMALS;exports.BasculeDepositStatus=e.BasculeDepositStatus;exports.BlockchainIdentifier=e.BlockchainIdentifier;exports.CHAIN_ID_TO_VIEM_CHAIN_MAP=e.CHAIN_ID_TO_VIEM_CHAIN_MAP;exports.ChainId=e.ChainId;exports.ENotarizationStatus=e.ENotarizationStatus;exports.ESessionState=e.ESessionState;exports.Env=e.t;exports.OFT_GAS_LIMIT=e.OFT_GAS_LIMIT;exports.OFT_HI_GAS_LIMIT=e.OFT_HI_GAS_LIMIT;exports.OFT_HI_GAS_LIMIT_CHAINS=e.OFT_HI_GAS_LIMIT_CHAINS;exports.PayoutTxStatus=e.PayoutTxStatus;exports.RATIO_TOKEN_MAP=e.RATIO_TOKEN_MAP;exports.RewardBlockchainType=e.RewardBlockchainType;exports.RewardToken=e.RewardToken;exports.RewardWithdrawalStatus=e.RewardWithdrawalStatus;exports.SANCTIONED_ADDRESS=e.SANCTIONED_ADDRESS;exports.SATOSHI_SCALE=e.SATOSHI_SCALE;exports.SOLANA_DEVNET_CHAIN=e.SOLANA_DEVNET_CHAIN;exports.SOLANA_MAINNET_CHAIN=e.SOLANA_MAINNET_CHAIN;exports.SOLANA_TESTNET_CHAIN=e.SOLANA_TESTNET_CHAIN;exports.SUI_DEVNET_CHAIN=e.SUI_DEVNET_CHAIN;exports.SUI_LOCALNET_CHAIN=e.SUI_LOCALNET_CHAIN;exports.SUI_MAINNET_CHAIN=e.SUI_MAINNET_CHAIN;exports.SUI_TESTNET_CHAIN=e.SUI_TESTNET_CHAIN;exports.TOKEN_ADDRESSES=e.TOKEN_ADDRESSES;exports.Token=e.Token;exports.Vault=e.Vault;exports.addChain=e.addChain;exports.approveLBTC=e.approveLBTC;exports.bridge=e.bridge;exports.bridgeCCIP=e.bridgeCCIP;exports.bridgeOFT=e.bridgeOFT;exports.cancelWithdraw=e.cancelWithdraw;exports.claimLBTC=e.claimLBTC;exports.claimReward=e.claimReward;exports.deposit=e.deposit;exports.fromSatoshi=e.fromSatoshi;exports.generateDepositBtcAddress=e.generateDepositBtcAddress;exports.getAdditionalRewards=e.getAdditionalRewards;exports.getApiConfig=e.getApiConfig;exports.getApy=e.getApy;exports.getBasculeDepositStatus=e.getBasculeDepositStatus;exports.getBaseNetworkByEnv=e.getBaseNetworkByEnv;exports.getBridgeInfo=e.getBridgeInfo;exports.getBscNetworkByEnv=e.getBscNetworkByEnv;exports.getChainIdByName=e.getChainIdByName;exports.getChainNameById=e.getChainNameById;exports.getDepositBtcAddress=e.getDepositBtcAddress;exports.getDepositBtcAddresses=e.getDepositBtcAddresses;exports.getDepositsByAddress=e.getDepositsByAddress;exports.getEthNetworkByEnv=e.getEthNetworkByEnv;exports.getExchangeRatio=e.getExchangeRatio;exports.getLBTCBurningFee=e.getLBTCBurningFee;exports.getLBTCExchangeRate=e.getLBTCExchangeRate;exports.getLBTCMintingFee=e.getLBTCMintingFee;exports.getLBTCStats=e.getLBTCStats;exports.getLBTCTotalSupply=e.getLBTCTotalSupply;exports.getLbtcContractAddresses=e.getLbtcContractAddresses;exports.getMintingFee=e.getMintingFee;exports.getNetworkFeeSignature=e.getNetworkFeeSignature;exports.getPermitNonce=e.getPermitNonce;exports.getPointsByAddress=e.getPointsByAddress;exports.getPositionsSummary=e.getPositionsSummary;exports.getRedeemFee=e.getRedeemFee;exports.getRewardBalances=e.getRewardBalances;exports.getRewardSigningData=e.getRewardSigningData;exports.getRewardWithdrawalFee=e.getRewardWithdrawalFee;exports.getRewardWithdrawals=e.getRewardWithdrawals;exports.getShareValue=e.getShareValue;exports.getSharesByAddress=e.getSharesByAddress;exports.getSolanaNetworkByEnv=e.getSolanaNetworkByEnv;exports.getSonicNetworkByEnv=e.getSonicNetworkByEnv;exports.getStakeAndBakeFee=e.getStakeAndBakeFee;exports.getSuiNetworkByEnv=e.getSuiNetworkByEnv;exports.getUnstakesByAddress=e.getUnstakesByAddress;exports.getUserStakeAndBakeSignature=e.getUserStakeAndBakeSignature;exports.getVaultApy=e.getVaultApy;exports.getVaultDeposits=e.getVaultDeposits;exports.getVaultPoints=e.getVaultPoints;exports.getVaultTVL=e.getVaultTVL;exports.getVaultWithdrawals=e.getVaultWithdrawals;exports.isKatanaChain=e.isKatanaChain;exports.isRewardTokenSupported=e.isRewardTokenSupported;exports.isValidChain=e.isValidChain;exports.katana=e.katana;exports.katanaTatara=e.katanaTatara;exports.mintToken=e.mintToken;exports.queueWithdraw=e.queueWithdraw;exports.redeemToken=e.redeemToken;exports.setReferral=e.setReferral;exports.signLbtcDestinationAddr=e.signLbtcDestinationAddr;exports.signNetworkFee=e.signNetworkFee;exports.signStakeAndBake=e.signStakeAndBake;exports.storeNetworkFeeSignature=e.storeNetworkFeeSignature;exports.storeStakeAndBakeSignature=e.storeStakeAndBakeSignature;exports.tac=e.tac;exports.toSatoshi=e.toSatoshi;exports.unstakeLBTC=e.unstakeLBTC;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs");exports.BTC_DECIMALS=e.BTC_DECIMALS;exports.BasculeDepositStatus=e.BasculeDepositStatus;exports.BlockchainIdentifier=e.BlockchainIdentifier;exports.CHAIN_ID_TO_VIEM_CHAIN_MAP=e.CHAIN_ID_TO_VIEM_CHAIN_MAP;exports.ChainId=e.ChainId;exports.ENotarizationStatus=e.ENotarizationStatus;exports.ESessionState=e.ESessionState;exports.Env=e.t;exports.OFT_GAS_LIMIT=e.OFT_GAS_LIMIT;exports.OFT_HI_GAS_LIMIT=e.OFT_HI_GAS_LIMIT;exports.OFT_HI_GAS_LIMIT_CHAINS=e.OFT_HI_GAS_LIMIT_CHAINS;exports.PayoutTxStatus=e.PayoutTxStatus;exports.RATIO_TOKEN_MAP=e.RATIO_TOKEN_MAP;exports.RewardBlockchainType=e.RewardBlockchainType;exports.RewardToken=e.RewardToken;exports.RewardWithdrawalStatus=e.RewardWithdrawalStatus;exports.SANCTIONED_ADDRESS=e.SANCTIONED_ADDRESS;exports.SATOSHI_SCALE=e.SATOSHI_SCALE;exports.SOLANA_DEVNET_CHAIN=e.SOLANA_DEVNET_CHAIN;exports.SOLANA_MAINNET_CHAIN=e.SOLANA_MAINNET_CHAIN;exports.SOLANA_TESTNET_CHAIN=e.SOLANA_TESTNET_CHAIN;exports.SUI_DEVNET_CHAIN=e.SUI_DEVNET_CHAIN;exports.SUI_LOCALNET_CHAIN=e.SUI_LOCALNET_CHAIN;exports.SUI_MAINNET_CHAIN=e.SUI_MAINNET_CHAIN;exports.SUI_TESTNET_CHAIN=e.SUI_TESTNET_CHAIN;exports.TOKEN_ADDRESSES=e.TOKEN_ADDRESSES;exports.Token=e.Token;exports.Vault=e.Vault;exports.addChain=e.addChain;exports.approveLBTC=e.approveLBTC;exports.bridge=e.bridge;exports.bridgeCCIP=e.bridgeCCIP;exports.bridgeOFT=e.bridgeOFT;exports.cancelWithdraw=e.cancelWithdraw;exports.claimLBTC=e.claimLBTC;exports.claimReward=e.claimReward;exports.deposit=e.deposit;exports.fromSatoshi=e.fromSatoshi;exports.generateDepositBtcAddress=e.generateDepositBtcAddress;exports.getAdditionalRewards=e.getAdditionalRewards;exports.getApiConfig=e.getApiConfig;exports.getApy=e.getApy;exports.getBasculeDepositStatus=e.getBasculeDepositStatus;exports.getBaseNetworkByEnv=e.getBaseNetworkByEnv;exports.getBridgeInfo=e.getBridgeInfo;exports.getBscNetworkByEnv=e.getBscNetworkByEnv;exports.getChainIdByName=e.getChainIdByName;exports.getChainNameById=e.getChainNameById;exports.getDepositBtcAddress=e.getDepositBtcAddress;exports.getDepositBtcAddresses=e.getDepositBtcAddresses;exports.getDepositsByAddress=e.getDepositsByAddress;exports.getEstimatedApy=e.getEstimatedApy;exports.getEthNetworkByEnv=e.getEthNetworkByEnv;exports.getExchangeRatio=e.getExchangeRatio;exports.getLBTCBurningFee=e.getLBTCBurningFee;exports.getLBTCExchangeRate=e.getLBTCExchangeRate;exports.getLBTCMintingFee=e.getLBTCMintingFee;exports.getLBTCStats=e.getLBTCStats;exports.getLBTCTotalSupply=e.getLBTCTotalSupply;exports.getLbtcContractAddresses=e.getLbtcContractAddresses;exports.getMintingFee=e.getMintingFee;exports.getNetworkFeeSignature=e.getNetworkFeeSignature;exports.getPermitNonce=e.getPermitNonce;exports.getPointsByAddress=e.getPointsByAddress;exports.getPositionsSummary=e.getPositionsSummary;exports.getRedeemFee=e.getRedeemFee;exports.getRewardBalances=e.getRewardBalances;exports.getRewardSigningData=e.getRewardSigningData;exports.getRewardWithdrawalFee=e.getRewardWithdrawalFee;exports.getRewardWithdrawals=e.getRewardWithdrawals;exports.getShareValue=e.getShareValue;exports.getSharesByAddress=e.getSharesByAddress;exports.getSolanaNetworkByEnv=e.getSolanaNetworkByEnv;exports.getSonicNetworkByEnv=e.getSonicNetworkByEnv;exports.getStakeAndBakeFee=e.getStakeAndBakeFee;exports.getSuiNetworkByEnv=e.getSuiNetworkByEnv;exports.getUnstakesByAddress=e.getUnstakesByAddress;exports.getUserStakeAndBakeSignature=e.getUserStakeAndBakeSignature;exports.getVaultApy=e.getVaultApy;exports.getVaultDeposits=e.getVaultDeposits;exports.getVaultPoints=e.getVaultPoints;exports.getVaultTVL=e.getVaultTVL;exports.getVaultWithdrawals=e.getVaultWithdrawals;exports.isKatanaChain=e.isKatanaChain;exports.isRewardTokenSupported=e.isRewardTokenSupported;exports.isValidChain=e.isValidChain;exports.katana=e.katana;exports.katanaTatara=e.katanaTatara;exports.mintToken=e.mintToken;exports.queueWithdraw=e.queueWithdraw;exports.redeemToken=e.redeemToken;exports.setReferral=e.setReferral;exports.signLbtcDestinationAddr=e.signLbtcDestinationAddr;exports.signNetworkFee=e.signNetworkFee;exports.signStakeAndBake=e.signStakeAndBake;exports.storeNetworkFeeSignature=e.storeNetworkFeeSignature;exports.storeStakeAndBakeSignature=e.storeStakeAndBakeSignature;exports.tac=e.tac;exports.toSatoshi=e.toSatoshi;exports.unstakeLBTC=e.unstakeLBTC;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aS as e, W as t, aw as i, aK as n, aJ as g, G as r, I as d, u as o, z as S, A, O as T, Q as N, aQ as B, ao as I, au as C, as as E, C as _, aT as k, S as u, h as w, j as l, k as c, aI as h, m as L, n as p, aR as y, aP as D, ad as R, aN as O, a3 as m, w as F, x as H, y as V, ah as M, a4 as v, am as P, ae as U, aU as f, D as W, t as b, av as x, q as G, X as K, aA as q, v as z, az as j, aE as J, ax as Q, E as X, F as Y, J as Z, r as $, ay as aa, L as sa, Z as ea, K as ta, Y as ia, o as na, a0 as ga, aO as ra, _ as da, M as oa, a1 as Sa, N as Aa, p as Ta, $ as Na, an as Ba, ap as Ia, aq as Ca, ar as Ea, ab as _a, ac as ka, aD as ua, aC as wa, a2 as la, aB as ca, P as ha, R as La, al as pa, af as ya, aj as Da, ak as Ra, ai as Oa, aL as ma, at as Fa, aM as Ha, aF as Va, aG as Ma, a5 as va, ag as Pa, aa as Ua, T as fa, a6 as Wa, a7 as ba, a8 as xa, U as Ga, V as Ka, aH as qa, aV as za, a9 as ja } from "./index2.js";
|
|
2
2
|
export {
|
|
3
3
|
e as BTC_DECIMALS,
|
|
4
4
|
t as BasculeDepositStatus,
|
|
5
5
|
i as BlockchainIdentifier,
|
|
6
6
|
n as CHAIN_ID_TO_VIEM_CHAIN_MAP,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
g as ChainId,
|
|
8
|
+
r as ENotarizationStatus,
|
|
9
9
|
d as ESessionState,
|
|
10
10
|
o as Env,
|
|
11
11
|
S as OFT_GAS_LIMIT,
|
|
@@ -15,8 +15,8 @@ export {
|
|
|
15
15
|
B as RATIO_TOKEN_MAP,
|
|
16
16
|
I as RewardBlockchainType,
|
|
17
17
|
C as RewardToken,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
E as RewardWithdrawalStatus,
|
|
19
|
+
_ as SANCTIONED_ADDRESS,
|
|
20
20
|
k as SATOSHI_SCALE,
|
|
21
21
|
u as SOLANA_DEVNET_CHAIN,
|
|
22
22
|
w as SOLANA_MAINNET_CHAIN,
|
|
@@ -29,11 +29,11 @@ export {
|
|
|
29
29
|
D as Token,
|
|
30
30
|
R as Vault,
|
|
31
31
|
O as addChain,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
m as approveLBTC,
|
|
33
|
+
F as bridge,
|
|
34
34
|
H as bridgeCCIP,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
V as bridgeOFT,
|
|
36
|
+
M as cancelWithdraw,
|
|
37
37
|
v as claimLBTC,
|
|
38
38
|
P as claimReward,
|
|
39
39
|
U as deposit,
|
|
@@ -51,52 +51,53 @@ export {
|
|
|
51
51
|
X as getDepositBtcAddress,
|
|
52
52
|
Y as getDepositBtcAddresses,
|
|
53
53
|
Z as getDepositsByAddress,
|
|
54
|
-
$ as
|
|
55
|
-
aa as
|
|
56
|
-
sa as
|
|
57
|
-
ea as
|
|
58
|
-
ta as
|
|
59
|
-
ia as
|
|
60
|
-
na as
|
|
54
|
+
$ as getEstimatedApy,
|
|
55
|
+
aa as getEthNetworkByEnv,
|
|
56
|
+
sa as getExchangeRatio,
|
|
57
|
+
ea as getLBTCBurningFee,
|
|
58
|
+
ta as getLBTCExchangeRate,
|
|
59
|
+
ia as getLBTCMintingFee,
|
|
60
|
+
na as getLBTCStats,
|
|
61
|
+
ga as getLBTCTotalSupply,
|
|
61
62
|
ra as getLbtcContractAddresses,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
da as getMintingFee,
|
|
64
|
+
oa as getNetworkFeeSignature,
|
|
65
|
+
Sa as getPermitNonce,
|
|
66
|
+
Aa as getPointsByAddress,
|
|
67
|
+
Ta as getPositionsSummary,
|
|
68
|
+
Na as getRedeemFee,
|
|
69
|
+
Ba as getRewardBalances,
|
|
70
|
+
Ia as getRewardSigningData,
|
|
71
|
+
Ca as getRewardWithdrawalFee,
|
|
72
|
+
Ea as getRewardWithdrawals,
|
|
72
73
|
_a as getShareValue,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
ka as getSharesByAddress,
|
|
75
|
+
ua as getSolanaNetworkByEnv,
|
|
76
|
+
wa as getSonicNetworkByEnv,
|
|
77
|
+
la as getStakeAndBakeFee,
|
|
78
|
+
ca as getSuiNetworkByEnv,
|
|
79
|
+
ha as getUnstakesByAddress,
|
|
80
|
+
La as getUserStakeAndBakeSignature,
|
|
81
|
+
pa as getVaultApy,
|
|
82
|
+
ya as getVaultDeposits,
|
|
83
|
+
Da as getVaultPoints,
|
|
84
|
+
Ra as getVaultTVL,
|
|
85
|
+
Oa as getVaultWithdrawals,
|
|
86
|
+
ma as isKatanaChain,
|
|
86
87
|
Fa as isRewardTokenSupported,
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
Ha as isValidChain,
|
|
89
|
+
Va as katana,
|
|
89
90
|
Ma as katanaTatara,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
va as mintToken,
|
|
92
|
+
Pa as queueWithdraw,
|
|
93
|
+
Ua as redeemToken,
|
|
94
|
+
fa as setReferral,
|
|
95
|
+
Wa as signLbtcDestinationAddr,
|
|
96
|
+
ba as signNetworkFee,
|
|
97
|
+
xa as signStakeAndBake,
|
|
98
|
+
Ga as storeNetworkFeeSignature,
|
|
99
|
+
Ka as storeStakeAndBakeSignature,
|
|
100
|
+
qa as tac,
|
|
101
|
+
za as toSatoshi,
|
|
102
|
+
ja as unstakeLBTC
|
|
102
103
|
};
|