@lombard.finance/sdk 0.1.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 +32 -0
- package/dist/index.js +12574 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
- package/src/btcSdk/utils/getOutputScript.ts +54 -0
- package/src/common/const.ts +3 -0
- package/src/common/types/internalTypes.ts +8 -0
- package/src/common/types/types.ts +13 -0
- package/src/common/utils/convertSatoshi.ts +21 -0
- package/src/common/utils/getErrorMessage.ts +35 -0
- package/src/common/utils/isValidChain.ts +5 -0
- package/src/index.ts +5 -0
- package/src/provider/Provider.ts +174 -0
- package/src/provider/ReadProvider.ts +120 -0
- package/src/provider/index.ts +2 -0
- package/src/provider/rpcUrlConfig.ts +8 -0
- package/src/provider/types.ts +58 -0
- package/src/provider/utils/getMaxPriorityFeePerGas.ts +25 -0
- package/src/sdk/apiConfig.ts +20 -0
- package/src/sdk/generateDepositBtcAddress/generateDepositBtcAddress.stories.tsx +52 -0
- package/src/sdk/generateDepositBtcAddress/generateDepositBtcAddress.ts +64 -0
- package/src/sdk/generateDepositBtcAddress/index.ts +1 -0
- package/src/sdk/getDepositBtcAddress/getDepositBtcAddress.stories.tsx +53 -0
- package/src/sdk/getDepositBtcAddress/getDepositBtcAddress.ts +101 -0
- package/src/sdk/getDepositBtcAddress/index.ts +1 -0
- package/src/sdk/getDepositsByAddress/getDepositsByAddress.stories.tsx +49 -0
- package/src/sdk/getDepositsByAddress/getDepositsByAddress.ts +146 -0
- package/src/sdk/getDepositsByAddress/index.ts +1 -0
- package/src/sdk/index.ts +3 -0
- package/src/sdk/internalTypes.ts +5 -0
- package/src/sdk/utils/getCainIdByName.ts +21 -0
- package/src/sdk/utils/getChainNameById.ts +17 -0
- package/src/stories/components/Button/Button.tsx +43 -0
- package/src/stories/components/Button/index.ts +1 -0
- package/src/stories/components/CodeBlock/CodeBlock.tsx +24 -0
- package/src/stories/components/CodeBlock/CodeBlockStyles.css +3 -0
- package/src/stories/components/CodeBlock/index.ts +1 -0
- package/src/stories/components/Spinner/Spinner.tsx +25 -0
- package/src/stories/components/Spinner/index.ts +1 -0
- package/src/stories/const.ts +1 -0
- package/src/stories/hooks/useConnect.ts +47 -0
- package/src/stories/hooks/useQuery.ts +56 -0
- package/src/stories/utils/connectInjectedWallet.ts +12 -0
- package/src/stories/utils/fromCamelCase.ts +16 -0
- package/src/stories/utils/getMetaTitle.ts +7 -0
- package/src/stories/utils/getWalletInfo.ts +31 -0
- package/src/vite-env.d.ts +1 -0
- package/src/web3Sdk/abi/IERC20.json +222 -0
- package/src/web3Sdk/abi/LBTC.json +1400 -0
- package/src/web3Sdk/abi/index.ts +4 -0
- package/src/web3Sdk/approveLBTC/approveLBTC.stories.tsx +77 -0
- package/src/web3Sdk/approveLBTC/approveLBTC.ts +48 -0
- package/src/web3Sdk/approveLBTC/index.ts +1 -0
- package/src/web3Sdk/claimLBTC/claimLBTC.stories.tsx +77 -0
- package/src/web3Sdk/claimLBTC/claimLBTC.ts +62 -0
- package/src/web3Sdk/claimLBTC/index.ts +1 -0
- package/src/web3Sdk/index.ts +4 -0
- package/src/web3Sdk/internalTypes.ts +19 -0
- package/src/web3Sdk/lbtcAddressConfig.ts +16 -0
- package/src/web3Sdk/signLbtcDestionationAddr/index.ts +1 -0
- package/src/web3Sdk/signLbtcDestionationAddr/signLbtcDestionationAddr.stories.tsx +97 -0
- package/src/web3Sdk/signLbtcDestionationAddr/signLbtcDestionationAddr.ts +25 -0
- package/src/web3Sdk/unstakeLBTC/index.ts +1 -0
- package/src/web3Sdk/unstakeLBTC/unstakeLBTC.stories.tsx +77 -0
- package/src/web3Sdk/unstakeLBTC/unstakeLBTC.ts +51 -0
- package/src/web3Sdk/utils/getGasMultiplier.ts +19 -0
- package/src/web3Sdk/utils/getLbtcTokenContract.ts +28 -0
- package/src/web3Sdk/utils/getTokenABI.ts +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @lombard.finance/sdk
|
|
2
|
+
|
|
3
|
+
The SDK package provides a set of tools to interact with the Lombard Protocol.
|
|
4
|
+
|
|
5
|
+
It includes API-based and Web3-based methods with which to interact.
|
|
6
|
+
|
|
7
|
+
Web3 methods require a Web3 provider to be set up.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm i @lombard.finance/sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Install Dependencies
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm i web3@^4 axios@^1 bignumber.js@^9
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
TODO: add few examples
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
Available scripts:
|
|
28
|
+
|
|
29
|
+
- `npm run build` - build the package
|
|
30
|
+
- `npm run storybook` - start [storybook](https://storybook.js.org/) for development
|
|
31
|
+
- `npm run build-storybook` - build storybook
|
|
32
|
+
- `npm run build-docs` - build [Typedoc](https://typedoc.org/) documentation
|