-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add Nova Transaction page (#1162)
* feat: add nova Transaction page * fix: bump sdk version and fix imports * Update TransactionMetadataSection and TransactionPage components * feat: add search by transaction id * feat: add link to tx in output page --------- Co-authored-by: Begoña Álvarez de la Cruz <[email protected]>
- Loading branch information
1 parent
4419c65
commit f4e01fd
Showing
18 changed files
with
463 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export interface ITransactionDetailsRequest { | ||
/** | ||
* The network to search on. | ||
*/ | ||
network: string; | ||
|
||
/** | ||
* The transaction id to get the details for. | ||
*/ | ||
transactionId: string; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-disable import/no-unresolved */ | ||
/* eslint-disable @typescript-eslint/no-redundant-type-constituents */ | ||
import { Block } from "@iota/sdk-nova"; | ||
import { IResponse } from "./IResponse"; | ||
|
||
export interface ITransactionDetailsResponse extends IResponse { | ||
/** | ||
* Transaction included block. | ||
*/ | ||
block?: Block; | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ServiceFactory } from "../../../factories/serviceFactory"; | ||
import { ITransactionDetailsRequest } from "../../../models/api/nova/ITransactionDetailsRequest"; | ||
import { ITransactionDetailsResponse } from "../../../models/api/nova/ITransactionDetailsResponse"; | ||
import { IConfiguration } from "../../../models/configuration/IConfiguration"; | ||
import { NOVA } from "../../../models/db/protocolVersion"; | ||
import { NetworkService } from "../../../services/networkService"; | ||
import { NovaApiService } from "../../../services/nova/novaApiService"; | ||
import { ValidationHelper } from "../../../utils/validationHelper"; | ||
|
||
/** | ||
* Find the object from the network. | ||
* @param config The configuration. | ||
* @param request The request. | ||
* @returns The response. | ||
*/ | ||
export async function get(config: IConfiguration, request: ITransactionDetailsRequest): Promise<ITransactionDetailsResponse> { | ||
const networkService = ServiceFactory.get<NetworkService>("network"); | ||
const networks = networkService.networkNames(); | ||
ValidationHelper.oneOf(request.network, networks, "network"); | ||
ValidationHelper.string(request.transactionId, "transactionId"); | ||
|
||
const networkConfig = networkService.get(request.network); | ||
|
||
if (networkConfig.protocolVersion !== NOVA) { | ||
return {}; | ||
} | ||
|
||
const novaApiService = ServiceFactory.get<NovaApiService>(`api-service-${networkConfig.network}`); | ||
return novaApiService.transactionIncludedBlock(request.transactionId); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
@import "../../../scss/fonts"; | ||
@import "../../../scss/mixins"; | ||
@import "../../../scss/media-queries"; | ||
@import "../../../scss/variables"; | ||
|
||
.transaction-page { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
.wrapper { | ||
display: flex; | ||
justify-content: center; | ||
|
||
.inner { | ||
display: flex; | ||
flex: 1; | ||
flex-direction: column; | ||
max-width: $desktop-width; | ||
margin: 40px 25px; | ||
|
||
@include desktop-down { | ||
flex: unset; | ||
width: 100%; | ||
max-width: 100%; | ||
margin: 40px 24px; | ||
padding-right: 24px; | ||
padding-left: 24px; | ||
|
||
> .row { | ||
flex-direction: column; | ||
} | ||
} | ||
|
||
@include tablet-down { | ||
margin: 28px 0; | ||
} | ||
|
||
.transation-page--header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
.section { | ||
padding-top: 44px; | ||
|
||
.section--header { | ||
margin-top: 44px; | ||
} | ||
} | ||
|
||
.link { | ||
@include font-size(14px); | ||
|
||
max-width: 100%; | ||
color: var(--link-color); | ||
font-family: $ibm-plex-mono; | ||
font-weight: normal; | ||
letter-spacing: 0.02em; | ||
line-height: 20px; | ||
} | ||
} | ||
|
||
.section--data { | ||
.amount-transacted { | ||
@include font-size(15px); | ||
font-weight: 700; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.