Discussions

Ask a Question
ANSWERED
ANSWERED
ANSWERED
ANSWERED
ANSWERED
ANSWERED

Commission on trade transactions in a Token Swap Dapp With 0x API

In tutorial: <https://docs.alchemy.com/docs/how-to-build-a-token-swap-dapp-with-0x-api> I have not found how to add a commission on each transaction. It is possible to do this with using the 0x swap API endpoint?

Get NFT transactions

Hi, is it possible to get the transactions for an individual NFT rather than a contract using getAssetTransfers. It does not seem to return a value for tokenId or erc721TokenId. This function seems to only return all transactions for a collection (contract).

alchemy.ws.on does not receive more transactions after a couple of hours

Hi there, I've been using Alchemy to listen to events on a specific contract but after a couple of hours it dies and I don't see a way to at least be some kind of error or warning so I can reconnect. The code I'm using is the following: alchemy.ws.on( { method: AlchemySubscription.PENDING_TRANSACTIONS, // "alchemy_pendingTransactions", toAddress: contractAddress }, (res) => { }); Is there any way to do this? For instance, something like when we connect to the mempool through a node: const customWsProvider = new ethers.providers.WebSocketProvider(nodeUrl); customWsProvider._websocket.on("close", async (code) => { }); Thanks. Best regards, Hugo

problem with alchemy.ws.on(topicSets, (log, e) => console.log(log, e))

Hi guys, I'm trying to listening to a contract event, but, when the event occurs, the e parameter result as undefined and I don't know how to get the parameters of the emitted event. Do you know how to handle it? Thanks :)