Skip to content

feat: add transaction data property useMoneyAccount#8858

Merged
jpuri merged 8 commits into
mainfrom
money_account_support
May 21, 2026
Merged

feat: add transaction data property useMoneyAccount#8858
jpuri merged 8 commits into
mainfrom
money_account_support

Conversation

@jpuri
Copy link
Copy Markdown
Contributor

@jpuri jpuri commented May 20, 2026

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

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Low risk additive change that threads a new optional config/state field through setTransactionConfig and public exports; main risk is downstream consumers needing to handle the new enum value when present.

Overview
Adds a new optional paymentOverride field (typed as PaymentOverride) to TransactionConfig and per-transaction TransactionData, allowing callers to override the payment source via TransactionPayController.setTransactionConfig.

Introduces the PaymentOverride enum (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.

@jpuri jpuri requested a review from a team as a code owner May 20, 2026 11:54
@jpuri jpuri temporarily deployed to default-branch May 20, 2026 11:54 — with GitHub Actions Inactive
@jpuri jpuri requested a review from a team as a code owner May 20, 2026 11:55
@jpuri jpuri enabled auto-merge May 20, 2026 11:57
accountOverride?: Hex;

/** Whether to use the Money Account (Money Keyring) as the payment source. */
useMoneyAccount?: boolean;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

@jpuri jpuri May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option could be we add a more generic field called additionTransactionsType: 'MONEY_ACCOUNT' this can be indicator to get additional transaction data.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created this other draft PR, but it needs more testing before it can be merged: #8870

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good, let me update the PR.

@jpuri jpuri requested a review from matthewwalsh0 May 20, 2026 15:19
accountOverride?: Hex;

/** Whether to use the Money Account (Money Keyring) as the payment source. */
useMoneyAccount?: boolean;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

@jpuri jpuri requested a review from matthewwalsh0 May 21, 2026 11:47
@jpuri jpuri added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit b7b8b54 May 21, 2026
370 checks passed
@jpuri jpuri deleted the money_account_support branch May 21, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants