@sun-protocol/sun-sdk-sunswap-v2 0.1.0-beta.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.cjs +1194 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +356 -0
- package/dist/index.d.ts +356 -0
- package/dist/index.js +1108 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @sun-protocol/sun-sdk-sunswap-v2
|
|
2
|
+
|
|
3
|
+
SunSwap V2 entities, routing math, contract reads, and transaction action builders.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sun-protocol/sun-sdk-sunswap-v2
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { buildV2SwapExactEthForTokensAction } from '@sun-protocol/sun-sdk-sunswap-v2'
|
|
15
|
+
|
|
16
|
+
const action = buildV2SwapExactEthForTokensAction({
|
|
17
|
+
network: 'mainnet',
|
|
18
|
+
amountIn: '1000000',
|
|
19
|
+
amountOutMin: '1',
|
|
20
|
+
path: [wtrx, token],
|
|
21
|
+
recipient,
|
|
22
|
+
deadline,
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Primary exports include token, pair, route, and trade entities; reserve and router reads; quote helpers; and swap and liquidity action builders.
|
|
27
|
+
|
|
28
|
+
This package provides protocol primitives only. It does not read a global wallet, select a cross-protocol route, sign, or broadcast. Use `sun.swap.v2` or `sun.liquidity.v2` from `@sun-protocol/sun-sdk-protocols` for orchestrated workflows.
|
|
29
|
+
|
|
30
|
+
Requires Node.js 20 or a compatible JavaScript runtime.
|
|
31
|
+
|
|
32
|
+
[Full API documentation](https://github.com/sun-protocol/sun-sdk/blob/main/docs/sdk/api/sunswap-v2.md)
|