@lombard.finance/sdk 0.2.0 → 0.3.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 CHANGED
@@ -20,7 +20,36 @@ npm i web3@^4 axios@^1 bignumber.js@^9
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: add few examples
23
+ API based methods:
24
+
25
+ ```typescript
26
+ import { getDepositBtcAddress } from '@lombard.finance/sdk';
27
+
28
+ const depositBtcAddress = await getDepositBtcAddress({
29
+ address: '0x...', // Ethereum address
30
+ chainId: 1,
31
+ });
32
+
33
+ console.log(depositBtcAddress); // bc1q...
34
+ ```
35
+
36
+ Web3 based methods:
37
+
38
+ ```typescript
39
+ import { unstakeLBTC } from '@lombard.finance/sdk';
40
+
41
+ const { receiptPromise, transactionHash } = await unstakeLBTC({
42
+ amount: '1', // 1 LBTC
43
+ btcAddress: 'bc1q...', // The BTC address to send the unstaked BTC to
44
+ account: '0x...', // current address in the web3 wallet
45
+ chainId: 1, // current chain id in the web3 wallet
46
+ provider: window.ethereum, // EIP-1193 provider
47
+ });
48
+
49
+ console.log(transactionHash); // 0x...
50
+
51
+ const receipt = await receiptPromise; // will return the tx receipt
52
+ ```
24
53
 
25
54
  ## Development
26
55