danogo-clmm 0.0.6 → 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.
Files changed (2) hide show
  1. package/README.md +43 -19
  2. package/package.json +9 -2
package/README.md CHANGED
@@ -44,14 +44,19 @@ async function main() {
44
44
  poolOutRef: {
45
45
  txHash:
46
46
  "your_tx_hash",
47
- outputIndex: 0, // your output index
47
+ outputIndex: 0, // your index
48
48
  },
49
49
  stakingOutRef: {
50
50
  txHash:
51
51
  "your_tx_hash",
52
- outputIndex: 1, // your output index
52
+ outputIndex: 1, // your index
53
53
  },
54
- deltaAmount: -3000000n,
54
+ protocolConfigOutRef: {
55
+ txHash:
56
+ "your_tx_hash",
57
+ outputIndex: 0, // your index
58
+ },
59
+ deltaAmount: -3000000n, // Positive: User sells X -> Buy Y, Negative: User sells Y -> Buy X
55
60
  };
56
61
 
57
62
  try {
@@ -87,17 +92,22 @@ async function main() {
87
92
  poolOutRef: {
88
93
  txHash:
89
94
  "your_tx_hash",
90
- outputIndex: 0, // your pool output index
95
+ outputIndex: 0, // your index
91
96
  },
92
97
  poolScriptOutRef: {
93
98
  txHash:
94
99
  "your_tx_hash",
95
- outputIndex: 0, // your pool script output index
100
+ outputIndex: 0, // your index
101
+ },
102
+ protocolConfigOutRef: {
103
+ txHash:
104
+ "your_tx_hash",
105
+ outputIndex: 0, // your index
96
106
  },
97
107
  stakingOutRef: {
98
108
  txHash:
99
109
  "your_tx_hash",
100
- outputIndex: 1, // your staking output index
110
+ outputIndex: 1, // your index
101
111
  },
102
112
  deltaAmount: -3000000n, // Positive: User sells X -> Buy Y, Negative: User sells Y -> Buy X
103
113
  minOutChangeAmount: 10000n, // Minimum amount of token received to accept
@@ -112,21 +122,35 @@ async function main() {
112
122
  }
113
123
  ```
114
124
 
115
- Note for Kupmios Users: There is currently a known issue with lucid-evolution when using Kupmios for transaction evaluation. If you encounter errors during submission, you may need to manually patch node_modules/@lucid-evolution/provider/dist/index.js node_modules/@lucid-evolution/provider/dist/index.cjs by commenting out the additionalUtxo line in the evaluateTx method:
116
- ```javascript
117
- const data = {
118
- jsonrpc: "2.0",
119
- method: "evaluateTransaction",
120
- params: {
121
- transaction: { cbor: tx },
122
- // additionalUtxo: toOgmiosUTxOs(additionalUTxOs) // comment here
123
- },
124
- id: null
125
- };
126
- ```
125
+ ## ⚠️ Provider Compatibility
127
126
 
127
+ `lucid-evolution` currently raises an error during transaction evaluation.
128
+
129
+ This package **only supports the Kupmios provider**.
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
+ ```
128
152
 
129
- ### 3. Get Pool Info from Ogmios Transaction
153
+ ### 3. Get Pool Info from Ogmios Transaction
130
154
 
131
155
  Extract pool data directly from an Ogmios transaction object.
132
156
 
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "danogo-clmm",
3
- "version": "0.0.6",
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",