@naviprotocol/wallet-client 1.4.7 → 1.4.8
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 +21 -21
- package/README.md +140 -140
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
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,140 +1,140 @@
|
|
|
1
|
-
# @naviprotocol/wallet-client
|
|
2
|
-
|
|
3
|
-
[](https://badge.fury.io/js/%40naviprotocol%2Fwallet-client)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
|
|
6
|
-
NAVI Wallet Client is a comprehensive wallet client SDK designed for the Sui blockchain. It provides a unified interface for managing transaction signing, account management, and various DeFi operations including token swapping, lending, and balance management.
|
|
7
|
-
|
|
8
|
-
## Documentation
|
|
9
|
-
|
|
10
|
-
For SDK documentation visit http://sdk.naviprotocol.io/wallet-client
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Core Features
|
|
14
|
-
|
|
15
|
-
- 🔐 **Transaction Signing**: Complete transaction signing and execution functionality
|
|
16
|
-
- 💰 **Token Swapping**: Integrated Astros aggregator for token swapping
|
|
17
|
-
- 🏦 **Lending Features**: Integrated lending protocol for deposit and borrow operations
|
|
18
|
-
- 💳 **Balance Management**: Complete wallet balance and portfolio management
|
|
19
|
-
- 🔄 **Modular Design**: Modular architecture for easy extension and maintenance
|
|
20
|
-
- 📱 **Easy Integration**: Clear API design for easy integration into various applications
|
|
21
|
-
- 🎯 **Type Safety**: Complete TypeScript type support
|
|
22
|
-
|
|
23
|
-
## Supported Modules
|
|
24
|
-
|
|
25
|
-
### [Balance Module](./wallet-client/balance)
|
|
26
|
-
Provides comprehensive wallet balance management functionality, including token tracking, portfolio management, token transfers, and automatic balance updates.
|
|
27
|
-
|
|
28
|
-
**Key Features:**
|
|
29
|
-
- Real-time balance tracking
|
|
30
|
-
- Token transfers
|
|
31
|
-
- Object transfers
|
|
32
|
-
- Automatic balance updates
|
|
33
|
-
|
|
34
|
-
### [Swap Module](./wallet-client/swap)
|
|
35
|
-
Provides DEX token swapping functionality, integrated with Astros aggregator to find optimal swap paths and execute trades across multiple decentralized exchanges.
|
|
36
|
-
|
|
37
|
-
**Key Features:**
|
|
38
|
-
- Token swapping
|
|
39
|
-
- Aggregator integration
|
|
40
|
-
- Slippage protection
|
|
41
|
-
- Multi-DEX support
|
|
42
|
-
|
|
43
|
-
### [Lending Module](./wallet-client/lending)
|
|
44
|
-
Provides comprehensive lending protocol functionality, including deposits, withdrawals, borrowing, repayments, liquidations, reward claiming, and oracle price updates.
|
|
45
|
-
|
|
46
|
-
**Key Features:**
|
|
47
|
-
- Deposits and withdrawals
|
|
48
|
-
- Borrowing and repayments
|
|
49
|
-
- Liquidation functionality
|
|
50
|
-
- Reward management
|
|
51
|
-
- Oracle updates
|
|
52
|
-
|
|
53
|
-
### [Haedal Module](./wallet-client/haedal)
|
|
54
|
-
Provides Haedal protocol staking and unstaking functionality, allowing users to stake SUI to receive haSUI and obtain APY statistics.
|
|
55
|
-
|
|
56
|
-
**Key Features:**
|
|
57
|
-
- SUI staking
|
|
58
|
-
- haSUI unstaking
|
|
59
|
-
- APY queries
|
|
60
|
-
|
|
61
|
-
### [Volo Module](./wallet-client/volo)
|
|
62
|
-
Provides Volo staking protocol functionality, allowing users to stake SUI tokens and receive vSUI (volo SUI) tokens for liquid staking.
|
|
63
|
-
|
|
64
|
-
**Key Features:**
|
|
65
|
-
- SUI staking
|
|
66
|
-
- vSUI unstaking
|
|
67
|
-
- Statistics queries
|
|
68
|
-
- APY queries
|
|
69
|
-
|
|
70
|
-
## Installation
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
npm install @naviprotocol/wallet-client
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## Quick Start
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
import { WalletClient } from '@naviprotocol/wallet-client'
|
|
80
|
-
|
|
81
|
-
// Create wallet client
|
|
82
|
-
const walletClient = new WalletClient()
|
|
83
|
-
|
|
84
|
-
// Use balance module
|
|
85
|
-
const portfolio = walletClient.balance.portfolio
|
|
86
|
-
const suiBalance = portfolio.getBalance('0x2::sui::SUI')
|
|
87
|
-
|
|
88
|
-
// Use swap module
|
|
89
|
-
const result = await walletClient.swap.swap(
|
|
90
|
-
'0x2::sui::SUI',
|
|
91
|
-
'0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN',
|
|
92
|
-
1000000000,
|
|
93
|
-
0.01
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
// Use lending module
|
|
97
|
-
const healthFactor = await walletClient.lending.getHealthFactor()
|
|
98
|
-
const pools = await walletClient.lending.getPools()
|
|
99
|
-
|
|
100
|
-
// Use Haedal module
|
|
101
|
-
const apy = await walletClient.haedal.getApy()
|
|
102
|
-
const stakeResult = await walletClient.haedal.stake(1000000000)
|
|
103
|
-
|
|
104
|
-
// Use Volo module
|
|
105
|
-
const stats = await walletClient.volo.getStats()
|
|
106
|
-
const voloStakeResult = await walletClient.volo.stake(1000000000)
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Event Listening
|
|
110
|
-
|
|
111
|
-
```ts
|
|
112
|
-
// Listen for balance updates
|
|
113
|
-
walletClient.events.on('balance:portfolio-updated', () => {
|
|
114
|
-
console.log('Portfolio updated')
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
// Listen for swap success
|
|
118
|
-
walletClient.events.on('swap:swap-success', (data) => {
|
|
119
|
-
console.log('Swap successful:', data)
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
// Listen for lending operations
|
|
123
|
-
walletClient.events.on('lending:deposit-success', (data) => {
|
|
124
|
-
console.log('Deposit successful:', data)
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
// Listen for staking operations
|
|
128
|
-
walletClient.events.on('haedal:stake-success', (data) => {
|
|
129
|
-
console.log('Haedal staking successful:', data)
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
walletClient.events.on('volo:stake-success', (data) => {
|
|
133
|
-
console.log('Volo staking successful:', data)
|
|
134
|
-
})
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## Support
|
|
138
|
-
|
|
139
|
-
- Issue reporting: [GitHub Issues](https://github.com/naviprotocol/naviprotocol-monorepo/issues)
|
|
140
|
-
|
|
1
|
+
# @naviprotocol/wallet-client
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/%40naviprotocol%2Fwallet-client)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
NAVI Wallet Client is a comprehensive wallet client SDK designed for the Sui blockchain. It provides a unified interface for managing transaction signing, account management, and various DeFi operations including token swapping, lending, and balance management.
|
|
7
|
+
|
|
8
|
+
## Documentation
|
|
9
|
+
|
|
10
|
+
For SDK documentation visit http://sdk.naviprotocol.io/wallet-client
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Core Features
|
|
14
|
+
|
|
15
|
+
- 🔐 **Transaction Signing**: Complete transaction signing and execution functionality
|
|
16
|
+
- 💰 **Token Swapping**: Integrated Astros aggregator for token swapping
|
|
17
|
+
- 🏦 **Lending Features**: Integrated lending protocol for deposit and borrow operations
|
|
18
|
+
- 💳 **Balance Management**: Complete wallet balance and portfolio management
|
|
19
|
+
- 🔄 **Modular Design**: Modular architecture for easy extension and maintenance
|
|
20
|
+
- 📱 **Easy Integration**: Clear API design for easy integration into various applications
|
|
21
|
+
- 🎯 **Type Safety**: Complete TypeScript type support
|
|
22
|
+
|
|
23
|
+
## Supported Modules
|
|
24
|
+
|
|
25
|
+
### [Balance Module](./wallet-client/balance)
|
|
26
|
+
Provides comprehensive wallet balance management functionality, including token tracking, portfolio management, token transfers, and automatic balance updates.
|
|
27
|
+
|
|
28
|
+
**Key Features:**
|
|
29
|
+
- Real-time balance tracking
|
|
30
|
+
- Token transfers
|
|
31
|
+
- Object transfers
|
|
32
|
+
- Automatic balance updates
|
|
33
|
+
|
|
34
|
+
### [Swap Module](./wallet-client/swap)
|
|
35
|
+
Provides DEX token swapping functionality, integrated with Astros aggregator to find optimal swap paths and execute trades across multiple decentralized exchanges.
|
|
36
|
+
|
|
37
|
+
**Key Features:**
|
|
38
|
+
- Token swapping
|
|
39
|
+
- Aggregator integration
|
|
40
|
+
- Slippage protection
|
|
41
|
+
- Multi-DEX support
|
|
42
|
+
|
|
43
|
+
### [Lending Module](./wallet-client/lending)
|
|
44
|
+
Provides comprehensive lending protocol functionality, including deposits, withdrawals, borrowing, repayments, liquidations, reward claiming, and oracle price updates.
|
|
45
|
+
|
|
46
|
+
**Key Features:**
|
|
47
|
+
- Deposits and withdrawals
|
|
48
|
+
- Borrowing and repayments
|
|
49
|
+
- Liquidation functionality
|
|
50
|
+
- Reward management
|
|
51
|
+
- Oracle updates
|
|
52
|
+
|
|
53
|
+
### [Haedal Module](./wallet-client/haedal)
|
|
54
|
+
Provides Haedal protocol staking and unstaking functionality, allowing users to stake SUI to receive haSUI and obtain APY statistics.
|
|
55
|
+
|
|
56
|
+
**Key Features:**
|
|
57
|
+
- SUI staking
|
|
58
|
+
- haSUI unstaking
|
|
59
|
+
- APY queries
|
|
60
|
+
|
|
61
|
+
### [Volo Module](./wallet-client/volo)
|
|
62
|
+
Provides Volo staking protocol functionality, allowing users to stake SUI tokens and receive vSUI (volo SUI) tokens for liquid staking.
|
|
63
|
+
|
|
64
|
+
**Key Features:**
|
|
65
|
+
- SUI staking
|
|
66
|
+
- vSUI unstaking
|
|
67
|
+
- Statistics queries
|
|
68
|
+
- APY queries
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install @naviprotocol/wallet-client
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Quick Start
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { WalletClient } from '@naviprotocol/wallet-client'
|
|
80
|
+
|
|
81
|
+
// Create wallet client
|
|
82
|
+
const walletClient = new WalletClient()
|
|
83
|
+
|
|
84
|
+
// Use balance module
|
|
85
|
+
const portfolio = walletClient.balance.portfolio
|
|
86
|
+
const suiBalance = portfolio.getBalance('0x2::sui::SUI')
|
|
87
|
+
|
|
88
|
+
// Use swap module
|
|
89
|
+
const result = await walletClient.swap.swap(
|
|
90
|
+
'0x2::sui::SUI',
|
|
91
|
+
'0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN',
|
|
92
|
+
1000000000,
|
|
93
|
+
0.01
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
// Use lending module
|
|
97
|
+
const healthFactor = await walletClient.lending.getHealthFactor()
|
|
98
|
+
const pools = await walletClient.lending.getPools()
|
|
99
|
+
|
|
100
|
+
// Use Haedal module
|
|
101
|
+
const apy = await walletClient.haedal.getApy()
|
|
102
|
+
const stakeResult = await walletClient.haedal.stake(1000000000)
|
|
103
|
+
|
|
104
|
+
// Use Volo module
|
|
105
|
+
const stats = await walletClient.volo.getStats()
|
|
106
|
+
const voloStakeResult = await walletClient.volo.stake(1000000000)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Event Listening
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
// Listen for balance updates
|
|
113
|
+
walletClient.events.on('balance:portfolio-updated', () => {
|
|
114
|
+
console.log('Portfolio updated')
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
// Listen for swap success
|
|
118
|
+
walletClient.events.on('swap:swap-success', (data) => {
|
|
119
|
+
console.log('Swap successful:', data)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
// Listen for lending operations
|
|
123
|
+
walletClient.events.on('lending:deposit-success', (data) => {
|
|
124
|
+
console.log('Deposit successful:', data)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
// Listen for staking operations
|
|
128
|
+
walletClient.events.on('haedal:stake-success', (data) => {
|
|
129
|
+
console.log('Haedal staking successful:', data)
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
walletClient.events.on('volo:stake-success', (data) => {
|
|
133
|
+
console.log('Volo staking successful:', data)
|
|
134
|
+
})
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Support
|
|
138
|
+
|
|
139
|
+
- Issue reporting: [GitHub Issues](https://github.com/naviprotocol/naviprotocol-monorepo/issues)
|
|
140
|
+
|