@lombard.finance/sdk 3.2.0 → 3.5.6
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 +2 -0
- package/dist/ccip.cjs +0 -1
- package/dist/ccip.js +0 -1
- package/dist/index.cjs +1 -2
- package/dist/index.js +84 -73
- package/dist/index2.cjs +54 -55
- package/dist/index2.js +7947 -6532
- package/package.json +35 -33
- package/src/api-functions/generateDepositBtcAddress/generateDepositBtcAddress.stories.tsx +7 -0
- package/src/api-functions/generateDepositBtcAddress/generateDepositBtcAddress.ts +78 -2
- package/src/api-functions/getDepositBtcAddress/getDepositBtcAddress.stories.tsx +7 -8
- package/src/api-functions/getDepositBtcAddress/getDepositBtcAddress.ts +66 -3
- package/src/api-functions/getDepositBtcAddress/getDepositBtcAddresses.stories.tsx +4 -0
- package/src/api-functions/getDepositsByAddress/getDepositsByAddress.ts +5 -2
- package/src/api-functions/getNetworkFeeSignature/getNetworkFeeSignature.stories.tsx +2 -0
- package/src/api-functions/getUnstakesByAddress/getUnstakesByAddress.ts +35 -6
- package/src/api-functions/getUnstakesByAddress/index.ts +1 -1
- package/src/bridge/lib/config.ts +127 -112
- package/src/bridge/lib/oft-bridge.stories.tsx +9 -9
- package/src/bridge/lib/oft-bridge.ts +16 -17
- package/src/clients/public-client.ts +9 -1
- package/src/clients/rpc-url-config.ts +27 -0
- package/src/common/api-config.ts +2 -2
- package/src/common/blockchain-identifier.ts +11 -0
- package/src/common/chains.stories.tsx +67 -0
- package/src/common/chains.ts +83 -0
- package/src/contract-functions/approveLBTC/approveLBTC.stories.tsx +2 -0
- package/src/contract-functions/claimLBTC/claimLBTC.stories.tsx +13 -4
- package/src/contract-functions/claimLBTC/claimLBTC.ts +50 -10
- package/src/contract-functions/getBasculeDepositStatus/getBasculeDepositStatus.ts +6 -4
- package/src/contract-functions/getLBTCMintingFee/getLBTCMintingFee.stories.tsx +7 -10
- package/src/contract-functions/getLBTCMintingFee/getLBTCMintingFee.tsx +45 -6
- package/src/contract-functions/getLBTCTotalSupply/getLBTCTotalSupply.stories.tsx +3 -1
- package/src/contract-functions/getLBTCTotalSupply/getLBTCTotalSupply.ts +5 -4
- package/src/contract-functions/signNetworkFee/signNetworkFee.stories.tsx +2 -0
- package/src/contract-functions/unstakeLBTC/unstakeLBTC.stories.tsx +15 -4
- package/src/contract-functions/unstakeLBTC/unstakeLBTC.ts +53 -11
- package/src/index.ts +1 -0
- package/src/rewards/lib/claim-reward.stories.tsx +1 -0
- package/src/rewards/lib/claim-reward.ts +5 -0
- package/src/rewards/lib/get-reward-signing-data.stories.tsx +1 -0
- package/src/rewards/lib/get-reward-signing-data.ts +4 -0
- package/src/stories/arg-types.ts +34 -0
- package/src/stories/components/decorators/wagmi-decorator.tsx +5 -0
- package/src/tokens/abi/BTCK_ABI.ts +1092 -0
- package/src/tokens/lbtc-addresses.ts +7 -0
- package/src/tokens/token-addresses.ts +97 -10
- package/src/tokens/tokens.ts +29 -18
- package/src/utils/env.ts +7 -0
- package/src/utils/err.ts +14 -0
- package/src/utils/gas.ts +36 -0
- package/src/vaults/lib/metrics/get-vault-tvl.ts +1 -0
- package/dist/ccip.cjs.map +0 -1
- package/dist/ccip.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index2.cjs.map +0 -1
- package/dist/index2.js.map +0 -1
package/README.md
CHANGED
|
@@ -351,6 +351,7 @@ Every entry in the result of the above may consist of:
|
|
|
351
351
|
* `amount` - The amount unstaked,
|
|
352
352
|
* `payoutTxHash` - The BTC transaction hash,
|
|
353
353
|
* `payoutTxIndex` - The index of the actual payout transfer,
|
|
354
|
+
* `payoutTxStatus` - The status of the payout, available values: `PayoutTxStatus.Completed` or `PayoutTxStatus.Pending`,
|
|
354
355
|
* `sanctioned` - A flag indicating whether the unstake transaction has been sanctioned and flagged as suspicious.
|
|
355
356
|
|
|
356
357
|
### 5. Depositing LBTC to the DeFi vault.
|
|
@@ -560,6 +561,7 @@ const withdrawal = await claimReward({
|
|
|
560
561
|
rewardToken, // The reward token, e.g. RewardToken.BABY
|
|
561
562
|
amount, // The amount to be claimed (withdrawn)
|
|
562
563
|
to, // The destination address, e.g. BABYLON chain address.
|
|
564
|
+
signingDataVariant: 'json', // Optional signing data variant, available values: 'json', 'plain-text'
|
|
563
565
|
chainId, // The chain id
|
|
564
566
|
provider, // The EIP-1193 provider.
|
|
565
567
|
});
|
package/dist/ccip.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index2.cjs");class w extends t.BaseError{constructor({callbackSelector:o,cause:a,data:n,extraData:f,sender:u,urls:r}){var c;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(c=a.metaMessages)!=null&&c.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(d=>` ${t.getUrl(d)}`)],` Sender: ${u}`,` Data: ${n}`,` Callback selector: ${o}`,` Extra data: ${f}`].flat(),name:"OffchainLookupError"})}}class k extends t.BaseError{constructor({result:o,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${t.getUrl(a)}`,`Response: ${t.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class b extends t.BaseError{constructor({sender:o,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${o}`],name:"OffchainLookupSenderMismatchError"})}}const L="0x556f1830",h={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function E(i,{blockNumber:o,blockTag:a,data:n,to:f}){const{args:u}=t.decodeErrorResult({data:n,abi:[h]}),[r,c,d,p,s]=u,{ccipRead:e}=i,m=e&&typeof(e==null?void 0:e.request)=="function"?e.request:y;try{if(!t.isAddressEqual(f,r))throw new b({sender:r,to:f});const l=await m({data:d,sender:r,urls:c}),{data:g}=await t.call(i,{blockNumber:o,blockTag:a,data:t.concat([p,t.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[l,s])]),to:f});return g}catch(l){throw new w({callbackSelector:p,cause:l,data:n,extraData:s,sender:r,urls:c})}}async function y({data:i,sender:o,urls:a}){var f;let n=new Error("An unknown error occurred.");for(let u=0;u<a.length;u++){const r=a[u],c=r.includes("{data}")?"GET":"POST",d=c==="POST"?{data:i,sender:o}:void 0,p=c==="POST"?{"Content-Type":"application/json"}:{};try{const s=await fetch(r.replace("{sender}",o.toLowerCase()).replace("{data}",i),{body:JSON.stringify(d),headers:p,method:c});let e;if((f=s.headers.get("Content-Type"))!=null&&f.startsWith("application/json")?e=(await s.json()).data:e=await s.text(),!s.ok){n=new t.HttpRequestError({body:d,details:e!=null&&e.error?t.stringify(e.error):s.statusText,headers:s.headers,status:s.status,url:r});continue}if(!t.isHex(e)){n=new k({result:e,url:r});continue}return e}catch(s){n=new t.HttpRequestError({body:d,details:s.message,url:r})}}throw n}exports.ccipRequest=y;exports.offchainLookup=E;exports.offchainLookupAbiItem=h;exports.offchainLookupSignature=L;
|
|
2
|
-
//# sourceMappingURL=ccip.cjs.map
|
package/dist/ccip.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,2 +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.
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
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.PayoutTxStatus=e.PayoutTxStatus;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.getApiConfig=e.getApiConfig;exports.getBasculeDepositStatus=e.getBasculeDepositStatus;exports.getBaseNetworkByEnv=e.getBaseNetworkByEnv;exports.getBridgeInfo=e.getBridgeInfo;exports.getBscNetworkByEnv=e.getBscNetworkByEnv;exports.getBurningFee=e.getBurningFee;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.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.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.toSatoshi=e.toSatoshi;exports.unstakeLBTC=e.unstakeLBTC;
|
package/dist/index.js
CHANGED
|
@@ -1,82 +1,93 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aG as s, K as t, am as n, az as i, ay as r, E as g, x as d, t as o, P as S, ae as A, ak as B, ai as N, r as T, aH as C, S as E, f as k, h as u, j as I, ax as l, k as w, l as _, aF as c, aE as h, a3 as p, aC as D, V as L, o as y, p as R, q as V, a7 as F, W as m, ac as H, a4 as v, aI as O, u as f, al as M, L as P, aq as U, n as W, ap as b, Q as x, au as q, an as z, v as K, w as j, y as G, ao as J, N as Q, z as X, M as Y, m as Z, R as $, aD as aa, O as ea, A as sa, T as ta, C as na, ad as ia, af as ra, ag as ga, ah as da, a1 as oa, a2 as Sa, at as Aa, as as Ba, U as Na, ar as Ta, D as Ca, F as Ea, ab as ka, a5 as ua, a9 as Ia, aa as la, a8 as wa, aA as _a, aj as ca, aB as ha, av as pa, aw as Da, X as La, a6 as ya, a0 as Ra, G as Va, Y as Fa, Z as ma, _ as Ha, I as va, J as Oa, aJ as fa, $ as Ma } from "./index2.js";
|
|
2
2
|
export {
|
|
3
3
|
s as BTC_DECIMALS,
|
|
4
4
|
t as BasculeDepositStatus,
|
|
5
|
-
|
|
5
|
+
n as BlockchainIdentifier,
|
|
6
6
|
i as CHAIN_ID_TO_VIEM_CHAIN_MAP,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
r as ChainId,
|
|
8
|
+
g as ENotarizationStatus,
|
|
9
9
|
d as ESessionState,
|
|
10
10
|
o as Env,
|
|
11
|
-
S as
|
|
12
|
-
A as
|
|
11
|
+
S as PayoutTxStatus,
|
|
12
|
+
A as RewardBlockchainType,
|
|
13
|
+
B as RewardToken,
|
|
13
14
|
N as RewardWithdrawalStatus,
|
|
14
|
-
|
|
15
|
+
T as SANCTIONED_ADDRESS,
|
|
15
16
|
C as SATOSHI_SCALE,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
L as
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
H as
|
|
34
|
-
|
|
35
|
-
O as
|
|
36
|
-
f as
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
U as
|
|
40
|
-
W as
|
|
41
|
-
b as
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
G as
|
|
48
|
-
J as
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
ga as
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Na as
|
|
68
|
-
|
|
69
|
-
Ca as
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
17
|
+
E as SOLANA_DEVNET_CHAIN,
|
|
18
|
+
k as SOLANA_MAINNET_CHAIN,
|
|
19
|
+
u as SOLANA_TESTNET_CHAIN,
|
|
20
|
+
I as SUI_DEVNET_CHAIN,
|
|
21
|
+
l as SUI_LOCALNET_CHAIN,
|
|
22
|
+
w as SUI_MAINNET_CHAIN,
|
|
23
|
+
_ as SUI_TESTNET_CHAIN,
|
|
24
|
+
c as TOKEN_ADDRESSES,
|
|
25
|
+
h as Token,
|
|
26
|
+
p as Vault,
|
|
27
|
+
D as addChain,
|
|
28
|
+
L as approveLBTC,
|
|
29
|
+
y as bridge,
|
|
30
|
+
R as bridgeCCIP,
|
|
31
|
+
V as bridgeOFT,
|
|
32
|
+
F as cancelWithdraw,
|
|
33
|
+
m as claimLBTC,
|
|
34
|
+
H as claimReward,
|
|
35
|
+
v as deposit,
|
|
36
|
+
O as fromSatoshi,
|
|
37
|
+
f as generateDepositBtcAddress,
|
|
38
|
+
M as getApiConfig,
|
|
39
|
+
P as getBasculeDepositStatus,
|
|
40
|
+
U as getBaseNetworkByEnv,
|
|
41
|
+
W as getBridgeInfo,
|
|
42
|
+
b as getBscNetworkByEnv,
|
|
43
|
+
x as getBurningFee,
|
|
44
|
+
q as getChainIdByName,
|
|
45
|
+
z as getChainNameById,
|
|
46
|
+
K as getDepositBtcAddress,
|
|
47
|
+
j as getDepositBtcAddresses,
|
|
48
|
+
G as getDepositsByAddress,
|
|
49
|
+
J as getEthNetworkByEnv,
|
|
50
|
+
Q as getLBTCBurningFee,
|
|
51
|
+
X as getLBTCExchangeRate,
|
|
52
|
+
Y as getLBTCMintingFee,
|
|
53
|
+
Z as getLBTCStats,
|
|
54
|
+
$ as getLBTCTotalSupply,
|
|
55
|
+
aa as getLbtcContractAddresses,
|
|
56
|
+
ea as getMintingFee,
|
|
57
|
+
sa as getNetworkFeeSignature,
|
|
58
|
+
ta as getPermitNonce,
|
|
59
|
+
na as getPointsByAddress,
|
|
60
|
+
ia as getRewardBalances,
|
|
61
|
+
ra as getRewardSigningData,
|
|
62
|
+
ga as getRewardWithdrawalFee,
|
|
63
|
+
da as getRewardWithdrawals,
|
|
64
|
+
oa as getShareValue,
|
|
65
|
+
Sa as getSharesByAddress,
|
|
66
|
+
Aa as getSolanaNetworkByEnv,
|
|
67
|
+
Ba as getSonicNetworkByEnv,
|
|
68
|
+
Na as getStakeAndBakeFee,
|
|
69
|
+
Ta as getSuiNetworkByEnv,
|
|
70
|
+
Ca as getUnstakesByAddress,
|
|
71
|
+
Ea as getUserStakeAndBakeSignature,
|
|
72
|
+
ka as getVaultApy,
|
|
73
|
+
ua as getVaultDeposits,
|
|
74
|
+
Ia as getVaultPoints,
|
|
75
|
+
la as getVaultTVL,
|
|
76
|
+
wa as getVaultWithdrawals,
|
|
77
|
+
_a as isKatanaChain,
|
|
78
|
+
ca as isRewardTokenSupported,
|
|
79
|
+
ha as isValidChain,
|
|
80
|
+
pa as katana,
|
|
81
|
+
Da as katanaTatara,
|
|
82
|
+
La as mintToken,
|
|
83
|
+
ya as queueWithdraw,
|
|
84
|
+
Ra as redeemToken,
|
|
85
|
+
Va as setReferral,
|
|
86
|
+
Fa as signLbtcDestinationAddr,
|
|
87
|
+
ma as signNetworkFee,
|
|
88
|
+
Ha as signStakeAndBake,
|
|
89
|
+
va as storeNetworkFeeSignature,
|
|
90
|
+
Oa as storeStakeAndBakeSignature,
|
|
91
|
+
fa as toSatoshi,
|
|
92
|
+
Ma as unstakeLBTC
|
|
81
93
|
};
|
|
82
|
-
//# sourceMappingURL=index.js.map
|