forked from Prompt-Hash-Stellar/prompt-hash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransactionSuccessCard.tsx
More file actions
81 lines (75 loc) · 2.3 KB
/
Copy pathTransactionSuccessCard.tsx
File metadata and controls
81 lines (75 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { Box } from "../../components/layout/Box";
import { TxResponse } from "./TxResponse";
import { ValidationResponseCard } from "./ValidationResponseCard";
import { SubmitRpcResponse } from "../types/types";
import { XdrJsonViewer } from "./XdrJsonViewer";
import { Alert } from "@stellar/design-system";
interface TransactionSuccessCardProps {
response: SubmitRpcResponse;
}
export const TransactionSuccessCard = ({
response,
}: TransactionSuccessCardProps) => {
return (
<ValidationResponseCard
variant="success"
title="Transaction submitted!"
summary={
<Alert
variant="success"
placement="inline"
title="Successful Execution"
>
{" "}
{`Transaction succeeded with ${response.operationCount} operation(s)`}
</Alert>
}
note={<></>}
detailedResponse={
<Box gap="lg">
<TxResponse
data-testid="submit-tx-rpc-success-hash"
label="Hash:"
value={response.hash}
/>
<TxResponse
data-testid="submit-tx-rpc-success-ledger"
label="Ledger number:"
value={response.result.ledger.toString()}
/>
<TxResponse
data-testid="submit-tx-rpc-success-envelope-xdr"
label="Transaction Envelope:"
item={
<XdrJsonViewer
xdr={response.result.envelopeXdr.toXDR("base64").toString()}
typeVariant="TransactionEnvelope"
/>
}
/>
<TxResponse
data-testid="submit-tx-rpc-success-result-xdr"
label="Transaction Result:"
item={
<XdrJsonViewer
xdr={response.result.resultXdr.toXDR("base64").toString()}
typeVariant="TransactionResult"
/>
}
/>
<TxResponse
data-testid="submit-tx-rpc-success-result-meta-xdr"
label="Transaction Result Meta:"
item={
<XdrJsonViewer
xdr={response.result.resultMetaXdr.toXDR("base64").toString()}
typeVariant="TransactionMeta"
/>
}
/>
<TxResponse label="Fee:" value={response.fee} />
</Box>
}
/>
);
};