Merge branch 'refs/heads/main' into OP-5247-frontend-optimization

# Conflicts:
#	package.json
This commit is contained in:
Mikhail Gladchenko
2024-04-17 09:26:42 +01:00
10 changed files with 368 additions and 97 deletions

View File

@@ -79,6 +79,6 @@ export default class Pmm {
const contract = new ethers.Contract(this.contractAddress, orionRFQContractABI, signer);
// @ts-ignore
return contract.fillOrderRFQ(order.quotation, order.signature, BigInt(0));
return contract.fillOrderRFQ(order.order, order.signature, BigInt(0));
}
}

View File

@@ -11,7 +11,7 @@ export const pmmOrderQuotationSchema = z.object({
});
export const pmmOrderSchema = z.object({
quotation: pmmOrderQuotationSchema.default({}),
order: pmmOrderQuotationSchema.default({}),
signature: z.string().default(''),
success: z.boolean().default(false),
error: z.string().default(''),

View File

@@ -41,7 +41,10 @@ export default class Unit {
public readonly contracts: Record<string, string>;
constructor(config: KnownConfig | VerboseUnitConfig) {
public logger: ((message: string) => void) | undefined;
constructor(config: KnownConfig | VerboseUnitConfig, logger?: ((message: string) => void) | undefined) {
this.logger = logger;
if ('env' in config) {
const staticConfig = envs[config.env];
if (!staticConfig) {
@@ -118,7 +121,8 @@ export default class Unit {
this.aggregator = new Aggregator(
this.config.services.aggregator.http,
this.config.services.aggregator.ws,
this.config.basicAuth
this.config.basicAuth,
logger,
);
this.priceFeed = new PriceFeed(
this.config.services.priceFeed.api,