@lombard.finance/sdk 3.5.6 → 3.5.7

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 CHANGED
@@ -4,93 +4,6 @@ The Lombard's SDK package provides a set of functions that allow interacting wit
4
4
 
5
5
  Read more about Lombard's mission: https://www.lombard.finance
6
6
 
7
- # Table of Contents
8
-
9
- [Installation](#installation)
10
-
11
- 1. [Dependencies installation](#1-dependencies-installation)
12
-
13
- 2. [SDK installation](#2-sdk-installation)
14
-
15
- [Usage](#usage)
16
-
17
- 1. [Depositing BTC in order to get LBTC (aka staking)](#1-depositing-btc-in-order-to-get-lbtc-aka-staking)
18
-
19
- 1.1. [Get the current minting fee](#11-get-the-current-minting-fee)
20
-
21
- 1.2. [Sign the network fee signature](#12-sign-the-network-fee-signature)
22
-
23
- 1.3. [Store the signature to the Lombard's systems](#13-store-the-signature-to-the-lombards-systems)
24
-
25
- 1.4. [Get or generate the BTC deposit address](#14-get-or-generate-the-btc-deposit-address)
26
-
27
- 1.5. [Deposit BTC to the address](#15-deposit-btc-to-the-address)
28
-
29
- 1.6. [Check the status of your deposit](#16-check-the-status-of-your-deposit)
30
-
31
- 2. [Manually claiming LBTC](#2-manually-claiming-lbtc)
32
-
33
- 3. [Depositing BTC and automatically staking LBTC into the DeFi vault (aka stake and bake)](#3-depositing-btc-and-automatically-staking-lbtc-into-the-defi-vault-aka-stake-and-bake)
34
-
35
- 3.1. [See what's the current stake and bake fee](#31-see-whats-the-current-stake-and-bake-fee)
36
-
37
- 3.2. [Sign the stake and bake signature](#32-sign-the-stake-and-bake-signature)
38
-
39
- 3.3. [Store the signature to the Lombard's systems](#33-store-the-signature-to-the-lombards-systems)
40
-
41
- 3.4. [Get or generate the BTC deposit address](#34-get-or-generate-the-btc-deposit-address)
42
-
43
- 3.5. [Deposit BTC to the address](#35-deposit-btc-to-the-address)
44
-
45
- 3.6. [Check the status of your deposit](#36-check-the-status-of-your-deposit)
46
-
47
- 3.7. [Check the amount of shares acquired](#37-check-the-amount-of-shares-acquired)
48
-
49
- 4. [Unstaking LBTC and getting BTC back](#4-unstaking-lbtc-and-getting-btc-back)
50
-
51
- 4.1. [Unstake LBTC](#41-unstake-lbtc)
52
-
53
- 4.2. [Check the status of your unstakes](#42-check-the-status-of-your-unstakes)
54
-
55
- 5. [Depositing LBTC to the DeFi vault](#5-depositing-lbtc-to-the-defi-vault)
56
-
57
- 5.1. [Making a deposit to the DeFi vault](#51-making-a-deposit-to-the-defi-vault)
58
-
59
- 5.2. [Checking the deposit history](#52-checking-the-deposit-history)
60
-
61
- 5.3. [Checking the user's DeFi vault balance](#53-checking-the-users-defi-vault-balance)
62
-
63
- 6. [Withdrawing LBTC from the DeFi vault](#6-withdrawing-lbtc-from-the-defi-vault)
64
-
65
- 6.1. [Requesting a withdrawal from the DeFi vault](#61-requesting-a-withdrawal-from-the-defi-vault)
66
-
67
- 6.2. [Checking the withdrawal history (tracking the withdrawal request)](#62-checking-the-withdrawal-history-tracking-the-withdrawal-request)
68
-
69
- 6.3. [Cancelling the withdrawal](#63-cancelling-the-withdrawal)
70
-
71
- 7. [Getting the points earned by an address](#7-getting-the-points-earned-by-an-address)
72
-
73
- 8. [Getting the DeFi vault points earned by an address](#8-getting-the-defi-vault-points-earned-by-an-address)
74
-
75
- 9. [Claiming rewards](#9-claiming-rewards)
76
-
77
- 9.1. [Checking reward balances](#91-checking-reward-balances)
78
-
79
- 9.2. [Claiming rewards](#92-claiming-rewards)
80
-
81
- 9.3. [Checking the reward withdrawal fee](#93-checking-the-reward-withdrawal-fee)
82
-
83
- 9.4. [Getting the withdrawal history (checking withdrawal status)](#94-getting-the-withdrawal-history-checking-withdrawal-status)
84
-
85
- 10. [Metrics](#10-metrics)
86
-
87
- 10.1. [Getting the vault's TVL](#101-getting-the-vaults-tvl)
88
-
89
- 10.2. [Getting the vault's performance data](#102-getting-the-vaults-performance-data)
90
-
91
- 10.3. [Getting the LBTC statistics](#103-getting-the-lbtc-statistics)
92
-
93
-
94
7
 
95
8
  ## Installation
96
9
 
@@ -224,7 +137,7 @@ const txHash = await claimLBTC({
224
137
 
225
138
  The successful execution of the above will result with the transaction id.
226
139
 
227
- ### 3. Depositing BTC and automatically staking LBTC into the DeFi vault (aka stake and bake)
140
+ ### 3. Depositing BTC and automatically staking LBTC into the DeFi vault
228
141
 
229
142
  You can read more about the DeFi vaults here: https://docs.lombard.finance/lbtc-liquid-bitcoin/defi-vaults/lombard-defi-vault
230
143
 
@@ -533,70 +446,9 @@ const {
533
446
  })
534
447
  ```
535
448
 
536
- ### 9. Claiming rewards.
537
-
538
- #### 9.1. Checking reward balances.
539
-
540
- ```javascript
541
- const rewards = await getRewardBalances({
542
- address,
543
- rewardToken: RewardToken.BABY
544
- });
545
- ```
546
-
547
- The data returned by the above function contains:
548
-
549
- * `address` - the address of the reward earner (claimer),
550
- * `availableBalance` - the available balance of the reward token (ready to be withdrawn),
551
- * `lockedBalance` - the locked balance (in processing),
552
- * `pendingBalance` - the pending balance to be credited,
553
- * `rewardToken` - the reward token,
554
- * `timestamp` - the timestamp.
555
-
556
- #### 9.2. Claiming rewards.
557
-
558
- ```javascript
559
- const withdrawal = await claimReward({
560
- account, // The account address.
561
- rewardToken, // The reward token, e.g. RewardToken.BABY
562
- amount, // The amount to be claimed (withdrawn)
563
- to, // The destination address, e.g. BABYLON chain address.
564
- signingDataVariant: 'json', // Optional signing data variant, available values: 'json', 'plain-text'
565
- chainId, // The chain id
566
- provider, // The EIP-1193 provider.
567
- });
568
- ```
569
-
570
- The function will ask a user to sign a message that consists of the amount, destination address and also a withdrawal fee and after obtaining this signature it will request a reward withdrawal from the pool to the provided destination address.
571
-
572
- The function returns the `RewardWithdrawal` object.
573
-
574
- #### 9.3. Checking the reward withdrawal fee.
575
-
576
- ```javascript
577
- const withdrawalFee = await getRewardWithdrawalFee({ address, rewardToken });
578
- ```
579
-
580
- #### 9.4. Getting the withdrawal history (checking withdrawal status).
581
-
582
- ```javascript
583
- const withdrawals = await getRewardWithdrawals({ address })
584
- ```
585
-
586
- The function returns an array of:
449
+ ### 9. Metrics
587
450
 
588
- * `amount` - the withdrawn (claimed) amount of rewards token,
589
- * `rewardToken` - the reward token,
590
- * `fee` - the applied withdrawal fee,
591
- * `to` - the destination address,
592
- * `signature` - the signature used,
593
- * `status` - the withdrawal status,
594
- * `estimatedTimeSent` - the estimated time when the funds are sent,
595
- * `timestamp` - the timestamp.
596
-
597
- ### 10. Metrics
598
-
599
- #### 10.1. Getting the vault's TVL
451
+ #### 9.1. Getting the vault's TVL
600
452
 
601
453
  The vault's TVL can be obtained by calling the `getVaultTVL` function.
602
454
 
@@ -609,7 +461,7 @@ The above returns:
609
461
  * `btcPrice` - the current price of BTC,
610
462
  * `tvl` - the amount of USD locked into the vault.
611
463
 
612
- #### 10.2. Getting the vault's performance data.
464
+ #### 9.2. Getting the vault's performance data.
613
465
 
614
466
  The performance of the vault can be checked via the `getVaultApy` function.
615
467
  As in the example below:
@@ -630,10 +482,17 @@ Each entry contains:
630
482
  * `breakdown` - the detailed record of allocations and APY values broken down by chain and protocol,
631
483
  * `timestamp` - the timestamp of the entry.
632
484
 
633
- #### 10.3. Getting the LBTC statistics.
485
+ #### 9.3. Getting the LBTC statistics.
634
486
 
635
487
  The simple set of LBTC statistics is accessible via `getLBTCStats` function.
636
488
 
489
+ ```javascript
490
+ const stats = await getLBTCStats({
491
+ partnerId, // The partner id - passing the partnerId will ensure relevant stats are returned
492
+ env // Optional env flag
493
+ })
494
+ ```
495
+
637
496
  The stats contain:
638
497
 
639
498
  * `historicalHolders` - the number of all-time LBTC holders,
@@ -641,3 +500,47 @@ The stats contain:
641
500
  * `price` - the current BTC price,
642
501
  * `supply` - the number of LBTC minted,
643
502
  * `tvl` - the Lombard's TVL in USD.
503
+ * `apr` - staking APR
504
+
505
+
506
+ #### 9.4. Getting the LBTC exchange ratio.
507
+
508
+ LBTC is a yield-bearing token and its exchange rate to BTC is not guaranteed to be 1:1.
509
+
510
+ In order to check the current exchange rate use:
511
+
512
+ ```javascript
513
+ const ratioData = await getExchangeRatio();
514
+
515
+ // returns:
516
+ //
517
+ // ratioData = {
518
+ // [Token.LBTC]: {
519
+ // tokenBTCRatio: BigNumber(1)
520
+ // BTCTokenRatio: BigNumber(1)
521
+ // }
522
+ // }
523
+ ```
524
+
525
+ The result of the above function is an object which contains:
526
+ * `tokenBTCRatio` - The Token:BTC ratio answering the question of how many tokens will I get for 1 BTC.
527
+ * `BTCTokenRatio` - The BTC:Token ratio (1 / tokenBTCRatio) answering the question of how many BTC will I get for 1 Token.
528
+
529
+
530
+ #### 9.5. Getting the rewards info
531
+
532
+ The information about the rewards acquired by an account can be obtained via the `getRewardsInfo` function as shown below:
533
+
534
+ ```javascript
535
+ const rewardsInfo = await getRewardsInfo({
536
+ account, // The account address
537
+ partnerId, // The partner id - passing the partnerId will ensure relevant stats are returned
538
+ env // Optional env flag
539
+ });
540
+ ```
541
+ The results of the includes:
542
+
543
+ * `type` - the type of a reward,
544
+ * `totalLbtcBalance` - the total LBTC balance,
545
+ * `totalRewards` - the amount of total rewards earned,
546
+ * `totalRewardsCost` - the amount of cost associated with the earned rewards
package/dist/ccip.cjs CHANGED
@@ -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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs");class w extends e.BaseError{constructor({callbackSelector:o,cause:a,data:c,extraData:u,sender:d,urls:r}){var n;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(n=a.metaMessages)!=null&&n.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(f=>` ${e.getUrl(f)}`)],` Sender: ${d}`,` Data: ${c}`,` Callback selector: ${o}`,` Extra data: ${u}`].flat(),name:"OffchainLookupError"})}}class k extends e.BaseError{constructor({result:o,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(a)}`,`Response: ${e.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class b extends e.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",y={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:c,to:u}){const{args:d}=e.decodeErrorResult({data:c,abi:[y]}),[r,n,f,l,s]=d,{ccipRead:t}=i,h=t&&typeof(t==null?void 0:t.request)=="function"?t.request:m;try{if(!e.isAddressEqual(u,r))throw new b({sender:r,to:u});const p=n.includes(e.localBatchGatewayUrl)?await e.localBatchGatewayRequest({data:f,ccipRequest:h}):await h({data:f,sender:r,urls:n}),{data:g}=await e.call(i,{blockNumber:o,blockTag:a,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,s])]),to:u});return g}catch(p){throw new w({callbackSelector:l,cause:p,data:c,extraData:s,sender:r,urls:n})}}async function m({data:i,sender:o,urls:a}){var u;let c=new Error("An unknown error occurred.");for(let d=0;d<a.length;d++){const r=a[d],n=r.includes("{data}")?"GET":"POST",f=n==="POST"?{data:i,sender:o}:void 0,l=n==="POST"?{"Content-Type":"application/json"}:{};try{const s=await fetch(r.replace("{sender}",o.toLowerCase()).replace("{data}",i),{body:JSON.stringify(f),headers:l,method:n});let t;if((u=s.headers.get("Content-Type"))!=null&&u.startsWith("application/json")?t=(await s.json()).data:t=await s.text(),!s.ok){c=new e.HttpRequestError({body:f,details:t!=null&&t.error?e.stringify(t.error):s.statusText,headers:s.headers,status:s.status,url:r});continue}if(!e.isHex(t)){c=new k({result:t,url:r});continue}return t}catch(s){c=new e.HttpRequestError({body:f,details:s.message,url:r})}}throw c}exports.ccipRequest=m;exports.offchainLookup=E;exports.offchainLookupAbiItem=y;exports.offchainLookupSignature=L;
package/dist/ccip.js CHANGED
@@ -1,19 +1,19 @@
1
- import { B as l, g as m, s as y, d as k, i as b, c as L, a as O, e as E, H as h, b as x } from "./index2.js";
2
- class M extends l {
3
- constructor({ callbackSelector: r, cause: a, data: o, extraData: i, sender: d, urls: t }) {
4
- var n;
1
+ import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index2.js";
2
+ class S extends p {
3
+ constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
4
+ var o;
5
5
  super(a.shortMessage || "An error occurred while fetching for an offchain result.", {
6
6
  cause: a,
7
7
  metaMessages: [
8
8
  ...a.metaMessages || [],
9
- (n = a.metaMessages) != null && n.length ? "" : [],
9
+ (o = a.metaMessages) != null && o.length ? "" : [],
10
10
  "Offchain Gateway Call:",
11
11
  t && [
12
12
  " Gateway URL(s):",
13
- ...t.map((f) => ` ${m(f)}`)
13
+ ...t.map((d) => ` ${m(d)}`)
14
14
  ],
15
- ` Sender: ${d}`,
16
- ` Data: ${o}`,
15
+ ` Sender: ${f}`,
16
+ ` Data: ${n}`,
17
17
  ` Callback selector: ${r}`,
18
18
  ` Extra data: ${i}`
19
19
  ].flat(),
@@ -21,18 +21,18 @@ class M extends l {
21
21
  });
22
22
  }
23
23
  }
24
- class R extends l {
24
+ class $ extends p {
25
25
  constructor({ result: r, url: a }) {
26
26
  super("Offchain gateway response is malformed. Response data must be a hex value.", {
27
27
  metaMessages: [
28
28
  `Gateway URL: ${m(a)}`,
29
- `Response: ${y(r)}`
29
+ `Response: ${w(r)}`
30
30
  ],
31
31
  name: "OffchainLookupResponseMalformedError"
32
32
  });
33
33
  }
34
34
  }
35
- class S extends l {
35
+ class q extends p {
36
36
  constructor({ sender: r, to: a }) {
37
37
  super("Reverted sender address does not match target contract address (`to`).", {
38
38
  metaMessages: [
@@ -43,7 +43,7 @@ class S extends l {
43
43
  });
44
44
  }
45
45
  }
46
- const C = "0x556f1830", $ = {
46
+ const A = "0x556f1830", T = {
47
47
  name: "OffchainLookup",
48
48
  type: "error",
49
49
  inputs: [
@@ -69,59 +69,62 @@ const C = "0x556f1830", $ = {
69
69
  }
70
70
  ]
71
71
  };
72
- async function A(c, { blockNumber: r, blockTag: a, data: o, to: i }) {
73
- const { args: d } = k({
74
- data: o,
75
- abi: [$]
76
- }), [t, n, f, u, s] = d, { ccipRead: e } = c, w = e && typeof (e == null ? void 0 : e.request) == "function" ? e.request : T;
72
+ async function D(c, { blockNumber: r, blockTag: a, data: n, to: i }) {
73
+ const { args: f } = k({
74
+ data: n,
75
+ abi: [T]
76
+ }), [t, o, d, l, s] = f, { ccipRead: e } = c, h = e && typeof (e == null ? void 0 : e.request) == "function" ? e.request : C;
77
77
  try {
78
78
  if (!b(i, t))
79
- throw new S({ sender: t, to: i });
80
- const p = await w({ data: f, sender: t, urls: n }), { data: g } = await L(c, {
79
+ throw new q({ sender: t, to: i });
80
+ const u = o.includes(L) ? await O({
81
+ data: d,
82
+ ccipRequest: h
83
+ }) : await h({ data: d, sender: t, urls: o }), { data: g } = await E(c, {
81
84
  blockNumber: r,
82
85
  blockTag: a,
83
- data: O([
84
- u,
85
- E([{ type: "bytes" }, { type: "bytes" }], [p, s])
86
+ data: x([
87
+ l,
88
+ R([{ type: "bytes" }, { type: "bytes" }], [u, s])
86
89
  ]),
87
90
  to: i
88
91
  });
89
92
  return g;
90
- } catch (p) {
91
- throw new M({
92
- callbackSelector: u,
93
- cause: p,
94
- data: o,
93
+ } catch (u) {
94
+ throw new S({
95
+ callbackSelector: l,
96
+ cause: u,
97
+ data: n,
95
98
  extraData: s,
96
99
  sender: t,
97
- urls: n
100
+ urls: o
98
101
  });
99
102
  }
100
103
  }
101
- async function T({ data: c, sender: r, urls: a }) {
104
+ async function C({ data: c, sender: r, urls: a }) {
102
105
  var i;
103
- let o = new Error("An unknown error occurred.");
104
- for (let d = 0; d < a.length; d++) {
105
- const t = a[d], n = t.includes("{data}") ? "GET" : "POST", f = n === "POST" ? { data: c, sender: r } : void 0, u = n === "POST" ? { "Content-Type": "application/json" } : {};
106
+ let n = new Error("An unknown error occurred.");
107
+ for (let f = 0; f < a.length; f++) {
108
+ const t = a[f], o = t.includes("{data}") ? "GET" : "POST", d = o === "POST" ? { data: c, sender: r } : void 0, l = o === "POST" ? { "Content-Type": "application/json" } : {};
106
109
  try {
107
110
  const s = await fetch(t.replace("{sender}", r.toLowerCase()).replace("{data}", c), {
108
- body: JSON.stringify(f),
109
- headers: u,
110
- method: n
111
+ body: JSON.stringify(d),
112
+ headers: l,
113
+ method: o
111
114
  });
112
115
  let e;
113
116
  if ((i = s.headers.get("Content-Type")) != null && i.startsWith("application/json") ? e = (await s.json()).data : e = await s.text(), !s.ok) {
114
- o = new h({
115
- body: f,
116
- details: e != null && e.error ? y(e.error) : s.statusText,
117
+ n = new y({
118
+ body: d,
119
+ details: e != null && e.error ? w(e.error) : s.statusText,
117
120
  headers: s.headers,
118
121
  status: s.status,
119
122
  url: t
120
123
  });
121
124
  continue;
122
125
  }
123
- if (!x(e)) {
124
- o = new R({
126
+ if (!M(e)) {
127
+ n = new $({
125
128
  result: e,
126
129
  url: t
127
130
  });
@@ -129,18 +132,18 @@ async function T({ data: c, sender: r, urls: a }) {
129
132
  }
130
133
  return e;
131
134
  } catch (s) {
132
- o = new h({
133
- body: f,
135
+ n = new y({
136
+ body: d,
134
137
  details: s.message,
135
138
  url: t
136
139
  });
137
140
  }
138
141
  }
139
- throw o;
142
+ throw n;
140
143
  }
141
144
  export {
142
- T as ccipRequest,
143
- A as offchainLookup,
144
- $ as offchainLookupAbiItem,
145
- C as offchainLookupSignature
145
+ C as ccipRequest,
146
+ D as offchainLookup,
147
+ T as offchainLookupAbiItem,
148
+ A as offchainLookupSignature
146
149
  };
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.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;
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.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.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.getRewardsInfo=e.getRewardsInfo;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,4 +1,4 @@
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";
1
+ import { aK as s, N as t, ap as n, aC as i, aB as r, E as g, A as d, t as o, P as S, aI as A, ah as N, an as B, al as T, w as C, aL as E, S as k, h as I, j as u, k as w, aA as _, m as l, n as c, aJ as h, aH as p, a6 as D, aF as L, Y as y, r as R, u as V, v as F, aa as O, Z as m, af as H, a7 as v, aM as M, x as f, ao as P, O as U, at as W, q as b, as as x, U as K, ax as q, aq as z, y as j, z as G, C as J, ar as Q, R as X, D as Y, Q as Z, o as $, V as aa, aG as ea, T as sa, F as ta, W as na, G as ia, ag as ra, ai as ga, aj as da, ak as oa, p as Sa, a4 as Aa, a5 as Na, aw as Ba, av as Ta, X as Ca, au as Ea, I as ka, J as Ia, ae as ua, a8 as wa, ac as _a, ad as la, ab as ca, aD as ha, am as pa, aE as Da, ay as La, az as ya, _ as Ra, a9 as Va, a3 as Fa, K as Oa, $ as ma, a0 as Ha, a1 as va, L as Ma, M as fa, aN as Pa, a2 as Ua } from "./index2.js";
2
2
  export {
3
3
  s as BTC_DECIMALS,
4
4
  t as BasculeDepositStatus,
@@ -9,85 +9,87 @@ export {
9
9
  d as ESessionState,
10
10
  o as Env,
11
11
  S as PayoutTxStatus,
12
- A as RewardBlockchainType,
12
+ A as RATIO_TOKEN_MAP,
13
+ N as RewardBlockchainType,
13
14
  B as RewardToken,
14
- N as RewardWithdrawalStatus,
15
- T as SANCTIONED_ADDRESS,
16
- C as SATOSHI_SCALE,
17
- E as SOLANA_DEVNET_CHAIN,
18
- k as SOLANA_MAINNET_CHAIN,
15
+ T as RewardWithdrawalStatus,
16
+ C as SANCTIONED_ADDRESS,
17
+ E as SATOSHI_SCALE,
18
+ k as SOLANA_DEVNET_CHAIN,
19
+ I as SOLANA_MAINNET_CHAIN,
19
20
  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,
21
+ w as SUI_DEVNET_CHAIN,
22
+ _ as SUI_LOCALNET_CHAIN,
23
+ l as SUI_MAINNET_CHAIN,
24
+ c as SUI_TESTNET_CHAIN,
25
+ h as TOKEN_ADDRESSES,
26
+ p as Token,
27
+ D as Vault,
28
+ L as addChain,
29
+ y as approveLBTC,
30
+ R as bridge,
31
+ V as bridgeCCIP,
32
+ F as bridgeOFT,
33
+ O as cancelWithdraw,
33
34
  m as claimLBTC,
34
35
  H as claimReward,
35
36
  v as deposit,
36
- O as fromSatoshi,
37
+ M as fromSatoshi,
37
38
  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,
39
+ P as getApiConfig,
40
+ U as getBasculeDepositStatus,
41
+ W as getBaseNetworkByEnv,
42
+ b as getBridgeInfo,
43
+ x as getBscNetworkByEnv,
44
+ K as getBurningFee,
44
45
  q as getChainIdByName,
45
46
  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,
47
+ j as getDepositBtcAddress,
48
+ G as getDepositBtcAddresses,
49
+ J as getDepositsByAddress,
50
+ Q as getEthNetworkByEnv,
51
+ X as getLBTCBurningFee,
52
+ Y as getLBTCExchangeRate,
53
+ Z as getLBTCMintingFee,
54
+ $ as getLBTCStats,
55
+ aa as getLBTCTotalSupply,
56
+ ea as getLbtcContractAddresses,
57
+ sa as getMintingFee,
58
+ ta as getNetworkFeeSignature,
59
+ na as getPermitNonce,
60
+ ia as getPointsByAddress,
61
+ ra as getRewardBalances,
62
+ ga as getRewardSigningData,
63
+ da as getRewardWithdrawalFee,
64
+ oa as getRewardWithdrawals,
65
+ Sa as getRewardsInfo,
66
+ Aa as getShareValue,
67
+ Na as getSharesByAddress,
68
+ Ba as getSolanaNetworkByEnv,
69
+ Ta as getSonicNetworkByEnv,
70
+ Ca as getStakeAndBakeFee,
71
+ Ea as getSuiNetworkByEnv,
72
+ ka as getUnstakesByAddress,
73
+ Ia as getUserStakeAndBakeSignature,
74
+ ua as getVaultApy,
75
+ wa as getVaultDeposits,
76
+ _a as getVaultPoints,
75
77
  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
78
+ ca as getVaultWithdrawals,
79
+ ha as isKatanaChain,
80
+ pa as isRewardTokenSupported,
81
+ Da as isValidChain,
82
+ La as katana,
83
+ ya as katanaTatara,
84
+ Ra as mintToken,
85
+ Va as queueWithdraw,
86
+ Fa as redeemToken,
87
+ Oa as setReferral,
88
+ ma as signLbtcDestinationAddr,
89
+ Ha as signNetworkFee,
90
+ va as signStakeAndBake,
91
+ Ma as storeNetworkFeeSignature,
92
+ fa as storeStakeAndBakeSignature,
93
+ Pa as toSatoshi,
94
+ Ua as unstakeLBTC
93
95
  };