-
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.
Merge branch 'dev' into feat/add-epoch-page
- Loading branch information
Showing
19 changed files
with
548 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { IDelegationWithDetails } from "./IDelegationWithDetails"; | ||
import { IResponse } from "./IResponse"; | ||
|
||
export interface IDelegationDetailsResponse extends IResponse { | ||
/** | ||
* The outputs data. | ||
*/ | ||
outputs?: IDelegationWithDetails[]; | ||
} |
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,16 @@ | ||
/* eslint-disable import/no-unresolved */ | ||
/* eslint-disable @typescript-eslint/no-unsafe-argument */ | ||
import { OutputWithMetadataResponse } from "@iota/sdk-nova"; | ||
import { IRewardsResponse } from "./IRewardsResponse"; | ||
|
||
export interface IDelegationWithDetails { | ||
/** | ||
* The output. | ||
*/ | ||
output: OutputWithMetadataResponse; | ||
|
||
/** | ||
* The rewards for the output. | ||
*/ | ||
rewards: IRewardsResponse; | ||
} |
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 { IAddressDetailsRequest } from "../../../../../models/api/nova/IAddressDetailsRequest"; | ||
import { IDelegationDetailsResponse } from "../../../../../models/api/nova/IDelegationDetailsResponse"; | ||
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"; | ||
|
||
/** | ||
* Fetch the delegation output details by address. | ||
* @param config The configuration. | ||
* @param request The request. | ||
* @returns The response. | ||
*/ | ||
export async function get(config: IConfiguration, request: IAddressDetailsRequest): Promise<IDelegationDetailsResponse> { | ||
const networkService = ServiceFactory.get<NetworkService>("network"); | ||
const networks = networkService.networkNames(); | ||
ValidationHelper.oneOf(request.network, networks, "network"); | ||
ValidationHelper.string(request.address, "address"); | ||
|
||
const networkConfig = networkService.get(request.network); | ||
|
||
if (networkConfig.protocolVersion !== NOVA) { | ||
return {}; | ||
} | ||
|
||
const novaApiService = ServiceFactory.get<NovaApiService>(`api-service-${networkConfig.network}`); | ||
return novaApiService.delegationOutputDetailsByAddress(request.address); | ||
} |
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
100 changes: 100 additions & 0 deletions
100
client/src/app/components/nova/address/section/delegation/DelegationSection.scss
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,100 @@ | ||
@import "../../../../../../scss/fonts"; | ||
@import "../../../../../../scss/media-queries"; | ||
@import "../../../../../../scss/mixins"; | ||
@import "../../../../../../scss/variables"; | ||
@import "../../../../../../scss/themes"; | ||
|
||
.table--delegation { | ||
width: 100%; | ||
border-spacing: 12px 28px; | ||
border-collapse: separate; | ||
|
||
@include tablet-down { | ||
display: none; | ||
} | ||
|
||
tr { | ||
@include font-size(14px); | ||
|
||
color: $gray-7; | ||
font-family: $inter; | ||
letter-spacing: 0.5px; | ||
|
||
th { | ||
@include font-size(12px); | ||
|
||
color: $gray-6; | ||
font-weight: 600; | ||
text-align: left; | ||
text-transform: uppercase; | ||
} | ||
|
||
td { | ||
color: var(--body-color); | ||
|
||
&.highlight { | ||
color: var(--link-color); | ||
@include font-size(14px); | ||
|
||
font-family: $ibm-plex-mono; | ||
font-weight: normal; | ||
letter-spacing: 0.02em; | ||
line-height: 20px; | ||
|
||
a { | ||
max-width: 200px; | ||
} | ||
} | ||
&.truncate { | ||
max-width: 150px; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.cards--delegation { | ||
display: none; | ||
|
||
@include tablet-down { | ||
display: block; | ||
} | ||
.card--delegation { | ||
margin-bottom: 16px; | ||
padding: 8px; | ||
|
||
.field { | ||
margin-bottom: 8px; | ||
|
||
.label { | ||
color: $gray-6; | ||
font-family: $inter; | ||
letter-spacing: 0.5px; | ||
|
||
@include font-size(14px, 21px); | ||
} | ||
|
||
.value { | ||
@include font-size(14px, 21px); | ||
|
||
color: var(--body-color); | ||
font-family: $metropolis; | ||
font-weight: 700; | ||
|
||
.highlight { | ||
color: var(--link-color); | ||
@include font-size(14px); | ||
|
||
font-family: $ibm-plex-mono; | ||
font-weight: normal; | ||
letter-spacing: 0.02em; | ||
line-height: 20px; | ||
max-width: 200px; | ||
} | ||
} | ||
} | ||
|
||
.field:last-child { | ||
margin-bottom: 0; | ||
} | ||
} | ||
} |
Oops, something went wrong.