Generalize parameter
This commit is contained in:
parent
ad29cbdc5d
commit
32ea63a3d0
|
@ -1,12 +1,12 @@
|
||||||
import { ethers } from "ethers";
|
import { ethers } from "ethers";
|
||||||
import { TransactionData, InternalOperation } from "./types";
|
import { InternalOperation } from "./types";
|
||||||
|
|
||||||
export const getInternalOperations = async (
|
export const getInternalOperations = async (
|
||||||
provider: ethers.providers.JsonRpcProvider,
|
provider: ethers.providers.JsonRpcProvider,
|
||||||
txData: TransactionData
|
txHash: string
|
||||||
) => {
|
) => {
|
||||||
const rawTransfers = await provider.send("ots_getInternalOperations", [
|
const rawTransfers = await provider.send("ots_getInternalOperations", [
|
||||||
txData.transactionHash,
|
txHash,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const _transfers: InternalOperation[] = [];
|
const _transfers: InternalOperation[] = [];
|
||||||
|
|
|
@ -190,7 +190,10 @@ export const useInternalOperations = (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const _transfers = await getInternalOperations(provider, txData);
|
const _transfers = await getInternalOperations(
|
||||||
|
provider,
|
||||||
|
txData.transactionHash
|
||||||
|
);
|
||||||
for (const t of _transfers) {
|
for (const t of _transfers) {
|
||||||
t.from = provider.formatter.address(t.from);
|
t.from = provider.formatter.address(t.from);
|
||||||
t.to = provider.formatter.address(t.to);
|
t.to = provider.formatter.address(t.to);
|
||||||
|
|
Loading…
Reference in New Issue