Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function parseSwap({
transactionHash: Address;
smartContractWallet?: Address;
}) {
const chainId = await publicClient.getChainId();
const chainId = publicClient.chain.id;

if (!isChainIdSupported(chainId)) {
throw new Error(`chainId ${chainId} is unsupported…`);
Expand All @@ -47,9 +47,11 @@ export async function parseSwap({
},
}));

const trace = await client.traceCall({ hash });

const transaction = await publicClient.getTransaction({ hash });
const [trace, transaction, transactionReceipt] = await Promise.all([
client.traceCall({ hash }),
publicClient.getTransaction({ hash }),
publicClient.getTransactionReceipt({ hash }),
]);

const { from: taker, value, to } = transaction;

Expand Down