Skip to content

Commit 0151e06

Browse files
chore: load hinkal lib asyncronously
1 parent bae9bfd commit 0151e06

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/payment-processor/src/payment/erc-20-private-payment-hinkal.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from './utils';
2020
import { IPreparedPrivateTransaction } from './prepared-transaction';
2121

22-
import { emporiumOp, IHinkal, RelayerTransaction } from '@hinkal/common';
22+
import type { IHinkal, RelayerTransaction } from '@hinkal/common';
2323
import { prepareEthersHinkal } from '@hinkal/common/providers/prepareEthersHinkal';
2424

2525
/**
@@ -150,6 +150,8 @@ export function prepareErc20ProxyPaymentFromHinkalShieldedAddress(
150150

151151
const { paymentReference, paymentAddress } = getRequestPaymentValues(request);
152152
const amountToPay = getAmountToPay(request, amount);
153+
const { emporiumOp } = await import('@hinkal/common');
154+
153155

154156
const ops = [
155157
emporiumOp(tokenContract, 'approve', [proxyContract.address, amountToPay]),
@@ -194,6 +196,7 @@ export function prepareErc20FeeProxyPaymentFromHinkalShieldedAddress(
194196
const amountToPay = getAmountToPay(request, amount);
195197
const feeToPay = String(feeAmountOverride || feeAmount || 0);
196198
const totalAmount = amountToPay.add(BigNumber.from(feeToPay));
199+
const { emporiumOp } = await import('@hinkal/common');
197200

198201
const ops = [
199202
emporiumOp(tokenContract, 'approve', [proxyContract.address, totalAmount]),

0 commit comments

Comments
 (0)