-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'chore/stake-pool-components-with-graphql' of github.com…
…:input-output-hk/cardano-explorer-app into chore/stake-pool-components-with-graphql
- Loading branch information
Showing
28 changed files
with
392 additions
and
117 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
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1,15 +1,36 @@ | ||
import { Currency } from 'cardano-js'; | ||
import { SearchForAddressQuery } from '../../../../generated/typings/graphql-schema'; | ||
import { IAddressSummary } from '../types'; | ||
import { | ||
SearchForPaymentAddressQuery, | ||
SearchForStakeAddressQuery, | ||
} from '../../../../generated/typings/graphql-schema'; | ||
import { IPaymentAddressSummary, IStakeAddressSummary } from '../types'; | ||
|
||
export const addressDetailTransformer = ( | ||
export const paymentAddressDetailTransformer = ( | ||
address: string, | ||
s: SearchForAddressQuery | ||
): IAddressSummary => ({ | ||
address, | ||
finalBalance: Currency.Util.lovelacesToAda( | ||
s.utxos_aggregate?.aggregate?.sum?.value || '0' | ||
), | ||
transactionsCount: | ||
s.transactions_aggregate?.aggregate?.count.toString() || '0', | ||
}); | ||
s: SearchForPaymentAddressQuery | ||
): IPaymentAddressSummary => { | ||
return { | ||
address, | ||
finalBalance: Currency.Util.lovelacesToAda( | ||
s.utxos_aggregate?.aggregate?.sum?.value || '0' | ||
), | ||
transactionsCount: | ||
s.transactions_aggregate?.aggregate?.count.toString() || '0' | ||
} | ||
}; | ||
|
||
export const stakeAddressDetailTransformer = ( | ||
address: string, | ||
s: SearchForStakeAddressQuery | ||
): IStakeAddressSummary => { | ||
return { | ||
address, | ||
totalWithdrawals: | ||
s.withdrawals_aggregate?.aggregate?.count.toString() || '0', | ||
totalWithdrawn: Currency.Util.lovelacesToAda( | ||
s.withdrawals_aggregate?.aggregate?.sum?.amount || '0' | ||
), | ||
transactionsCount: | ||
s.transactions_aggregate?.aggregate?.count.toString() || '0' | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
export interface IAddressSummary { | ||
address: string; | ||
finalBalance: string; | ||
transactionsCount: string; | ||
} | ||
|
||
export interface IPaymentAddressSummary extends IAddressSummary { | ||
finalBalance: string; | ||
} | ||
|
||
export interface IStakeAddressSummary extends IAddressSummary { | ||
totalWithdrawals: string; | ||
totalWithdrawn: 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
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
2 changes: 1 addition & 1 deletion
2
...tures/search/api/searchForAddress.graphql → ...earch/api/searchForPaymentAddress.graphql
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
query searchForAddress( | ||
query searchForPaymentAddress( | ||
$address: String! | ||
) { | ||
utxos_aggregate ( | ||
|
Oops, something went wrong.