@lombard.finance/sdk 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -37
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2994 -721
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/common/const.ts +0 -4
- package/src/common/types/internalTypes.ts +2 -2
- package/src/common/types/types.ts +20 -15
- package/src/common/utils/convertSatoshi.ts +11 -7
- package/src/index.ts +2 -0
- package/src/sdk/apiConfig.ts +9 -5
- package/src/sdk/generateDepositBtcAddress/generateDepositBtcAddress.stories.tsx +1 -1
- package/src/sdk/generateDepositBtcAddress/generateDepositBtcAddress.ts +3 -3
- package/src/sdk/getDepositBtcAddress/getDepositBtcAddress.stories.tsx +1 -3
- package/src/sdk/getDepositBtcAddress/getDepositBtcAddress.ts +4 -4
- package/src/sdk/getDepositsByAddress/getDepositsByAddress.stories.tsx +1 -1
- package/src/sdk/getDepositsByAddress/getDepositsByAddress.ts +4 -3
- package/src/sdk/getLBTCExchangeRate/getLBTCExchangeRate.stories.tsx +3 -3
- package/src/sdk/getNetworkFeeSignature/getNetworkFeeSignature.stories.tsx +1 -1
- package/src/sdk/getPointsByAddress/getPointsByAddress.stories.tsx +49 -0
- package/src/sdk/getPointsByAddress/getPointsByAddress.ts +163 -0
- package/src/sdk/getPointsByAddress/index.ts +6 -0
- package/src/sdk/getUnstakesByAddress/getUnstakesByAddress.stories.tsx +49 -0
- package/src/sdk/getUnstakesByAddress/getUnstakesByAddress.ts +133 -0
- package/src/sdk/getUnstakesByAddress/index.ts +1 -0
- package/src/sdk/getUserStakeAndBakeSignature/getUserStakeAndBakeSignature.stories.tsx +1 -1
- package/src/sdk/index.ts +3 -1
- package/src/sdk/internalTypes.ts +3 -0
- package/src/sdk/setReferral/setReferral.ts +6 -5
- package/src/sdk/storeNetworkFeeSignature/storeNetworkFeeSignature.stories.tsx +1 -1
- package/src/sdk/storeStakeAndBakeSignature/storeStakeAndBakeSignature.stories.tsx +1 -1
- package/src/sdk/utils/getChainIdByName.ts +12 -6
- package/src/sdk/utils/getChainNameById.ts +25 -15
- package/src/web3Sdk/approveLBTC/approveLBTC.stories.tsx +1 -1
- package/src/web3Sdk/approveLBTC/approveLBTC.ts +1 -1
- package/src/web3Sdk/basculeAddressConfig.ts +7 -8
- package/src/web3Sdk/claimLBTC/claimLBTC.stories.tsx +1 -1
- package/src/web3Sdk/getBasculeDepositStatus/getBasculeDepositStatus.stories.tsx +5 -2
- package/src/web3Sdk/getLBTCTotalSupply/getLBTCTotalSupply.stories.tsx +1 -2
- package/src/web3Sdk/lbtcAddressConfig.ts +10 -9
- package/src/web3Sdk/signLbtcDestionationAddr/index.ts +1 -1
- package/src/web3Sdk/signLbtcDestionationAddr/{signLbtcDestionationAddr.ts → signLbtcDestinationAddr.ts} +4 -4
- package/src/web3Sdk/signLbtcDestionationAddr/signLbtcDestionationAddr.stories.tsx +3 -3
- package/src/web3Sdk/signNetworkFee/signNetworkFee.stories.tsx +1 -1
- package/src/web3Sdk/signStakeAndBake/utils.ts +4 -2
- package/src/web3Sdk/unstakeLBTC/unstakeLBTC.stories.tsx +1 -1
- package/src/web3Sdk/unstakeLBTC/unstakeLBTC.ts +2 -2
- package/src/web3Sdk/utils/chainIdToEnv.ts +4 -3
- package/src/web3Sdk/utils/getLbtcTokenContract.ts +5 -2
- package/src/btcSdk/utils/getOutputScript.ts +0 -67
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ Parameters:
|
|
|
69
69
|
|-----------|----------|--------------------------------------------------------------|
|
|
70
70
|
| `address` | `string` | The destination EVM user address where LBTC will be claimed. |
|
|
71
71
|
| `chainId` | `TChainId` | The destination chain ID where LBTC will be claimed. |
|
|
72
|
-
| `env` | `
|
|
72
|
+
| `env` | `Env` | Environment (optional, default: 'prod') |
|
|
73
73
|
| `partnerId` | `string` | Partner ID (optional) |
|
|
74
74
|
|
|
75
75
|
Usage
|
|
@@ -108,7 +108,7 @@ Parameters:
|
|
|
108
108
|
| `chainId` | `TChainId` | The destination chain ID where LBTC will be claimed. |
|
|
109
109
|
| `signature` | `string` | The signature of the address. The signature is generated by signing the address using EVM wallet. |
|
|
110
110
|
| `referrerCode` | `string` | The referrer code. |
|
|
111
|
-
| `env` | `
|
|
111
|
+
| `env` | `Env` | Environment (optional, default: 'prod') |
|
|
112
112
|
| `captchaToken` | `string` | The captcha token (optional) |
|
|
113
113
|
| `partnerId` | `string` | The partner ID (optional) |
|
|
114
114
|
|
|
@@ -133,10 +133,10 @@ Returns all deposits for a given address.
|
|
|
133
133
|
|
|
134
134
|
Parameters:
|
|
135
135
|
|
|
136
|
-
| name | type
|
|
137
|
-
| --------- |
|
|
136
|
+
| name | type | description |
|
|
137
|
+
| --------- | ------- | --------------------------------------- |
|
|
138
138
|
| `address` | `string` | The EVM address to get deposits for |
|
|
139
|
-
| `env` | `
|
|
139
|
+
| `env` | `Env` | Environment (optional, default: 'prod') |
|
|
140
140
|
|
|
141
141
|
Usage
|
|
142
142
|
|
|
@@ -156,11 +156,11 @@ Returns the exchange rate for LBTC.
|
|
|
156
156
|
|
|
157
157
|
Parameters:
|
|
158
158
|
|
|
159
|
-
| name | type
|
|
160
|
-
| --------- |
|
|
159
|
+
| name | type | description |
|
|
160
|
+
| --------- | --------- | ------------------------------------------------------ |
|
|
161
161
|
| `chainId` | `TChainId` | The chain id of the asset to get the exchange rate for |
|
|
162
|
-
| `amount` | `number`
|
|
163
|
-
| `env` | `
|
|
162
|
+
| `amount` | `number` | The amount of the asset to get the exchange rate for |
|
|
163
|
+
| `env` | `Env` | Environment (optional, default: 'prod') |
|
|
164
164
|
|
|
165
165
|
Usage
|
|
166
166
|
|
|
@@ -191,11 +191,12 @@ Parameters:
|
|
|
191
191
|
Usage
|
|
192
192
|
|
|
193
193
|
```typescript
|
|
194
|
-
import {
|
|
194
|
+
import { signLbtcDestinationAddr } from '@lombard.finance/sdk';
|
|
195
|
+
|
|
195
196
|
...
|
|
196
197
|
// do connect to the wallet using web3.js or ethers.js or any other library
|
|
197
198
|
// and get the provider, account and chainId
|
|
198
|
-
const destinationAddr = await
|
|
199
|
+
const destinationAddr = await signLbtcDestinationAddr({
|
|
199
200
|
provider: window.ethereum,
|
|
200
201
|
account: '0x...',
|
|
201
202
|
chainId: 1,
|
|
@@ -210,14 +211,14 @@ Claims LBTC.
|
|
|
210
211
|
|
|
211
212
|
Parameters:
|
|
212
213
|
|
|
213
|
-
| name | type
|
|
214
|
-
| ---------------- |
|
|
215
|
-
| `data` | `string`
|
|
216
|
-
| `proofSignature` | `string`
|
|
214
|
+
| name | type | description |
|
|
215
|
+
| ---------------- | ----------------- | -------------------------------------------------------------------------------------- |
|
|
216
|
+
| `data` | `string` | Raw payload from deposit notarization. Can be obtained from the `getDepositsByAddress` |
|
|
217
|
+
| `proofSignature` | `string` | Signature from deposit notarization. Can be obtained from the `getDepositsByAddress` |
|
|
217
218
|
| `provider` | `IEIP1193Provider` | The EIP-1193 provider instance |
|
|
218
|
-
| `account` | `string`
|
|
219
|
-
| `chainId` | `TChainId`
|
|
220
|
-
| `env` | `
|
|
219
|
+
| `account` | `string` | Current account address |
|
|
220
|
+
| `chainId` | `TChainId` | Current chain ID |
|
|
221
|
+
| `env` | `Env` | Environment (optional, default: 'prod') |
|
|
221
222
|
|
|
222
223
|
Usage
|
|
223
224
|
|
|
@@ -245,14 +246,14 @@ Unstakes LBTC to the specified BTC address.
|
|
|
245
246
|
|
|
246
247
|
Parameters:
|
|
247
248
|
|
|
248
|
-
| name | type
|
|
249
|
-
| ------------ |
|
|
250
|
-
| `btcAddress` | `string`
|
|
251
|
-
| `amount` | `string`
|
|
249
|
+
| name | type | description |
|
|
250
|
+
| ------------ | ----------------- | ------------------------------------------- |
|
|
251
|
+
| `btcAddress` | `string` | The BTC address to send the unstaked BTC to |
|
|
252
|
+
| `amount` | `string` | The amount of LBTC to unstake |
|
|
252
253
|
| `provider` | `IEIP1193Provider` | The EIP-1193 provider instance |
|
|
253
|
-
| `account` | `string`
|
|
254
|
-
| `chainId` | `TChainId`
|
|
255
|
-
| `env` | `
|
|
254
|
+
| `account` | `string` | Current account address |
|
|
255
|
+
| `chainId` | `TChainId` | Current chain ID |
|
|
256
|
+
| `env` | `Env` | Environment (optional, default: 'prod') |
|
|
256
257
|
|
|
257
258
|
Usage
|
|
258
259
|
|
|
@@ -280,13 +281,13 @@ Check Deposit Status by hash id through Bascule
|
|
|
280
281
|
|
|
281
282
|
Parameters:
|
|
282
283
|
|
|
283
|
-
| name | type
|
|
284
|
-
| ---------- |
|
|
285
|
-
| `txId` | `string`
|
|
284
|
+
| name | type | description |
|
|
285
|
+
| ---------- | ----------------- | ---------------------------------------------------------------------------------- |
|
|
286
|
+
| `txId` | `string` | Payload from deposit notarization. Can be obtained from the `getDepositsByAddress` |
|
|
286
287
|
| `provider` | `IEIP1193Provider` | The EIP-1193 provider instance |
|
|
287
|
-
| `account` | `string`
|
|
288
|
-
| `chainId` | `TChainId`
|
|
289
|
-
| `env` | `
|
|
288
|
+
| `account` | `string` | Current account address |
|
|
289
|
+
| `chainId` | `TChainId` | Current chain ID |
|
|
290
|
+
| `env` | `Env` | Environment (optional, default: 'prod') |
|
|
290
291
|
|
|
291
292
|
Usage
|
|
292
293
|
|
|
@@ -311,11 +312,11 @@ Get LBTC total supply
|
|
|
311
312
|
|
|
312
313
|
Parameters:
|
|
313
314
|
|
|
314
|
-
| name | type
|
|
315
|
-
| --------- |
|
|
316
|
-
| `rpcUrl` | `string`
|
|
315
|
+
| name | type | description |
|
|
316
|
+
| --------- | --------- | --------------------------------------- |
|
|
317
|
+
| `rpcUrl` | `string` | Rpc url for the chain |
|
|
317
318
|
| `chainId` | `TChainId` | Current chain ID |
|
|
318
|
-
| `env` | `
|
|
319
|
+
| `env` | `Env` | Environment (optional, default: 'prod') |
|
|
319
320
|
|
|
320
321
|
Usage
|
|
321
322
|
|
|
@@ -396,8 +397,8 @@ Get user's stake and bake signature from the API
|
|
|
396
397
|
|
|
397
398
|
## Parameters
|
|
398
399
|
|
|
399
|
-
| name | type
|
|
400
|
-
| ------------------------ |
|
|
400
|
+
| name | type | description |
|
|
401
|
+
| ------------------------ | ------- | --------------------------------------- |
|
|
401
402
|
| `userDestinationAddress` | `string` | The user's destination address |
|
|
402
403
|
| `chainId` | `string` | The chain ID |
|
|
403
404
|
| `env` | `TEnv` | Environment (e.g., 'prod', 'stage', etc.) |
|