@naviprotocol/lending 1.0.6 → 1.2.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 NAVI
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 NAVI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,66 +1,66 @@
1
- # @naviprotocol/lending
2
-
3
- [![npm version](https://badge.fury.io/js/%40naviprotocol%2Flending.svg)](https://badge.fury.io/js/%40naviprotocol%2Flending)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
-
6
- NAVI Lending SDK is a lending SDK designed specifically for the Sui blockchain, providing complete lending functionality including account management, pool operations, flash loans, liquidation, and reward systems.
7
-
8
- ## Documentation
9
-
10
- For SDK documentation visit http://sdk.naviprotocol.io/lending
11
-
12
- ## Core Concepts
13
-
14
- ### Lending Protocol Basics
15
-
16
- The NAVI lending protocol allows users to:
17
-
18
- - **Deposit**: Deposit assets into pools to earn interest
19
- - **Borrow**: Use deposits as collateral to borrow other assets
20
- - **Repay**: Repay loans and pay interest
21
- - **Withdraw**: Withdraw deposits from pools
22
-
23
- ### Health Factor
24
-
25
- Health factor is an important metric for measuring the safety of a user's lending account:
26
-
27
- - **Health Factor > 1**: Account is safe and can continue borrowing
28
- - **Health Factor ≤ 1**: Account is at risk of liquidation
29
-
30
- ### Flash Loan
31
-
32
- Flash loans allow users to borrow assets without collateral, but must be repaid within the same transaction.
33
-
34
- ## Installation
35
-
36
- ```npm
37
- npm install @naviprotocol/lending
38
- ```
39
-
40
- ## Code Style and Conventions
41
-
42
- ### Interface Optional Parameters
43
-
44
- The last `options` parameter of the interface is usually an optional object used to customize interface behavior. Common optional parameters include but are not limited to:
45
-
46
- - `client`: Sui network client instance (such as `SuiClient`), used for customizing network requests, suitable for scenarios that require custom RPC nodes or multi-network environments.
47
- - `env`: Specify environment (such as `'prod'`、`'dev'`), affecting data sources and on-chain contract addresses, ensuring data isolation and compatibility in different deployment environments.
48
- - `cacheTime`: Custom cache time in milliseconds. By setting cache time, you can reduce duplicate requests and improve performance. For example, `cacheTime: 60000` means cache for 60 seconds.
49
- - `disableCache`: Whether to disable cache
50
- - `accountCap`: In ptb-related operations, use account cap
51
-
52
- **Usage Recommendations:**
53
-
54
- - If you don't pass `options`, the SDK will automatically use default configuration, suitable for most regular scenarios.
55
- - When you need to customize network, environment, or cache strategy, it's recommended to pass corresponding parameters for more flexible control.
56
-
57
-
58
- ### Interface Naming
59
-
60
- - Interfaces with PTB suffix indicate that the current interface is used for constructing transactions.
61
-
62
-
63
- ## Support
64
-
65
- - Issues: [GitHub Issues](https://github.com/naviprotocol/naviprotocol-monorepo/issues)
66
-
1
+ # @naviprotocol/lending
2
+
3
+ [![npm version](https://badge.fury.io/js/%40naviprotocol%2Flending.svg)](https://badge.fury.io/js/%40naviprotocol%2Flending)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ NAVI Lending SDK is a lending SDK designed specifically for the Sui blockchain, providing complete lending functionality including account management, pool operations, flash loans, liquidation, and reward systems.
7
+
8
+ ## Documentation
9
+
10
+ For SDK documentation visit http://sdk.naviprotocol.io/lending
11
+
12
+ ## Core Concepts
13
+
14
+ ### Lending Protocol Basics
15
+
16
+ The NAVI lending protocol allows users to:
17
+
18
+ - **Deposit**: Deposit assets into pools to earn interest
19
+ - **Borrow**: Use deposits as collateral to borrow other assets
20
+ - **Repay**: Repay loans and pay interest
21
+ - **Withdraw**: Withdraw deposits from pools
22
+
23
+ ### Health Factor
24
+
25
+ Health factor is an important metric for measuring the safety of a user's lending account:
26
+
27
+ - **Health Factor > 1**: Account is safe and can continue borrowing
28
+ - **Health Factor ≤ 1**: Account is at risk of liquidation
29
+
30
+ ### Flash Loan
31
+
32
+ Flash loans allow users to borrow assets without collateral, but must be repaid within the same transaction.
33
+
34
+ ## Installation
35
+
36
+ ```npm
37
+ npm install @naviprotocol/lending
38
+ ```
39
+
40
+ ## Code Style and Conventions
41
+
42
+ ### Interface Optional Parameters
43
+
44
+ The last `options` parameter of the interface is usually an optional object used to customize interface behavior. Common optional parameters include but are not limited to:
45
+
46
+ - `client`: Sui network client instance (such as `SuiClient`), used for customizing network requests, suitable for scenarios that require custom RPC nodes or multi-network environments.
47
+ - `env`: Specify environment (such as `'prod'`、`'dev'`), affecting data sources and on-chain contract addresses, ensuring data isolation and compatibility in different deployment environments.
48
+ - `cacheTime`: Custom cache time in milliseconds. By setting cache time, you can reduce duplicate requests and improve performance. For example, `cacheTime: 60000` means cache for 60 seconds.
49
+ - `disableCache`: Whether to disable cache
50
+ - `accountCap`: In ptb-related operations, use account cap
51
+
52
+ **Usage Recommendations:**
53
+
54
+ - If you don't pass `options`, the SDK will automatically use default configuration, suitable for most regular scenarios.
55
+ - When you need to customize network, environment, or cache strategy, it's recommended to pass corresponding parameters for more flexible control.
56
+
57
+
58
+ ### Interface Naming
59
+
60
+ - Interfaces with PTB suffix indicate that the current interface is used for constructing transactions.
61
+
62
+
63
+ ## Support
64
+
65
+ - Issues: [GitHub Issues](https://github.com/naviprotocol/naviprotocol-monorepo/issues)
66
+