Skip to content

Commit e0efb2c

Browse files
authored
less wasteful queries (#3823)
- **feat(app): optimize queries** - **refactor(app): delete legacy assets**
2 parents df5b7ea + 49d6f0e commit e0efb2c

File tree

7 files changed

+3
-79
lines changed

7 files changed

+3
-79
lines changed

app/src/lib/components/chains-gate.svelte

+1-5
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ let checkedChains: Readable<Array<Chain>> = derived([chains, page], ([$chains, $
5656
features: chain.features,
5757
// this as statement should no longer be required in the next typescript release
5858
tokens: chain.tokens,
59-
relayer_status: chain.relayer_status,
60-
// @deprecated
61-
assets: chain.assets.filter(
62-
asset => asset.display_symbol !== null && asset.decimals !== null && asset.denom !== null
63-
) as Chain["assets"]
59+
relayer_status: chain.relayer_status
6460
} as Chain
6561
})
6662
})

app/src/lib/graphql/fragments/transfers.ts

-25
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,9 @@ export const transferListDataFragment = graphql(`
1111
receiver_normalized
1212
destination_chain_id
1313
packet_recv_timestamp
14-
packet_recv_transaction_hash
1514
base_token
1615
base_amount
17-
base_token_symbol
1816
quote_token
1917
quote_amount
2018
}
2119
`)
22-
23-
// tokens {
24-
// asset {
25-
// denom
26-
// chain {
27-
// chain_id
28-
// display_name
29-
// }
30-
// decimals
31-
// logo_uri
32-
// gas_token
33-
// display_name
34-
// display_symbol
35-
// }
36-
// amount
37-
// denom
38-
// }
39-
//
40-
//
41-
// forwards {
42-
// destination_chain_id
43-
// receiver
44-
// }

app/src/lib/graphql/queries/chains.ts

-11
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@ export const chainsQueryDocument =
3333
block_url
3434
address_url
3535
}
36-
assets {
37-
denom
38-
display_symbol
39-
display_name
40-
decimals
41-
faucets(where: { enabled: {_eq: true}}) {
42-
url
43-
display_name
44-
}
45-
gas_token
46-
}
4736
tokens {
4837
denom
4938
cw20 {

app/src/lib/graphql/queries/channels.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const channelsQuery =
3737
}`)
3838

3939
export const recommendedUcs03ChannelsQueryDocument = graphql(/* GraphQL */ `
40-
query Ucs03Channels {
40+
query Ucs03Channels @cached(ttl: 60) {
4141
v1_ibc_union_channel_recommendations(where: {version: {_eq: "ucs03-zkgm-0"}}) {
4242
source_port_id
4343
source_chain_id

app/src/lib/graphql/queries/transfer-details.ts

-22
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,9 @@ export const transfersBySourceHashBaseQueryDocument = graphql(/* GraphQL */ `
1919
packet_send_timestamp
2020
packet_recv_timestamp
2121
base_token
22-
base_token_details {
23-
decimals
24-
denom
25-
display_name
26-
display_symbol
27-
gas_token
28-
logo_uri
29-
origin
30-
unwrapped_denom
31-
}
32-
base_token_name
33-
base_token_symbol
3422
base_amount
3523
quote_amount
3624
quote_token
37-
quote_token_details {
38-
decimals
39-
denom
40-
display_name
41-
display_symbol
42-
gas_token
43-
logo_uri
44-
origin
45-
unwrapped_denom
46-
}
4725
4826
traces {
4927
type

app/src/lib/queries/channels.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export const recommendedUcs03ChannelsQuery = () =>
1212
(await request(URLS().GRAPHQL, recommendedUcs03ChannelsQueryDocument, {}))
1313
.v1_ibc_union_channel_recommendations,
1414
enabled: true,
15-
refetchInterval: 6_000,
15+
refetchInterval: 60_000,
1616
refetchOnWindowFocus: false
1717
})

app/src/lib/types.ts

-14
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export type Chain = {
6060
}>
6161
addr_prefix: string
6262
features: ChainFeature["features"]
63-
assets: Array<ChainAsset>
6463
tokens: Array<ChainToken>
6564
}
6665

@@ -75,19 +74,6 @@ export type Ucs03Channel = {
7574
destination_port_id: Hex
7675
}
7776

78-
/** @deprecated */
79-
export type ChainAsset = {
80-
denom: string
81-
display_symbol: string
82-
display_name: string | null
83-
decimals: number
84-
faucets: Array<{
85-
url: string
86-
display_name: string
87-
}>
88-
gas_token: boolean
89-
}
90-
9177
export type ChainToken = {
9278
denom: string
9379
cw20: {

0 commit comments

Comments
 (0)