TransactionButtonProps
Props for the TransactionButton
component.
type TransactionButtonProps = { children: React.ReactNode; className?: string; disabled?: boolean; gasless?: GaslessOptions; onClick?: () => void; onError?: (error: Error) => void; onTransactionConfirmed?: (receipt: TransactionReceipt) => void; onTransactionSent?: ( ) => void; style?: React.CSSProperties; transaction: () => type?: HTMLButtonElement["type"]; unstyled?: boolean;};
The React.ReactNode
to be rendered inside the button
type children = React.ReactNode;
The className to apply to the button element for custom styling
type className = string;
The button's disabled state
type disabled = boolean;
Configuration for gasless transactions.
Refer to GaslessOptions
for more details.
type gasless = GaslessOptions;
function onTransactionConfirmed(receipt: TransactionReceipt): void;
function onTransactionSent(): void;
Configuration for the "Pay Modal" that opens when the user doesn't have enough funds to send a transaction.
Set payModal: false
to disable the "Pay Modal" popup
This configuration object includes the following properties to configure the "Pay Modal" UI:
locale
The language to use for the "Pay Modal" UI. Defaults to "en_US"
.
supportedTokens
An object of type SupportedTokens
to configure the tokens to show for a chain.
theme
The theme to use for the "Pay Modal" UI. Defaults to "dark"
.
It can be set to "light"
or "dark"
or an object of type Theme
for a custom theme.
Refer to lightTheme
or darkTheme
helper functions to use the default light or dark theme and customize it.
The style to apply to the button element for custom styling
type style = React.CSSProperties;
The theme to use for the button
function transaction():
let returnType:
Remove all default styling from the button
type unstyled = boolean;