@runesx/api-client 0.5.3 → 0.5.4
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/package.json +1 -1
- package/src/api.mjs +2 -1
package/package.json
CHANGED
package/src/api.mjs
CHANGED
|
@@ -181,7 +181,8 @@ export function createApi(config) {
|
|
|
181
181
|
async function postSwap({ amountIn, path, minAmountOut, idempotencyKey }) {
|
|
182
182
|
try {
|
|
183
183
|
const key = idempotencyKey || randomUUID();
|
|
184
|
-
const
|
|
184
|
+
const cleanPath = path.map(({ from, to }) => ({ from, to }));
|
|
185
|
+
const response = await api.post('/swap', { amountIn, path: cleanPath, minAmountOut }, {
|
|
185
186
|
headers: { 'X-Idempotency-Key': key },
|
|
186
187
|
});
|
|
187
188
|
return response.data;
|