TransactionPayController Actions
12 actions registered.
TransactionPayController:getAmountData
Package: @metamask/transaction-pay-controller
Returns additional transactions for the paymentOverride flow.
Delegates to the client-supplied GetPaymentOverrideDataCallback.
Called during quote execution when paymentOverride is defined on the transaction.
Returns an empty array when no callback is configured.
Parameters:
| Name | Description |
|---|---|
args | The arguments forwarded to the GetPaymentOverrideDataCallback. |
Returns: A promise resolving to the additional transactions array.
Handler signature:
(...args: Parameters<GetAmountDataCallback>) => ReturnType<GetAmountDataCallback>
TransactionPayController:getClientId
Package: @metamask/transaction-pay-controller
Returns the configured client identifier.
Used to set the X-Client-Id header on intents API requests so the
server can distinguish Mobile from Extension traffic. This is
intentionally not stored in controller state.
Returns: The client identifier, if configured.
Handler signature:
() => TransactionPayClientId | undefined
TransactionPayController:getDelegationTransaction
Package: @metamask/transaction-pay-controller
Gets the delegation transaction for a given transaction.
Converts the provided transaction into a redeem delegation by delegating to the configured callback. Returns the delegation transaction data including the encoded call data, target address, value, and an optional authorization list.
Parameters:
| Name | Description |
|---|---|
args | The arguments forwarded to the GetDelegationTransactionCallback, containing the transaction metadata. |
Returns: A promise resolving to the delegation transaction data.
Handler signature:
(...args: Parameters<GetDelegationTransactionCallback>) => ReturnType<GetDelegationTransactionCallback>
TransactionPayController:getFiatOptions
Package: @metamask/transaction-pay-controller
Returns optional fiat execution configuration.
This is intentionally not stored in controller state.
Returns: Fiat execution options, if configured.
Handler signature:
() => TransactionPayFiatOptions | undefined
TransactionPayController:getPaymentOverrideData
Package: @metamask/transaction-pay-controller
Handler signature:
(...args: Parameters<GetPaymentOverrideDataCallback>) => ReturnType<GetPaymentOverrideDataCallback>
TransactionPayController:getState
Package: @metamask/transaction-pay-controller
Handler signature:
() => TransactionPayControllerState
TransactionPayController:getStrategy
Package: @metamask/transaction-pay-controller
Gets the preferred strategy for a transaction.
Returns the first strategy from the ordered list of strategies applicable to the given transaction. Falls back to the default strategy order derived from feature flags when no custom strategy callback is configured.
Parameters:
| Name | Description |
|---|---|
transaction | The transaction metadata to determine the strategy for. |
Returns: The preferred TransactionPayStrategy for the transaction.
Handler signature:
(transaction: TransactionMeta) => TransactionPayStrategy
TransactionPayController:polymarketGetDepositWalletAddress
Package: @metamask/transaction-pay-controller
Derives the Polymarket deposit-wallet address for an EOA via the client-supplied callback.
Parameters:
| Name | Description |
|---|---|
args | The arguments forwarded to PolymarketCallbacks.getDepositWalletAddress. |
Returns: A promise resolving to the deposit-wallet address.
Handler signature:
(...args: Parameters<PolymarketCallbacks['getDepositWalletAddress']>) => ReturnType<PolymarketCallbacks['getDepositWalletAddress']>
TransactionPayController:polymarketSubmitDepositWalletBatch
Package: @metamask/transaction-pay-controller
Signs and broadcasts a Polymarket deposit-wallet batch via the client-supplied callback.
Parameters:
| Name | Description |
|---|---|
args | The arguments forwarded to PolymarketCallbacks.submitDepositWalletBatch. |
Returns: A promise resolving to the relayer-issued source hash.
Handler signature:
(...args: Parameters<PolymarketCallbacks['submitDepositWalletBatch']>) => ReturnType<PolymarketCallbacks['submitDepositWalletBatch']>
TransactionPayController:setTransactionConfig
Package: @metamask/transaction-pay-controller
Sets the transaction configuration.
The callback receives the current configuration properties and can mutate them in place. Updated values are written back to the transaction data.
Parameters:
| Name | Description |
|---|---|
transactionId | The ID of the transaction to configure. |
callback | A callback that receives a mutable TransactionConfig object. |
Handler signature:
(transactionId: string, callback: TransactionConfigCallback) => void
TransactionPayController:updateFiatPayment
Package: @metamask/transaction-pay-controller
Updates the fiat payment state for a transaction.
The request callback receives the current fiat payment state and can mutate it to update properties such as the selected payment method or fiat amount.
Parameters:
| Name | Description |
|---|---|
request | The fiat payment update request containing the transaction ID and a callback to mutate fiat payment state. |
Handler signature:
(request: UpdateFiatPaymentRequest) => void
TransactionPayController:updatePaymentToken
Package: @metamask/transaction-pay-controller
Updates the payment token for a transaction.
Resolves token metadata and balances, then stores the new payment token in the transaction data. This triggers recalculation of source amounts and quote retrieval.
Parameters:
| Name | Description |
|---|---|
request | The payment token update request containing the transaction ID, token address, and chain ID. |
Handler signature:
(request: UpdatePaymentTokenRequest) => void