Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: transaction screen #549

Merged
merged 32 commits into from
Sep 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8076ae4
feat: include receipts without group
arthurgeron Sep 18, 2024
d308fa4
chore: type import
arthurgeron Sep 18, 2024
9aa2428
fix: include receipt type
arthurgeron Sep 18, 2024
3e83023
feat: move receipt grouping logic to factory
arthurgeron Sep 18, 2024
1978cc4
feat: create rootless operation type
arthurgeron Sep 18, 2024
17babb9
chore: add type constraints to receipts factory
arthurgeron Sep 18, 2024
eaa081d
feat: add badge to receipts
arthurgeron Sep 18, 2024
9f5f076
fix: hide receipt address on invalid data or mobile
arthurgeron Sep 18, 2024
bd2bb32
feat: adapt receipts to new design
arthurgeron Sep 18, 2024
e9f3823
feat: adapt input coint to new design
arthurgeron Sep 18, 2024
b0da4d9
feat: adapt input contract to new design
arthurgeron Sep 18, 2024
9ab490a
fix: type optios for Amount component
arthurgeron Sep 18, 2024
028c1cc
feat: adapt input message to new design
arthurgeron Sep 18, 2024
246acd3
chore: avoid rendering undefined
arthurgeron Sep 18, 2024
2bdc58b
fix: render variable output
arthurgeron Sep 18, 2024
4d3d1d6
feat: make amount values follow the same pattern on operations
arthurgeron Sep 18, 2024
5370637
feat: replace label Contract with utxoid
arthurgeron Sep 18, 2024
c75715c
chore: update gql codegen
arthurgeron Sep 18, 2024
d511d9a
feat: add badge amount and txicon to outputs
arthurgeron Sep 18, 2024
3260184
refactor: organize txoutput components into their own files
arthurgeron Sep 18, 2024
84bdb88
feat: show destination addrs first on no symbol
arthurgeron Sep 18, 2024
811b414
chore: change order and fields displayed for some operations
arthurgeron Sep 18, 2024
a42f44a
feat: show asset from addrs before asset on coin input
arthurgeron Sep 18, 2024
2de2f08
feat: prefix asset with Asset:
arthurgeron Sep 18, 2024
195caac
feat: use correct txIcon on output
arthurgeron Sep 19, 2024
7022bf4
feat: contract output card
arthurgeron Sep 19, 2024
15b12c6
fix: change fields shown in burn receipt
arthurgeron Sep 19, 2024
1e6a20b
feat: type grouped receipts factory
arthurgeron Sep 19, 2024
c31a617
fix: type errors
arthurgeron Sep 19, 2024
a028ea0
fix: order of cards with assets
arthurgeron Sep 19, 2024
e38c7f5
feat: add prefix to asset name
arthurgeron Sep 19, 2024
fb90831
fix: use rem based font size for more predictable results
arthurgeron Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: create rootless operation type
arthurgeron committed Sep 19, 2024
commit 1978cc4ea52bb61382b62eb46c59ed5fcdb80746
12 changes: 6 additions & 6 deletions packages/graphql/src/domain/Transaction/TransactionEntity.ts
Original file line number Diff line number Diff line change
@@ -55,12 +55,12 @@ export class TransactionEntity extends Entity<
// Should show for other status like FailureStatus?
// @ts-ignore
if (item.status?.receipts) {
// @ts-ignore
const receipts = item.status?.receipts || [];
operations = parser.parse(receipts) as any;
operations = operations.map((operation: any) =>
OperationEntity.create(operation, item._id || '', item.id),
);
operations = parser
// @ts-ignore
.parse(item.status?.receipts ?? [])
.map((operation: any) =>
OperationEntity.create(operation, item._id || '', item.id),
);
}
const props = {
id,
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { GQLOperationType } from '~/graphql/generated/sdk-provider';

const GroupTypeMap = {
CALL: 'FROM_CONTRACT',
RETURN: 'FINAL_RESULT',
SCRIPT_RESULT: 'FINAL_RESULT',
};

export function GroupedReceiptsFactory(group: any) {
const type =
GroupTypeMap[group.type] ?? group?.item?.receiptType ?? 'UNKNOWN';
const type = GroupTypeMap[group.type] ?? GQLOperationType.Rootless;
const top = {
type,
receipts: [] as any,
2,447 changes: 2,310 additions & 137 deletions packages/graphql/src/graphql/generated/sdk-provider.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/graphql/src/graphql/generated/sdk.ts
Original file line number Diff line number Diff line change
@@ -837,6 +837,7 @@ export enum GQLOperationType {
FinalResult = 'FINAL_RESULT',
FromAccount = 'FROM_ACCOUNT',
FromContract = 'FROM_CONTRACT',
Rootless = 'ROOTLESS',
}

export type GQLOperationsFilterInput = {
1 change: 1 addition & 0 deletions packages/graphql/src/graphql/schemas/explorer.graphql
Original file line number Diff line number Diff line change
@@ -114,6 +114,7 @@ enum OperationType {
FROM_CONTRACT
FROM_ACCOUNT
FINAL_RESULT
ROOTLESS
}

type OperationReceipt {