Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
benjlevesque committed Apr 12, 2021
1 parent 124c332 commit 8070bdf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/payment-processor/src/index.ts
Expand Up @@ -6,6 +6,7 @@ export * from './payment/erc20-fee-proxy';
export * from './payment/eth-input-data';
export * from './payment/eth-proxy';
export * from './payment/swap-conversion-erc20';
export * from './payment/swap-any-to-erc20';
export * from './payment/swap-erc20';
export * from './payment/swap-erc20-fee-proxy';
export * from './payment/conversion-erc20';
Expand Down
Expand Up @@ -52,7 +52,6 @@ export async function swapToPayAnyToErc20Request(
* Encodes the call to pay a request through the ERC20 fee proxy contract, can be used with a Multisig contract.
* @param request request to pay
* @param signerOrProvider the Web3 provider, or signer. Defaults to window.ethereum
* @param settings settings for the swap and the on-chain conversion
* @param options to override amount, feeAmount and transaction parameters
*/
export function encodeSwapToPayAnyToErc20Request(
Expand Down
Expand Up @@ -25,9 +25,11 @@ export async function approveErc20ForSwapWithConversionIfNeeded(
minAmount: BigNumberish,
overrides?: ITransactionOverrides,
): Promise<ContractTransaction | void> {
if (!request.extensions[PaymentTypes.PAYMENT_NETWORK_ID.ANY_TO_ERC20_PROXY]) {
throw new Error(`The request must have the payment network any-to-erc20-proxy`);
}
const network =
request.extensions[PaymentTypes.PAYMENT_NETWORK_ID.ANY_TO_ERC20_PROXY].values.network ||
'mainnet';
request.extensions[PaymentTypes.PAYMENT_NETWORK_ID.ANY_TO_ERC20_PROXY].values.network;
if (
!(await checkErc20Allowance(
ownerAddress,
Expand Down

0 comments on commit 8070bdf

Please sign in to comment.