Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SDK to poll and create smart order and handle result #16

Merged
merged 23 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ node_modules/
/actions/types/

# Compiled production code
/actions/out/
/actions/out/
.yalc
yalc.lock
anxolin marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 11 additions & 7 deletions actions/addContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ import type {
} from "./types/ComposableCoW";
import { ComposableCoW__factory } from "./types/factories/ComposableCoW__factory";

import { isComposableCowCompatible, handleExecutionError, init, writeRegistry } from "./utils";
import {
isComposableCowCompatible,
handleExecutionError,
init,
writeRegistry,
toChainId,
} from "./utils";
import { ChainContext, Owner, Proof, Registry } from "./model";

/**
Expand All @@ -32,12 +38,10 @@ const _addContract: ActionFn = async (context: Context, event: Event) => {
const transactionEvent = event as TransactionEvent;
const tx = transactionEvent.hash;
const composableCow = ComposableCoW__factory.createInterface();
const { provider } = await ChainContext.create(context, transactionEvent.network);
const { registry } = await init(
"addContract",
transactionEvent.network,
context
);

const chainId = toChainId(transactionEvent.network);
const { provider } = await ChainContext.create(context, chainId);
const { registry } = await init("addContract", chainId, context);

// Process the logs
let hasErrors = false;
Expand Down
Loading