From 0f0ead95e44add3383740a9da250da7f6c1e0934 Mon Sep 17 00:00:00 2001 From: cor Date: Thu, 9 Jan 2025 11:45:17 +0000 Subject: [PATCH 01/15] refactor(app): rework metadata fetching --- app/src/lib/queries/balance/index.ts | 47 ++++----------------- app/src/routes/balances/+page.svelte | 11 +++++ app/src/routes/balances/UserBalances.svelte | 38 +++++++++++++++++ 3 files changed, 57 insertions(+), 39 deletions(-) create mode 100644 app/src/routes/balances/+page.svelte create mode 100644 app/src/routes/balances/UserBalances.svelte diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index 0a26fe7e74..027c0ce56f 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -11,28 +11,14 @@ import { getBalancesFromRoutescan } from "./evm/routescan.ts" export type BalanceResult = // EVM balance result (from multicall) - | { - balance: string | bigint - address: string - name?: string | null - symbol: string - gasToken?: boolean - } - // Cosmos balance result - | { - address: string - symbol: string - balance: string | number - decimals: number - gasToken?: boolean - } - // Aptos balance result - | { - balance: string | bigint - address: string - symbol: string - gasToken?: boolean - } + { + balance: string + address: string + symbol: string | null + name: string | null + decimals: number | null + gasToken: boolean + } export function userBalancesQuery({ userAddr, @@ -54,23 +40,6 @@ export function userBalancesQuery({ if (!connected) return [] if (chain.rpc_type === "evm" && userAddr.evm) { - const rpc = chain.rpcs - .filter(rpc => rpc.type === "alchemy" || rpc.type === "routescan") - .at(0) - - if (rpc?.type === "alchemy") { - return await getBalancesFromAlchemy({ - url: rpc.url, - walletAddress: userAddr.evm.canonical - }) - } - if (rpc?.type === "routescan") { - return await getBalancesFromRoutescan({ - url: rpc.url, - walletAddress: userAddr.evm.canonical - }) - } - const tokenList = chain.assets.filter(asset => isAddress(asset.denom)) const multicallResults = await erc20ReadMulticall({ diff --git a/app/src/routes/balances/+page.svelte b/app/src/routes/balances/+page.svelte new file mode 100644 index 0000000000..c409a66977 --- /dev/null +++ b/app/src/routes/balances/+page.svelte @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/app/src/routes/balances/UserBalances.svelte b/app/src/routes/balances/UserBalances.svelte new file mode 100644 index 0000000000..5845266a90 --- /dev/null +++ b/app/src/routes/balances/UserBalances.svelte @@ -0,0 +1,38 @@ + + +

hi

+ + +
+{#each $userBalances as balance} + {JSON.stringify(balance.data, 2)} +{/each} + +

chains

+{JSON.stringify(chains, null)} +
+ From 128df059c56c9268b7b125bd41fb8125065d0012 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 15:47:23 +0100 Subject: [PATCH 02/15] refactor(app): save progress --- app/src/lib/queries/balance/index.ts | 317 +++++++++++++++----- app/src/lib/query-client.ts | 11 +- app/src/routes/balances/UserBalances.svelte | 88 ++++-- 3 files changed, 316 insertions(+), 100 deletions(-) diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index 027c0ce56f..7bf1732dec 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -1,86 +1,255 @@ -import { isAddress, type Address } from "viem" -import { raise } from "$lib/utilities/index.ts" -import { getAptosChainBalances } from "./aptos.ts" +import { writable, derived, type Readable } from "svelte/store" +import { bech32ToBech32Address } from "@unionlabs/client" +import { type Address, isAddress } from "viem" +import type { Chain, ChainAsset, UserAddresses } from "$lib/types" +import { erc20ReadMulticall } from "./evm/multicall.ts" import { getCosmosChainBalances } from "./cosmos.ts" +import { getAptosChainBalances } from "./aptos.ts" import { createQueries } from "@tanstack/svelte-query" -import { erc20ReadMulticall } from "./evm/multicall.ts" -import { bech32ToBech32Address } from "@unionlabs/client" -import type { Chain, UserAddresses } from "$lib/types.ts" -import { getBalancesFromAlchemy } from "./evm/alchemy.ts" -import { getBalancesFromRoutescan } from "./evm/routescan.ts" - -export type BalanceResult = - // EVM balance result (from multicall) - { - balance: string - address: string - symbol: string | null - name: string | null - decimals: number | null - gasToken: boolean - } +import type { QueryObserverResult } from "@tanstack/query-core" -export function userBalancesQuery({ - userAddr, - chains, - connected = true -}: { userAddr: UserAddresses; chains: Array; connected?: boolean }) { - return createQueries>({ - queries: chains.map(chain => ({ - queryKey: [ - "balances", - chain.chain_id, - userAddr?.evm?.normalized, - userAddr?.cosmos?.normalized, - userAddr.aptos?.canonical - ], - refetchInterval: 4_000, - refetchOnWindowFocus: false, - queryFn: async () => { - if (!connected) return [] - - if (chain.rpc_type === "evm" && userAddr.evm) { - const tokenList = chain.assets.filter(asset => isAddress(asset.denom)) - - const multicallResults = await erc20ReadMulticall({ - chainId: chain.chain_id, - functionNames: ["balanceOf"], - address: userAddr.evm.canonical, - contractAddresses: tokenList.map(asset => asset.denom) as Array
- }) - - return multicallResults - .map((result, index) => ({ - balance: result.balance, - address: tokenList[index].denom, - name: tokenList[index].display_name, - symbol: tokenList[index].display_symbol, - gasToken: tokenList[index].gas_token ?? false - })) - .filter(result => !!result?.balance && BigInt(result.balance) > 0n) - } +export type AssetMetadata = { + balance: string + denom: string + display_symbol: string | null + display_name: string | null + decimals: number | null + gasToken: boolean + metadata_level: "graphql" | "onchain" | "none" +} - if (chain.rpc_type === "cosmos" && userAddr.cosmos) { - const url = chain.rpcs.filter(rpc => rpc.type === "rest").at(0)?.url - if (!url) raise(`No REST RPC available for chain ${chain.chain_id}`) +export type BalanceData = { + denom: string + balance: string +} - const bech32Address = bech32ToBech32Address({ - toPrefix: chain.addr_prefix, - address: userAddr.cosmos.canonical - }) +function normalizeAddress(denom: string): string { + return isAddress(denom) ? denom.toLowerCase() : denom +} - return getCosmosChainBalances({ url, walletAddress: bech32Address }) - } +export async function getAssetInfo(chain: Chain, denom: string): Promise { + const normalizedDenom = normalizeAddress(denom) + const configAsset = chain.assets.find( + (asset: { denom: string }) => normalizeAddress(asset.denom) === normalizedDenom + ) - if (chain.rpc_type === "aptos" && userAddr.aptos) { - const url = chain.rpcs.filter(rpc => rpc.type === "rpc").at(0)?.url - if (!url) raise(`No RPC available for chain ${chain.chain_id}`) + if (configAsset) { + return { + balance: "0", + denom: normalizedDenom, + display_symbol: configAsset.display_symbol, + display_name: configAsset.display_name, + decimals: configAsset.decimals, + gasToken: configAsset.gas_token, + metadata_level: "graphql" + } + } - return getAptosChainBalances({ url, walletAddress: userAddr.aptos.canonical }) - } + if (chain.rpc_type === "evm" && isAddress(normalizedDenom)) { + try { + console.log("here") + const results = await erc20ReadMulticall({ + chainId: chain.chain_id, + functionNames: ["decimals", "symbol", "name"], + address: normalizedDenom as Address, + contractAddresses: [normalizedDenom] as Array
+ }) - return [] + return { + balance: "0", + denom: normalizedDenom, + display_symbol: results[0].symbol ?? null, + display_name: results[0].name ?? null, + decimals: results[0].decimals ?? null, + gasToken: false, + metadata_level: "onchain" } + } catch (e) { + console.error("Multicall metadata fetch failed:", e) + } + } + + // Fallback + return { + balance: "0", + denom: normalizedDenom, + display_symbol: null, + display_name: null, + decimals: null, + gasToken: false, + metadata_level: "none" + } +} + +export async function getUserBalances( + chain: Chain, + address: string, + denoms?: Array +): Promise> { + if (chain.rpc_type === "evm") { + const contractAddresses = denoms + ? denoms.filter((denom): denom is Address => isAddress(denom)).map(normalizeAddress) + : chain.assets + .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) + .map(asset => normalizeAddress(asset.denom)) + + const results = await erc20ReadMulticall({ + chainId: chain.chain_id, + functionNames: ["balanceOf"], + address: address as Address, + contractAddresses: contractAddresses as Array
+ }) + + return results + .map((result, index) => ({ + denom: normalizeAddress(contractAddresses[index]), + balance: result.balance?.toString() ?? "0" + })) + .filter(result => BigInt(result.balance) > 0n) + } + + if (chain.rpc_type === "cosmos") { + const restEndpoint = chain.rpcs.find(rpc => rpc.type === "rest")?.url + if (!restEndpoint) { + throw new Error(`No REST endpoint found for chain ${chain.chain_id}`) + } + + const bech32Address = bech32ToBech32Address({ + toPrefix: chain.addr_prefix, + address + }) + + const balances = await getCosmosChainBalances({ + url: restEndpoint, + walletAddress: bech32Address + }) + + return balances.map(balance => ({ + denom: normalizeAddress(balance.address), + balance: balance.balance.toString() })) - }) + } + + if (chain.rpc_type === "aptos") { + const graphqlEndpoint = chain.rpcs.find(rpc => rpc.type === "rpc")?.url + if (!graphqlEndpoint) { + throw new Error(`No GraphQL endpoint found for chain ${chain.chain_id}`) + } + + const balances = await getAptosChainBalances({ + url: graphqlEndpoint, + walletAddress: address + }) + + return balances.map(balance => ({ + denom: normalizeAddress(balance.address), + balance: balance.balance.toString() + })) + } + + return [] +} + +function getAddressForChain(chain: Chain, addresses: UserAddresses): string | null { + switch (chain.rpc_type) { + case "evm": + return addresses.evm?.canonical ?? null + case "cosmos": + return addresses.cosmos?.canonical ?? null + case "aptos": + return addresses.aptos?.canonical ?? null + default: + return null + } +} + +export function createChainBalances( + chain: Chain, + addressStore: Readable +): Readable> { + const balanceStore = writable>([]) + + return derived, Array>( + addressStore, + ($addresses, set) => { + const address = getAddressForChain(chain, $addresses) + + if (!address) { + set([]) + return + } + + const initialBalances: Array = chain.assets.map(asset => ({ + balance: "0", + denom: asset.denom, + display_symbol: asset.display_symbol || null, + display_name: asset.display_name || null, + decimals: asset.decimals !== undefined ? asset.decimals : null, + gasToken: asset.gas_token, + metadata_level: "none" + })) + balanceStore.set(initialBalances) + set(initialBalances) + + // Fetch all balances + createQueries({ + queries: [ + { + queryKey: ["balances", chain.chain_id, address], + queryFn: async () => { + const balances = await getUserBalances(chain, address) + const enrichedBalances = await Promise.all( + balances.map(async ({ denom, balance }) => { + const assetInfo = await getAssetInfo(chain, denom) + return { ...assetInfo, balance, denom } + }) + ) + + // Merge with placeholder balances to ensure all assets are represented + const mergedBalances = initialBalances.map(placeholder => { + const enriched = enrichedBalances.find(b => b.denom === placeholder.denom) + return enriched || placeholder + }) + + // Add any new tokens discovered that weren't in the original asset list + enrichedBalances.forEach(enriched => { + if (!mergedBalances.some(b => b.denom === enriched.denom)) { + mergedBalances.push(enriched) + } + }) + + // Ensure all balance values are valid numbers and sort the balances + return mergedBalances + .map(balance => ({ + ...balance, + balance: balance.balance === "Loading..." ? "0" : balance.balance, + decimals: balance.decimals !== null ? balance.decimals : 18 // Default to 18 if decimals is null + })) + .sort((a, b) => { + const aValue = BigInt(a.balance) * BigInt(10 ** (18 - a.decimals)) + const bValue = BigInt(b.balance) * BigInt(10 ** (18 - b.decimals)) + return bValue > aValue ? 1 : -1 + }) + }, + refetchInterval: 4000 + } + ] + }).subscribe(results => { + const queryResult = results[0] as QueryObserverResult, Error> + if (queryResult.data) { + balanceStore.set(queryResult.data) + set(queryResult.data) + } + }) + + return balanceStore.subscribe(set) + }, + [] as Array + ) +} + +export function allChainBalances(chains: Array, addressStore: Readable) { + const chainStores = chains.map(chain => createChainBalances(chain, addressStore)) + + return derived(chainStores, $chainStores => $chainStores) } diff --git a/app/src/lib/query-client.ts b/app/src/lib/query-client.ts index d150971a3d..b6f6f2377c 100644 --- a/app/src/lib/query-client.ts +++ b/app/src/lib/query-client.ts @@ -11,14 +11,13 @@ export function createQueryClient() { defaultOptions: { queries: { enabled: browser, - gcTime: HOUR * 1, // 1 hour - refetchOnReconnect: () => !queryClient.isMutating() + gcTime: HOUR, + refetchOnReconnect: () => !queryClient.isMutating(), + staleTime: MINUTE, + refetchOnWindowFocus: true, + refetchOnMount: true } }, - /** - * https://tkdodo.eu/blog/react-query-error-handling#putting-it-all-together - * note: only runs in development mode. Production unaffected. - */ queryCache: new QueryCache({ onError: (error, query) => { if (import.meta.env.MODE !== "development") return diff --git a/app/src/routes/balances/UserBalances.svelte b/app/src/routes/balances/UserBalances.svelte index 5845266a90..0a21fa42b0 100644 --- a/app/src/routes/balances/UserBalances.svelte +++ b/app/src/routes/balances/UserBalances.svelte @@ -1,15 +1,13 @@ +$: chainBalances = allChainBalances(chains, userAddress) -

hi

+let hideZeroBalances = writable(true) +$: filteredChainBalances = derived( + [chainBalances, hideZeroBalances], + ([$chainBalances, $hideZeroBalances]) => { + if (!$hideZeroBalances) return $chainBalances + return $chainBalances.map(chainAssets => + chainAssets.filter(asset => BigInt(asset.balance) > 0n) + ) + } +) -
-{#each $userBalances as balance} - {JSON.stringify(balance.data, 2)} -{/each} +function formatBalance(balance: string, decimals: number | null): string { + if (!decimals) return balance + const num = Number(balance) / 10 ** decimals + return new Intl.NumberFormat("en-US", { + minimumFractionDigits: 2, + maximumFractionDigits: 6 + }).format(num) +} + -

chains

-{JSON.stringify(chains, null)} -
+
+
+ + +
+ {#each $filteredChainBalances as chainAssets, chainIndex} + {#if chainAssets?.length} +
+

+ {chains[chainIndex].display_name} +

+
+ {#each chainAssets as asset} +
+
+ {asset.display_symbol ?? asset.denom} + {#if asset.display_name} + + ({asset.display_name}) + + {/if} + {#if asset.gasToken} + + Gas Token + + {/if} +
+
+
+ {formatBalance(asset.balance, asset.decimals)} +
+
+ {asset.metadata_level} +
+
+
+ {/each} +
+
+ {/if} + {/each} +
\ No newline at end of file From a1970ee00e2a3a7c16ce5f54ad9786e7526d0e68 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 15:50:51 +0100 Subject: [PATCH 03/15] refactor(app): logging --- app/src/lib/queries/balance/index.ts | 276 +++++++++++++++------------ 1 file changed, 150 insertions(+), 126 deletions(-) diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index 7bf1732dec..e033d68b5c 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -28,56 +28,68 @@ function normalizeAddress(denom: string): string { } export async function getAssetInfo(chain: Chain, denom: string): Promise { - const normalizedDenom = normalizeAddress(denom) - const configAsset = chain.assets.find( - (asset: { denom: string }) => normalizeAddress(asset.denom) === normalizedDenom - ) - - if (configAsset) { - return { - balance: "0", - denom: normalizedDenom, - display_symbol: configAsset.display_symbol, - display_name: configAsset.display_name, - decimals: configAsset.decimals, - gasToken: configAsset.gas_token, - metadata_level: "graphql" - } - } - - if (chain.rpc_type === "evm" && isAddress(normalizedDenom)) { - try { - console.log("here") - const results = await erc20ReadMulticall({ - chainId: chain.chain_id, - functionNames: ["decimals", "symbol", "name"], - address: normalizedDenom as Address, - contractAddresses: [normalizedDenom] as Array
- }) + try { + const normalizedDenom = normalizeAddress(denom) + const configAsset = chain.assets.find( + (asset: { denom: string }) => normalizeAddress(asset.denom) === normalizedDenom + ) + if (configAsset) { return { balance: "0", denom: normalizedDenom, - display_symbol: results[0].symbol ?? null, - display_name: results[0].name ?? null, - decimals: results[0].decimals ?? null, - gasToken: false, - metadata_level: "onchain" + display_symbol: configAsset.display_symbol, + display_name: configAsset.display_name, + decimals: configAsset.decimals, + gasToken: configAsset.gas_token, + metadata_level: "graphql" } - } catch (e) { - console.error("Multicall metadata fetch failed:", e) } - } - // Fallback - return { - balance: "0", - denom: normalizedDenom, - display_symbol: null, - display_name: null, - decimals: null, - gasToken: false, - metadata_level: "none" + if (chain.rpc_type === "evm" && isAddress(normalizedDenom)) { + try { + const results = await erc20ReadMulticall({ + chainId: chain.chain_id, + functionNames: ["decimals", "symbol", "name"], + address: normalizedDenom as Address, + contractAddresses: [normalizedDenom] as Array
+ }) + + return { + balance: "0", + denom: normalizedDenom, + display_symbol: results[0].symbol ?? null, + display_name: results[0].name ?? null, + decimals: results[0].decimals ?? null, + gasToken: false, + metadata_level: "onchain" + } + } catch (e) { + console.error("Multicall metadata fetch failed:", e) + } + } + + // Fallback + return { + balance: "0", + denom: normalizedDenom, + display_symbol: null, + display_name: null, + decimals: null, + gasToken: false, + metadata_level: "none" + } + } catch (error) { + console.error("Unexpected error in getAssetInfo:", error) + return { + balance: "0", + denom: normalizeAddress(denom), + display_symbol: null, + display_name: null, + decimals: null, + gasToken: false, + metadata_level: "none" + } } } @@ -86,68 +98,75 @@ export async function getUserBalances( address: string, denoms?: Array ): Promise> { - if (chain.rpc_type === "evm") { - const contractAddresses = denoms - ? denoms.filter((denom): denom is Address => isAddress(denom)).map(normalizeAddress) - : chain.assets - .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) - .map(asset => normalizeAddress(asset.denom)) - - const results = await erc20ReadMulticall({ - chainId: chain.chain_id, - functionNames: ["balanceOf"], - address: address as Address, - contractAddresses: contractAddresses as Array
- }) - - return results - .map((result, index) => ({ - denom: normalizeAddress(contractAddresses[index]), - balance: result.balance?.toString() ?? "0" - })) - .filter(result => BigInt(result.balance) > 0n) - } + try { + if (chain.rpc_type === "evm") { + const contractAddresses = denoms + ? denoms.filter((denom): denom is Address => isAddress(denom)).map(normalizeAddress) + : chain.assets + .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) + .map(asset => normalizeAddress(asset.denom)) - if (chain.rpc_type === "cosmos") { - const restEndpoint = chain.rpcs.find(rpc => rpc.type === "rest")?.url - if (!restEndpoint) { - throw new Error(`No REST endpoint found for chain ${chain.chain_id}`) + const results = await erc20ReadMulticall({ + chainId: chain.chain_id, + functionNames: ["balanceOf"], + address: address as Address, + contractAddresses: contractAddresses as Array
+ }) + + return results + .map((result, index) => ({ + denom: normalizeAddress(contractAddresses[index]), + balance: result.balance?.toString() ?? "0" + })) + .filter(result => BigInt(result.balance) > 0n) } - const bech32Address = bech32ToBech32Address({ - toPrefix: chain.addr_prefix, - address - }) + if (chain.rpc_type === "cosmos") { + const restEndpoint = chain.rpcs.find(rpc => rpc.type === "rest")?.url + if (!restEndpoint) { + console.error(`No REST endpoint found for chain ${chain.chain_id}`) + return [] + } - const balances = await getCosmosChainBalances({ - url: restEndpoint, - walletAddress: bech32Address - }) + const bech32Address = bech32ToBech32Address({ + toPrefix: chain.addr_prefix, + address + }) - return balances.map(balance => ({ - denom: normalizeAddress(balance.address), - balance: balance.balance.toString() - })) - } + const balances = await getCosmosChainBalances({ + url: restEndpoint, + walletAddress: bech32Address + }) - if (chain.rpc_type === "aptos") { - const graphqlEndpoint = chain.rpcs.find(rpc => rpc.type === "rpc")?.url - if (!graphqlEndpoint) { - throw new Error(`No GraphQL endpoint found for chain ${chain.chain_id}`) + return balances.map(balance => ({ + denom: normalizeAddress(balance.address), + balance: balance.balance.toString() + })) } - const balances = await getAptosChainBalances({ - url: graphqlEndpoint, - walletAddress: address - }) + if (chain.rpc_type === "aptos") { + const graphqlEndpoint = chain.rpcs.find(rpc => rpc.type === "rpc")?.url + if (!graphqlEndpoint) { + console.error(`No GraphQL endpoint found for chain ${chain.chain_id}`) + return [] + } - return balances.map(balance => ({ - denom: normalizeAddress(balance.address), - balance: balance.balance.toString() - })) - } + const balances = await getAptosChainBalances({ + url: graphqlEndpoint, + walletAddress: address + }) - return [] + return balances.map(balance => ({ + denom: normalizeAddress(balance.address), + balance: balance.balance.toString() + })) + } + + return [] + } catch (error) { + console.error("Error in getUserBalances:", error) + return [] + } } function getAddressForChain(chain: Chain, addresses: UserAddresses): string | null { @@ -197,39 +216,44 @@ export function createChainBalances( { queryKey: ["balances", chain.chain_id, address], queryFn: async () => { - const balances = await getUserBalances(chain, address) - const enrichedBalances = await Promise.all( - balances.map(async ({ denom, balance }) => { - const assetInfo = await getAssetInfo(chain, denom) - return { ...assetInfo, balance, denom } + try { + const balances = await getUserBalances(chain, address) + const enrichedBalances = await Promise.all( + balances.map(async ({ denom, balance }) => { + const assetInfo = await getAssetInfo(chain, denom) + return { ...assetInfo, balance, denom } + }) + ) + + // Merge with placeholder balances to ensure all assets are represented + const mergedBalances = initialBalances.map(placeholder => { + const enriched = enrichedBalances.find(b => b.denom === placeholder.denom) + return enriched || placeholder }) - ) - - // Merge with placeholder balances to ensure all assets are represented - const mergedBalances = initialBalances.map(placeholder => { - const enriched = enrichedBalances.find(b => b.denom === placeholder.denom) - return enriched || placeholder - }) - - // Add any new tokens discovered that weren't in the original asset list - enrichedBalances.forEach(enriched => { - if (!mergedBalances.some(b => b.denom === enriched.denom)) { - mergedBalances.push(enriched) - } - }) - - // Ensure all balance values are valid numbers and sort the balances - return mergedBalances - .map(balance => ({ - ...balance, - balance: balance.balance === "Loading..." ? "0" : balance.balance, - decimals: balance.decimals !== null ? balance.decimals : 18 // Default to 18 if decimals is null - })) - .sort((a, b) => { - const aValue = BigInt(a.balance) * BigInt(10 ** (18 - a.decimals)) - const bValue = BigInt(b.balance) * BigInt(10 ** (18 - b.decimals)) - return bValue > aValue ? 1 : -1 + + // Add any new tokens discovered that weren't in the original asset list + enrichedBalances.forEach(enriched => { + if (!mergedBalances.some(b => b.denom === enriched.denom)) { + mergedBalances.push(enriched) + } }) + + // Ensure all balance values are valid numbers and sort the balances + return mergedBalances + .map(balance => ({ + ...balance, + balance: balance.balance === "Loading..." ? "0" : balance.balance, + decimals: balance.decimals !== null ? balance.decimals : 18 // Default to 18 if decimals is null + })) + .sort((a, b) => { + const aValue = BigInt(a.balance) * BigInt(10 ** (18 - a.decimals)) + const bValue = BigInt(b.balance) * BigInt(10 ** (18 - b.decimals)) + return bValue > aValue ? 1 : -1 + }) + } catch (error) { + console.error("Error fetching balances:", error) + return initialBalances + } }, refetchInterval: 4000 } From ca55e5334aa065077d1418e348a2379f6f1ed492 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 17:38:54 +0100 Subject: [PATCH 04/15] refactor(app): refactor domino --- .../components/Cube/faces/Assets.svelte | 60 ++++----- .../components/Cube/faces/Chains.svelte | 51 ++++--- .../components/Cube/faces/Intent.svelte | 4 +- .../components/Cube/faces/Transfer.svelte | 20 +-- .../components/SelectedAsset.svelte | 43 +++--- .../lib/components/TransferFrom/index.svelte | 14 +- .../TransferFrom/transfer/balances.ts | 7 +- .../TransferFrom/transfer/context.ts | 32 ++--- .../TransferFrom/transfer/intents.ts | 75 +++-------- .../TransferFrom/transfer/validation.ts | 38 ++---- app/src/lib/queries/balance/index.ts | 127 +++++++++--------- app/src/routes/balances/UserBalances.svelte | 80 +++++------ 12 files changed, 233 insertions(+), 318 deletions(-) diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte index bf3cadf028..bbb7a20380 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte @@ -1,37 +1,29 @@
@@ -44,20 +36,20 @@ function setAsset(address: string) {
- {#if sortedAssets.length} + {#if $intents.sourceAssets.length}
- {#each sortedAssets as asset} + {#each $intents.sourceAssets as asset (asset.metadata.denom)}
diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte index 499237f8a1..0a8a105697 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte @@ -1,37 +1,37 @@
@@ -100,5 +100,4 @@ function toggleExpand(chainId: string) { {/each}
- \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte index 097364207c..97bdc872a1 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte @@ -4,9 +4,7 @@ import SelectedAsset from "$lib/components/TransferFrom/components/SelectedAsset import type { Readable } from "svelte/store" import type { ValidationStore, - ValidationStoreAndMethods } from "$lib/components/TransferFrom/transfer/validation.ts" -import type { ContextStore } from "$lib/components/TransferFrom/transfer/context.ts" import { Button } from "$lib/components/ui/button" import type { IntentsStore } from "$lib/components/TransferFrom/transfer/intents.ts" import type { CubeFaces } from "$lib/components/TransferFrom/components/Cube/types.ts" @@ -46,7 +44,7 @@ let { rawIntents, intents, validation } = stores minlength={1} maxlength={64} required={true} - disabled={!$intents.selectedAsset.address} + disabled={!$intents.selectedAsset?.metadata.denom} autocorrect="off" placeholder="0.00" spellcheck="false" diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte index 7372cec591..1f55a2ce92 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte @@ -50,7 +50,7 @@ let transferState: Writable = writable({ kind: "PRE_TRANSFER" }) const transfer = async () => { if (!$validation.isValid) return - let parsedAmount = parseUnits($validation.transfer.amount, $validation.transfer.asset.decimals) + let parsedAmount = parseUnits($validation.transfer.amount, $validation.transfer.asset.metadata.decimals) /** --- APTOS START --- */ if ($validation.transfer.sourceChain.rpc_type === "aptos") { @@ -109,7 +109,7 @@ const transfer = async () => { receiver: $validation.transfer.receiver, amount: parsedAmount, authAccess: "wallet", - denomAddress: $validation.transfer.asset.address, + denomAddress: $validation.transfer.asset?.balance, destinationChainId: $validation.transfer.destinationChain.chain_id as ChainId } satisfies TransferAssetsParameters<"2"> @@ -201,18 +201,18 @@ const transfer = async () => { account: cosmosOfflineSigner, transport: http(`https://${rpcUrl}`), chainId: $validation.transfer.sourceChain.chain_id as CosmosChainId, - gasPrice: { amount: "0.0025", denom: $validation.transfer.asset.address } + gasPrice: { amount: "0.0025", denom: $validation.transfer.asset.metadata.denom } }) const transfer = await unionClient.transferAsset({ autoApprove: true, receiver: $validation.transfer.receiver, amount: parsedAmount, - denomAddress: $validation.transfer.asset.address, + denomAddress: $validation.transfer.asset.metadata.denom, account: cosmosOfflineSigner, // TODO: verify chain id is correct destinationChainId: $validation.transfer.destinationChain.chain_id as ChainId, - gasPrice: { amount: "0.0025", denom: $validation.transfer.asset.address } + gasPrice: { amount: "0.0025", denom: $validation.transfer.asset.metadata.denom } }) if (transfer.isErr()) throw transfer.error transferState.set({ kind: "TRANSFERRING", transferHash: transfer.value }) @@ -273,7 +273,7 @@ const transfer = async () => { const approve = await unionClient.approveTransaction({ amount: parsedAmount, receiver: $validation.transfer.receiver, - denomAddress: getAddress($validation.transfer.asset.address), + denomAddress: getAddress($validation.transfer.asset.metadata.denom), // TODO: verify chain id is correct destinationChainId: $validation.transfer.destinationChain.chain_id as ChainId }) @@ -334,7 +334,7 @@ const transfer = async () => { autoApprove: false, amount: parsedAmount, receiver: $validation.transfer.receiver, - denomAddress: getAddress($validation.transfer.asset.address), + denomAddress: getAddress($validation.transfer.asset.metadata.denom), destinationChainId: $validation.transfer.destinationChain.chain_id as ChainId }) if (transfer.isErr()) throw transfer.error @@ -387,10 +387,10 @@ const transfer = async () => { transfer_day: toIsoString(new Date(Date.now())).split("T")[0], receiver: $validation.transfer?.receiver, assets: { - [$validation.transfer?.asset.address]: { + [$validation.transfer?.asset.metadata.denom]: { info: $validation.transfer?.sourceChain?.assets?.find( - d => d.denom === $validation.transfer?.asset.address + d => d.denom === $validation.transfer?.asset.metadata.denom ) ?? null, amount: parsedAmount } @@ -643,7 +643,7 @@ let stepperSteps = derived(
ASSET: - {truncate($validation.transfer.asset.address, 6)} + {truncate($validation.transfer.asset.metadata.denom, 6)}
AMOUNT: diff --git a/app/src/lib/components/TransferFrom/components/SelectedAsset.svelte b/app/src/lib/components/TransferFrom/components/SelectedAsset.svelte index 34a27e539f..e80550369e 100644 --- a/app/src/lib/components/TransferFrom/components/SelectedAsset.svelte +++ b/app/src/lib/components/TransferFrom/components/SelectedAsset.svelte @@ -1,22 +1,22 @@
@@ -28,10 +28,13 @@ export let onSelectAsset: Props["onSelectAsset"] class="border-2 font-bold" on:click={onSelectAsset} > - {$intents.selectedAsset.symbol ? - truncate($intents.selectedAsset.symbol, 18) : - $rawIntents.asset ? truncate($rawIntents.asset, 6) : - "Select Asset"} + {#if $intents.selectedAsset} + {truncate($intents.selectedAsset.metadata.display_symbol || $intents.selectedAsset.metadata.denom, 18)} + {:else if $rawIntents.asset} + {truncate($rawIntents.asset, 6)} + {:else} + Select Asset + {/if} {#if $validation.errors.asset}

{$validation.errors.asset}

diff --git a/app/src/lib/components/TransferFrom/index.svelte b/app/src/lib/components/TransferFrom/index.svelte index a0b1f15363..1dd2668b2d 100644 --- a/app/src/lib/components/TransferFrom/index.svelte +++ b/app/src/lib/components/TransferFrom/index.svelte @@ -7,18 +7,14 @@ import Chains from "$lib/components/TransferFrom/components/Cube/faces/Chains.sv import Assets from "$lib/components/TransferFrom/components/Cube/faces/Assets.svelte" import Transfer from "$lib/components/TransferFrom/components/Cube/faces/Transfer.svelte" import Cube from "$lib/components/TransferFrom/components/Cube/index.svelte" -import type { Chain, UserAddresses } from "$lib/types.ts" -import { userBalancesQuery } from "$lib/queries/balance" +import type { Chain } from "$lib/types.ts" +import { allChainBalances } from "$lib/queries/balance" import { balanceStore, userAddress } from "$lib/components/TransferFrom/transfer/balances.ts" export let chains: Array -$: userBalancesQuery({ - chains, - userAddr: $userAddress, - connected: true -}).subscribe(x => { - balanceStore.set(x) +$: allChainBalances(chains, userAddress).subscribe(data => { + balanceStore.set(data) }) const stores = createTransferStore(chains) @@ -34,7 +30,7 @@ const stores = createTransferStore(chains)
- +
diff --git a/app/src/lib/components/TransferFrom/transfer/balances.ts b/app/src/lib/components/TransferFrom/transfer/balances.ts index 46884f5c04..135d5c674c 100644 --- a/app/src/lib/components/TransferFrom/transfer/balances.ts +++ b/app/src/lib/components/TransferFrom/transfer/balances.ts @@ -1,10 +1,11 @@ -import { derived, type Readable, writable } from "svelte/store" + import type { UserAddresses } from "$lib/types.ts" import { userAddrCosmos } from "$lib/wallet/cosmos" import { userAddrEvm } from "$lib/wallet/evm" import { userAddressAptos } from "$lib/wallet/aptos" import type { QueryObserverResult } from "@tanstack/query-core" -import type { BalanceResult } from "$lib/queries/balance" +import type {BalanceData} from "$lib/queries/balance"; +import {derived, type Readable, writable} from "svelte/store"; export let userAddress: Readable = derived( [userAddrCosmos, userAddrEvm, userAddressAptos], @@ -15,4 +16,4 @@ export let userAddress: Readable = derived( }) ) -export const balanceStore = writable, Error>>>() +export const balanceStore = writable([]) \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/transfer/context.ts b/app/src/lib/components/TransferFrom/transfer/context.ts index 00b621ad08..47c78b7a06 100644 --- a/app/src/lib/components/TransferFrom/transfer/context.ts +++ b/app/src/lib/components/TransferFrom/transfer/context.ts @@ -1,20 +1,11 @@ import { derived, type Readable } from "svelte/store" import type { Chain, UserAddresses } from "$lib/types" -import type { Address } from "$lib/wallet/types" import { balanceStore, userAddress } from "./balances.ts" -import type { BalanceResult } from "$lib/queries/balance" -import type { QueryObserverResult } from "@tanstack/query-core" - -export type BalanceRecord = { - balance: bigint - gasToken: boolean - address: Address - symbol: string -} +import type { BalanceData } from "$lib/queries/balance" export type ChainBalances = { chainId: string - balances: Array + balances: Array } export type BalancesList = Array @@ -27,8 +18,8 @@ export interface ContextStore { export function createContextStore(chains: Array): Readable { const balances = derived( - balanceStore as Readable, Error>>>, - $rawBalances => { + balanceStore, + ($rawBalances: BalanceData[][]) => { if ($rawBalances?.length === 0) { return chains.map(chain => ({ chainId: chain.chain_id, @@ -37,10 +28,9 @@ export function createContextStore(chains: Array): Readable } return chains.map((chain, chainIndex) => { - const balanceResult = $rawBalances[chainIndex] + const chainBalances = $rawBalances[chainIndex] - if (!(balanceResult?.isSuccess && balanceResult.data)) { - console.log(`No balances fetched yet for chain ${chain.chain_id}`) + if (!chainBalances || chainBalances.length === 0) { return { chainId: chain.chain_id, balances: [] @@ -49,13 +39,7 @@ export function createContextStore(chains: Array): Readable return { chainId: chain.chain_id, - balances: balanceResult.data.map((balance: BalanceResult) => ({ - ...balance, - balance: BigInt(balance.balance), - gasToken: "gasToken" in balance ? (balance.gasToken ?? false) : false, - address: balance.address as Address, - symbol: balance.symbol || balance.address - })) + balances: chainBalances } }) } @@ -66,4 +50,4 @@ export function createContextStore(chains: Array): Readable userAddress: $userAddress, balances: $balances })) -} +} \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/transfer/intents.ts b/app/src/lib/components/TransferFrom/transfer/intents.ts index 7fe44f86f4..f135e8b67d 100644 --- a/app/src/lib/components/TransferFrom/transfer/intents.ts +++ b/app/src/lib/components/TransferFrom/transfer/intents.ts @@ -1,28 +1,16 @@ import { derived, type Readable } from "svelte/store" -import type { Chain, ChainAsset } from "$lib/types" -import { useQueryClient } from "@tanstack/svelte-query" -import { getSupportedAsset } from "$lib/utilities/helpers.ts" +import type { Chain } from "$lib/types" import type { RawIntentsStore } from "$lib/components/TransferFrom/transfer/raw-intents.ts" -import type { ContextStore, BalanceRecord } from "$lib/components/TransferFrom/transfer/context.ts" +import type { ContextStore } from "$lib/components/TransferFrom/transfer/context.ts" import { showUnsupported } from "$lib/stores/user.ts" import { get } from "svelte/store" +import type { BalanceData } from "$lib/queries/balance" -export type AssetListItem = { - balance: BalanceRecord - isSupported: boolean - supportedAsset?: ChainAsset - symbol: string +export type AssetListItem = BalanceData & { sourceChain: Chain } -export interface SelectedAsset { - address: string | null - balance: bigint | null - symbol: string | null - decimals: number - gasToken: boolean - supported: ChainAsset | null -} +export type SelectedAsset = BalanceData | null export interface IntentsStore { sourceChain: Chain | null @@ -33,18 +21,10 @@ export interface IntentsStore { amount: string } -const getDisplaySymbol = ( - balance: BalanceRecord | undefined, - supportedAsset: ChainAsset | undefined -): string | undefined => - supportedAsset?.display_symbol || balance?.symbol || balance?.address || undefined - export function createIntentStore( rawIntents: RawIntentsStore, context: Readable ): Readable { - const queryClient = useQueryClient() - const sourceChain = derived([rawIntents, context], ([$intents, $context]) => { return $context.chains.find(chain => chain.chain_id === $intents.source) ?? null }) @@ -55,7 +35,6 @@ export function createIntentStore( $context.chains.find(chain => chain.chain_id === $intents.destination) ?? null ) - //Assets of selected chain const sourceAssets = derived([context, sourceChain], ([$context, $sourceChain]) => { if (!$sourceChain) return [] @@ -63,44 +42,20 @@ export function createIntentStore( $context.balances.find(chain => chain.chainId === $sourceChain.chain_id)?.balances || [] return chainBalances - .map(balance => { - const supportedAsset = getSupportedAsset($sourceChain, balance.address) - const isSupported = Boolean(supportedAsset) - - if (!(get(showUnsupported) || isSupported)) return null - - return { - balance, - isSupported, - supportedAsset, - symbol: getDisplaySymbol(balance, supportedAsset) || balance.address, - sourceChain: $sourceChain - } - }) - .filter(Boolean) as Array + .filter(balance => get(showUnsupported) || balance.metadata.metadata_level !== "none") + .map(balance => ({ + ...balance, + sourceChain: $sourceChain + })) }) - // Find the specific asset in the source chain assets - const asset = derived( + const selectedAsset = derived( [sourceAssets, rawIntents], - ([$assets, $intents]) => $assets.find(x => x.balance.address === $intents.asset)?.balance + ([$sourceAssets, $rawIntents]) => { + return $sourceAssets.find(x => x.metadata.denom === $rawIntents.asset) ?? null + } ) - //Get supported asset info (if supported) - const supportedAsset = derived([sourceChain, asset], ([$sourceChain, $asset]) => - $sourceChain && $asset ? getSupportedAsset($sourceChain, $asset.address) : undefined - ) - - //Create th selected asset with all info - const selectedAsset = derived([asset, supportedAsset], ([$asset, $supportedAsset]) => ({ - address: $asset?.address ?? "", - balance: $asset?.balance ?? 0n, - symbol: getDisplaySymbol($asset, $supportedAsset) ?? "", - decimals: $supportedAsset?.decimals ?? 0, - gasToken: $asset?.gasToken ?? false, - supported: $supportedAsset ?? null - })) - return derived( [sourceChain, destinationChain, selectedAsset, sourceAssets, rawIntents], ([$sourceChain, $destinationChain, $selectedAsset, $sourceAssets, $rawIntents]) => ({ @@ -112,4 +67,4 @@ export function createIntentStore( amount: $rawIntents.amount }) ) -} +} \ No newline at end of file diff --git a/app/src/lib/components/TransferFrom/transfer/validation.ts b/app/src/lib/components/TransferFrom/transfer/validation.ts index c753df1ddc..f7b02b425a 100644 --- a/app/src/lib/components/TransferFrom/transfer/validation.ts +++ b/app/src/lib/components/TransferFrom/transfer/validation.ts @@ -1,7 +1,7 @@ import type { Readable } from "svelte/store" import { derived } from "svelte/store" -import type { IntentsStore } from "./intents.ts" -import type { Chain, ChainAsset } from "$lib/types" +import type { IntentsStore, SelectedAsset } from "./intents.ts" +import type { Chain } from "$lib/types" import type { ContextStore } from "$lib/components/TransferFrom/transfer/context" import { isHex, parseUnits } from "viem" import { @@ -19,14 +19,7 @@ export type FieldErrors = Partial> export interface ValidTransfer { sourceChain: Chain destinationChain: Chain - asset: { - address: string - balance: bigint - symbol: string - decimals: number - gasToken: boolean - supported: ChainAsset - } + asset: SelectedAsset receiver: string amount: string sender: string @@ -81,18 +74,18 @@ export function createValidationStore( // Required fields when asset is selected if ($rawIntents.asset) { - if (!$intents.selectedAsset.address) errors.asset = "Asset not found in wallet" + if (!$intents.selectedAsset) errors.asset = "Asset not found in wallet" if (!$rawIntents.amount) errors.amount = "Amount is required" if (!$rawIntents.receiver) errors.receiver = "Receiver is required" // Amount validation - if ($rawIntents.amount) { + if ($rawIntents.amount && $intents.selectedAsset) { try { - const parsedAmount = parseUnits($rawIntents.amount, $intents.selectedAsset.decimals ?? 0) + const parsedAmount = parseUnits($rawIntents.amount, $intents.selectedAsset.metadata.decimals ?? 0) if (parsedAmount <= 0n) { errors.amount = "Amount must be greater than 0" } - if (parsedAmount > ($intents.selectedAsset.balance ?? 0n)) { + if (parsedAmount > BigInt($intents.selectedAsset.balance)) { errors.amount = "Amount exceeds balance" } } catch { @@ -131,10 +124,7 @@ export function createValidationStore( !( $intents.sourceChain && $intents.destinationChain && - $intents.selectedAsset.address && - $intents.selectedAsset.balance && - $intents.selectedAsset.symbol && - $intents.selectedAsset.supported + $intents.selectedAsset ) ) { return undefined @@ -146,20 +136,14 @@ export function createValidationStore( return { sourceChain: $intents.sourceChain, destinationChain: $intents.destinationChain, - asset: { - address: $intents.selectedAsset.address, - balance: $intents.selectedAsset.balance, - symbol: $intents.selectedAsset.symbol, - decimals: $intents.selectedAsset.decimals, - gasToken: $intents.selectedAsset.gasToken, - supported: $intents.selectedAsset.supported - }, + asset: $intents.selectedAsset, receiver: $rawIntents.receiver, amount: $rawIntents.amount, sender } as ValidTransfer } ) + return derived([transfer, errors], ([$transfer, $errors]): ValidationStore => { const isValid = $transfer !== undefined @@ -167,4 +151,4 @@ export function createValidationStore( ? { transfer: $transfer as ValidTransfer, errors: $errors, isValid: true } : { transfer: undefined, errors: $errors, isValid: false } }) -} +} \ No newline at end of file diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index e033d68b5c..b4d8a2f60b 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -1,26 +1,25 @@ -import { writable, derived, type Readable } from "svelte/store" -import { bech32ToBech32Address } from "@unionlabs/client" -import { type Address, isAddress } from "viem" -import type { Chain, ChainAsset, UserAddresses } from "$lib/types" -import { erc20ReadMulticall } from "./evm/multicall.ts" -import { getCosmosChainBalances } from "./cosmos.ts" -import { getAptosChainBalances } from "./aptos.ts" -import { createQueries } from "@tanstack/svelte-query" -import type { QueryObserverResult } from "@tanstack/query-core" +import {derived, type Readable, writable} from "svelte/store" +import {bech32ToBech32Address} from "@unionlabs/client" +import {type Address, isAddress} from "viem" +import type {Chain, ChainAsset, UserAddresses} from "$lib/types" +import {erc20ReadMulticall} from "./evm/multicall.ts" +import {getCosmosChainBalances} from "./cosmos.ts" +import {getAptosChainBalances} from "./aptos.ts" +import {createQueries} from "@tanstack/svelte-query" +import type {QueryObserverResult} from "@tanstack/query-core" export type AssetMetadata = { - balance: string denom: string display_symbol: string | null display_name: string | null - decimals: number | null + decimals: number gasToken: boolean + chain_id: string metadata_level: "graphql" | "onchain" | "none" } - export type BalanceData = { - denom: string - balance: string + balance: string; + metadata: AssetMetadata } function normalizeAddress(denom: string): string { @@ -36,7 +35,7 @@ export async function getAssetInfo(chain: Chain, denom: string): Promise isAddress(denom)).map(normalizeAddress) : chain.assets - .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) - .map(asset => normalizeAddress(asset.denom)) + .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) + .map(asset => normalizeAddress(asset.denom)) const results = await erc20ReadMulticall({ chainId: chain.chain_id, @@ -113,12 +112,16 @@ export async function getUserBalances( contractAddresses: contractAddresses as Array
}) - return results - .map((result, index) => ({ - denom: normalizeAddress(contractAddresses[index]), - balance: result.balance?.toString() ?? "0" - })) - .filter(result => BigInt(result.balance) > 0n) + const balances = await Promise.all(results + .map(async (result, index) => { + const denom = normalizeAddress(contractAddresses[index]); + const balance = result.balance?.toString() ?? "0"; + const metadata = await getAssetInfo(chain, denom); + return { balance, metadata }; + }) + ); + + return balances.filter(result => BigInt(result.balance) > 0n); } if (chain.rpc_type === "cosmos") { @@ -138,10 +141,10 @@ export async function getUserBalances( walletAddress: bech32Address }) - return balances.map(balance => ({ - denom: normalizeAddress(balance.address), - balance: balance.balance.toString() - })) + return Promise.all(balances.map(async balance => ({ + balance: balance.balance.toString(), + metadata: await getAssetInfo(chain, normalizeAddress(balance.address)) + }))) } if (chain.rpc_type === "aptos") { @@ -156,10 +159,10 @@ export async function getUserBalances( walletAddress: address }) - return balances.map(balance => ({ - denom: normalizeAddress(balance.address), - balance: balance.balance.toString() - })) + return Promise.all(balances.map(async balance => ({ + balance: balance.balance.toString(), + metadata: await getAssetInfo(chain, normalizeAddress(balance.address)) + }))) } return [] @@ -185,10 +188,10 @@ function getAddressForChain(chain: Chain, addresses: UserAddresses): string | nu export function createChainBalances( chain: Chain, addressStore: Readable -): Readable> { - const balanceStore = writable>([]) +): Readable> { + const balanceStore = writable>([]) - return derived, Array>( + return derived, Array>( addressStore, ($addresses, set) => { const address = getAddressForChain(chain, $addresses) @@ -198,14 +201,17 @@ export function createChainBalances( return } - const initialBalances: Array = chain.assets.map(asset => ({ + const initialBalances: Array = chain.assets.map(asset => ({ balance: "0", - denom: asset.denom, - display_symbol: asset.display_symbol || null, - display_name: asset.display_name || null, - decimals: asset.decimals !== undefined ? asset.decimals : null, - gasToken: asset.gas_token, - metadata_level: "none" + metadata: { + denom: asset.denom, + display_symbol: asset.display_symbol || null, + display_name: asset.display_name || null, + decimals: asset.decimals !== undefined ? asset.decimals : 0, + gasToken: asset.gas_token, + chain_id: chain.chain_id, + metadata_level: "none" + } })) balanceStore.set(initialBalances) set(initialBalances) @@ -218,23 +224,17 @@ export function createChainBalances( queryFn: async () => { try { const balances = await getUserBalances(chain, address) - const enrichedBalances = await Promise.all( - balances.map(async ({ denom, balance }) => { - const assetInfo = await getAssetInfo(chain, denom) - return { ...assetInfo, balance, denom } - }) - ) // Merge with placeholder balances to ensure all assets are represented const mergedBalances = initialBalances.map(placeholder => { - const enriched = enrichedBalances.find(b => b.denom === placeholder.denom) + const enriched = balances.find(b => b.metadata.denom === placeholder.metadata.denom) return enriched || placeholder }) // Add any new tokens discovered that weren't in the original asset list - enrichedBalances.forEach(enriched => { - if (!mergedBalances.some(b => b.denom === enriched.denom)) { - mergedBalances.push(enriched) + balances.forEach(balance => { + if (!mergedBalances.some(b => b.metadata.denom === balance.metadata.denom)) { + mergedBalances.push(balance) } }) @@ -243,11 +243,14 @@ export function createChainBalances( .map(balance => ({ ...balance, balance: balance.balance === "Loading..." ? "0" : balance.balance, - decimals: balance.decimals !== null ? balance.decimals : 18 // Default to 18 if decimals is null + metadata: { + ...balance.metadata, + decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18 // Default to 18 if decimals is null + } })) .sort((a, b) => { - const aValue = BigInt(a.balance) * BigInt(10 ** (18 - a.decimals)) - const bValue = BigInt(b.balance) * BigInt(10 ** (18 - b.decimals)) + const aValue = BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) + const bValue = BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) return bValue > aValue ? 1 : -1 }) } catch (error) { @@ -259,7 +262,7 @@ export function createChainBalances( } ] }).subscribe(results => { - const queryResult = results[0] as QueryObserverResult, Error> + const queryResult = results[0] as QueryObserverResult, Error> if (queryResult.data) { balanceStore.set(queryResult.data) set(queryResult.data) @@ -268,7 +271,7 @@ export function createChainBalances( return balanceStore.subscribe(set) }, - [] as Array + [] as Array ) } @@ -276,4 +279,4 @@ export function allChainBalances(chains: Array, addressStore: Readable createChainBalances(chain, addressStore)) return derived(chainStores, $chainStores => $chainStores) -} +} \ No newline at end of file diff --git a/app/src/routes/balances/UserBalances.svelte b/app/src/routes/balances/UserBalances.svelte index 0a21fa42b0..19b44f2a4b 100644 --- a/app/src/routes/balances/UserBalances.svelte +++ b/app/src/routes/balances/UserBalances.svelte @@ -1,44 +1,44 @@
@@ -57,13 +57,13 @@ function formatBalance(balance: string, decimals: number | null): string { {#each chainAssets as asset}
- {asset.display_symbol ?? asset.denom} - {#if asset.display_name} + {asset.metadata.display_symbol ?? asset.metadata.denom} + {#if asset.metadata.display_name} - ({asset.display_name}) + ({asset.metadata.display_name}) {/if} - {#if asset.gasToken} + {#if asset.metadata.gasToken} Gas Token @@ -71,10 +71,10 @@ function formatBalance(balance: string, decimals: number | null): string {
- {formatBalance(asset.balance, asset.decimals)} + {formatBalance(asset.balance, asset.metadata.decimals)}
- {asset.metadata_level} + {asset.metadata.metadata_level}
From d2a83c00516543ade029585d074c17da1f47a6de Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 17:39:45 +0100 Subject: [PATCH 05/15] chore(app): pre commit --- .../components/Cube/faces/Assets.svelte | 40 +++++----- .../components/Cube/faces/Chains.svelte | 50 ++++++------ .../components/Cube/faces/Intent.svelte | 4 +- .../components/Cube/faces/Transfer.svelte | 5 +- .../components/SelectedAsset.svelte | 32 ++++---- .../TransferFrom/transfer/balances.ts | 8 +- .../TransferFrom/transfer/context.ts | 43 +++++----- .../TransferFrom/transfer/intents.ts | 11 +-- .../TransferFrom/transfer/validation.ts | 15 ++-- app/src/lib/queries/balance/index.ts | 80 ++++++++++--------- app/src/routes/balances/UserBalances.svelte | 68 ++++++++-------- 11 files changed, 177 insertions(+), 179 deletions(-) diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte index bbb7a20380..9bf86a41ba 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte @@ -1,29 +1,29 @@
diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte index 0a8a105697..3c5183f7f5 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Chains.svelte @@ -1,37 +1,37 @@
diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte index 97bdc872a1..5a916b9085 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Intent.svelte @@ -2,9 +2,7 @@ import Direction from "$lib/components/TransferFrom/components/Direction.svelte" import SelectedAsset from "$lib/components/TransferFrom/components/SelectedAsset.svelte" import type { Readable } from "svelte/store" -import type { - ValidationStore, -} from "$lib/components/TransferFrom/transfer/validation.ts" +import type { ValidationStore } from "$lib/components/TransferFrom/transfer/validation.ts" import { Button } from "$lib/components/ui/button" import type { IntentsStore } from "$lib/components/TransferFrom/transfer/intents.ts" import type { CubeFaces } from "$lib/components/TransferFrom/components/Cube/types.ts" diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte index 1f55a2ce92..49f9b34122 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Transfer.svelte @@ -50,7 +50,10 @@ let transferState: Writable = writable({ kind: "PRE_TRANSFER" }) const transfer = async () => { if (!$validation.isValid) return - let parsedAmount = parseUnits($validation.transfer.amount, $validation.transfer.asset.metadata.decimals) + let parsedAmount = parseUnits( + $validation.transfer.amount, + $validation.transfer.asset.metadata.decimals + ) /** --- APTOS START --- */ if ($validation.transfer.sourceChain.rpc_type === "aptos") { diff --git a/app/src/lib/components/TransferFrom/components/SelectedAsset.svelte b/app/src/lib/components/TransferFrom/components/SelectedAsset.svelte index e80550369e..84f5814d52 100644 --- a/app/src/lib/components/TransferFrom/components/SelectedAsset.svelte +++ b/app/src/lib/components/TransferFrom/components/SelectedAsset.svelte @@ -1,22 +1,22 @@
diff --git a/app/src/lib/components/TransferFrom/transfer/balances.ts b/app/src/lib/components/TransferFrom/transfer/balances.ts index 135d5c674c..a5748a28b9 100644 --- a/app/src/lib/components/TransferFrom/transfer/balances.ts +++ b/app/src/lib/components/TransferFrom/transfer/balances.ts @@ -1,11 +1,9 @@ - import type { UserAddresses } from "$lib/types.ts" import { userAddrCosmos } from "$lib/wallet/cosmos" import { userAddrEvm } from "$lib/wallet/evm" import { userAddressAptos } from "$lib/wallet/aptos" -import type { QueryObserverResult } from "@tanstack/query-core" -import type {BalanceData} from "$lib/queries/balance"; -import {derived, type Readable, writable} from "svelte/store"; +import type { BalanceData } from "$lib/queries/balance" +import { derived, type Readable, writable } from "svelte/store" export let userAddress: Readable = derived( [userAddrCosmos, userAddrEvm, userAddressAptos], @@ -16,4 +14,4 @@ export let userAddress: Readable = derived( }) ) -export const balanceStore = writable([]) \ No newline at end of file +export const balanceStore = writable>>([]) diff --git a/app/src/lib/components/TransferFrom/transfer/context.ts b/app/src/lib/components/TransferFrom/transfer/context.ts index 47c78b7a06..d9478583bc 100644 --- a/app/src/lib/components/TransferFrom/transfer/context.ts +++ b/app/src/lib/components/TransferFrom/transfer/context.ts @@ -17,37 +17,34 @@ export interface ContextStore { } export function createContextStore(chains: Array): Readable { - const balances = derived( - balanceStore, - ($rawBalances: BalanceData[][]) => { - if ($rawBalances?.length === 0) { - return chains.map(chain => ({ - chainId: chain.chain_id, - balances: [] - })) - } - - return chains.map((chain, chainIndex) => { - const chainBalances = $rawBalances[chainIndex] + const balances = derived(balanceStore, ($rawBalances: Array>) => { + if ($rawBalances?.length === 0) { + return chains.map(chain => ({ + chainId: chain.chain_id, + balances: [] + })) + } - if (!chainBalances || chainBalances.length === 0) { - return { - chainId: chain.chain_id, - balances: [] - } - } + return chains.map((chain, chainIndex) => { + const chainBalances = $rawBalances[chainIndex] + if (!chainBalances || chainBalances.length === 0) { return { chainId: chain.chain_id, - balances: chainBalances + balances: [] } - }) - } - ) as Readable + } + + return { + chainId: chain.chain_id, + balances: chainBalances + } + }) + }) as Readable return derived([userAddress, balances], ([$userAddress, $balances]) => ({ chains, userAddress: $userAddress, balances: $balances })) -} \ No newline at end of file +} diff --git a/app/src/lib/components/TransferFrom/transfer/intents.ts b/app/src/lib/components/TransferFrom/transfer/intents.ts index f135e8b67d..b47ad4cfd9 100644 --- a/app/src/lib/components/TransferFrom/transfer/intents.ts +++ b/app/src/lib/components/TransferFrom/transfer/intents.ts @@ -49,12 +49,9 @@ export function createIntentStore( })) }) - const selectedAsset = derived( - [sourceAssets, rawIntents], - ([$sourceAssets, $rawIntents]) => { - return $sourceAssets.find(x => x.metadata.denom === $rawIntents.asset) ?? null - } - ) + const selectedAsset = derived([sourceAssets, rawIntents], ([$sourceAssets, $rawIntents]) => { + return $sourceAssets.find(x => x.metadata.denom === $rawIntents.asset) ?? null + }) return derived( [sourceChain, destinationChain, selectedAsset, sourceAssets, rawIntents], @@ -67,4 +64,4 @@ export function createIntentStore( amount: $rawIntents.amount }) ) -} \ No newline at end of file +} diff --git a/app/src/lib/components/TransferFrom/transfer/validation.ts b/app/src/lib/components/TransferFrom/transfer/validation.ts index f7b02b425a..b5b9d12b70 100644 --- a/app/src/lib/components/TransferFrom/transfer/validation.ts +++ b/app/src/lib/components/TransferFrom/transfer/validation.ts @@ -81,7 +81,10 @@ export function createValidationStore( // Amount validation if ($rawIntents.amount && $intents.selectedAsset) { try { - const parsedAmount = parseUnits($rawIntents.amount, $intents.selectedAsset.metadata.decimals ?? 0) + const parsedAmount = parseUnits( + $rawIntents.amount, + $intents.selectedAsset.metadata.decimals ?? 0 + ) if (parsedAmount <= 0n) { errors.amount = "Amount must be greater than 0" } @@ -120,13 +123,7 @@ export function createValidationStore( ([$rawIntents, $intents, $context, $errors]) => { if (Object.keys($errors).length > 0) return undefined - if ( - !( - $intents.sourceChain && - $intents.destinationChain && - $intents.selectedAsset - ) - ) { + if (!($intents.sourceChain && $intents.destinationChain && $intents.selectedAsset)) { return undefined } @@ -151,4 +148,4 @@ export function createValidationStore( ? { transfer: $transfer as ValidTransfer, errors: $errors, isValid: true } : { transfer: undefined, errors: $errors, isValid: false } }) -} \ No newline at end of file +} diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index b4d8a2f60b..05c123b66c 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -1,12 +1,12 @@ -import {derived, type Readable, writable} from "svelte/store" -import {bech32ToBech32Address} from "@unionlabs/client" -import {type Address, isAddress} from "viem" -import type {Chain, ChainAsset, UserAddresses} from "$lib/types" -import {erc20ReadMulticall} from "./evm/multicall.ts" -import {getCosmosChainBalances} from "./cosmos.ts" -import {getAptosChainBalances} from "./aptos.ts" -import {createQueries} from "@tanstack/svelte-query" -import type {QueryObserverResult} from "@tanstack/query-core" +import { derived, type Readable, writable } from "svelte/store" +import { bech32ToBech32Address } from "@unionlabs/client" +import { type Address, isAddress } from "viem" +import type { Chain, ChainAsset, UserAddresses } from "$lib/types" +import { erc20ReadMulticall } from "./evm/multicall.ts" +import { getCosmosChainBalances } from "./cosmos.ts" +import { getAptosChainBalances } from "./aptos.ts" +import { createQueries } from "@tanstack/svelte-query" +import type { QueryObserverResult } from "@tanstack/query-core" export type AssetMetadata = { denom: string @@ -18,7 +18,7 @@ export type AssetMetadata = { metadata_level: "graphql" | "onchain" | "none" } export type BalanceData = { - balance: string; + balance: string metadata: AssetMetadata } @@ -35,7 +35,7 @@ export async function getAssetInfo(chain: Chain, denom: string): Promise isAddress(denom)).map(normalizeAddress) : chain.assets - .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) - .map(asset => normalizeAddress(asset.denom)) + .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) + .map(asset => normalizeAddress(asset.denom)) const results = await erc20ReadMulticall({ chainId: chain.chain_id, @@ -112,16 +112,16 @@ export async function getUserBalances( contractAddresses: contractAddresses as Array
}) - const balances = await Promise.all(results - .map(async (result, index) => { - const denom = normalizeAddress(contractAddresses[index]); - const balance = result.balance?.toString() ?? "0"; - const metadata = await getAssetInfo(chain, denom); - return { balance, metadata }; + const balances = await Promise.all( + results.map(async (result, index) => { + const denom = normalizeAddress(contractAddresses[index]) + const balance = result.balance?.toString() ?? "0" + const metadata = await getAssetInfo(chain, denom) + return { balance, metadata } }) - ); + ) - return balances.filter(result => BigInt(result.balance) > 0n); + return balances.filter(result => BigInt(result.balance) > 0n) } if (chain.rpc_type === "cosmos") { @@ -141,10 +141,12 @@ export async function getUserBalances( walletAddress: bech32Address }) - return Promise.all(balances.map(async balance => ({ - balance: balance.balance.toString(), - metadata: await getAssetInfo(chain, normalizeAddress(balance.address)) - }))) + return Promise.all( + balances.map(async balance => ({ + balance: balance.balance.toString(), + metadata: await getAssetInfo(chain, normalizeAddress(balance.address)) + })) + ) } if (chain.rpc_type === "aptos") { @@ -159,10 +161,12 @@ export async function getUserBalances( walletAddress: address }) - return Promise.all(balances.map(async balance => ({ - balance: balance.balance.toString(), - metadata: await getAssetInfo(chain, normalizeAddress(balance.address)) - }))) + return Promise.all( + balances.map(async balance => ({ + balance: balance.balance.toString(), + metadata: await getAssetInfo(chain, normalizeAddress(balance.address)) + })) + ) } return [] @@ -227,7 +231,9 @@ export function createChainBalances( // Merge with placeholder balances to ensure all assets are represented const mergedBalances = initialBalances.map(placeholder => { - const enriched = balances.find(b => b.metadata.denom === placeholder.metadata.denom) + const enriched = balances.find( + b => b.metadata.denom === placeholder.metadata.denom + ) return enriched || placeholder }) @@ -249,8 +255,10 @@ export function createChainBalances( } })) .sort((a, b) => { - const aValue = BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) - const bValue = BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) + const aValue = + BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) + const bValue = + BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) return bValue > aValue ? 1 : -1 }) } catch (error) { @@ -279,4 +287,4 @@ export function allChainBalances(chains: Array, addressStore: Readable createChainBalances(chain, addressStore)) return derived(chainStores, $chainStores => $chainStores) -} \ No newline at end of file +} diff --git a/app/src/routes/balances/UserBalances.svelte b/app/src/routes/balances/UserBalances.svelte index 19b44f2a4b..e01a45a128 100644 --- a/app/src/routes/balances/UserBalances.svelte +++ b/app/src/routes/balances/UserBalances.svelte @@ -1,44 +1,44 @@
From b044afe943d569a49989caceda0b07d1ba25c0fd Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 18:08:44 +0100 Subject: [PATCH 06/15] refactor(app): change asset list --- .../components/Cube/faces/Assets.svelte | 84 +++++++++++++------ app/src/lib/queries/balance/index.ts | 1 - 2 files changed, 59 insertions(+), 26 deletions(-) diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte index 9bf86a41ba..395102349a 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte @@ -1,34 +1,64 @@
- Assets +
+ Assets + +
- {#if $intents.sourceAssets.length} + {#if $filteredAssets.length}
- {#each $intents.sourceAssets as asset (asset.metadata.denom)} + {#each $filteredAssets as asset (asset.metadata.denom)}
+ {#if asset.error} +

{asset.error.message}

+ {/if}
{/each}
diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index 05c123b66c..a61379f209 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -127,7 +127,6 @@ export async function getUserBalances( if (chain.rpc_type === "cosmos") { const restEndpoint = chain.rpcs.find(rpc => rpc.type === "rest")?.url if (!restEndpoint) { - console.error(`No REST endpoint found for chain ${chain.chain_id}`) return [] } From c8ca63abeae1614b10e0c3193a0ca2b9ca187dc6 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 18:54:04 +0100 Subject: [PATCH 07/15] refactor(app): reactivity issues --- app/src/generated/graphql-env.d.ts | 4 +- app/src/lib/queries/balance/index.ts | 204 +++++++++++++++------------ 2 files changed, 117 insertions(+), 91 deletions(-) diff --git a/app/src/generated/graphql-env.d.ts b/app/src/generated/graphql-env.d.ts index 3b3710b9f6..5d5a32d4aa 100644 --- a/app/src/generated/graphql-env.d.ts +++ b/app/src/generated/graphql-env.d.ts @@ -15,6 +15,8 @@ export type introspection_types = { 'String_comparison_exp': { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; isOneOf: false; inputFields: [{ name: '_eq'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_gt'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_gte'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_ilike'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; defaultValue: null }, { name: '_iregex'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_is_null'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: '_like'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_lt'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_lte'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_neq'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_nilike'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_nin'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; defaultValue: null }, { name: '_niregex'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_nlike'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_nregex'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_nsimilar'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_regex'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_similar'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; 'bigint': unknown; 'bigint_comparison_exp': { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; isOneOf: false; inputFields: [{ name: '_eq'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: '_gt'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: '_gte'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: '_in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; }; }; defaultValue: null }, { name: '_is_null'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: '_lt'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: '_lte'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: '_neq'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: '_nin'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; }; }; defaultValue: null }]; }; + 'bytea': unknown; + 'bytea_comparison_exp': { kind: 'INPUT_OBJECT'; name: 'bytea_comparison_exp'; isOneOf: false; inputFields: [{ name: '_eq'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; defaultValue: null }, { name: '_gt'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; defaultValue: null }, { name: '_gte'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; defaultValue: null }, { name: '_in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; }; }; defaultValue: null }, { name: '_is_null'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: '_lt'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; defaultValue: null }, { name: '_lte'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; defaultValue: null }, { name: '_neq'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; defaultValue: null }, { name: '_nin'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; }; }; defaultValue: null }]; }; 'cursor_ordering': { name: 'cursor_ordering'; enumValues: 'ASC' | 'DESC'; }; 'date': unknown; 'date_comparison_exp': { kind: 'INPUT_OBJECT'; name: 'date_comparison_exp'; isOneOf: false; inputFields: [{ name: '_eq'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; }; defaultValue: null }, { name: '_gt'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; }; defaultValue: null }, { name: '_gte'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; }; defaultValue: null }, { name: '_in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'date'; ofType: null; }; }; }; defaultValue: null }, { name: '_is_null'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: '_lt'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; }; defaultValue: null }, { name: '_lte'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; }; defaultValue: null }, { name: '_neq'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; }; defaultValue: null }, { name: '_nin'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'date'; ofType: null; }; }; }; defaultValue: null }]; }; @@ -190,7 +192,7 @@ export type introspection_types = { 'v1_ibc_union_packets_view_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_order_by'; isOneOf: false; inputFields: [{ name: 'acknowledgement'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_packets_view_select_column': { name: 'v1_ibc_union_packets_view_select_column'; enumValues: 'acknowledgement' | 'acknowledgement_decoded' | 'channel_version' | 'data' | 'data_decoded' | 'destination_chain_id' | 'destination_channel_id' | 'destination_connection_id' | 'destination_port_id' | 'packet_ack_block_hash' | 'packet_ack_event_index' | 'packet_ack_height' | 'packet_ack_maker' | 'packet_ack_timestamp' | 'packet_ack_transaction_event_index' | 'packet_ack_transaction_hash' | 'packet_ack_transaction_index' | 'packet_recv_block_hash' | 'packet_recv_event_index' | 'packet_recv_height' | 'packet_recv_maker' | 'packet_recv_maker_msg' | 'packet_recv_timestamp' | 'packet_recv_transaction_event_index' | 'packet_recv_transaction_hash' | 'packet_recv_transaction_index' | 'packet_send_block_hash' | 'packet_send_event_index' | 'packet_send_height' | 'packet_send_timestamp' | 'packet_send_transaction_event_index' | 'packet_send_transaction_hash' | 'packet_send_transaction_index' | 'source_chain_id' | 'source_channel_id' | 'source_connection_id' | 'source_port_id' | 'status' | 'timeout_height' | 'timeout_timestamp' | 'write_ack_block_hash' | 'write_ack_event_index' | 'write_ack_height' | 'write_ack_timestamp' | 'write_ack_transaction_event_index' | 'write_ack_transaction_hash' | 'write_ack_transaction_index'; }; 'v1_ibc_union_packets_view_stream_cursor_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_stream_cursor_input'; isOneOf: false; inputFields: [{ name: 'initial_value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_stream_cursor_value_input'; ofType: null; }; }; defaultValue: null }, { name: 'ordering'; type: { kind: 'ENUM'; name: 'cursor_ordering'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_packets_view_stream_cursor_value_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_stream_cursor_value_input'; isOneOf: false; inputFields: [{ name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_packets_view_stream_cursor_value_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_stream_cursor_value_input'; isOneOf: false; inputFields: [{ name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }]; }; 'v1_index_status': { kind: 'OBJECT'; name: 'v1_index_status'; fields: { 'chain': { name: 'chain'; type: { kind: 'OBJECT'; name: 'v1_chains'; ofType: null; } }; 'chain_id': { name: 'chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'display_name': { name: 'display_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'height': { name: 'height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'status': { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'timestamp': { name: 'timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'tip_age_seconds': { name: 'tip_age_seconds'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; } }; }; }; 'v1_index_status_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_index_status_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_index_status_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_index_status_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_index_status_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_chains_bool_exp'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'display_name'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'tip_age_seconds'; type: { kind: 'INPUT_OBJECT'; name: 'numeric_comparison_exp'; ofType: null; }; defaultValue: null }]; }; 'v1_index_status_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_index_status_order_by'; isOneOf: false; inputFields: [{ name: 'chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_chains_order_by'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'display_name'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'tip_age_seconds'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index a61379f209..c3f7915659 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -1,12 +1,13 @@ -import { derived, type Readable, writable } from "svelte/store" -import { bech32ToBech32Address } from "@unionlabs/client" -import { type Address, isAddress } from "viem" -import type { Chain, ChainAsset, UserAddresses } from "$lib/types" -import { erc20ReadMulticall } from "./evm/multicall.ts" -import { getCosmosChainBalances } from "./cosmos.ts" -import { getAptosChainBalances } from "./aptos.ts" -import { createQueries } from "@tanstack/svelte-query" -import type { QueryObserverResult } from "@tanstack/query-core" +import {derived, get, type Readable} from "svelte/store" +import {bech32ToBech32Address} from "@unionlabs/client" +import {type Address, isAddress} from "viem" +import type {Chain, ChainAsset, UserAddresses} from "$lib/types" +import {erc20ReadMulticall} from "./evm/multicall.ts" +import {getCosmosChainBalances} from "./cosmos.ts" +import {getAptosChainBalances} from "./aptos.ts" +import {createQueries} from "@tanstack/svelte-query" +import type {QueryObserverResult} from "@tanstack/query-core" +import {balanceStore} from "$lib/components/TransferFrom/transfer/balances.ts" export type AssetMetadata = { denom: string @@ -17,6 +18,7 @@ export type AssetMetadata = { chain_id: string metadata_level: "graphql" | "onchain" | "none" } + export type BalanceData = { balance: string metadata: AssetMetadata @@ -35,7 +37,7 @@ export async function getAssetInfo(chain: Chain, denom: string): Promise isAddress(denom)).map(normalizeAddress) : chain.assets - .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) - .map(asset => normalizeAddress(asset.denom)) + .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) + .map(asset => normalizeAddress(asset.denom)) const results = await erc20ReadMulticall({ chainId: chain.chain_id, @@ -127,6 +128,7 @@ export async function getUserBalances( if (chain.rpc_type === "cosmos") { const restEndpoint = chain.rpcs.find(rpc => rpc.type === "rest")?.url if (!restEndpoint) { + console.error(`No REST endpoint found for chain ${chain.chain_id}`) return [] } @@ -192,19 +194,10 @@ export function createChainBalances( chain: Chain, addressStore: Readable ): Readable> { - const balanceStore = writable>([]) - return derived, Array>( addressStore, ($addresses, set) => { - const address = getAddressForChain(chain, $addresses) - - if (!address) { - set([]) - return - } - - const initialBalances: Array = chain.assets.map(asset => ({ + const initialBalances = chain.assets.map(asset => ({ balance: "0", metadata: { denom: asset.denom, @@ -213,77 +206,108 @@ export function createChainBalances( decimals: asset.decimals !== undefined ? asset.decimals : 0, gasToken: asset.gas_token, chain_id: chain.chain_id, - metadata_level: "none" + metadata_level: "none" as const } })) - balanceStore.set(initialBalances) - set(initialBalances) - - // Fetch all balances - createQueries({ - queries: [ - { - queryKey: ["balances", chain.chain_id, address], - queryFn: async () => { - try { - const balances = await getUserBalances(chain, address) - - // Merge with placeholder balances to ensure all assets are represented - const mergedBalances = initialBalances.map(placeholder => { - const enriched = balances.find( - b => b.metadata.denom === placeholder.metadata.denom - ) - return enriched || placeholder - }) - // Add any new tokens discovered that weren't in the original asset list - balances.forEach(balance => { - if (!mergedBalances.some(b => b.metadata.denom === balance.metadata.denom)) { - mergedBalances.push(balance) - } - }) - - // Ensure all balance values are valid numbers and sort the balances - return mergedBalances - .map(balance => ({ - ...balance, - balance: balance.balance === "Loading..." ? "0" : balance.balance, - metadata: { - ...balance.metadata, - decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18 // Default to 18 if decimals is null - } - })) - .sort((a, b) => { - const aValue = - BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) - const bValue = - BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) - return bValue > aValue ? 1 : -1 - }) - } catch (error) { - console.error("Error fetching balances:", error) - return initialBalances - } - }, - refetchInterval: 4000 - } - ] - }).subscribe(results => { - const queryResult = results[0] as QueryObserverResult, Error> - if (queryResult.data) { - balanceStore.set(queryResult.data) - set(queryResult.data) - } - }) - - return balanceStore.subscribe(set) + const address = getAddressForChain(chain, $addresses) + set(address ? initialBalances : []) }, [] as Array ) } +let querySubscription: (() => void) | undefined +let lastData: Array> = [] + export function allChainBalances(chains: Array, addressStore: Readable) { - const chainStores = chains.map(chain => createChainBalances(chain, addressStore)) + if (querySubscription) { + querySubscription() + querySubscription = undefined + } - return derived(chainStores, $chainStores => $chainStores) -} + lastData = Array(chains.length).fill([]) + balanceStore.set(lastData) + + const chainStores = chains.map((chain, chainIndex) => { + const store = createChainBalances(chain, addressStore) + + const address = getAddressForChain(chain, get(addressStore)) + if (!address) { + lastData[chainIndex] = [] + balanceStore.set([...lastData]) + return store + } + + querySubscription = createQueries({ + queries: [ + { + queryKey: ["balances", chain.chain_id, address], + queryFn: async () => { + try { + const balances = await getUserBalances(chain, address) + const initialBalances = get(store) + + const mergedBalances = initialBalances.map(placeholder => { + const enriched = balances.find( + b => b.metadata.denom === placeholder.metadata.denom + ) + return enriched || placeholder + }) + + balances.forEach(balance => { + if (!mergedBalances.some(b => b.metadata.denom === balance.metadata.denom)) { + mergedBalances.push(balance) + } + }) + + const sortedBalances = mergedBalances + .map(balance => ({ + ...balance, + balance: balance.balance === "Loading..." ? "0" : balance.balance, + metadata: { + ...balance.metadata, + decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18, + metadata_level: balance.metadata.metadata_level as "graphql" | "onchain" | "none" + } + })) + .sort((a, b) => { + const aValue = + BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) + const bValue = + BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) + return bValue > aValue ? 1 : -1 + }) + + lastData[chainIndex] = sortedBalances + balanceStore.set([...lastData]) + return sortedBalances + + } catch (error) { + console.error("Error fetching balances:", error) + return get(store) + } + }, + refetchInterval: 4000 + } + ] + }).subscribe(results => { + const queryResult = results[0] as QueryObserverResult, Error> + if (queryResult.data) { + lastData[chainIndex] = queryResult.data + balanceStore.set([...lastData]) + } + }) + + return store + }) + + return derived([addressStore, ...chainStores], ([$addresses, ...$chainStores]) => { + const hasAddress = chains.some(chain => getAddressForChain(chain, $addresses)) + if (!hasAddress) { + lastData = Array(chains.length).fill([]) + balanceStore.set(lastData) + } + return $chainStores + }) +} \ No newline at end of file From 807b105228828b406575f60ff4f8086207a475ca Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 19:20:59 +0100 Subject: [PATCH 08/15] refactor(app): reactivity fixes --- .../components/Cube/faces/Assets.svelte | 84 +++------- .../lib/components/TransferFrom/index.svelte | 7 +- .../TransferFrom/transfer/validation.ts | 8 +- app/src/lib/queries/balance/index.ts | 155 +++++++----------- 4 files changed, 93 insertions(+), 161 deletions(-) diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte index 395102349a..f7433906e6 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte @@ -1,64 +1,34 @@
-
- Assets - -
+ Assets
- {#if $filteredAssets.length} + {#if $intents.sourceAssets.length}
- {#each $filteredAssets as asset (asset.metadata.denom)} + {#each $intents.sourceAssets as asset (asset)}
- {#if asset.error} -

{asset.error.message}

- {/if}
{/each}
diff --git a/app/src/lib/components/TransferFrom/index.svelte b/app/src/lib/components/TransferFrom/index.svelte index 1dd2668b2d..0aeeaf78e9 100644 --- a/app/src/lib/components/TransferFrom/index.svelte +++ b/app/src/lib/components/TransferFrom/index.svelte @@ -9,12 +9,13 @@ import Transfer from "$lib/components/TransferFrom/components/Cube/faces/Transfe import Cube from "$lib/components/TransferFrom/components/Cube/index.svelte" import type { Chain } from "$lib/types.ts" import { allChainBalances } from "$lib/queries/balance" -import { balanceStore, userAddress } from "$lib/components/TransferFrom/transfer/balances.ts" +import { userAddress } from "$lib/components/TransferFrom/transfer/balances.ts" export let chains: Array -$: allChainBalances(chains, userAddress).subscribe(data => { - balanceStore.set(data) +const balances = allChainBalances(chains, userAddress) +balances.subscribe(data => { + console.log(data) }) const stores = createTransferStore(chains) diff --git a/app/src/lib/components/TransferFrom/transfer/validation.ts b/app/src/lib/components/TransferFrom/transfer/validation.ts index b5b9d12b70..e920bad183 100644 --- a/app/src/lib/components/TransferFrom/transfer/validation.ts +++ b/app/src/lib/components/TransferFrom/transfer/validation.ts @@ -47,12 +47,12 @@ export function createValidationStore( const errors = derived([rawIntents, intents, context], ([$rawIntents, $intents, $context]) => { const errors: FieldErrors = {} - if ($rawIntents.source) { - if (!$intents.sourceChain) errors.source = "Chain not supported" + if ($rawIntents.source && !$intents.sourceChain) { + errors.source = "Chain not supported" } - if ($rawIntents.destination) { - if (!$intents.destinationChain) errors.destination = "Chain not supported" + if ($rawIntents.destination && !$intents.destinationChain) { + errors.destination = "Chain not supported" } // Source chain wallet validation diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index c3f7915659..5426ad89ec 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -1,13 +1,11 @@ -import {derived, get, type Readable} from "svelte/store" -import {bech32ToBech32Address} from "@unionlabs/client" -import {type Address, isAddress} from "viem" -import type {Chain, ChainAsset, UserAddresses} from "$lib/types" -import {erc20ReadMulticall} from "./evm/multicall.ts" -import {getCosmosChainBalances} from "./cosmos.ts" -import {getAptosChainBalances} from "./aptos.ts" -import {createQueries} from "@tanstack/svelte-query" -import type {QueryObserverResult} from "@tanstack/query-core" -import {balanceStore} from "$lib/components/TransferFrom/transfer/balances.ts" +import { derived, type Readable } from "svelte/store" +import { bech32ToBech32Address } from "@unionlabs/client" +import { type Address, isAddress } from "viem" +import type { Chain, ChainAsset, UserAddresses } from "$lib/types" +import { erc20ReadMulticall } from "./evm/multicall.ts" +import { getCosmosChainBalances } from "./cosmos.ts" +import { getAptosChainBalances } from "./aptos.ts" +import { balanceStore } from "$lib/components/TransferFrom/transfer/balances.ts" export type AssetMetadata = { denom: string @@ -103,8 +101,8 @@ export async function getUserBalances( const contractAddresses = denoms ? denoms.filter((denom): denom is Address => isAddress(denom)).map(normalizeAddress) : chain.assets - .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) - .map(asset => normalizeAddress(asset.denom)) + .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) + .map(asset => normalizeAddress(asset.denom)) const results = await erc20ReadMulticall({ chainId: chain.chain_id, @@ -221,93 +219,60 @@ let querySubscription: (() => void) | undefined let lastData: Array> = [] export function allChainBalances(chains: Array, addressStore: Readable) { - if (querySubscription) { - querySubscription() - querySubscription = undefined - } - - lastData = Array(chains.length).fill([]) - balanceStore.set(lastData) - - const chainStores = chains.map((chain, chainIndex) => { - const store = createChainBalances(chain, addressStore) - - const address = getAddressForChain(chain, get(addressStore)) - if (!address) { - lastData[chainIndex] = [] - balanceStore.set([...lastData]) - return store + const clearAndResetData = () => { + if (querySubscription) { + querySubscription() + querySubscription = undefined } + lastData = new Array(chains.length).fill([]) + balanceStore.set(lastData) + } - querySubscription = createQueries({ - queries: [ - { - queryKey: ["balances", chain.chain_id, address], - queryFn: async () => { - try { - const balances = await getUserBalances(chain, address) - const initialBalances = get(store) - - const mergedBalances = initialBalances.map(placeholder => { - const enriched = balances.find( - b => b.metadata.denom === placeholder.metadata.denom - ) - return enriched || placeholder - }) + return derived( + addressStore, + ($addresses, set) => { + clearAndResetData() + + const chainStores = chains.map((chain, chainIndex) => { + const address = getAddressForChain(chain, $addresses) + if (!address) { + lastData[chainIndex] = [] + balanceStore.set([...lastData]) + return [] + } - balances.forEach(balance => { - if (!mergedBalances.some(b => b.metadata.denom === balance.metadata.denom)) { - mergedBalances.push(balance) + return getUserBalances(chain, address) + .then(balances => { + const sortedBalances = balances + .map(balance => ({ + ...balance, + balance: balance.balance === "Loading..." ? "0" : balance.balance, + metadata: { + ...balance.metadata, + decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18, + metadata_level: balance.metadata.metadata_level as "graphql" | "onchain" | "none" } + })) + .sort((a, b) => { + const aValue = BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) + const bValue = BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) + return bValue > aValue ? 1 : -1 }) - const sortedBalances = mergedBalances - .map(balance => ({ - ...balance, - balance: balance.balance === "Loading..." ? "0" : balance.balance, - metadata: { - ...balance.metadata, - decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18, - metadata_level: balance.metadata.metadata_level as "graphql" | "onchain" | "none" - } - })) - .sort((a, b) => { - const aValue = - BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) - const bValue = - BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) - return bValue > aValue ? 1 : -1 - }) - - lastData[chainIndex] = sortedBalances - balanceStore.set([...lastData]) - return sortedBalances - - } catch (error) { - console.error("Error fetching balances:", error) - return get(store) - } - }, - refetchInterval: 4000 - } - ] - }).subscribe(results => { - const queryResult = results[0] as QueryObserverResult, Error> - if (queryResult.data) { - lastData[chainIndex] = queryResult.data - balanceStore.set([...lastData]) - } - }) - - return store - }) + lastData[chainIndex] = sortedBalances + balanceStore.set([...lastData]) + return sortedBalances + }) + .catch(error => { + console.error("Error fetching balances:", error) + return [] + }) + }) - return derived([addressStore, ...chainStores], ([$addresses, ...$chainStores]) => { - const hasAddress = chains.some(chain => getAddressForChain(chain, $addresses)) - if (!hasAddress) { - lastData = Array(chains.length).fill([]) - balanceStore.set(lastData) - } - return $chainStores - }) -} \ No newline at end of file + Promise.all(chainStores).then(results => { + set(results) + }) + }, + [] as Array> + ) +} From 23edd4776bab4dec5e81a026c92d1677d6c0ac3b Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 19:26:31 +0100 Subject: [PATCH 09/15] fix(app): reactivity issues fix --- app/src/generated/graphql-env.d.ts | 18 +- .../lib/components/TransferFrom/index.svelte | 3 - app/src/lib/queries/balance/index.ts | 155 +++++++++++------- 3 files changed, 104 insertions(+), 72 deletions(-) diff --git a/app/src/generated/graphql-env.d.ts b/app/src/generated/graphql-env.d.ts index 5d5a32d4aa..fa1e281689 100644 --- a/app/src/generated/graphql-env.d.ts +++ b/app/src/generated/graphql-env.d.ts @@ -181,16 +181,16 @@ export type introspection_types = { 'v1_health_check_select_column': { name: 'v1_health_check_select_column'; enumValues: 'result' | 'test'; }; 'v1_health_check_stream_cursor_input': { kind: 'INPUT_OBJECT'; name: 'v1_health_check_stream_cursor_input'; isOneOf: false; inputFields: [{ name: 'initial_value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_health_check_stream_cursor_value_input'; ofType: null; }; }; defaultValue: null }, { name: 'ordering'; type: { kind: 'ENUM'; name: 'cursor_ordering'; ofType: null; }; defaultValue: null }]; }; 'v1_health_check_stream_cursor_value_input': { kind: 'INPUT_OBJECT'; name: 'v1_health_check_stream_cursor_value_input'; isOneOf: false; inputFields: [{ name: 'result'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'test'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_fungible_asset_order_view': { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view'; fields: { 'ack_fill_type': { name: 'ack_fill_type'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'ack_market_maker': { name: 'ack_market_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'ack_tag': { name: 'ack_tag'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'acknowledgement': { name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'acknowledgement_decoded': { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; } }; 'base_amount': { name: 'base_amount'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'base_token': { name: 'base_token'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'base_token_name': { name: 'base_token_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'base_token_path': { name: 'base_token_path'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'base_token_symbol': { name: 'base_token_symbol'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'channel_version': { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'data_decoded': { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; } }; 'destination_chain_id': { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'destination_channel_id': { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'destination_connection_id': { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'destination_port_id': { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'instruction_path': { name: 'instruction_path'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'internal_destination_chain_id': { name: 'internal_destination_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'internal_source_chain_id': { name: 'internal_source_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet': { name: 'packet'; type: { kind: 'OBJECT'; name: 'v1_ibc_union_packets_view'; ofType: null; } }; 'packet_ack_block_hash': { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_event_index': { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_height': { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_ack_maker': { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_timestamp': { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_ack_transaction_event_index': { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_transaction_hash': { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_transaction_index': { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_block_hash': { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_event_index': { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_height': { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_recv_maker': { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_maker_msg': { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_timestamp': { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_recv_transaction_event_index': { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_transaction_hash': { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_transaction_index': { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_block_hash': { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_send_event_index': { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_height': { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_send_timestamp': { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_send_transaction_event_index': { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_transaction_hash': { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_send_transaction_index': { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'quote_amount': { name: 'quote_amount'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'quote_token': { name: 'quote_token'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'receiver': { name: 'receiver'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'sender': { name: 'sender'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_chain_id': { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_channel_id': { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'source_connection_id': { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'source_port_id': { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'status': { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'timeout_height': { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'timeout_timestamp': { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; } }; 'write_ack_block_hash': { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'write_ack_event_index': { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'write_ack_height': { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'write_ack_timestamp': { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'write_ack_transaction_event_index': { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'write_ack_transaction_hash': { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'write_ack_transaction_index': { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; }; }; - 'v1_ibc_union_fungible_asset_order_view_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_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_fungible_asset_order_view_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_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_fungible_asset_order_view_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'ack_fill_type'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'ack_market_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'ack_tag'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_amount'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_token'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_token_name'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_token_path'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_token_symbol'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'instruction_path'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_bool_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'quote_amount'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'quote_token'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'sender'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'numeric_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_fungible_asset_order_view_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_order_by'; isOneOf: false; inputFields: [{ name: 'ack_fill_type'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'ack_market_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'ack_tag'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_amount'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_token'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_token_name'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_token_path'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_token_symbol'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'instruction_path'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'quote_amount'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'quote_token'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'sender'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_fungible_asset_order_view_select_column': { name: 'v1_ibc_union_fungible_asset_order_view_select_column'; enumValues: 'ack_fill_type' | 'ack_market_maker' | 'ack_tag' | 'acknowledgement' | 'acknowledgement_decoded' | 'base_amount' | 'base_token' | 'base_token_name' | 'base_token_path' | 'base_token_symbol' | 'channel_version' | 'data' | 'data_decoded' | 'destination_chain_id' | 'destination_channel_id' | 'destination_connection_id' | 'destination_port_id' | 'instruction_path' | 'internal_destination_chain_id' | 'internal_source_chain_id' | 'packet_ack_block_hash' | 'packet_ack_event_index' | 'packet_ack_height' | 'packet_ack_maker' | 'packet_ack_timestamp' | 'packet_ack_transaction_event_index' | 'packet_ack_transaction_hash' | 'packet_ack_transaction_index' | 'packet_recv_block_hash' | 'packet_recv_event_index' | 'packet_recv_height' | 'packet_recv_maker' | 'packet_recv_maker_msg' | 'packet_recv_timestamp' | 'packet_recv_transaction_event_index' | 'packet_recv_transaction_hash' | 'packet_recv_transaction_index' | 'packet_send_block_hash' | 'packet_send_event_index' | 'packet_send_height' | 'packet_send_timestamp' | 'packet_send_transaction_event_index' | 'packet_send_transaction_hash' | 'packet_send_transaction_index' | 'quote_amount' | 'quote_token' | 'receiver' | 'sender' | 'source_chain_id' | 'source_channel_id' | 'source_connection_id' | 'source_port_id' | 'status' | 'timeout_height' | 'timeout_timestamp' | 'write_ack_block_hash' | 'write_ack_event_index' | 'write_ack_height' | 'write_ack_timestamp' | 'write_ack_transaction_event_index' | 'write_ack_transaction_hash' | 'write_ack_transaction_index'; }; + 'v1_ibc_union_fungible_asset_order_view': { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view'; fields: { 'ack_fill_type': { name: 'ack_fill_type'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'ack_market_maker': { name: 'ack_market_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'ack_tag': { name: 'ack_tag'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'acknowledgement': { name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'acknowledgement_decoded': { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; } }; 'base_amount': { name: 'base_amount'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'base_token': { name: 'base_token'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'base_token_name': { name: 'base_token_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'base_token_path': { name: 'base_token_path'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'base_token_symbol': { name: 'base_token_symbol'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'channel_version': { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'data_decoded': { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; } }; 'destination_chain_id': { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'destination_channel_id': { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'destination_connection_id': { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'destination_port_id': { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'instruction_path': { name: 'instruction_path'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'internal_destination_chain_id': { name: 'internal_destination_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'internal_source_chain_id': { name: 'internal_source_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet': { name: 'packet'; type: { kind: 'OBJECT'; name: 'v1_ibc_union_packets_view'; ofType: null; } }; 'packet_ack_block_hash': { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_event_index': { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_height': { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_ack_maker': { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_timestamp': { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_ack_transaction_event_index': { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_transaction_hash': { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_transaction_index': { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_block_hash': { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_event_index': { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_height': { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_recv_maker': { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_maker_msg': { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_timestamp': { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_recv_transaction_event_index': { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_transaction_hash': { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_transaction_index': { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_block_hash': { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_send_event_index': { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_height': { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_send_timestamp': { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_send_transaction_event_index': { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_transaction_hash': { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_send_transaction_index': { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'path': { name: 'path'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; } }; 'quote_amount': { name: 'quote_amount'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'quote_token': { name: 'quote_token'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'receiver': { name: 'receiver'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'salt': { name: 'salt'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; } }; 'sender': { name: 'sender'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_chain_id': { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_channel_id': { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'source_connection_id': { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'source_port_id': { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'status': { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'timeout_height': { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'timeout_timestamp': { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; } }; 'write_ack_block_hash': { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'write_ack_event_index': { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'write_ack_height': { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'write_ack_timestamp': { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'write_ack_transaction_event_index': { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'write_ack_transaction_hash': { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'write_ack_transaction_index': { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; }; }; + 'v1_ibc_union_fungible_asset_order_view_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_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_fungible_asset_order_view_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_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_fungible_asset_order_view_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'ack_fill_type'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'ack_market_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'ack_tag'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_amount'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_token'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_token_name'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_token_path'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'base_token_symbol'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'instruction_path'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_bool_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'path'; type: { kind: 'INPUT_OBJECT'; name: 'bytea_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'quote_amount'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'quote_token'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'salt'; type: { kind: 'INPUT_OBJECT'; name: 'bytea_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'sender'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'numeric_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_fungible_asset_order_view_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_order_by'; isOneOf: false; inputFields: [{ name: 'ack_fill_type'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'ack_market_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'ack_tag'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_amount'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_token'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_token_name'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_token_path'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'base_token_symbol'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'instruction_path'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'path'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'quote_amount'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'quote_token'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'salt'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'sender'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_fungible_asset_order_view_select_column': { name: 'v1_ibc_union_fungible_asset_order_view_select_column'; enumValues: 'ack_fill_type' | 'ack_market_maker' | 'ack_tag' | 'acknowledgement' | 'acknowledgement_decoded' | 'base_amount' | 'base_token' | 'base_token_name' | 'base_token_path' | 'base_token_symbol' | 'channel_version' | 'data' | 'data_decoded' | 'destination_chain_id' | 'destination_channel_id' | 'destination_connection_id' | 'destination_port_id' | 'instruction_path' | 'internal_destination_chain_id' | 'internal_source_chain_id' | 'packet_ack_block_hash' | 'packet_ack_event_index' | 'packet_ack_height' | 'packet_ack_maker' | 'packet_ack_timestamp' | 'packet_ack_transaction_event_index' | 'packet_ack_transaction_hash' | 'packet_ack_transaction_index' | 'packet_recv_block_hash' | 'packet_recv_event_index' | 'packet_recv_height' | 'packet_recv_maker' | 'packet_recv_maker_msg' | 'packet_recv_timestamp' | 'packet_recv_transaction_event_index' | 'packet_recv_transaction_hash' | 'packet_recv_transaction_index' | 'packet_send_block_hash' | 'packet_send_event_index' | 'packet_send_height' | 'packet_send_timestamp' | 'packet_send_transaction_event_index' | 'packet_send_transaction_hash' | 'packet_send_transaction_index' | 'path' | 'quote_amount' | 'quote_token' | 'receiver' | 'salt' | 'sender' | 'source_chain_id' | 'source_channel_id' | 'source_connection_id' | 'source_port_id' | 'status' | 'timeout_height' | 'timeout_timestamp' | 'write_ack_block_hash' | 'write_ack_event_index' | 'write_ack_height' | 'write_ack_timestamp' | 'write_ack_transaction_event_index' | 'write_ack_transaction_hash' | 'write_ack_transaction_index'; }; 'v1_ibc_union_fungible_asset_order_view_stream_cursor_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_stream_cursor_input'; isOneOf: false; inputFields: [{ name: 'initial_value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_stream_cursor_value_input'; ofType: null; }; }; defaultValue: null }, { name: 'ordering'; type: { kind: 'ENUM'; name: 'cursor_ordering'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_fungible_asset_order_view_stream_cursor_value_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_stream_cursor_value_input'; isOneOf: false; inputFields: [{ name: 'ack_fill_type'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'ack_market_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'ack_tag'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'base_amount'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'base_token'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'base_token_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'base_token_path'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'base_token_symbol'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'instruction_path'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'quote_amount'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'quote_token'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'sender'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_packets_view': { kind: 'OBJECT'; name: 'v1_ibc_union_packets_view'; fields: { 'acknowledgement': { name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'acknowledgement_decoded': { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; } }; 'channel_version': { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'data_decoded': { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; } }; 'destination_chain_id': { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'destination_channel_id': { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'destination_connection_id': { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'destination_port_id': { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_block_hash': { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_event_index': { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_height': { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_ack_maker': { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_timestamp': { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_ack_transaction_event_index': { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_transaction_hash': { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_transaction_index': { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_block_hash': { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_event_index': { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_height': { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_recv_maker': { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_maker_msg': { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_timestamp': { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_recv_transaction_event_index': { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_transaction_hash': { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_transaction_index': { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_block_hash': { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_send_event_index': { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_height': { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_send_timestamp': { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_send_transaction_event_index': { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_transaction_hash': { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_send_transaction_index': { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'source_chain_id': { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_channel_id': { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'source_connection_id': { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'source_port_id': { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'status': { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'timeout_height': { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'timeout_timestamp': { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; } }; 'write_ack_block_hash': { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'write_ack_event_index': { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'write_ack_height': { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'write_ack_timestamp': { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'write_ack_transaction_event_index': { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'write_ack_transaction_hash': { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'write_ack_transaction_index': { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; }; }; - 'v1_ibc_union_packets_view_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_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_packets_view_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_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_packets_view_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'acknowledgement'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'numeric_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_packets_view_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_order_by'; isOneOf: false; inputFields: [{ name: 'acknowledgement'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; - 'v1_ibc_union_packets_view_select_column': { name: 'v1_ibc_union_packets_view_select_column'; enumValues: 'acknowledgement' | 'acknowledgement_decoded' | 'channel_version' | 'data' | 'data_decoded' | 'destination_chain_id' | 'destination_channel_id' | 'destination_connection_id' | 'destination_port_id' | 'packet_ack_block_hash' | 'packet_ack_event_index' | 'packet_ack_height' | 'packet_ack_maker' | 'packet_ack_timestamp' | 'packet_ack_transaction_event_index' | 'packet_ack_transaction_hash' | 'packet_ack_transaction_index' | 'packet_recv_block_hash' | 'packet_recv_event_index' | 'packet_recv_height' | 'packet_recv_maker' | 'packet_recv_maker_msg' | 'packet_recv_timestamp' | 'packet_recv_transaction_event_index' | 'packet_recv_transaction_hash' | 'packet_recv_transaction_index' | 'packet_send_block_hash' | 'packet_send_event_index' | 'packet_send_height' | 'packet_send_timestamp' | 'packet_send_transaction_event_index' | 'packet_send_transaction_hash' | 'packet_send_transaction_index' | 'source_chain_id' | 'source_channel_id' | 'source_connection_id' | 'source_port_id' | 'status' | 'timeout_height' | 'timeout_timestamp' | 'write_ack_block_hash' | 'write_ack_event_index' | 'write_ack_height' | 'write_ack_timestamp' | 'write_ack_transaction_event_index' | 'write_ack_transaction_hash' | 'write_ack_transaction_index'; }; + 'v1_ibc_union_fungible_asset_order_view_stream_cursor_value_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_fungible_asset_order_view_stream_cursor_value_input'; isOneOf: false; inputFields: [{ name: 'ack_fill_type'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'ack_market_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'ack_tag'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'base_amount'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'base_token'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'base_token_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'base_token_path'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'base_token_symbol'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'instruction_path'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'path'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; defaultValue: null }, { name: 'quote_amount'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'quote_token'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'salt'; type: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; defaultValue: null }, { name: 'sender'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_packets_view': { kind: 'OBJECT'; name: 'v1_ibc_union_packets_view'; fields: { 'acknowledgement': { name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'acknowledgement_decoded': { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; } }; 'channel_version': { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'data_decoded': { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; } }; 'destination_chain_id': { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'destination_channel_id': { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'destination_connection_id': { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'destination_port_id': { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'internal_destination_chain_id': { name: 'internal_destination_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'internal_source_chain_id': { name: 'internal_source_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_block_hash': { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_event_index': { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_height': { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_ack_maker': { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_timestamp': { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_ack_transaction_event_index': { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_ack_transaction_hash': { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_ack_transaction_index': { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_block_hash': { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_event_index': { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_height': { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_recv_maker': { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_maker_msg': { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_timestamp': { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_recv_transaction_event_index': { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_recv_transaction_hash': { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_recv_transaction_index': { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_block_hash': { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_send_event_index': { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_height': { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'packet_send_timestamp': { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'packet_send_transaction_event_index': { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'packet_send_transaction_hash': { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'packet_send_transaction_index': { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'source_chain_id': { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_channel_id': { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'source_connection_id': { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'source_port_id': { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'status': { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'timeout_height': { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'timeout_timestamp': { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; } }; 'write_ack_block_hash': { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'write_ack_event_index': { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'write_ack_height': { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'write_ack_timestamp': { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'write_ack_transaction_event_index': { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'write_ack_transaction_hash': { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'write_ack_transaction_index': { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; }; }; + 'v1_ibc_union_packets_view_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_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_packets_view_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_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_packets_view_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'acknowledgement'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'numeric_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_packets_view_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_order_by'; isOneOf: false; inputFields: [{ name: 'acknowledgement'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_packets_view_select_column': { name: 'v1_ibc_union_packets_view_select_column'; enumValues: 'acknowledgement' | 'acknowledgement_decoded' | 'channel_version' | 'data' | 'data_decoded' | 'destination_chain_id' | 'destination_channel_id' | 'destination_connection_id' | 'destination_port_id' | 'internal_destination_chain_id' | 'internal_source_chain_id' | 'packet_ack_block_hash' | 'packet_ack_event_index' | 'packet_ack_height' | 'packet_ack_maker' | 'packet_ack_timestamp' | 'packet_ack_transaction_event_index' | 'packet_ack_transaction_hash' | 'packet_ack_transaction_index' | 'packet_recv_block_hash' | 'packet_recv_event_index' | 'packet_recv_height' | 'packet_recv_maker' | 'packet_recv_maker_msg' | 'packet_recv_timestamp' | 'packet_recv_transaction_event_index' | 'packet_recv_transaction_hash' | 'packet_recv_transaction_index' | 'packet_send_block_hash' | 'packet_send_event_index' | 'packet_send_height' | 'packet_send_timestamp' | 'packet_send_transaction_event_index' | 'packet_send_transaction_hash' | 'packet_send_transaction_index' | 'source_chain_id' | 'source_channel_id' | 'source_connection_id' | 'source_port_id' | 'status' | 'timeout_height' | 'timeout_timestamp' | 'write_ack_block_hash' | 'write_ack_event_index' | 'write_ack_height' | 'write_ack_timestamp' | 'write_ack_transaction_event_index' | 'write_ack_transaction_hash' | 'write_ack_transaction_index'; }; 'v1_ibc_union_packets_view_stream_cursor_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_stream_cursor_input'; isOneOf: false; inputFields: [{ name: 'initial_value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_stream_cursor_value_input'; ofType: null; }; }; defaultValue: null }, { name: 'ordering'; type: { kind: 'ENUM'; name: 'cursor_ordering'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_packets_view_stream_cursor_value_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_packets_view_stream_cursor_value_input'; isOneOf: false; inputFields: [{ name: 'acknowledgement'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'acknowledgement_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'channel_version'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'data_decoded'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'destination_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'internal_source_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_maker_msg'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_recv_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'packet_send_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'packet_send_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'source_connection_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'source_port_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'timeout_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'timeout_timestamp'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: 'write_ack_block_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'write_ack_timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_event_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_hash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'write_ack_transaction_index'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }]; }; 'v1_index_status': { kind: 'OBJECT'; name: 'v1_index_status'; fields: { 'chain': { name: 'chain'; type: { kind: 'OBJECT'; name: 'v1_chains'; ofType: null; } }; 'chain_id': { name: 'chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'display_name': { name: 'display_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'height': { name: 'height'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'status': { name: 'status'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'timestamp': { name: 'timestamp'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; } }; 'tip_age_seconds': { name: 'tip_age_seconds'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; } }; }; }; diff --git a/app/src/lib/components/TransferFrom/index.svelte b/app/src/lib/components/TransferFrom/index.svelte index 0aeeaf78e9..0ea0ed4eeb 100644 --- a/app/src/lib/components/TransferFrom/index.svelte +++ b/app/src/lib/components/TransferFrom/index.svelte @@ -14,9 +14,6 @@ import { userAddress } from "$lib/components/TransferFrom/transfer/balances.ts" export let chains: Array const balances = allChainBalances(chains, userAddress) -balances.subscribe(data => { - console.log(data) -}) const stores = createTransferStore(chains) diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index 5426ad89ec..c3f7915659 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -1,11 +1,13 @@ -import { derived, type Readable } from "svelte/store" -import { bech32ToBech32Address } from "@unionlabs/client" -import { type Address, isAddress } from "viem" -import type { Chain, ChainAsset, UserAddresses } from "$lib/types" -import { erc20ReadMulticall } from "./evm/multicall.ts" -import { getCosmosChainBalances } from "./cosmos.ts" -import { getAptosChainBalances } from "./aptos.ts" -import { balanceStore } from "$lib/components/TransferFrom/transfer/balances.ts" +import {derived, get, type Readable} from "svelte/store" +import {bech32ToBech32Address} from "@unionlabs/client" +import {type Address, isAddress} from "viem" +import type {Chain, ChainAsset, UserAddresses} from "$lib/types" +import {erc20ReadMulticall} from "./evm/multicall.ts" +import {getCosmosChainBalances} from "./cosmos.ts" +import {getAptosChainBalances} from "./aptos.ts" +import {createQueries} from "@tanstack/svelte-query" +import type {QueryObserverResult} from "@tanstack/query-core" +import {balanceStore} from "$lib/components/TransferFrom/transfer/balances.ts" export type AssetMetadata = { denom: string @@ -101,8 +103,8 @@ export async function getUserBalances( const contractAddresses = denoms ? denoms.filter((denom): denom is Address => isAddress(denom)).map(normalizeAddress) : chain.assets - .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) - .map(asset => normalizeAddress(asset.denom)) + .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) + .map(asset => normalizeAddress(asset.denom)) const results = await erc20ReadMulticall({ chainId: chain.chain_id, @@ -219,60 +221,93 @@ let querySubscription: (() => void) | undefined let lastData: Array> = [] export function allChainBalances(chains: Array, addressStore: Readable) { - const clearAndResetData = () => { - if (querySubscription) { - querySubscription() - querySubscription = undefined - } - lastData = new Array(chains.length).fill([]) - balanceStore.set(lastData) + if (querySubscription) { + querySubscription() + querySubscription = undefined } - return derived( - addressStore, - ($addresses, set) => { - clearAndResetData() - - const chainStores = chains.map((chain, chainIndex) => { - const address = getAddressForChain(chain, $addresses) - if (!address) { - lastData[chainIndex] = [] - balanceStore.set([...lastData]) - return [] - } + lastData = Array(chains.length).fill([]) + balanceStore.set(lastData) + + const chainStores = chains.map((chain, chainIndex) => { + const store = createChainBalances(chain, addressStore) - return getUserBalances(chain, address) - .then(balances => { - const sortedBalances = balances - .map(balance => ({ - ...balance, - balance: balance.balance === "Loading..." ? "0" : balance.balance, - metadata: { - ...balance.metadata, - decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18, - metadata_level: balance.metadata.metadata_level as "graphql" | "onchain" | "none" + const address = getAddressForChain(chain, get(addressStore)) + if (!address) { + lastData[chainIndex] = [] + balanceStore.set([...lastData]) + return store + } + + querySubscription = createQueries({ + queries: [ + { + queryKey: ["balances", chain.chain_id, address], + queryFn: async () => { + try { + const balances = await getUserBalances(chain, address) + const initialBalances = get(store) + + const mergedBalances = initialBalances.map(placeholder => { + const enriched = balances.find( + b => b.metadata.denom === placeholder.metadata.denom + ) + return enriched || placeholder + }) + + balances.forEach(balance => { + if (!mergedBalances.some(b => b.metadata.denom === balance.metadata.denom)) { + mergedBalances.push(balance) } - })) - .sort((a, b) => { - const aValue = BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) - const bValue = BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) - return bValue > aValue ? 1 : -1 }) - lastData[chainIndex] = sortedBalances - balanceStore.set([...lastData]) - return sortedBalances - }) - .catch(error => { - console.error("Error fetching balances:", error) - return [] - }) - }) + const sortedBalances = mergedBalances + .map(balance => ({ + ...balance, + balance: balance.balance === "Loading..." ? "0" : balance.balance, + metadata: { + ...balance.metadata, + decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18, + metadata_level: balance.metadata.metadata_level as "graphql" | "onchain" | "none" + } + })) + .sort((a, b) => { + const aValue = + BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) + const bValue = + BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) + return bValue > aValue ? 1 : -1 + }) - Promise.all(chainStores).then(results => { - set(results) - }) - }, - [] as Array> - ) -} + lastData[chainIndex] = sortedBalances + balanceStore.set([...lastData]) + return sortedBalances + + } catch (error) { + console.error("Error fetching balances:", error) + return get(store) + } + }, + refetchInterval: 4000 + } + ] + }).subscribe(results => { + const queryResult = results[0] as QueryObserverResult, Error> + if (queryResult.data) { + lastData[chainIndex] = queryResult.data + balanceStore.set([...lastData]) + } + }) + + return store + }) + + return derived([addressStore, ...chainStores], ([$addresses, ...$chainStores]) => { + const hasAddress = chains.some(chain => getAddressForChain(chain, $addresses)) + if (!hasAddress) { + lastData = Array(chains.length).fill([]) + balanceStore.set(lastData) + } + return $chainStores + }) +} \ No newline at end of file From e3ec4f2d59a24b1e91f3b598591b0414dfd16b8b Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 19:27:38 +0100 Subject: [PATCH 10/15] chore(app): pre commit --- app/src/lib/queries/balance/index.ts | 40 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index c3f7915659..85ad73c2fe 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -1,13 +1,13 @@ -import {derived, get, type Readable} from "svelte/store" -import {bech32ToBech32Address} from "@unionlabs/client" -import {type Address, isAddress} from "viem" -import type {Chain, ChainAsset, UserAddresses} from "$lib/types" -import {erc20ReadMulticall} from "./evm/multicall.ts" -import {getCosmosChainBalances} from "./cosmos.ts" -import {getAptosChainBalances} from "./aptos.ts" -import {createQueries} from "@tanstack/svelte-query" -import type {QueryObserverResult} from "@tanstack/query-core" -import {balanceStore} from "$lib/components/TransferFrom/transfer/balances.ts" +import { derived, get, type Readable } from "svelte/store" +import { bech32ToBech32Address } from "@unionlabs/client" +import { type Address, isAddress } from "viem" +import type { Chain, ChainAsset, UserAddresses } from "$lib/types" +import { erc20ReadMulticall } from "./evm/multicall.ts" +import { getCosmosChainBalances } from "./cosmos.ts" +import { getAptosChainBalances } from "./aptos.ts" +import { createQueries } from "@tanstack/svelte-query" +import type { QueryObserverResult } from "@tanstack/query-core" +import { balanceStore } from "$lib/components/TransferFrom/transfer/balances.ts" export type AssetMetadata = { denom: string @@ -103,8 +103,8 @@ export async function getUserBalances( const contractAddresses = denoms ? denoms.filter((denom): denom is Address => isAddress(denom)).map(normalizeAddress) : chain.assets - .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) - .map(asset => normalizeAddress(asset.denom)) + .filter((asset): asset is ChainAsset & { denom: Address } => isAddress(asset.denom)) + .map(asset => normalizeAddress(asset.denom)) const results = await erc20ReadMulticall({ chainId: chain.chain_id, @@ -226,7 +226,7 @@ export function allChainBalances(chains: Array, addressStore: Readable { @@ -249,9 +249,7 @@ export function allChainBalances(chains: Array, addressStore: Readable { - const enriched = balances.find( - b => b.metadata.denom === placeholder.metadata.denom - ) + const enriched = balances.find(b => b.metadata.denom === placeholder.metadata.denom) return enriched || placeholder }) @@ -268,7 +266,10 @@ export function allChainBalances(chains: Array, addressStore: Readable { @@ -282,7 +283,6 @@ export function allChainBalances(chains: Array, addressStore: Readable, addressStore: Readable { const hasAddress = chains.some(chain => getAddressForChain(chain, $addresses)) if (!hasAddress) { - lastData = Array(chains.length).fill([]) + lastData = new Array(chains.length).fill([]) balanceStore.set(lastData) } return $chainStores }) -} \ No newline at end of file +} From 45c328480d58c6cbf08d5ae0363a3784b0e50b39 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 20:00:50 +0100 Subject: [PATCH 11/15] fix(app): wallet reactivity --- .../components/Cube/faces/Assets.svelte | 29 +++- .../lib/components/TransferFrom/index.svelte | 20 ++- app/src/lib/queries/balance/index.ts | 158 +++++++++--------- 3 files changed, 117 insertions(+), 90 deletions(-) diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte index f7433906e6..55504c6c9b 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte @@ -5,7 +5,8 @@ import { formatUnits } from "viem" import { Button } from "$lib/components/ui/button" import type { CubeFaces } from "$lib/components/TransferFrom/components/Cube/types.ts" import type { RawIntentsStore } from "$lib/components/TransferFrom/transfer/raw-intents.ts" -import type { IntentsStore } from "$lib/components/TransferFrom/transfer/intents.ts" +import type { IntentsStore, AssetListItem } from "$lib/components/TransferFrom/transfer/intents.ts" +import { derived, writable } from "svelte/store" interface Props { stores: { @@ -20,15 +21,35 @@ export let rotateTo: Props["rotateTo"] let { rawIntents, intents } = stores +const showZeroBalances = writable(false) + +$: filteredAssets = derived([intents, showZeroBalances], ([$intents, $showZeroBalances]) => + $showZeroBalances + ? $intents.sourceAssets + : $intents.sourceAssets.filter(asset => BigInt(asset.balance) > 0n) +) + function setAsset(denom: string) { rawIntents.updateField("asset", denom) rotateTo("intentFace") } + +function toggleZeroBalances() { + showZeroBalances.update(value => !value) +}
- Assets +
+ Assets + +
- {#if $intents.sourceAssets.length} + {#if $filteredAssets.length}
- {#each $intents.sourceAssets as asset (asset)} + {#each $filteredAssets as asset (asset.metadata.denom)}
- +
- +
@@ -42,6 +52,6 @@ const stores = createTransferStore(chains)
{#if TRANSFER_DEBUG} - + {/if} -
+
\ No newline at end of file diff --git a/app/src/lib/queries/balance/index.ts b/app/src/lib/queries/balance/index.ts index 85ad73c2fe..0ccbc9d4db 100644 --- a/app/src/lib/queries/balance/index.ts +++ b/app/src/lib/queries/balance/index.ts @@ -1,4 +1,4 @@ -import { derived, get, type Readable } from "svelte/store" +import { derived, type Readable } from "svelte/store" import { bech32ToBech32Address } from "@unionlabs/client" import { type Address, isAddress } from "viem" import type { Chain, ChainAsset, UserAddresses } from "$lib/types" @@ -7,7 +7,6 @@ import { getCosmosChainBalances } from "./cosmos.ts" import { getAptosChainBalances } from "./aptos.ts" import { createQueries } from "@tanstack/svelte-query" import type { QueryObserverResult } from "@tanstack/query-core" -import { balanceStore } from "$lib/components/TransferFrom/transfer/balances.ts" export type AssetMetadata = { denom: string @@ -218,96 +217,93 @@ export function createChainBalances( } let querySubscription: (() => void) | undefined -let lastData: Array> = [] export function allChainBalances(chains: Array, addressStore: Readable) { - if (querySubscription) { - querySubscription() - querySubscription = undefined - } - - lastData = new Array(chains.length).fill([]) - balanceStore.set(lastData) + const chainStores = chains.map(chain => createChainBalances(chain, addressStore)) - const chainStores = chains.map((chain, chainIndex) => { - const store = createChainBalances(chain, addressStore) + return derived([addressStore, ...chainStores], ([$addresses, ...$chainStores]) => { + // Clean up previous subscription + if (querySubscription) { + querySubscription() + querySubscription = undefined + } - const address = getAddressForChain(chain, get(addressStore)) - if (!address) { - lastData[chainIndex] = [] - balanceStore.set([...lastData]) - return store + const hasAddress = chains.some(chain => getAddressForChain(chain, $addresses)) + if (!hasAddress) { + return new Array(chains.length).fill([]) } - querySubscription = createQueries({ - queries: [ - { - queryKey: ["balances", chain.chain_id, address], - queryFn: async () => { - try { - const balances = await getUserBalances(chain, address) - const initialBalances = get(store) - - const mergedBalances = initialBalances.map(placeholder => { - const enriched = balances.find(b => b.metadata.denom === placeholder.metadata.denom) - return enriched || placeholder - }) - - balances.forEach(balance => { - if (!mergedBalances.some(b => b.metadata.denom === balance.metadata.denom)) { - mergedBalances.push(balance) - } - }) - - const sortedBalances = mergedBalances - .map(balance => ({ - ...balance, - balance: balance.balance === "Loading..." ? "0" : balance.balance, - metadata: { - ...balance.metadata, - decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18, - metadata_level: balance.metadata.metadata_level as - | "graphql" - | "onchain" - | "none" + const results = new Array(chains.length).fill([]) + + // Set up new subscriptions for each chain + chains.forEach((chain, chainIndex) => { + const address = getAddressForChain(chain, $addresses) + if (!address) { + results[chainIndex] = [] + return + } + + querySubscription = createQueries({ + queries: [ + { + queryKey: ["balances", chain.chain_id, address], + queryFn: async () => { + try { + const balances = await getUserBalances(chain, address) + const initialBalances = $chainStores[chainIndex] + + const mergedBalances = initialBalances.map(placeholder => { + const enriched = balances.find( + b => b.metadata.denom === placeholder.metadata.denom + ) + return enriched || placeholder + }) + + balances.forEach(balance => { + if (!mergedBalances.some(b => b.metadata.denom === balance.metadata.denom)) { + mergedBalances.push(balance) } - })) - .sort((a, b) => { - const aValue = - BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) - const bValue = - BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) - return bValue > aValue ? 1 : -1 }) - lastData[chainIndex] = sortedBalances - balanceStore.set([...lastData]) - return sortedBalances - } catch (error) { - console.error("Error fetching balances:", error) - return get(store) - } - }, - refetchInterval: 4000 + const sortedBalances = mergedBalances + .map(balance => ({ + ...balance, + balance: balance.balance === "Loading..." ? "0" : balance.balance, + metadata: { + ...balance.metadata, + decimals: balance.metadata.decimals !== null ? balance.metadata.decimals : 18, + metadata_level: balance.metadata.metadata_level as + | "graphql" + | "onchain" + | "none" + } + })) + .sort((a, b) => { + const aValue = + BigInt(a.balance) * BigInt(10 ** (18 - (a.metadata.decimals ?? 18))) + const bValue = + BigInt(b.balance) * BigInt(10 ** (18 - (b.metadata.decimals ?? 18))) + return bValue > aValue ? 1 : -1 + }) + + results[chainIndex] = sortedBalances + return sortedBalances + } catch (error) { + console.error("Error fetching balances:", error) + return $chainStores[chainIndex] + } + }, + refetchInterval: 4000 + } + ] + }).subscribe(queryResults => { + const queryResult = queryResults[0] as QueryObserverResult, Error> + if (queryResult.data) { + results[chainIndex] = queryResult.data } - ] - }).subscribe(results => { - const queryResult = results[0] as QueryObserverResult, Error> - if (queryResult.data) { - lastData[chainIndex] = queryResult.data - balanceStore.set([...lastData]) - } + }) }) - return store - }) - - return derived([addressStore, ...chainStores], ([$addresses, ...$chainStores]) => { - const hasAddress = chains.some(chain => getAddressForChain(chain, $addresses)) - if (!hasAddress) { - lastData = new Array(chains.length).fill([]) - balanceStore.set(lastData) - } - return $chainStores + return results }) } From 8580c208d5106f9a48fd3dc8eac87bd6fe89092b Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 9 Jan 2025 22:27:04 +0100 Subject: [PATCH 12/15] fix(app): reactivity --- .../components/Cube/faces/Assets.svelte | 2 +- .../lib/components/TransferFrom/index.svelte | 15 +- .../TransferFrom/transfer/context.ts | 1 + app/src/lib/queries/balance/index.ts | 302 ++++++------------ app/src/lib/query-client.ts | 11 +- 5 files changed, 104 insertions(+), 227 deletions(-) diff --git a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte index 55504c6c9b..b6df44aa80 100644 --- a/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte +++ b/app/src/lib/components/TransferFrom/components/Cube/faces/Assets.svelte @@ -59,7 +59,7 @@ function toggleZeroBalances() { {#if $filteredAssets.length}
- {#each $filteredAssets as asset (asset.metadata.denom)} + {#each $filteredAssets as asset (asset)}