We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8bd9f34 commit e74ca40Copy full SHA for e74ca40
1 file changed
src/index.ts
@@ -241,12 +241,13 @@ export async function parseSwap({
241
(acc, curr) => ({
242
symbol: curr.symbol,
243
amount: formatUnits(
244
- BigInt(acc.amount) + parseUnits(curr.amount, curr.decimals),
+ acc.amountRaw + curr.amountRaw,
245
curr.decimals
246
),
247
+ amountRaw: acc.amountRaw + curr.amountRaw,
248
address: curr.address,
249
}),
- { symbol: "", amount: "", address: "" }
250
+ { symbol: "", amount: "", amountRaw: 0n, address: "" }
251
);
252
253
return {
@@ -255,7 +256,11 @@ export async function parseSwap({
255
256
address: NATIVE_TOKEN_ADDRESS,
257
amount: nativeSellAmount,
258
},
- tokenOut,
259
+ tokenOut: {
260
+ symbol: tokenOut.symbol,
261
+ amount: tokenOut.amount,
262
+ address: tokenOut.address,
263
+ },
264
};
265
}
266
0 commit comments