[Import Transaction] signatures#2094
Open
jeesunikim wants to merge 3 commits into
Open
Conversation
|
Preview is available here: |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an imported-transaction signature viewer and adjusts the Import flow footer so users can skip directly to submission when an imported classic transaction already contains signatures.
Changes:
- Add a new
Signaturescomponent to display decorated signatures and best-effort offline signer matching/verification. - Introduce
getRequiredSignershelper to derive per-envelope “possible signers” (outer/inner for fee-bumps). - Extend
TransactionFlowFooterwith anextOverrideto customize the primary action on specific steps (used by Import).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/globals.scss | Adds info-message styling used by the new signatures UI. |
| src/helpers/checkRequiredSignatures.ts | New helper deriving per-envelope required/possible signer accounts and hashes. |
| src/components/TransactionFlowFooter/index.tsx | Adds nextOverride support to replace the default Next button. |
| src/app/(sidebar)/transaction/styles.scss | Adds .Signatures table styling for transaction flows. |
| src/app/(sidebar)/transaction/import/page.tsx | Uses nextOverride to default classic imports with signatures to “Submit transaction”. |
| src/app/(sidebar)/transaction/import/components/ImportStepContent.tsx | Renders the new Signatures component when signatures are present. |
| src/app/(sidebar)/transaction/components/Signatures.tsx | New signatures table + offline verification/status UI for imported transactions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+100
to
+102
| parsedTxType === "classic" && | ||
| Boolean(importState?.hasSignatures) && | ||
| Boolean(importState?.importXdr); |
| isClassicReadyToSubmit | ||
| ? { | ||
| label: "Submit transaction", | ||
| onClick: handleSkipToSubmit, |
Comment on lines
+134
to
135
| const hasSignatures = Boolean(parsedTx?.signatures.length); | ||
|
|
Comment on lines
+22
to
+25
| * Optional overrides let a flow customize the primary Next button (label | ||
| * + handler) and surface a secondary action — used by the Import flow to | ||
| * default to "Submit transaction" when the imported tx is already valid, | ||
| * while still offering "Sign transaction" alongside. |
Comment on lines
+31
to
+56
| export const getRequiredSigners = ( | ||
| tx: Transaction | FeeBumpTransaction, | ||
| ): EnvelopeRequirement[] => { | ||
| if (tx instanceof FeeBumpTransaction) { | ||
| const inner = tx.innerTransaction; | ||
| return [ | ||
| { | ||
| envelope: "outer", | ||
| signers: [getPublicKey(tx.feeSource)], | ||
| hash: tx.hash(), | ||
| }, | ||
| { | ||
| envelope: "inner", | ||
| signers: collectTxSigners(inner), | ||
| hash: inner.hash(), | ||
| }, | ||
| ]; | ||
| } | ||
| return [ | ||
| { | ||
| envelope: "outer", | ||
| signers: collectTxSigners(tx), | ||
| hash: tx.hash(), | ||
| }, | ||
| ]; | ||
| }; |
Comment on lines
+58
to
+129
| // ============================================================================= | ||
| // Signatures | ||
| // ============================================================================= | ||
| .Signatures { | ||
| color: var(--sds-clr-gray-11); | ||
|
|
||
| &__cell { | ||
| &[data-is-header="true"] { | ||
| text-align: left; | ||
| font-size: pxToRem(12px); | ||
| line-height: pxToRem(18px); | ||
| color: var(--sds-clr-gray-11); | ||
| } | ||
|
|
||
| &[data-is-signature="true"] { | ||
| white-space: normal; | ||
| word-break: break-all; | ||
| overflow-wrap: break-word; | ||
| font-family: var(--sds-ff-monospace), monospace; | ||
| } | ||
| } | ||
|
|
||
| &__gridTableContainer { | ||
| width: 100%; | ||
| overflow-y: auto; | ||
|
|
||
| border: 1px solid var(--sds-clr-gray-06); | ||
| border-radius: pxToRem(8px); | ||
| background-color: var(--sds-clr-base-00); | ||
|
|
||
| table { | ||
| tr { | ||
| display: grid; | ||
| grid-template-columns: | ||
| minmax(pxToRem(160px), 1fr) | ||
| minmax(pxToRem(160px), 1fr) | ||
| minmax(pxToRem(160px), 1fr); | ||
|
|
||
| &[data-is-highlighted="true"] { | ||
| background-color: var(--sds-clr-gray-03); | ||
| } | ||
| } | ||
|
|
||
| td, | ||
| th { | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding: pxToRem(8px) pxToRem(12px); | ||
| justify-content: center; | ||
|
|
||
| &:not(:last-child) { | ||
| border-right: 1px solid var(--sds-clr-gray-06); | ||
| } | ||
|
|
||
| .Badge { | ||
| --Badge-padding-vertical: 0; | ||
| --Badge-padding-horizontal: #{pxToRem(6px)}; | ||
|
|
||
| font-family: var(--sds-ff-monospace), monospace; | ||
| letter-spacing: pxToRem(-0.24px); | ||
| } | ||
| } | ||
|
|
||
| tbody { | ||
| tr { | ||
| border-top: 1px solid var(--sds-clr-gray-06); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
|
Preview is available here: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Few scenarios:
simulatingdiscard the existing signatures