Skip to content

Commit

Permalink
exposing escrow deployment info
Browse files Browse the repository at this point in the history
  • Loading branch information
KolevDarko committed May 17, 2022
1 parent 9c51703 commit ba2b3fb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/payment-detection/src/erc20/escrow-info-retriever.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { BigNumber, ethers } from 'ethers';
import { IEventRetriever } from '../types';

import { getDefaultProvider } from '../provider';
import { parseLogArgs } from '../utils';
import { makeGetDeploymentInformation, parseLogArgs } from '../utils';

const ESCROW_CONTRACT_ADDRESS_MAP = {
['0.1.0']: '0.1.0',
['0.2.0']: '0.1.0',
};

/** Escrow contract event arguments. */
type EscrowArgs = {
Expand All @@ -28,8 +33,7 @@ export class EscrowERC20InfoRetriever
IEventRetriever<
PaymentTypes.IPaymentNetworkBaseEvent<PaymentTypes.ESCROW_EVENTS_NAMES>,
PaymentTypes.ESCROW_EVENTS_NAMES
>
{
> {
public contractEscrow: ethers.Contract;
public provider: ethers.providers.Provider;

Expand Down Expand Up @@ -183,4 +187,9 @@ export class EscrowERC20InfoRetriever
public async getEscrowRequestMapping(): Promise<PaymentTypes.EscrowChainData> {
return this.contractEscrow.requestMapping(`0x${this.paymentReference}`);
}

public static getEscrowDeploymentInformation = makeGetDeploymentInformation(
erc20EscrowToPayArtifact,
ESCROW_CONTRACT_ADDRESS_MAP,
);
}

0 comments on commit ba2b3fb

Please sign in to comment.