@sky-mavis/ronin-dex 0.0.1
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 +53 -0
- package/dist/index.d.mts +2091 -0
- package/dist/index.d.ts +2091 -0
- package/dist/index.js +4887 -0
- package/dist/index.mjs +4835 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# ronin-dex
|
|
2
|
+
|
|
3
|
+
Multi-chain swap integration.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install ronin-dex
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Multi-protocol support (KyberSwap, Relay, Li.fi)
|
|
14
|
+
- Cross-chain trading (EVM + Solana)
|
|
15
|
+
- Quote aggregation and optimization
|
|
16
|
+
- Transaction building and execution
|
|
17
|
+
- Event-driven architecture for trade lifecycle
|
|
18
|
+
- Type-safe contract interactions
|
|
19
|
+
- Gas estimation and fee management
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import DexFactory from 'ronin-dex';
|
|
25
|
+
import type { CoreDexDependencies } from 'ronin-dex';
|
|
26
|
+
|
|
27
|
+
// Initialize with your provider manager and account handlers
|
|
28
|
+
const dependencies: CoreDexDependencies = {
|
|
29
|
+
apiUrl: 'https://api.example.com',
|
|
30
|
+
providerManager: yourProviderManager,
|
|
31
|
+
getAccounts: async (address) => { /* ... */ },
|
|
32
|
+
getSignerForAddress: async (address) => { /* ... */ },
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const dex = new DexFactory(new CoreDex(dependencies));
|
|
36
|
+
|
|
37
|
+
// Get quotes
|
|
38
|
+
const quotes = await dex.getQuotes({
|
|
39
|
+
currencyIn,
|
|
40
|
+
currencyOut,
|
|
41
|
+
amount: '1000000000000000000',
|
|
42
|
+
direction: 'exactIn',
|
|
43
|
+
account: '0x...',
|
|
44
|
+
slippageToleranceBps: new Percent(50, 10000), // 0.5%
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Execute trade
|
|
48
|
+
const txResponse = await dex.handle(quotes[0]);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
ISC
|