feat: add transaction data property useMoneyAccount#8858
Conversation
| accountOverride?: Hex; | ||
|
|
||
| /** Whether to use the Money Account (Money Keyring) as the payment source. */ | ||
| useMoneyAccount?: boolean; |
There was a problem hiding this comment.
Can we match the other existing configs so isMoneyAccountSource as we'll also likely need isMoneyAccountTarget in future too?
And should we add the callback at the same time so getMoneyAccountWithdrawData to the constructor?
There was a problem hiding this comment.
May be I change is to isUsingMoneyAccount , We can find source / target depending on postQuote.
I plan to work on separate PR to implement rest of changes, with this PR my intent is to unblock UI work.
On client side we need to know isUsingMoneyAccount value to set pay token and changes on review page also.
There was a problem hiding this comment.
Another option could be we add a more generic field called additionTransactionsType: 'MONEY_ACCOUNT' this can be indicator to get additional transaction data.
There was a problem hiding this comment.
I created this other draft PR, but it needs more testing before it can be merged: #8870
There was a problem hiding this comment.
Great point! We'd need similar properties for Perps > Predict and vice versa.
So maybe an optional paymentOverride enum with PaymentOverride.Perps, PaymentOverride.Predict and PaymentOverride.MoneyAccount.
And then we could have a single generic callback such as getPaymentOverrideData(paymentOverride, amount)?
There was a problem hiding this comment.
That sounds good, let me update the PR.
| accountOverride?: Hex; | ||
|
|
||
| /** Whether to use the Money Account (Money Keyring) as the payment source. */ | ||
| useMoneyAccount?: boolean; |
There was a problem hiding this comment.
Great point! We'd need similar properties for Perps > Predict and vice versa.
So maybe an optional paymentOverride enum with PaymentOverride.Perps, PaymentOverride.Predict and PaymentOverride.MoneyAccount.
And then we could have a single generic callback such as getPaymentOverrideData(paymentOverride, amount)?
Explanation
Add transactionData property useMoneyAccount, it will enable to know if source / target of transaction is money account.
References
Related to https://consensyssoftware.atlassian.net/browse/CONF-1409
Checklist
Note
Low Risk
Low risk additive change that threads a new optional config/state field through
setTransactionConfigand public exports; main risk is downstream consumers needing to handle the new enum value when present.Overview
Adds a new optional
paymentOverridefield (typed asPaymentOverride) toTransactionConfigand per-transactionTransactionData, allowing callers to override the payment source viaTransactionPayController.setTransactionConfig.Introduces the
PaymentOverrideenum (moneyAccount,perps,predict), exports it from the package public API, and updates tests and changelog to cover the new state update behavior.Reviewed by Cursor Bugbot for commit 924e329. Bugbot is set up for automated code reviews on this repo. Configure here.