danogo-clmm 0.0.7 → 0.0.15
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 +30 -16
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -44,19 +44,19 @@ async function main() {
|
|
|
44
44
|
poolOutRef: {
|
|
45
45
|
txHash:
|
|
46
46
|
"your_tx_hash",
|
|
47
|
-
outputIndex: 0, // your
|
|
47
|
+
outputIndex: 0, // your index
|
|
48
48
|
},
|
|
49
49
|
stakingOutRef: {
|
|
50
50
|
txHash:
|
|
51
51
|
"your_tx_hash",
|
|
52
|
-
outputIndex: 1, // your
|
|
52
|
+
outputIndex: 1, // your index
|
|
53
53
|
},
|
|
54
54
|
protocolConfigOutRef: {
|
|
55
55
|
txHash:
|
|
56
56
|
"your_tx_hash",
|
|
57
57
|
outputIndex: 0, // your index
|
|
58
58
|
},
|
|
59
|
-
deltaAmount: -3000000n,
|
|
59
|
+
deltaAmount: -3000000n, // Positive: User sells X -> Buy Y, Negative: User sells Y -> Buy X
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
try {
|
|
@@ -122,21 +122,35 @@ async function main() {
|
|
|
122
122
|
}
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
params: {
|
|
131
|
-
transaction: { cbor: tx },
|
|
132
|
-
// additionalUtxo: toOgmiosUTxOs(additionalUTxOs) // comment here
|
|
133
|
-
},
|
|
134
|
-
id: null
|
|
135
|
-
};
|
|
136
|
-
```
|
|
125
|
+
## ⚠️ Provider Compatibility
|
|
126
|
+
|
|
127
|
+
`lucid-evolution` currently raises an error during transaction evaluation.
|
|
128
|
+
|
|
129
|
+
This package **only supports the Kupmios provider**.
|
|
137
130
|
|
|
131
|
+
### Required Patch
|
|
132
|
+
|
|
133
|
+
Modify the following files:
|
|
134
|
+
|
|
135
|
+
- `node_modules/@lucid-evolution/provider/dist/index.js`
|
|
136
|
+
- `node_modules/@lucid-evolution/provider/dist/index.cjs`
|
|
137
|
+
|
|
138
|
+
In the `evaluateTx` method, comment out the `additionalUtxo` line:
|
|
139
|
+
|
|
140
|
+
```javascript
|
|
141
|
+
const data = {
|
|
142
|
+
jsonrpc: "2.0",
|
|
143
|
+
method: "evaluateTransaction",
|
|
144
|
+
params: {
|
|
145
|
+
transaction: { cbor: tx },
|
|
146
|
+
// Comment out the line below:
|
|
147
|
+
// additionalUtxo: toOgmiosUTxOs(additionalUTxOs)
|
|
148
|
+
},
|
|
149
|
+
id: null
|
|
150
|
+
};
|
|
151
|
+
```
|
|
138
152
|
|
|
139
|
-
|
|
153
|
+
### 3. Get Pool Info from Ogmios Transaction
|
|
140
154
|
|
|
141
155
|
Extract pool data directly from an Ogmios transaction object.
|
|
142
156
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "danogo-clmm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "An SDK to calculate and execute swaps on the Danogo liquidity platform.",
|
|
5
5
|
"main": "./dist/sdk.js",
|
|
6
6
|
"module": "./dist/sdk.mjs",
|
|
7
7
|
"types": "./dist/sdk.d.ts",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"cardano",
|
|
14
|
+
"danogo",
|
|
15
|
+
"swap",
|
|
16
|
+
"clmm"
|
|
10
17
|
],
|
|
11
18
|
"scripts": {
|
|
12
19
|
"start": "tsc && node dist/main.js",
|