From ca9b6ed8e58729d24733efb84e00f3ad8602c57f Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 21 Jan 2025 14:43:10 +0000 Subject: [PATCH] feat(app): show full token metadata --- app/src/generated/graphql-env.d.ts | 6 +-- app/src/generated/schema.graphql | 5 ++ app/src/lib/components/token.svelte | 50 ++++++++++++------- .../lib/components/transfer-details.svelte | 2 +- app/src/lib/graphql/queries/chains.ts | 4 ++ app/src/lib/types.ts | 3 ++ 6 files changed, 49 insertions(+), 21 deletions(-) diff --git a/app/src/generated/graphql-env.d.ts b/app/src/generated/graphql-env.d.ts index c67c12dbd5..8f40066a30 100644 --- a/app/src/generated/graphql-env.d.ts +++ b/app/src/generated/graphql-env.d.ts @@ -350,13 +350,13 @@ export type introspection_types = { 'v1_ibc_union_token_sources_select_column': { name: 'v1_ibc_union_token_sources_select_column'; enumValues: 'logo_uri' | 'name' | 'source_uri'; }; 'v1_ibc_union_token_sources_stream_cursor_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_sources_stream_cursor_input'; isOneOf: false; inputFields: [{ name: 'initial_value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_sources_stream_cursor_value_input'; ofType: null; }; }; defaultValue: null }, { name: 'ordering'; type: { kind: 'ENUM'; name: 'cursor_ordering'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_token_sources_stream_cursor_value_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_sources_stream_cursor_value_input'; isOneOf: false; inputFields: [{ name: 'logo_uri'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'source_uri'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_token_unwrapping': { kind: 'OBJECT'; name: 'v1_ibc_union_token_unwrapping'; fields: { 'destination_channel_id': { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'unwrapped_denom': { name: 'unwrapped_denom'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'wrapped_chain': { name: 'wrapped_chain'; type: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; } }; }; }; + 'v1_ibc_union_token_unwrapping': { kind: 'OBJECT'; name: 'v1_ibc_union_token_unwrapping'; fields: { 'destination_channel_id': { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'unwrapped_chain': { name: 'unwrapped_chain'; type: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; } }; 'unwrapped_denom': { name: 'unwrapped_denom'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'wrapped_chain': { name: 'wrapped_chain'; type: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; } }; }; }; 'v1_ibc_union_token_unwrapping_aggregate_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_aggregate_order_by'; isOneOf: false; inputFields: [{ name: 'avg'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_avg_order_by'; ofType: null; }; defaultValue: null }, { name: 'count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'max'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_max_order_by'; ofType: null; }; defaultValue: null }, { name: 'min'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_min_order_by'; ofType: null; }; defaultValue: null }, { name: 'stddev'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_stddev_order_by'; ofType: null; }; defaultValue: null }, { name: 'stddev_pop'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_stddev_pop_order_by'; ofType: null; }; defaultValue: null }, { name: 'stddev_samp'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_stddev_samp_order_by'; ofType: null; }; defaultValue: null }, { name: 'sum'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_sum_order_by'; ofType: null; }; defaultValue: null }, { name: 'var_pop'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_var_pop_order_by'; ofType: null; }; defaultValue: null }, { name: 'var_samp'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_var_samp_order_by'; ofType: null; }; defaultValue: null }, { name: 'variance'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_variance_order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_token_unwrapping_avg_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_avg_order_by'; isOneOf: false; inputFields: [{ name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_token_unwrapping_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'unwrapped_denom'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'wrapped_chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_bool_exp'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_token_unwrapping_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'unwrapped_chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_bool_exp'; ofType: null; }; defaultValue: null }, { name: 'unwrapped_denom'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'wrapped_chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_bool_exp'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_token_unwrapping_max_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_max_order_by'; isOneOf: false; inputFields: [{ name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'unwrapped_denom'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_token_unwrapping_min_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_min_order_by'; isOneOf: false; inputFields: [{ name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'unwrapped_denom'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_token_unwrapping_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_order_by'; isOneOf: false; inputFields: [{ name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'unwrapped_denom'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'wrapped_chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_order_by'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_token_unwrapping_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_order_by'; isOneOf: false; inputFields: [{ name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'unwrapped_chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_order_by'; ofType: null; }; defaultValue: null }, { name: 'unwrapped_denom'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'wrapped_chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_token_unwrapping_select_column': { name: 'v1_ibc_union_token_unwrapping_select_column'; enumValues: 'destination_channel_id' | 'unwrapped_denom'; }; 'v1_ibc_union_token_unwrapping_stddev_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_stddev_order_by'; isOneOf: false; inputFields: [{ name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_token_unwrapping_stddev_pop_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_token_unwrapping_stddev_pop_order_by'; isOneOf: false; inputFields: [{ name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; diff --git a/app/src/generated/schema.graphql b/app/src/generated/schema.graphql index 33f5d8cc97..3a6d0591f0 100644 --- a/app/src/generated/schema.graphql +++ b/app/src/generated/schema.graphql @@ -9195,6 +9195,9 @@ columns and relationships of "v1_ibc_union.token_unwrapping" """ type v1_ibc_union_token_unwrapping { destination_channel_id: Int + + """An object relationship""" + unwrapped_chain: v1_ibc_union_chains unwrapped_denom: String """An object relationship""" @@ -9233,6 +9236,7 @@ input v1_ibc_union_token_unwrapping_bool_exp { _not: v1_ibc_union_token_unwrapping_bool_exp _or: [v1_ibc_union_token_unwrapping_bool_exp!] destination_channel_id: Int_comparison_exp + unwrapped_chain: v1_ibc_union_chains_bool_exp unwrapped_denom: String_comparison_exp wrapped_chain: v1_ibc_union_chains_bool_exp } @@ -9258,6 +9262,7 @@ Ordering options when selecting data from "v1_ibc_union.token_unwrapping". """ input v1_ibc_union_token_unwrapping_order_by { destination_channel_id: order_by + unwrapped_chain: v1_ibc_union_chains_order_by unwrapped_denom: order_by wrapped_chain: v1_ibc_union_chains_order_by } diff --git a/app/src/lib/components/token.svelte b/app/src/lib/components/token.svelte index e2089b27d7..e878012056 100644 --- a/app/src/lib/components/token.svelte +++ b/app/src/lib/components/token.svelte @@ -2,7 +2,7 @@ import type { Chain, TokenInfo } from "$lib/types"; import TokenQualityLevel from "$lib/components/token-quality-level.svelte"; import Truncate from "./truncate.svelte"; - import ArrowRightIcon from "virtual:icons/lucide/arrow-right"; + import ArrowLeftIcon from "virtual:icons/lucide/arrow-left"; import { toDisplayName } from "$lib/utilities/chains.ts"; import { formatUnits } from "viem"; @@ -50,23 +50,39 @@ })(); -
- - {#if token.quality_level === "GRAPHQL"} - {#if amount !== null} - {formatUnits(BigInt(amount), token.primaryRepresentation.decimals)} +
+
+ + {#if token.quality_level === "GRAPHQL"} + {#if amount !== null} + {formatUnits(BigInt(amount), token.primaryRepresentation.decimals)} + {/if} +
{token.primaryRepresentation.symbol}
+
+ {toDisplayName(chainId, chains)} + {#each token.wrapping as wrapping} + {toDisplayName( + wrapping.unwrapped_chain.chain_id, + chains, + )} + {/each} +
+ {:else} + {amount} + {/if} -
{token.primaryRepresentation.symbol}
-
- {#each token.wrapping as wrapping} - {toDisplayName( - wrapping.wrapped_chain.chain_id, - chains, - )} - {/each} +
+ {#if token.quality_level === "GRAPHQL"} +
+
Name: {token.primaryRepresentation.name}
+
Symbol: {token.primaryRepresentation.symbol}
+
Denom:
+
+ Verifiers: {#each token.primaryRepresentation.sources as source}{source.source.name}{/each} +
- {:else} - {amount} - {/if}
diff --git a/app/src/lib/components/transfer-details.svelte b/app/src/lib/components/transfer-details.svelte index 0e6583cd7f..9ca8843e26 100644 --- a/app/src/lib/components/transfer-details.svelte +++ b/app/src/lib/components/transfer-details.svelte @@ -93,7 +93,7 @@
-
+
{#if transfer.base_amount && transfer.base_token}