mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix provider fee approve for free assets
This commit is contained in:
parent
455a68a29c
commit
256744317f
@ -186,12 +186,16 @@ export async function handleComputeOrder(
|
||||
initializeData.providerFee &&
|
||||
initializeData.providerFee.providerFeeAmount !== '0'
|
||||
) {
|
||||
const baseToken =
|
||||
asset?.accessDetails?.type === 'free'
|
||||
? getOceanConfig(asset.chainId).oceanTokenAddress
|
||||
: asset?.accessDetails?.baseToken?.address
|
||||
const txApproveWei = await approveWei(
|
||||
web3,
|
||||
accountId,
|
||||
asset.accessDetails.baseToken.address,
|
||||
asset.accessDetails.datatoken.address,
|
||||
initializeData.providerFee.providerFeeAmount
|
||||
baseToken,
|
||||
asset?.accessDetails?.datatoken?.address,
|
||||
initializeData?.providerFee?.providerFeeAmount
|
||||
)
|
||||
if (!txApproveWei) {
|
||||
toast.error('Failed to approve provider fees!')
|
||||
|
Loading…
Reference in New Issue
Block a user