Skip to content

Commit

Permalink
fix: Buying NFT orders with transak
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Jan 29, 2025
1 parent 611111a commit 2473a82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webapp/src/modules/transak/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,15 @@ function* handleOpenTransak(action: OpenTransakAction) {
const MarketplaveV3Interface = new ethers.utils.Interface(abi)
calldata = MarketplaveV3Interface.encodeFunctionData('accept', [[getOnChainTrade(trade, transakMulticallContract)]])
} else if (order && isNFT(asset)) {
console.log('IS NFT', isNFT(asset), asset)
contractId = MarketplaceV2ContractIds[asset.network]?.[asset.chainId]
if (!contractId) {
throw new Error(`Marketplace contract not found for network ${asset.network} and chainId ${asset.chainId}`)
}
const contractName = getContractName(order.marketplaceAddress)
const contract = getContract(contractName, order.chainId)
const MarketplaceV2Interface = new ethers.utils.Interface(contract.abi)
calldata = MarketplaceV2Interface.encodeFunctionData('executeOrder', [[asset.contractAddress, asset.tokenId, order.price]])
calldata = MarketplaceV2Interface.encodeFunctionData('executeOrder', [asset.contractAddress, asset.tokenId, order.price])
} else if (!isNFT(asset)) {
contractId = asset.chainId === ChainId.MATIC_AMOY ? '670e8b512bbeb54123b3a2b4' : '6717e6e62fb1688e111c1a87' // CollectionStore contractId
const contract = getContract(ContractName.CollectionStore, asset.chainId)
Expand Down

0 comments on commit 2473a82

Please sign in to comment.