OnrampOption
object in the SDK, which has the following properties:
Property | Type | Required | Default | Description |
---|---|---|---|---|
displayName | string | Yes | - | The name of the onramp provider to be displayed in UI. Example: “Coinbase” |
iconUrl | string | Yes | - | The icon URL of the onramp provider to be displayed in UI. Example: “https://www.coinbase.com/assets/coinbase-logo-2020-09-09-1024x1024.png” |
id | string | Yes | - | The id of the onramp provider, ideally based off its name. Example: “coinbase” |
url | string | No | - | The URL of the onramp provider. For iframe mode, this is displayed directly in the UI. For popup mode, this is opened in a new window when the provider is selected. Example: “https://widget.coinbase.com/iframe/onramp?apiKey=YOUR_API_KEY&walletAddress=YOUR_WALLET_ADDRESS” |
openMode | ’iframe’ | ‘popup’ | No | ’iframe’ | The display mode for the onramp provider. ‘iframe’ - The provider will be displayed in an iframe within the UI ’popup’ - The provider will be opened in a new window when selected |
onClick | function | Yes | - | The onClick handler for when the onramp provider is selected. Signature: ({ wallet }: { wallet: Wallet }) => void |
description | string | No | - | The description of the onramp provider to be displayed in UI. Example: “Buy crypto with a credit card” |
isPaymentMethod | boolean | No | false | Whether the option is for a specific payment method within the onramp provider. If true, the SDK will display the option as a payment method in the UI. |
onClick
handler is not customizable, but rather it takes the current URL defined in the url
field and opens it in a new window.onrampOptions
prop in the overrides
prop of the DynamicContextProvider
component which provides the current options and allows you to return a new array of options.
url
field updated.
displayName
field set to the payment method name as well as the URL adapted to include the payment method parameter.