Skip to content

Commit

Permalink
Multi address in contract creation info
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Dec 19, 2024
1 parent 2185f27 commit 35741fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/script/show-contract-creation-infos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function main() {
default: "all",
describe: "only import data for this chain",
},
contractAddress: { type: "string", demand: true, alias: "a", describe: "only import data for this contract address" },
contractAddress: { type: "string", array: true, demand: true, alias: "a", describe: "only import data for this contract address" },
disableWorkConcurrency: {
type: "boolean",
demand: false,
Expand All @@ -46,6 +46,10 @@ async function main() {
};

const pipeline$ = Rx.of(options).pipe(
Rx.mergeMap((item) => {
return Rx.of(...item.contractAddress.map((contractAddress) => ({ chain: item.chain, contractAddress })));
}),

fetchContractCreationInfos$({
ctx,
getCallParams: (item) => {
Expand All @@ -56,6 +60,10 @@ async function main() {
},
formatOutput: (contractAddress, contractCreationInfos) => ({ contractAddress, contractCreationInfos }),
}),

Rx.tap((item) => {
console.dir(item, { depth: 10 });
}),
);
const res = await consumeObservable(pipeline$);
console.dir(res, { depth: 10 });
Expand Down

0 comments on commit 35741fc

Please sign in to comment.