usePayWithDynamic
hook provides a unified payment flow that lets users fund transactions using any supported Dynamic method—whether through an external wallet, exchange account, or onramp provider.It accepts a PayWithDynamicProps object (destination address, token symbol, amount, network, and chain name), then renders a contextual UI prompting the user to choose their preferred payment source. After the user selects a method, the hook orchestrates the transaction through their desired funding method.
Note that each funding method must be enabled and configured for it to appear as a funding option.
See each individual funding method for more details:
Inputs:
Parameter | Type | Description |
---|---|---|
destinationAddress | string | Where the transfer should go to |
tokenAmount | number | The amount of the given token to be transfered |
tokenSymbol | string | The token to be transfered |
network | string or number | The network ID to be used on the transaction |
chainName | ChainEnum | The chain to be used for the transaction |