From e0070f4e77f0229be99c1d2e60a94d7b486bdf30 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 4 Apr 2025 20:27:02 +0200 Subject: [PATCH 01/43] feat(app2): wip - transfer state --- app2/src/lib/components/Transfer/index.svelte | 1044 ++++++++--------- .../Transfer/state/filling/check-allowance.ts | 250 ++++ .../Transfer/state/filling/check-balance.ts | 35 + .../Transfer/state/filling/create-orders.ts | 199 ++++ .../Transfer/state/filling/index.ts | 149 +++ .../Transfer/state/filling/transfer-steps.ts | 0 .../components/Transfer/transfer.svelte.ts | 69 +- app2/src/lib/queries/chains.svelte.ts | 4 +- app2/src/lib/queries/channels.svelte.ts | 2 +- 9 files changed, 1222 insertions(+), 530 deletions(-) create mode 100644 app2/src/lib/components/Transfer/state/filling/check-allowance.ts create mode 100644 app2/src/lib/components/Transfer/state/filling/check-balance.ts create mode 100644 app2/src/lib/components/Transfer/state/filling/create-orders.ts create mode 100644 app2/src/lib/components/Transfer/state/filling/index.ts create mode 100644 app2/src/lib/components/Transfer/state/filling/transfer-steps.ts diff --git a/app2/src/lib/components/Transfer/index.svelte b/app2/src/lib/components/Transfer/index.svelte index 651e82f951..9b35c039ba 100644 --- a/app2/src/lib/components/Transfer/index.svelte +++ b/app2/src/lib/components/Transfer/index.svelte @@ -1,595 +1,586 @@
lts.steps.length), Option.getOrElse(() => transferSteps.pipe( @@ -598,7 +589,7 @@ beforeNavigate(reset) ), ), )} - stepDescriptions={lockedTransferStore.get().pipe( + stepDescriptions={lockedTransferStore.get().pipe( Option.map((lts) => lts.steps.map(TransferStep.description)), Option.orElse(() => transferSteps.pipe( @@ -615,8 +606,8 @@ beforeNavigate(reset)
@@ -632,22 +623,22 @@ beforeNavigate(reset) {#each lockedTransferStore.get().value.steps.slice(1) as step, i} {#if TransferStep.is("ApprovalRequired")(step)} {:else if TransferStep.is("SubmitInstruction")(step)} {:else if TransferStep.is("WaitForIndex")(step)} {/if} {/each} @@ -655,6 +646,9 @@ beforeNavigate(reset)
+{#key statusMessage} +

{statusMessage}

+{/key} @@ -689,7 +683,7 @@ beforeNavigate(reset) - + diff --git a/app2/src/lib/components/Transfer/state/filling/check-allowance.ts b/app2/src/lib/components/Transfer/state/filling/check-allowance.ts new file mode 100644 index 0000000000..d040c69b1f --- /dev/null +++ b/app2/src/lib/components/Transfer/state/filling/check-allowance.ts @@ -0,0 +1,250 @@ +import { Effect, Option, Match } from "effect"; +import { type AddressCanonicalBytes, Chain } from "@unionlabs/sdk/schema"; +import { isHex, fromHex, http } from "viem"; +import { + createViemPublicClient, + readErc20Allowance, + ViemPublicClient +} from "@unionlabs/sdk/evm"; +import { + createCosmWasmClient, + CosmWasmClientSource +} from "@unionlabs/sdk/cosmos"; +import { isValidBech32ContractAddress } from "@unionlabs/client"; +import type { TransferIntent } from "$lib/components/Transfer/transfer.svelte.ts"; + +/** + * Represents a single approval step indicating that a specific token + * needs an approval for the requiredAmount if currentAllowance < requiredAmount. + */ +type ApprovalStep = { + token: string; + requiredAmount: bigint; + currentAllowance: bigint; +}; + +/** + * Collect total needed amounts for each token from an array of TransferIntents. + */ +function gatherNeededAmounts(intents: TransferIntent[]): Map { + console.log("lukas: gatherNeededAmounts called with", intents); + const neededMap = new Map(); + for (const { baseToken, baseAmount } of intents) { + const current = neededMap.get(baseToken) ?? 0n; + neededMap.set(baseToken, current + baseAmount); + } + console.log("lukas: gatherNeededAmounts result:", neededMap); + return neededMap; +} + +/** + * checkAllowances: + * + * 1) Aggregates the user's needed amounts per token (from TransferIntent). + * 2) Dispatches to EVM or Cosmos logic to read actual allowances. + * 3) Builds a list of ApprovalStep objects for any token where allowance < needed. + * 4) Returns Option.none() if no approvals are needed, or Option.some([...]) otherwise. + */ +export function checkAllowances( + chain: Chain, + intents: TransferIntent[], + sender: AddressCanonicalBytes, + spenderAddress: string +) { + return Effect.gen(function* () { + console.log("lukas: checkAllowances called with", { + chain: chain.display_name, + rpc_type: chain.rpc_type, + sender, + spenderAddress, + intents + }); + + // 1) Summarize amounts needed for each token + const neededMap = gatherNeededAmounts(intents); + const tokenAddresses = [...neededMap.keys()]; + + // 2) Based on chain type, do EVM or Cosmos + const allowancesOpt = yield* Match.value(chain.rpc_type).pipe( + Match.when("evm", () => + handleEvmAllowances(tokenAddresses, sender, spenderAddress, chain) + ), + Match.when("cosmos", () => + handleCosmosAllowances(tokenAddresses, sender, spenderAddress, chain) + ), + Match.orElse(() => { + console.log("lukas: Unsupported chain type for allowances:", chain.rpc_type); + return Effect.succeed(Option.none>()); + }) + ); + + if (Option.isNone(allowancesOpt)) { + console.log("lukas: No allowances returned (Option.none)"); + return Option.none(); + } + + const allowances = allowancesOpt.value; + console.log("lukas: Fetched allowances:", allowances); + + // 3) Compare each token’s needed amount with fetched allowance + const steps: ApprovalStep[] = []; + + for (const { token, allowance } of allowances) { + const requiredAmount = neededMap.get(token) ?? 0n; + if (allowance < requiredAmount) { + console.log("lukas: Token requires approval:", { + token, + requiredAmount, + currentAllowance: allowance + }); + steps.push({ + token, + requiredAmount, + currentAllowance: allowance + }); + } + } + + // 4) Return Option.some(...) if steps needed, else Option.none() + if (steps.length === 0) { + console.log("lukas: No approval steps needed – returning Option.none"); + return Option.none(); + } + + console.log("lukas: Returning approval steps:", steps); + return Option.some(steps); + }); +} + +/** + * handleEvmAllowances: + * For each ERC20 token, read allowance in parallel. + * Returns Option.some([{ token, allowance }, ...]) or Option.none. + */ +function handleEvmAllowances( + tokenAddresses: string[], + sender: AddressCanonicalBytes, + spender: string, + sourceChain: Chain +) { + return Effect.gen(function* () { + console.log("lukas: handleEvmAllowances called with", { + tokenAddresses, + sender, + spender, + chain: sourceChain.display_name + }); + + const viemChainOpt = sourceChain.toViemChain(); + if (Option.isNone(viemChainOpt)) { + console.log("lukas: Could not get viemChain for EVM chain:", sourceChain.display_name); + return Option.none>(); + } + + const publicClientSource = yield* createViemPublicClient({ + chain: viemChainOpt.value, + transport: http() + }); + + // Parallel readErc20Allowance calls + const results = yield* Effect.all( + tokenAddresses.map(tokenAddress => + Effect.gen(function* () { + console.log("lukas: Checking allowance for EVM token:", tokenAddress); + const allowance = yield* readErc20Allowance(tokenAddress, sender, spender); + console.log("lukas: readErc20Allowance result", { tokenAddress, allowance }); + return { token: tokenAddress, allowance }; + }).pipe( + Effect.provideService(ViemPublicClient, { + client: publicClientSource + }) + ) + ) + ); + + console.log("lukas: handleEvmAllowances final results:", results); + return Option.some(results); + }); +} + +/** + * handleCosmosAllowances: + * If token is not hex => native => no approval needed => 0n allowance + * If token is hex => treat as CW20 => query allowance + */ +function handleCosmosAllowances( + tokenAddresses: string[], + sender: AddressCanonicalBytes, + spender: string, + sourceChain: Chain +) { + return Effect.gen(function* () { + console.log("lukas: handleCosmosAllowances called with", { + tokenAddresses, + sender, + spender, + chain: sourceChain.display_name + }); + + const rpcUrlOpt = sourceChain.getRpcUrl("rpc"); + if (Option.isNone(rpcUrlOpt) || !sourceChain.toCosmosDisplay) { + console.log("lukas: Missing rpcUrl or toCosmosDisplay on chain:", sourceChain.display_name); + return Option.none>(); + } + + const rpcUrl = rpcUrlOpt.value; + console.log("lukas: Creating CosmWasm client with rpcUrl:", rpcUrl); + + const cosmwasmClient = yield* createCosmWasmClient(rpcUrl); + + // For each token, either skip or query + const checks = yield* Effect.all( + tokenAddresses.map(tokenAddress => + Effect.gen(function* () { + console.log("lukas: Checking token (Cosmos):", tokenAddress); + + // If not hex => native => set allowance=0n to reflect "no approval needed" + if (!isHex(tokenAddress)) { + console.log("lukas: Token is native denom (not hex) => skip approval:", tokenAddress); + return { token: tokenAddress, allowance: 0n }; + } + + // If hex => we treat it as a CW20 + const decoded = fromHex(tokenAddress, "string"); + if (!isValidBech32ContractAddress(decoded)) { + console.log("lukas: Not valid bech32 contract address => skip:", decoded); + return { token: tokenAddress, allowance: 0n }; + } + + const owner = yield* sourceChain.toCosmosDisplay(sender); + console.log("lukas: Querying CW20 allowance for:", { + tokenAddress, + owner, + spender + }); + + const result = yield* Effect.tryPromise({ + try: () => + cosmwasmClient.queryContractSmart(decoded, { + allowance: { owner, spender } + }), + catch: e => { + console.log("lukas: Error in queryContractSmart:", e); + return e; + } + }); + + const allowance = result?.allowance ? BigInt(result.allowance) : 0n; + console.log("lukas: Query result allowance:", allowance); + + return { token: tokenAddress, allowance }; + }).pipe( + Effect.provideService(CosmWasmClientSource, { client: cosmwasmClient }) + ) + ) + ); + + console.log("lukas: handleCosmosAllowances final checks:", checks); + return Option.some(checks); + }); +} diff --git a/app2/src/lib/components/Transfer/state/filling/check-balance.ts b/app2/src/lib/components/Transfer/state/filling/check-balance.ts new file mode 100644 index 0000000000..b7b013afc8 --- /dev/null +++ b/app2/src/lib/components/Transfer/state/filling/check-balance.ts @@ -0,0 +1,35 @@ +import {Effect, Option} from "effect"; +import {type AddressCanonicalBytes, Chain, Token} from "@unionlabs/sdk/schema"; +import {balancesStore} from "$lib/stores/balances.svelte.ts"; + +export const checkBalance = (source: Chain, sender: AddressCanonicalBytes, token: Token, amount: string) => { + return Effect.flatMap( + Effect.sync(() => balancesStore.getBalance(source.universal_chain_id, sender, token.denom)), + balance => { + if (!Option.isSome(balance)) { + console.log('[CTS] No balance found'); + return Effect.succeed(false); + } + + return Effect.try({ + try: () => { + const amountBigInt = BigInt(amount); + const balanceBigInt = BigInt(balance.value); + const enough = amountBigInt <= balanceBigInt; + + console.log('[CTS] Balance check:', { + amount: amountBigInt.toString(), + balance: balanceBigInt.toString(), + enough + }); + + return enough; + }, + catch: (error) => { + console.error('[CTS] Error converting to BigInt:', error); + return false; + } + }); + } + ); +}; \ No newline at end of file diff --git a/app2/src/lib/components/Transfer/state/filling/create-orders.ts b/app2/src/lib/components/Transfer/state/filling/create-orders.ts new file mode 100644 index 0000000000..d5e26c157f --- /dev/null +++ b/app2/src/lib/components/Transfer/state/filling/create-orders.ts @@ -0,0 +1,199 @@ +import { Effect, Match, Option, pipe } from "effect"; +import { fromHex, http } from "viem"; +import { + createViemPublicClient, + ViemPublicClientSource, + ViemPublicClientDestination, + EvmChannelDestination +} from "@unionlabs/sdk/evm"; +import { + createCosmWasmClient, + CosmWasmClientSource, + CosmWasmClientDestination, + CosmosChannelDestination +} from "@unionlabs/sdk/cosmos"; +import { + createEvmToCosmosFungibleAssetOrder, + createEvmToEvmFungibleAssetOrder, + createCosmosToEvmFungibleAssetOrder, + createCosmosToCosmosFungibleAssetOrder +} from "@unionlabs/sdk/ucs03"; +import { Batch } from "@unionlabs/sdk/ucs03/instruction"; +import {Channel, Chain} from "@unionlabs/sdk/schema"; +import {transfer} from "$lib/components/Transfer/transfer.svelte.ts"; + +export function createOrdersBatch( + sourceChain: Chain, + destinationChain: Chain, + channel: Channel, + ucs03address: string, + intents: typeof transfer.intents +) { + return Effect.gen(function* () { + if (!sourceChain || !destinationChain || !channel || !ucs03address || !intents?.length) { + return Option.none(); + } + + const source = sourceChain.rpc_type; + const destination = destinationChain.rpc_type; + + // Provide viem public client for the source chain + const provideViemPublicClientSource = Effect.provideServiceEffect( + ViemPublicClientSource, + pipe( + sourceChain.toViemChain(), + Option.map(chain => + createViemPublicClient({ + chain, + transport: http() + }) + ), + Effect.flatten, + Effect.map(client => ({ client })) + ) + ); + + // Provide viem public client for the destination chain + const provideViemPublicClientDestination = Effect.provideServiceEffect( + ViemPublicClientDestination, + pipe( + destinationChain.toViemChain(), + Option.map(chain => + createViemPublicClient({ + chain, + transport: http() + }) + ), + Effect.flatten, + Effect.map(client => ({ client })) + ) + ); + + // Provide CosmWasm client for the source chain + const provideCosmWasmClientSource = Effect.provideServiceEffect( + CosmWasmClientSource, + pipe( + sourceChain.getRpcUrl("rpc"), + Option.map(createCosmWasmClient), + Effect.flatten, + Effect.map(client => ({ client })) + ) + ); + + // Provide CosmWasm client for the destination chain + const provideCosmWasmClientDestination = Effect.provideServiceEffect( + CosmWasmClientDestination, + pipe( + destinationChain.getRpcUrl("rpc"), + Option.map(createCosmWasmClient), + Effect.flatten, + Effect.map(client => ({ client })) + ) + ); + + // Provide channel addresses + const provideEvmChannelDestination = Effect.provideServiceEffect(EvmChannelDestination, { + ucs03address: channel.source_port_id, + channelId: channel.source_channel_id + }); + + const provideCosmosChannelDestination = Effect.provideServiceEffect(CosmosChannelDestination, { + ucs03address: fromHex(channel.destination_port_id, "string"), + channelId: channel.destination_channel_id + }); + + // Build the orders (Batch) based on source/destination + const batchEffect = Effect.gen(function* () { + const orders = yield* Match.value([source, destination]).pipe( + Match.when(["evm", "cosmos"], () => + // Example: EVM -> Cosmos with two intents + Effect.all([ + Effect.tap(createEvmToCosmosFungibleAssetOrder(intents[0]), createdOrder => + Effect.sync(() => console.log("First EVM->Cosmos order created", createdOrder)) + ), + Effect.tap(createEvmToCosmosFungibleAssetOrder(intents[1]), createdOrder => + Effect.sync(() => console.log("Second EVM->Cosmos order created", createdOrder)) + ) + ]).pipe( + Effect.tap(createdOrders => + Effect.sync(() => console.log("All EVM->Cosmos orders created", createdOrders)) + ), + Effect.catchAll(error => { + console.error("Error creating EVM->Cosmos orders", error.cause); + return Effect.fail(error); + }), + // Service injection for cross-chain creation + provideCosmosChannelDestination, + provideViemPublicClientSource, + provideCosmWasmClientDestination + ) + ), + + Match.when(["evm", "evm"], () => + // EVM -> EVM + Effect.all([ + createEvmToEvmFungibleAssetOrder(intents[0]), + createEvmToEvmFungibleAssetOrder(intents[1]) + ]).pipe( + Effect.tap(createdOrders => + Effect.sync(() => console.log("EVM->EVM orders created", createdOrders)) + ), + Effect.catchAll(error => { + console.error("Error creating EVM->EVM orders", error.cause); + return Effect.fail(error); + }), + provideViemPublicClientSource, + provideViemPublicClientDestination, + provideEvmChannelDestination + ) + ), + + Match.when(["cosmos", "evm"], () => + // Cosmos -> EVM + createCosmosToEvmFungibleAssetOrder(intents[0]).pipe( + Effect.tap(createdOrder => + Effect.sync(() => console.log("Cosmos->EVM order created", createdOrder)) + ), + Effect.catchAll(error => { + console.error("Error creating Cosmos->EVM order", error); + return Effect.fail(error); + }), + provideCosmWasmClientSource, + provideViemPublicClientDestination, + provideEvmChannelDestination + ) + ), + + Match.when(["cosmos", "cosmos"], () => + // Cosmos -> Cosmos + createCosmosToCosmosFungibleAssetOrder(intents[0]).pipe( + Effect.tap(createdOrder => + Effect.sync(() => console.log("Cosmos->Cosmos order created", createdOrder)) + ), + Effect.catchAll(error => { + console.error("Error creating Cosmos->Cosmos order", error.cause); + return Effect.fail(error); + }), + provideCosmWasmClientSource, + provideCosmWasmClientDestination, + provideCosmosChannelDestination + ) + ), + + Match.orElse(() => { + // Fallback if no combination matched + console.warn(`Unsupported source->destination: ${source} -> ${destination}`); + throw new Error(`Unsupported chain combo: ${source} -> ${destination}`); + }) + ); + + // Return a new Batch, wrapping single or multiple orders + return new Batch({ + operand: Array.isArray(orders) ? orders : [orders] + }); + }); + + const batchResult = yield* batchEffect; + return Option.some(batchResult); + }); +} diff --git a/app2/src/lib/components/Transfer/state/filling/index.ts b/app2/src/lib/components/Transfer/state/filling/index.ts new file mode 100644 index 0000000000..53299837cc --- /dev/null +++ b/app2/src/lib/components/Transfer/state/filling/index.ts @@ -0,0 +1,149 @@ +import {Data, Effect, type Exit, Option} from "effect"; +import type {Transfer} from "$lib/components/Transfer/transfer.svelte.ts"; +import {checkBalance} from "$lib/components/Transfer/state/filling/check-balance.ts"; +import {createOrdersBatch} from "$lib/components/Transfer/state/filling/create-orders.ts"; +import {checkAllowances} from "$lib/components/Transfer/state/filling/check-allowance.ts"; + +export type StateResult = { + nextState: CreateTransferState | null; + message?: string; +}; + +export type EffectToExit = T extends Effect.Effect + ? Exit.Exit + : never; + +export type CreateTransferState = Data.TaggedEnum<{ + Filling: {}; + CreateIntents: {}; + CheckBalance: {}; + CheckAllowance: {}; + CreateOrders: { + allowances: Array<{ token: string; allowance: bigint }>; + }; + CreateSteps: { + allowances: Array<{ token: string; allowance: bigint }>; + orders: Array; + }; +}>; + +export const CreateTransferState = Data.taggedEnum(); + +const { + CreateIntents, + CheckBalance, + CheckAllowance, + CreateOrders, + CreateSteps +} = CreateTransferState; + +export const createTransferState = ( + cts: CreateTransferState, + transfer: Transfer +): Effect.Effect => { + if ( + !Option.isSome(transfer.sourceChain) || + !Option.isSome(transfer.destinationChain) || + !Option.isSome(transfer.baseToken) || + !Option.isSome(transfer.derivedSender) || + !Option.isSome(transfer.parsedAmount) || + !Option.isSome(transfer.ucs03address) || + !Option.isSome(transfer.channel) || + !Option.isSome(transfer.intents) + ) { + console.log("[CTS] Missing arguments"); + return Effect.succeed({ + nextState: null, + message: "Missing arguments" + }); + } + + // Destructure the needed values + const channel = transfer.channel.value; + const ucs03address = transfer.ucs03address.value; + const source = transfer.sourceChain.value; + const destination = transfer.destinationChain.value; + const token = transfer.baseToken.value; + const sender = transfer.derivedSender.value; + const amount = transfer.parsedAmount.value; + const intents = transfer.intents.value; + + if (amount === "0" || amount === "" || BigInt(amount) === BigInt(0)) { + return Effect.succeed({ + nextState: null, + message: "Please enter a non-zero amount" + }); + } + + return CreateTransferState.$match(cts, { + Filling: () => + Effect.succeed({ + nextState: CreateIntents(), + message: "Creating intents..." + }), + CreateIntents: () => + Effect.succeed({ + nextState: CheckBalance(), + message: "Checking balance..." + }), + CheckBalance: () => + Effect.gen(function* () { + const hasEnoughBalance = yield* checkBalance(source, sender, token, amount); + return hasEnoughBalance + ? { nextState: CheckAllowance(), message: "Checking allowance..." } + : { nextState: null, message: "Insufficient funds" }; + }), + CheckAllowance: () => + Effect.gen(function* ($) { + // Attempt to retrieve allowances + const allowancesOpt = yield* $(checkAllowances(source, intents, sender, ucs03address)); + + if (Option.isNone(allowancesOpt)) { + return { + nextState: null, + message: "CheckAllowance not supported or no tokens to approve" + }; + } + const allowances = allowancesOpt.value; + return { + nextState: CreateOrders({ allowances }), + message: "Allowances found, creating orders next..." + }; + }), + CreateOrders: ({ allowances }) => + Effect.gen(function* () { + // Now we can pass in the chain details & create the batch + const batchOpt = yield* createOrdersBatch( + source, + destination, + channel, + ucs03address, + intents + ); + + if (Option.isNone(batchOpt)) { + return { + nextState: null, + message: "Could not create orders" + }; + } + + const batch = batchOpt.value; + console.log("Successfully created batch:", batch); + return { + nextState: CreateSteps({ + allowances, + orders: batch + }), + message: "Orders created successfully" + }; + }), + CreateSteps: ({ allowances, orders }) => + Effect.succeed({ + nextState: null, + message: `Transfer process complete (or ready) – allowances: ${JSON.stringify( + allowances + )}, orders: ${JSON.stringify(orders)}` + }) + }); +}; diff --git a/app2/src/lib/components/Transfer/state/filling/transfer-steps.ts b/app2/src/lib/components/Transfer/state/filling/transfer-steps.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app2/src/lib/components/Transfer/transfer.svelte.ts b/app2/src/lib/components/Transfer/transfer.svelte.ts index 0eea220e90..cfb95ed68e 100644 --- a/app2/src/lib/components/Transfer/transfer.svelte.ts +++ b/app2/src/lib/components/Transfer/transfer.svelte.ts @@ -1,15 +1,24 @@ -import { Option } from "effect" +import {Match, Option} from "effect" import { RawTransferSvelte } from "./raw-transfer.svelte.ts" import type { Channel, Token } from "@unionlabs/sdk/schema" import { tokensStore } from "$lib/stores/tokens.svelte.ts" import { chains } from "$lib/stores/chains.svelte.ts" -import { type Address, fromHex, type Hex } from "viem" +import {type Address, fromHex, type Hex, isHex} from "viem" import { channels } from "$lib/stores/channels.svelte.ts" import { getChannelInfoSafe } from "$lib/services/transfer-ucs03-evm/channel.ts" import { getDerivedReceiverSafe, getParsedAmountSafe } from "$lib/services/shared" import { sortedBalancesStore } from "$lib/stores/sorted-balances.svelte.ts" import { validateTransfer, type ValidationResult } from "$lib/components/Transfer/validation.ts" import { WETH_DENOMS } from "$lib/constants/weth-denoms.ts" +import {wallets} from "$lib/stores/wallets.svelte.ts"; + +export type TransferIntent = { + sender: string; + receiver: string; + baseToken: string; + baseAmount: bigint; + quoteAmount: bigint; +}; export class Transfer { raw = new RawTransferSvelte() @@ -70,6 +79,12 @@ export class Transfer { derivedReceiver = $derived(getDerivedReceiverSafe(this.raw.receiver)) + derivedSender = $derived( + Option.isNone(this.sourceChain) + ? Option.none() + : wallets.getAddressForChain(this.sourceChain.value) + ) + channel = $derived.by>(() => { return Option.all([channels.data, this.sourceChain, this.destinationChain]).pipe( Option.flatMap(([channelsData, sourceChain, destinationChain]) => @@ -145,6 +160,56 @@ export class Transfer { } }) + intents = $derived.by(() => { + if (this.validation._tag !== "Success") return Option.none() + const transferValue = this.validation.value + + if (Option.isNone(this.derivedSender)) return Option.none() + + const sender = Option.getOrUndefined(this.derivedSender) + if (!sender) return Option.none() + + return Match.value(transferValue.sourceChain.rpc_type).pipe( + Match.when("evm", () => { + if (Option.isNone(this.wethBaseToken)) return Option.none() + // Safely get the wethBaseToken + const wethToken = Option.getOrUndefined(this.wethBaseToken) + if (!wethToken) return Option.none() + + return Option.some([ + { + sender: sender, + receiver: transferValue.receiver, + baseToken: transferValue.baseToken, + baseAmount: transferValue.baseAmount, + quoteAmount: transferValue.baseAmount + }, + { + sender: sender, + receiver: transferValue.receiver, + baseToken: wethToken, + baseAmount: 500n, + quoteAmount: 0n + } + ]) + }), + Match.when("cosmos", () => { + return Option.some([ + { + sender: sender, + receiver: transferValue.receiver.toLowerCase(), + baseToken: isHex(transferValue.baseToken) + ? fromHex(transferValue.baseToken, "string") + : transferValue.baseToken, + baseAmount: transferValue.baseAmount, + quoteAmount: transferValue.baseAmount + } + ]) + }), + Match.orElse(() => Option.none()) + ) + }) + validation = $derived.by(() => validateTransfer(this.args)) } diff --git a/app2/src/lib/queries/chains.svelte.ts b/app2/src/lib/queries/chains.svelte.ts index 3c8855741d..d8acece2fa 100644 --- a/app2/src/lib/queries/chains.svelte.ts +++ b/app2/src/lib/queries/chains.svelte.ts @@ -5,7 +5,7 @@ import { graphql } from "gql.tada" import { chains } from "$lib/stores/chains.svelte" import type { Environment } from "$lib/constants" -export let chainsQuery = (environment: Environment) => +export const chainsQuery = (environment: Environment) => createQueryGraphql({ schema: Schema.Struct({ v2_chains: Chains }), document: graphql(` @@ -42,7 +42,7 @@ export let chainsQuery = (environment: Environment) => } `), variables: { environment }, - refetchInterval: "60 seconds", + refetchInterval: "10 minutes", writeData: data => { chains.data = data.pipe(Option.map(d => d.v2_chains)) }, diff --git a/app2/src/lib/queries/channels.svelte.ts b/app2/src/lib/queries/channels.svelte.ts index 54a5cd5b74..17fddcffb4 100644 --- a/app2/src/lib/queries/channels.svelte.ts +++ b/app2/src/lib/queries/channels.svelte.ts @@ -27,7 +27,7 @@ export const channelsQuery = () => } `), variables: {}, - refetchInterval: "60 seconds", + refetchInterval: "10 minutes", writeData: data => { channels.data = data.pipe(Option.map(d => d.v2_channels)) }, From 43e8569ba70f2b94c79989c7662f9bd89ffdfbaa Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 5 Apr 2025 00:06:59 +0200 Subject: [PATCH 02/43] feat(app2): wip - transfer state --- .../Transfer/state/filling/check-allowance.ts | 41 ++-- .../Transfer/state/filling/create-orders.ts | 227 ++++++++++++------ .../Transfer/state/filling/index.ts | 46 ++-- .../components/Transfer/transfer.svelte.ts | 34 +-- 4 files changed, 197 insertions(+), 151 deletions(-) diff --git a/app2/src/lib/components/Transfer/state/filling/check-allowance.ts b/app2/src/lib/components/Transfer/state/filling/check-allowance.ts index d040c69b1f..aabf306b37 100644 --- a/app2/src/lib/components/Transfer/state/filling/check-allowance.ts +++ b/app2/src/lib/components/Transfer/state/filling/check-allowance.ts @@ -1,6 +1,6 @@ import { Effect, Option, Match } from "effect"; import { type AddressCanonicalBytes, Chain } from "@unionlabs/sdk/schema"; -import { isHex, fromHex, http } from "viem"; +import {isHex, fromHex, http, type Address} from "viem"; import { createViemPublicClient, readErc20Allowance, @@ -105,7 +105,6 @@ export function checkAllowances( } } - // 4) Return Option.some(...) if steps needed, else Option.none() if (steps.length === 0) { console.log("lukas: No approval steps needed – returning Option.none"); return Option.none(); @@ -148,11 +147,9 @@ function handleEvmAllowances( // Parallel readErc20Allowance calls const results = yield* Effect.all( - tokenAddresses.map(tokenAddress => + tokenAddresses.map((tokenAddress) => Effect.gen(function* () { - console.log("lukas: Checking allowance for EVM token:", tokenAddress); const allowance = yield* readErc20Allowance(tokenAddress, sender, spender); - console.log("lukas: readErc20Allowance result", { tokenAddress, allowance }); return { token: tokenAddress, allowance }; }).pipe( Effect.provideService(ViemPublicClient, { @@ -193,36 +190,29 @@ function handleCosmosAllowances( } const rpcUrl = rpcUrlOpt.value; - console.log("lukas: Creating CosmWasm client with rpcUrl:", rpcUrl); - const cosmwasmClient = yield* createCosmWasmClient(rpcUrl); - // For each token, either skip or query - const checks = yield* Effect.all( - tokenAddresses.map(tokenAddress => - Effect.gen(function* () { - console.log("lukas: Checking token (Cosmos):", tokenAddress); + // Filter out native tokens entirely + const cw20Addresses = tokenAddresses.filter(isHex); - // If not hex => native => set allowance=0n to reflect "no approval needed" - if (!isHex(tokenAddress)) { - console.log("lukas: Token is native denom (not hex) => skip approval:", tokenAddress); - return { token: tokenAddress, allowance: 0n }; - } + // If everything was native, we can just return an empty array + if (cw20Addresses.length === 0) { + console.log("lukas: All tokens are native → no allowances needed"); + return Option.some([]); + } - // If hex => we treat it as a CW20 + const checks = yield* Effect.all( + cw20Addresses.map(tokenAddress => + Effect.gen(function* () { + console.log("lukas: Checking CW20 token:", tokenAddress); const decoded = fromHex(tokenAddress, "string"); + if (!isValidBech32ContractAddress(decoded)) { - console.log("lukas: Not valid bech32 contract address => skip:", decoded); + console.log("lukas: Not valid bech32 contract address => skipping:", decoded); return { token: tokenAddress, allowance: 0n }; } const owner = yield* sourceChain.toCosmosDisplay(sender); - console.log("lukas: Querying CW20 allowance for:", { - tokenAddress, - owner, - spender - }); - const result = yield* Effect.tryPromise({ try: () => cosmwasmClient.queryContractSmart(decoded, { @@ -248,3 +238,4 @@ function handleCosmosAllowances( return Option.some(checks); }); } + diff --git a/app2/src/lib/components/Transfer/state/filling/create-orders.ts b/app2/src/lib/components/Transfer/state/filling/create-orders.ts index d5e26c157f..e62854e17c 100644 --- a/app2/src/lib/components/Transfer/state/filling/create-orders.ts +++ b/app2/src/lib/components/Transfer/state/filling/create-orders.ts @@ -1,5 +1,5 @@ import { Effect, Match, Option, pipe } from "effect"; -import { fromHex, http } from "viem"; +import { fromHex, http, isHex } from "viem"; import { createViemPublicClient, ViemPublicClientSource, @@ -19,8 +19,8 @@ import { createCosmosToCosmosFungibleAssetOrder } from "@unionlabs/sdk/ucs03"; import { Batch } from "@unionlabs/sdk/ucs03/instruction"; -import {Channel, Chain} from "@unionlabs/sdk/schema"; -import {transfer} from "$lib/components/Transfer/transfer.svelte.ts"; +import { Channel, Chain } from "@unionlabs/sdk/schema"; +import { transfer } from "$lib/components/Transfer/transfer.svelte.ts"; export function createOrdersBatch( sourceChain: Chain, @@ -30,14 +30,30 @@ export function createOrdersBatch( intents: typeof transfer.intents ) { return Effect.gen(function* () { - if (!sourceChain || !destinationChain || !channel || !ucs03address || !intents?.length) { + // Validate required parameters. + if ( + !sourceChain || + !destinationChain || + !channel || + !ucs03address || + !intents?.length + ) { + console.log("lukas: Missing required params or no intents → returning Option.none"); return Option.none(); } + console.log("lukas: createOrdersBatch invoked with:"); + console.log("lukas: sourceChain =>", sourceChain.display_name); + console.log("lukas: destinationChain =>", destinationChain.display_name); + console.log("lukas: channel =>", channel); + console.log("lukas: ucs03address =>", ucs03address); + console.log("lukas: first intent =>", intents[0]); + // Extract the chain type strings. const source = sourceChain.rpc_type; const destination = destinationChain.rpc_type; + console.log("lukas: source =>", source, ", destination =>", destination); - // Provide viem public client for the source chain + // Set up client providers. const provideViemPublicClientSource = Effect.provideServiceEffect( ViemPublicClientSource, pipe( @@ -53,23 +69,25 @@ export function createOrdersBatch( ) ); - // Provide viem public client for the destination chain - const provideViemPublicClientDestination = Effect.provideServiceEffect( - ViemPublicClientDestination, - pipe( - destinationChain.toViemChain(), - Option.map(chain => - createViemPublicClient({ - chain, - transport: http() - }) - ), - Effect.flatten, - Effect.map(client => ({ client })) - ) - ); + // For destination: only use ViemPublicClientDestination if destination is EVM. + const provideViemPublicClientDestination = + destination === "evm" + ? Effect.provideServiceEffect( + ViemPublicClientDestination, + pipe( + destinationChain.toViemChain(), + Option.map(chain => + createViemPublicClient({ + chain, + transport: http() + }) + ), + Effect.flatten, + Effect.map(client => ({ client })) + ) + ) + : Effect.succeed({}); - // Provide CosmWasm client for the source chain const provideCosmWasmClientSource = Effect.provideServiceEffect( CosmWasmClientSource, pipe( @@ -80,7 +98,6 @@ export function createOrdersBatch( ) ); - // Provide CosmWasm client for the destination chain const provideCosmWasmClientDestination = Effect.provideServiceEffect( CosmWasmClientDestination, pipe( @@ -91,109 +108,159 @@ export function createOrdersBatch( ) ); - // Provide channel addresses - const provideEvmChannelDestination = Effect.provideServiceEffect(EvmChannelDestination, { - ucs03address: channel.source_port_id, - channelId: channel.source_channel_id - }); - - const provideCosmosChannelDestination = Effect.provideServiceEffect(CosmosChannelDestination, { + // Set up channel provider data. + const evmChannelDestinationData = { + ucs03address: channel.destination_port_id, + channelId: channel.destination_channel_id + }; + const cosmosChannelDestinationData = { ucs03address: fromHex(channel.destination_port_id, "string"), channelId: channel.destination_channel_id - }); + }; + console.log("lukas: EVM Channel =>", evmChannelDestinationData); + console.log("lukas: Cosmos Channel =>", cosmosChannelDestinationData); - // Build the orders (Batch) based on source/destination + const provideEvmChannelDestination = Effect.provideServiceEffect( + EvmChannelDestination, + Effect.succeed(evmChannelDestinationData) + ); + const provideCosmosChannelDestination = Effect.provideServiceEffect( + CosmosChannelDestination, + Effect.succeed(cosmosChannelDestinationData) + ); + + console.log("lukas: Setting up batchEffect for order creation..."); + + // Build the orders using a Match over [source, destination]. const batchEffect = Effect.gen(function* () { + console.log(`lukas: Using Match with [${source}, ${destination}]`); const orders = yield* Match.value([source, destination]).pipe( - Match.when(["evm", "cosmos"], () => - // Example: EVM -> Cosmos with two intents - Effect.all([ - Effect.tap(createEvmToCosmosFungibleAssetOrder(intents[0]), createdOrder => - Effect.sync(() => console.log("First EVM->Cosmos order created", createdOrder)) + // EVM -> Cosmos: Create two orders if two intents exist. + Match.when(["evm", "cosmos"], () => { + console.log("lukas: Matched EVM -> Cosmos pattern", intents.value); + return Effect.all([ + Effect.tap(createEvmToCosmosFungibleAssetOrder(intents[0]), order => + Effect.sync(() => console.log("lukas: First EVM->Cosmos order created", order)) ), - Effect.tap(createEvmToCosmosFungibleAssetOrder(intents[1]), createdOrder => - Effect.sync(() => console.log("Second EVM->Cosmos order created", createdOrder)) - ) + intents.length > 1 + ? Effect.tap(createEvmToCosmosFungibleAssetOrder(intents[1]), order => + Effect.sync(() => console.log("lukas: Second EVM->Cosmos order created", order)) + ) + : Effect.succeed(null) ]).pipe( Effect.tap(createdOrders => - Effect.sync(() => console.log("All EVM->Cosmos orders created", createdOrders)) + Effect.sync(() => console.log("lukas: All EVM->Cosmos orders created", createdOrders)) ), Effect.catchAll(error => { - console.error("Error creating EVM->Cosmos orders", error.cause); + console.error("lukas: Error creating EVM->Cosmos orders", error); return Effect.fail(error); }), - // Service injection for cross-chain creation + // Apply providers for this branch. provideCosmosChannelDestination, provideViemPublicClientSource, provideCosmWasmClientDestination - ) - ), - - Match.when(["evm", "evm"], () => - // EVM -> EVM - Effect.all([ - createEvmToEvmFungibleAssetOrder(intents[0]), - createEvmToEvmFungibleAssetOrder(intents[1]) + ); + }), + // EVM -> EVM: Create two orders. + Match.when(["evm", "evm"], () => { + console.log("lukas: Matched EVM -> EVM pattern"); + return Effect.all([ + Effect.tap(createEvmToEvmFungibleAssetOrder(intents[0]), order => + Effect.sync(() => console.log("lukas: EVM->EVM first order created", order)) + ), + intents.length > 1 + ? Effect.tap(createEvmToEvmFungibleAssetOrder(intents[1]), order => + Effect.sync(() => console.log("lukas: EVM->EVM second order created", order)) + ) + : Effect.succeed(null) ]).pipe( Effect.tap(createdOrders => - Effect.sync(() => console.log("EVM->EVM orders created", createdOrders)) + Effect.sync(() => console.log("lukas: EVM->EVM orders created", createdOrders)) ), Effect.catchAll(error => { - console.error("Error creating EVM->EVM orders", error.cause); + console.error("lukas: Error creating EVM->EVM orders", error); return Effect.fail(error); }), provideViemPublicClientSource, provideViemPublicClientDestination, provideEvmChannelDestination - ) - ), - - Match.when(["cosmos", "evm"], () => - // Cosmos -> EVM - createCosmosToEvmFungibleAssetOrder(intents[0]).pipe( - Effect.tap(createdOrder => - Effect.sync(() => console.log("Cosmos->EVM order created", createdOrder)) + ); + }), + // Cosmos -> EVM: Create one order. + Match.when(["cosmos", "evm"], () => { + console.log("lukas: Matched Cosmos -> EVM pattern"); + // Wrap in Effect.all to maintain consistency with other branches + return Effect.all([ + createCosmosToEvmFungibleAssetOrder(intents[0]).pipe( + Effect.tap(order => + Effect.sync(() => console.log("lukas: (Cosmos->EVM) order created", order)) + ) + ) + ]).pipe( + Effect.tap(createdOrders => + Effect.sync(() => console.log("lukas: All Cosmos->EVM orders created", createdOrders)) ), Effect.catchAll(error => { - console.error("Error creating Cosmos->EVM order", error); + console.error("lukas: Error creating Cosmos->EVM orders", error); return Effect.fail(error); }), provideCosmWasmClientSource, provideViemPublicClientDestination, provideEvmChannelDestination - ) - ), - - Match.when(["cosmos", "cosmos"], () => - // Cosmos -> Cosmos - createCosmosToCosmosFungibleAssetOrder(intents[0]).pipe( - Effect.tap(createdOrder => - Effect.sync(() => console.log("Cosmos->Cosmos order created", createdOrder)) + ); + }), + // Cosmos -> Cosmos: Create one order. + Match.when(["cosmos", "cosmos"], () => { + console.log("lukas: Matched Cosmos -> Cosmos pattern"); + // Wrap in Effect.all to maintain consistency with other branches + return Effect.all([ + createCosmosToCosmosFungibleAssetOrder(intents[0]).pipe( + Effect.tap(order => + Effect.sync(() => console.log("lukas: (Cosmos->Cosmos) order created", order)) + ) + ) + ]).pipe( + Effect.tap(createdOrders => + Effect.sync(() => console.log("lukas: All Cosmos->Cosmos orders created", createdOrders)) ), Effect.catchAll(error => { - console.error("Error creating Cosmos->Cosmos order", error.cause); + console.error("lukas: Error creating Cosmos->Cosmos orders", error); return Effect.fail(error); }), provideCosmWasmClientSource, provideCosmWasmClientDestination, provideCosmosChannelDestination - ) - ), - + ); + }), Match.orElse(() => { - // Fallback if no combination matched - console.warn(`Unsupported source->destination: ${source} -> ${destination}`); + console.warn(`lukas: Unsupported source->destination: ${source} -> ${destination}`); throw new Error(`Unsupported chain combo: ${source} -> ${destination}`); }) ); - // Return a new Batch, wrapping single or multiple orders - return new Batch({ - operand: Array.isArray(orders) ? orders : [orders] + // Yield the resolved orders. + console.log("lukas: Done creating orders =>", orders); + + // Filter null values (from optional second intents) + const filteredOrders = orders.filter(order => order !== null); + console.log("lukas: Filtered orders:", filteredOrders); + + const batch = new Batch({ + operand: filteredOrders }); + console.log("lukas: Created new Batch =>", batch); + return batch; }); + console.log("lukas: About to run batchEffect..."); const batchResult = yield* batchEffect; + console.log("lukas: Batch created successfully:", batchResult); + console.log("lukas: Finished batchEffect. Returning Option.some(batch)."); return Option.some(batchResult); - }); -} + }).pipe( + Effect.catchAll(error => { + console.error("lukas: Top-level error in createOrdersBatch:", error); + return Effect.succeed(Option.none()); + }) + ); +} \ No newline at end of file diff --git a/app2/src/lib/components/Transfer/state/filling/index.ts b/app2/src/lib/components/Transfer/state/filling/index.ts index 53299837cc..ecdbe96b7d 100644 --- a/app2/src/lib/components/Transfer/state/filling/index.ts +++ b/app2/src/lib/components/Transfer/state/filling/index.ts @@ -1,8 +1,8 @@ -import {Data, Effect, type Exit, Option} from "effect"; -import type {Transfer} from "$lib/components/Transfer/transfer.svelte.ts"; -import {checkBalance} from "$lib/components/Transfer/state/filling/check-balance.ts"; -import {createOrdersBatch} from "$lib/components/Transfer/state/filling/create-orders.ts"; -import {checkAllowances} from "$lib/components/Transfer/state/filling/check-allowance.ts"; +import { Data, Effect, type Exit, Option } from "effect"; +import type { Transfer } from "$lib/components/Transfer/transfer.svelte.ts"; +import { checkBalance } from "$lib/components/Transfer/state/filling/check-balance.ts"; +import { createOrdersBatch } from "$lib/components/Transfer/state/filling/create-orders.ts"; +import { checkAllowances } from "$lib/components/Transfer/state/filling/check-allowance.ts"; export type StateResult = { nextState: CreateTransferState | null; @@ -29,18 +29,13 @@ export type CreateTransferState = Data.TaggedEnum<{ export const CreateTransferState = Data.taggedEnum(); -const { - CreateIntents, - CheckBalance, - CheckAllowance, - CreateOrders, - CreateSteps -} = CreateTransferState; +const { CreateIntents, CheckBalance, CheckAllowance, CreateOrders, CreateSteps } = + CreateTransferState; export const createTransferState = ( cts: CreateTransferState, transfer: Transfer -): Effect.Effect => { +) => { if ( !Option.isSome(transfer.sourceChain) || !Option.isSome(transfer.destinationChain) || @@ -58,7 +53,7 @@ export const createTransferState = ( }); } - // Destructure the needed values + // Destructure the needed values. Note that source and destination are now full chain objects. const channel = transfer.channel.value; const ucs03address = transfer.ucs03address.value; const source = transfer.sourceChain.value; @@ -95,24 +90,15 @@ export const createTransferState = ( }), CheckAllowance: () => Effect.gen(function* ($) { - // Attempt to retrieve allowances const allowancesOpt = yield* $(checkAllowances(source, intents, sender, ucs03address)); - - if (Option.isNone(allowancesOpt)) { - return { - nextState: null, - message: "CheckAllowance not supported or no tokens to approve" - }; - } - const allowances = allowancesOpt.value; + const allowances = Option.getOrElse(allowancesOpt, () => []); return { nextState: CreateOrders({ allowances }), - message: "Allowances found, creating orders next..." + message: "Creating orders..." }; }), CreateOrders: ({ allowances }) => Effect.gen(function* () { - // Now we can pass in the chain details & create the batch const batchOpt = yield* createOrdersBatch( source, destination, @@ -120,14 +106,12 @@ export const createTransferState = ( ucs03address, intents ); - if (Option.isNone(batchOpt)) { return { nextState: null, message: "Could not create orders" }; } - const batch = batchOpt.value; console.log("Successfully created batch:", batch); return { @@ -138,12 +122,14 @@ export const createTransferState = ( message: "Orders created successfully" }; }), - CreateSteps: ({ allowances, orders }) => - Effect.succeed({ + CreateSteps: ({ allowances, orders }) => { + console.log("lukas here"); + return Effect.succeed({ nextState: null, message: `Transfer process complete (or ready) – allowances: ${JSON.stringify( allowances )}, orders: ${JSON.stringify(orders)}` - }) + }); + } }); }; diff --git a/app2/src/lib/components/Transfer/transfer.svelte.ts b/app2/src/lib/components/Transfer/transfer.svelte.ts index cfb95ed68e..c878e8f824 100644 --- a/app2/src/lib/components/Transfer/transfer.svelte.ts +++ b/app2/src/lib/components/Transfer/transfer.svelte.ts @@ -19,6 +19,7 @@ export type TransferIntent = { baseAmount: bigint; quoteAmount: bigint; }; +export type TransferIntents = Array; export class Transfer { raw = new RawTransferSvelte() @@ -161,22 +162,21 @@ export class Transfer { }) intents = $derived.by(() => { - if (this.validation._tag !== "Success") return Option.none() - const transferValue = this.validation.value + if (this.validation._tag !== "Success") return Option.none(); + const transferValue = this.validation.value; - if (Option.isNone(this.derivedSender)) return Option.none() + if (Option.isNone(this.derivedSender)) return Option.none(); - const sender = Option.getOrUndefined(this.derivedSender) - if (!sender) return Option.none() + const sender = Option.getOrUndefined(this.derivedSender); + if (!sender) return Option.none(); return Match.value(transferValue.sourceChain.rpc_type).pipe( Match.when("evm", () => { - if (Option.isNone(this.wethBaseToken)) return Option.none() - // Safely get the wethBaseToken - const wethToken = Option.getOrUndefined(this.wethBaseToken) - if (!wethToken) return Option.none() + if (Option.isNone(this.wethBaseToken)) return Option.none(); + const wethToken = Option.getOrUndefined(this.wethBaseToken); + if (!wethToken) return Option.none(); - return Option.some([ + return Option.some([ { sender: sender, receiver: transferValue.receiver, @@ -191,10 +191,11 @@ export class Transfer { baseAmount: 500n, quoteAmount: 0n } - ]) + ]); }), + Match.when("cosmos", () => { - return Option.some([ + return Option.some([ { sender: sender, receiver: transferValue.receiver.toLowerCase(), @@ -204,11 +205,12 @@ export class Transfer { baseAmount: transferValue.baseAmount, quoteAmount: transferValue.baseAmount } - ]) + ]); }), - Match.orElse(() => Option.none()) - ) - }) + + Match.orElse(() => Option.none()) + ); + }); validation = $derived.by(() => validateTransfer(this.args)) } From bb98b586127b661ea1d44dee1b179ba086585158 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 5 Apr 2025 02:48:20 +0200 Subject: [PATCH 03/43] feat(app2): wip - transfer state --- app2/src/lib/components/Transfer/index.svelte | 596 +++--------------- .../Transfer/state/filling/create-orders.ts | 6 +- .../Transfer/state/filling/index.ts | 35 +- app2/src/lib/queries/channels.svelte.ts | 2 +- 4 files changed, 115 insertions(+), 524 deletions(-) diff --git a/app2/src/lib/components/Transfer/index.svelte b/app2/src/lib/components/Transfer/index.svelte index 9b35c039ba..08c051c177 100644 --- a/app2/src/lib/components/Transfer/index.svelte +++ b/app2/src/lib/components/Transfer/index.svelte @@ -1,486 +1,58 @@ + = T extends Effect.Effect @@ -19,11 +28,11 @@ export type CreateTransferState = Data.TaggedEnum<{ CheckBalance: {}; CheckAllowance: {}; CreateOrders: { - allowances: Array<{ token: string; allowance: bigint }>; + allowances: AllowanceData[]; }; CreateSteps: { - allowances: Array<{ token: string; allowance: bigint }>; - orders: Array; + allowances: AllowanceData[]; + orders: unknown[]; }; }>; @@ -53,7 +62,6 @@ export const createTransferState = ( }); } - // Destructure the needed values. Note that source and destination are now full chain objects. const channel = transfer.channel.value; const ucs03address = transfer.ucs03address.value; const source = transfer.sourceChain.value; @@ -90,6 +98,7 @@ export const createTransferState = ( }), CheckAllowance: () => Effect.gen(function* ($) { + // Expected to return allowances in the new AllowanceData format. const allowancesOpt = yield* $(checkAllowances(source, intents, sender, ucs03address)); const allowances = Option.getOrElse(allowancesOpt, () => []); return { @@ -114,21 +123,21 @@ export const createTransferState = ( } const batch = batchOpt.value; console.log("Successfully created batch:", batch); + // Return orders and allowances for later use. return { - nextState: CreateSteps({ - allowances, - orders: batch - }), - message: "Orders created successfully" + nextState: CreateSteps({ allowances, orders: batch }), + message: "Orders created successfully", + orders: batch, + allowances: allowances }; }), CreateSteps: ({ allowances, orders }) => { - console.log("lukas here"); + console.log("Finalizing transfer process"); return Effect.succeed({ nextState: null, - message: `Transfer process complete (or ready) – allowances: ${JSON.stringify( - allowances - )}, orders: ${JSON.stringify(orders)}` + message: `Transfer complete – allowances: ${JSON.stringify(allowances)}, orders: ${JSON.stringify(orders)}`, + orders, + allowances }); } }); diff --git a/app2/src/lib/queries/channels.svelte.ts b/app2/src/lib/queries/channels.svelte.ts index 17fddcffb4..5935fd7d57 100644 --- a/app2/src/lib/queries/channels.svelte.ts +++ b/app2/src/lib/queries/channels.svelte.ts @@ -9,7 +9,7 @@ export const channelsQuery = () => schema: Schema.Struct({ v2_channels: Channels }), document: graphql(` query Ucs03Channels @cached(ttl: 60) { - v2_channels(args: { p_tags: ["experimental"]}) { + v2_channels(args: { p_recommended: true}) { destination_channel_id destination_client_id destination_connection_id From 24c5aa5e92cc052a5f1fc8812dae121444fdf435 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 5 Apr 2025 03:20:22 +0200 Subject: [PATCH 04/43] feat(app2): wip - transfer state --- app2/src/lib/components/Transfer/index.svelte | 51 ------------ .../Transfer/state/filling/check-balance.ts | 77 +++++++++++-------- .../Transfer/state/filling/index.ts | 25 +++--- .../components/Transfer/transfer.svelte.ts | 6 +- app2/src/lib/queries/channels.svelte.ts | 4 +- 5 files changed, 61 insertions(+), 102 deletions(-) diff --git a/app2/src/lib/components/Transfer/index.svelte b/app2/src/lib/components/Transfer/index.svelte index 08c051c177..786e9ecce0 100644 --- a/app2/src/lib/components/Transfer/index.svelte +++ b/app2/src/lib/components/Transfer/index.svelte @@ -220,7 +220,6 @@ {:else if TransferStep.is("WaitForIndex")(step)} {/if} {/each} @@ -231,53 +230,3 @@ {#key statusMessage}

{statusMessage}

{/key} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app2/src/lib/components/Transfer/state/filling/check-balance.ts b/app2/src/lib/components/Transfer/state/filling/check-balance.ts index b7b013afc8..971482190c 100644 --- a/app2/src/lib/components/Transfer/state/filling/check-balance.ts +++ b/app2/src/lib/components/Transfer/state/filling/check-balance.ts @@ -1,35 +1,52 @@ -import {Effect, Option} from "effect"; -import {type AddressCanonicalBytes, Chain, Token} from "@unionlabs/sdk/schema"; -import {balancesStore} from "$lib/stores/balances.svelte.ts"; +import { Effect, Option } from "effect"; +import { Chain } from "@unionlabs/sdk/schema"; +import { balancesStore } from "$lib/stores/balances.svelte.ts"; +import type {TransferIntents} from "$lib/components/Transfer/transfer.svelte.ts"; -export const checkBalance = (source: Chain, sender: AddressCanonicalBytes, token: Token, amount: string) => { - return Effect.flatMap( - Effect.sync(() => balancesStore.getBalance(source.universal_chain_id, sender, token.denom)), - balance => { - if (!Option.isSome(balance)) { - console.log('[CTS] No balance found'); - return Effect.succeed(false); - } - return Effect.try({ - try: () => { - const amountBigInt = BigInt(amount); - const balanceBigInt = BigInt(balance.value); - const enough = amountBigInt <= balanceBigInt; +export const checkBalanceForIntents = ( + source: Chain, + intents: TransferIntents +) => { + const grouped = intents.reduce((acc, intent) => { + const key = `${intent.sender}_${intent.baseToken}`; + if (!acc[key]) { + acc[key] = { sender: intent.sender, baseToken: intent.baseToken, required: intent.baseAmount }; + } else { + acc[key].required += intent.baseAmount; + } + return acc; + }, {} as Record); - console.log('[CTS] Balance check:', { - amount: amountBigInt.toString(), - balance: balanceBigInt.toString(), - enough - }); + const groupedValues = Object.values(grouped); - return enough; - }, - catch: (error) => { - console.error('[CTS] Error converting to BigInt:', error); - return false; + return Effect.forEach(groupedValues, (group) => + Effect.flatMap( + Effect.sync(() => + balancesStore.getBalance(source.universal_chain_id, group.sender, group.baseToken) + ), + (balance) => { + if (!Option.isSome(balance)) { + console.log("[CTS] No balance found for grouping:", group); + return Effect.succeed(false); } - }); - } - ); -}; \ No newline at end of file + return Effect.try({ + try: () => { + const balanceBigInt = BigInt(balance.value); + const enough = group.required <= balanceBigInt; + console.log("[CTS] Balance check for grouping:", { + group, + balance: balanceBigInt.toString(), + enough + }); + return enough; + }, + catch: (error) => { + console.error("[CTS] Error converting balance to BigInt for grouping:", group, error); + return false; + } + }); + } + ) + ).pipe(Effect.map((results) => results.every((result) => result === true))); +}; diff --git a/app2/src/lib/components/Transfer/state/filling/index.ts b/app2/src/lib/components/Transfer/state/filling/index.ts index 0af3452b8b..01492c229d 100644 --- a/app2/src/lib/components/Transfer/state/filling/index.ts +++ b/app2/src/lib/components/Transfer/state/filling/index.ts @@ -1,6 +1,6 @@ import { Data, Effect, type Exit, Option } from "effect"; -import type { Transfer } from "$lib/components/Transfer/transfer.svelte.ts"; -import { checkBalance } from "$lib/components/Transfer/state/filling/check-balance.ts"; +import type { Transfer, TransferIntents } from "$lib/components/Transfer/transfer.svelte.ts"; +import { checkBalanceForIntents } from "$lib/components/Transfer/state/filling/check-balance.ts"; import { createOrdersBatch } from "$lib/components/Transfer/state/filling/create-orders.ts"; import { checkAllowances } from "$lib/components/Transfer/state/filling/check-allowance.ts"; @@ -25,15 +25,10 @@ export type EffectToExit = T extends Effect.Effect export type CreateTransferState = Data.TaggedEnum<{ Filling: {}; CreateIntents: {}; - CheckBalance: {}; + CheckBalance: { intents: TransferIntents }; CheckAllowance: {}; - CreateOrders: { - allowances: AllowanceData[]; - }; - CreateSteps: { - allowances: AllowanceData[]; - orders: unknown[]; - }; + CreateOrders: { allowances: AllowanceData[] }; + CreateSteps: { allowances: AllowanceData[]; orders: unknown[] }; }>; export const CreateTransferState = Data.taggedEnum(); @@ -66,7 +61,6 @@ export const createTransferState = ( const ucs03address = transfer.ucs03address.value; const source = transfer.sourceChain.value; const destination = transfer.destinationChain.value; - const token = transfer.baseToken.value; const sender = transfer.derivedSender.value; const amount = transfer.parsedAmount.value; const intents = transfer.intents.value; @@ -74,7 +68,7 @@ export const createTransferState = ( if (amount === "0" || amount === "" || BigInt(amount) === BigInt(0)) { return Effect.succeed({ nextState: null, - message: "Please enter a non-zero amount" + message: "Enter an amount" }); } @@ -86,19 +80,18 @@ export const createTransferState = ( }), CreateIntents: () => Effect.succeed({ - nextState: CheckBalance(), + nextState: CheckBalance({ intents }), message: "Checking balance..." }), - CheckBalance: () => + CheckBalance: ({ intents }) => Effect.gen(function* () { - const hasEnoughBalance = yield* checkBalance(source, sender, token, amount); + const hasEnoughBalance = yield* checkBalanceForIntents(source, intents); return hasEnoughBalance ? { nextState: CheckAllowance(), message: "Checking allowance..." } : { nextState: null, message: "Insufficient funds" }; }), CheckAllowance: () => Effect.gen(function* ($) { - // Expected to return allowances in the new AllowanceData format. const allowancesOpt = yield* $(checkAllowances(source, intents, sender, ucs03address)); const allowances = Option.getOrElse(allowancesOpt, () => []); return { diff --git a/app2/src/lib/components/Transfer/transfer.svelte.ts b/app2/src/lib/components/Transfer/transfer.svelte.ts index c878e8f824..604eb15595 100644 --- a/app2/src/lib/components/Transfer/transfer.svelte.ts +++ b/app2/src/lib/components/Transfer/transfer.svelte.ts @@ -1,6 +1,6 @@ import {Match, Option} from "effect" import { RawTransferSvelte } from "./raw-transfer.svelte.ts" -import type { Channel, Token } from "@unionlabs/sdk/schema" +import type {AddressCanonicalBytes, Channel, Token, TokenRawDenom} from "@unionlabs/sdk/schema" import { tokensStore } from "$lib/stores/tokens.svelte.ts" import { chains } from "$lib/stores/chains.svelte.ts" import {type Address, fromHex, type Hex, isHex} from "viem" @@ -13,9 +13,9 @@ import { WETH_DENOMS } from "$lib/constants/weth-denoms.ts" import {wallets} from "$lib/stores/wallets.svelte.ts"; export type TransferIntent = { - sender: string; + sender: AddressCanonicalBytes; receiver: string; - baseToken: string; + baseToken: TokenRawDenom; baseAmount: bigint; quoteAmount: bigint; }; diff --git a/app2/src/lib/queries/channels.svelte.ts b/app2/src/lib/queries/channels.svelte.ts index 5935fd7d57..54a5cd5b74 100644 --- a/app2/src/lib/queries/channels.svelte.ts +++ b/app2/src/lib/queries/channels.svelte.ts @@ -9,7 +9,7 @@ export const channelsQuery = () => schema: Schema.Struct({ v2_channels: Channels }), document: graphql(` query Ucs03Channels @cached(ttl: 60) { - v2_channels(args: { p_recommended: true}) { + v2_channels(args: { p_tags: ["experimental"]}) { destination_channel_id destination_client_id destination_connection_id @@ -27,7 +27,7 @@ export const channelsQuery = () => } `), variables: {}, - refetchInterval: "10 minutes", + refetchInterval: "60 seconds", writeData: data => { channels.data = data.pipe(Option.map(d => d.v2_channels)) }, From 3ef2234dc9a850fd92b4c75d1d0cde75d11da22a Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 5 Apr 2025 03:47:07 +0200 Subject: [PATCH 05/43] feat(app2): wip - transfer state --- app2/src/lib/components/Transfer/index.svelte | 9 +++++++-- .../components/Transfer/pages/IndexPage.svelte | 17 +---------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/app2/src/lib/components/Transfer/index.svelte b/app2/src/lib/components/Transfer/index.svelte index 786e9ecce0..315c1a07f8 100644 --- a/app2/src/lib/components/Transfer/index.svelte +++ b/app2/src/lib/components/Transfer/index.svelte @@ -37,8 +37,12 @@ let actionButtonText = $derived.by(() => { if (Option.isNone(transferSteps)) return "Submit"; - const currentStep = transferSteps.value[currentPage]; - if (currentPage === transferSteps.value.length - 1) { + const steps = transferSteps.value; + if (currentPage < 0 || currentPage >= steps.length || !steps[currentPage]) { + return "Submit"; + } + const currentStep = steps[currentPage]; + if (currentPage === steps.length - 1) { return "Complete"; } return TransferStep.match(currentStep, { @@ -49,6 +53,7 @@ }); }); + function handleActionButtonClick() { if (Option.isNone(transferSteps)) return; const currentStep = transferSteps.value[currentPage]; diff --git a/app2/src/lib/components/Transfer/pages/IndexPage.svelte b/app2/src/lib/components/Transfer/pages/IndexPage.svelte index d0071f0e24..36e367114b 100644 --- a/app2/src/lib/components/Transfer/pages/IndexPage.svelte +++ b/app2/src/lib/components/Transfer/pages/IndexPage.svelte @@ -1,7 +1,5 @@ @@ -234,4 +235,8 @@
{#key statusMessage}

{statusMessage}

+
+
+    {JSON.stringify(lockedTransferStore.transfer, null, 2)}
+  
{/key} diff --git a/app2/src/lib/components/Transfer/state/filling/check-balance.ts b/app2/src/lib/components/Transfer/state/filling/check-balance.ts index 971482190c..1fbdc8762d 100644 --- a/app2/src/lib/components/Transfer/state/filling/check-balance.ts +++ b/app2/src/lib/components/Transfer/state/filling/check-balance.ts @@ -1,52 +1,60 @@ -import { Effect, Option } from "effect"; -import { Chain } from "@unionlabs/sdk/schema"; -import { balancesStore } from "$lib/stores/balances.svelte.ts"; -import type {TransferIntents} from "$lib/components/Transfer/transfer.svelte.ts"; +import { Effect, Option } from "effect" +import { Chain } from "@unionlabs/sdk/schema" +import { balancesStore } from "$lib/stores/balances.svelte.ts" +import type { TransferIntents } from "$lib/components/Transfer/transfer.svelte.ts" +import { isHex, toHex } from "viem" +export const checkBalanceForIntents = (source: Chain, intents: TransferIntents) => { + const grouped = intents.reduce( + (acc, intent) => { + const key = `${intent.sender}_${intent.baseToken}` + if (acc[key]) { + acc[key].required += intent.baseAmount + } else { + acc[key] = { + sender: intent.sender, + baseToken: intent.baseToken, + required: intent.baseAmount + } + } + return acc + }, + {} as Record + ) -export const checkBalanceForIntents = ( - source: Chain, - intents: TransferIntents -) => { - const grouped = intents.reduce((acc, intent) => { - const key = `${intent.sender}_${intent.baseToken}`; - if (!acc[key]) { - acc[key] = { sender: intent.sender, baseToken: intent.baseToken, required: intent.baseAmount }; - } else { - acc[key].required += intent.baseAmount; - } - return acc; - }, {} as Record); - - const groupedValues = Object.values(grouped); + const groupedValues = Object.values(grouped) - return Effect.forEach(groupedValues, (group) => + return Effect.forEach(groupedValues, group => Effect.flatMap( Effect.sync(() => - balancesStore.getBalance(source.universal_chain_id, group.sender, group.baseToken) + balancesStore.getBalance( + source.universal_chain_id, + group.sender, + isHex(group.baseToken) ? group.baseToken : toHex(group.baseToken) + ) ), - (balance) => { + balance => { if (!Option.isSome(balance)) { - console.log("[CTS] No balance found for grouping:", group); - return Effect.succeed(false); + console.log("[CTS] No balance found for grouping:", group) + return Effect.succeed(false) } return Effect.try({ try: () => { - const balanceBigInt = BigInt(balance.value); - const enough = group.required <= balanceBigInt; + const balanceBigInt = BigInt(balance.value) + const enough = group.required <= balanceBigInt console.log("[CTS] Balance check for grouping:", { group, balance: balanceBigInt.toString(), enough - }); - return enough; + }) + return enough }, - catch: (error) => { - console.error("[CTS] Error converting balance to BigInt for grouping:", group, error); - return false; + catch: error => { + console.error("[CTS] Error converting balance to BigInt for grouping:", group, error) + return false } - }); + }) } ) - ).pipe(Effect.map((results) => results.every((result) => result === true))); -}; + ).pipe(Effect.map(results => results.every(result => result === true))) +} diff --git a/app2/src/lib/components/Transfer/state/filling/index.ts b/app2/src/lib/components/Transfer/state/filling/index.ts index 01492c229d..902bb3ff81 100644 --- a/app2/src/lib/components/Transfer/state/filling/index.ts +++ b/app2/src/lib/components/Transfer/state/filling/index.ts @@ -1,45 +1,42 @@ -import { Data, Effect, type Exit, Option } from "effect"; -import type { Transfer, TransferIntents } from "$lib/components/Transfer/transfer.svelte.ts"; -import { checkBalanceForIntents } from "$lib/components/Transfer/state/filling/check-balance.ts"; -import { createOrdersBatch } from "$lib/components/Transfer/state/filling/create-orders.ts"; -import { checkAllowances } from "$lib/components/Transfer/state/filling/check-allowance.ts"; +import { Data, Effect, type Exit, Option } from "effect" +import type { Transfer, TransferIntents } from "$lib/components/Transfer/transfer.svelte.ts" +import { checkBalanceForIntents } from "$lib/components/Transfer/state/filling/check-balance.ts" +import { createOrdersBatch } from "$lib/components/Transfer/state/filling/create-orders.ts" +import { checkAllowances } from "$lib/components/Transfer/state/filling/check-allowance.ts" // New type representing the simplified allowance data export type AllowanceData = { - token: string; - requiredAmount: string; - currentAllowance: string; -}; + token: string + requiredAmount: string + currentAllowance: string +} export type StateResult = { - nextState: CreateTransferState | null; - message?: string; - orders?: unknown[]; - allowances?: AllowanceData[]; -}; + nextState: CreateTransferState | null + message?: string + orders?: unknown[] + allowances?: AllowanceData[] +} export type EffectToExit = T extends Effect.Effect ? Exit.Exit - : never; + : never export type CreateTransferState = Data.TaggedEnum<{ - Filling: {}; - CreateIntents: {}; - CheckBalance: { intents: TransferIntents }; - CheckAllowance: {}; - CreateOrders: { allowances: AllowanceData[] }; - CreateSteps: { allowances: AllowanceData[]; orders: unknown[] }; -}>; + Filling: {} + CreateIntents: {} + CheckBalance: { intents: TransferIntents } + CheckAllowance: {} + CreateOrders: { allowances: Array } + CreateSteps: { allowances: Array; orders: Array } +}> -export const CreateTransferState = Data.taggedEnum(); +export const CreateTransferState = Data.taggedEnum() const { CreateIntents, CheckBalance, CheckAllowance, CreateOrders, CreateSteps } = - CreateTransferState; + CreateTransferState -export const createTransferState = ( - cts: CreateTransferState, - transfer: Transfer -) => { +export const createTransferState = (cts: CreateTransferState, transfer: Transfer) => { if ( !Option.isSome(transfer.sourceChain) || !Option.isSome(transfer.destinationChain) || @@ -50,26 +47,26 @@ export const createTransferState = ( !Option.isSome(transfer.channel) || !Option.isSome(transfer.intents) ) { - console.log("[CTS] Missing arguments"); + console.log("[CTS] Missing arguments") return Effect.succeed({ nextState: null, message: "Missing arguments" - }); + }) } - const channel = transfer.channel.value; - const ucs03address = transfer.ucs03address.value; - const source = transfer.sourceChain.value; - const destination = transfer.destinationChain.value; - const sender = transfer.derivedSender.value; - const amount = transfer.parsedAmount.value; - const intents = transfer.intents.value; + const channel = transfer.channel.value + const ucs03address = transfer.ucs03address.value + const source = transfer.sourceChain.value + const destination = transfer.destinationChain.value + const sender = transfer.derivedSender.value + const amount = transfer.parsedAmount.value + const intents = transfer.intents.value if (amount === "0" || amount === "" || BigInt(amount) === BigInt(0)) { return Effect.succeed({ nextState: null, message: "Enter an amount" - }); + }) } return CreateTransferState.$match(cts, { @@ -85,19 +82,19 @@ export const createTransferState = ( }), CheckBalance: ({ intents }) => Effect.gen(function* () { - const hasEnoughBalance = yield* checkBalanceForIntents(source, intents); + const hasEnoughBalance = yield* checkBalanceForIntents(source, intents) return hasEnoughBalance ? { nextState: CheckAllowance(), message: "Checking allowance..." } - : { nextState: null, message: "Insufficient funds" }; + : { nextState: null, message: "Insufficient funds" } }), CheckAllowance: () => Effect.gen(function* ($) { - const allowancesOpt = yield* $(checkAllowances(source, intents, sender, ucs03address)); - const allowances = Option.getOrElse(allowancesOpt, () => []); + const allowancesOpt = yield* $(checkAllowances(source, intents, sender, ucs03address)) + const allowances = Option.getOrElse(allowancesOpt, () => []) return { nextState: CreateOrders({ allowances }), message: "Creating orders..." - }; + } }), CreateOrders: ({ allowances }) => Effect.gen(function* () { @@ -107,31 +104,31 @@ export const createTransferState = ( channel, ucs03address, intents - ); + ) if (Option.isNone(batchOpt)) { return { nextState: null, message: "Could not create orders" - }; + } } - const batch = batchOpt.value; - console.log("Successfully created batch:", batch); + const batch = batchOpt.value + console.log("Successfully created batch:", batch) // Return orders and allowances for later use. return { nextState: CreateSteps({ allowances, orders: batch }), message: "Orders created successfully", orders: batch, allowances: allowances - }; + } }), CreateSteps: ({ allowances, orders }) => { - console.log("Finalizing transfer process"); + console.log("Finalizing transfer process") return Effect.succeed({ nextState: null, message: `Transfer complete – allowances: ${JSON.stringify(allowances)}, orders: ${JSON.stringify(orders)}`, orders, allowances - }); + }) } - }); -}; + }) +} diff --git a/app2/src/lib/components/Transfer/transfer.svelte.ts b/app2/src/lib/components/Transfer/transfer.svelte.ts index 604eb15595..0f1f74107a 100644 --- a/app2/src/lib/components/Transfer/transfer.svelte.ts +++ b/app2/src/lib/components/Transfer/transfer.svelte.ts @@ -1,25 +1,30 @@ -import {Match, Option} from "effect" +import { Match, Option, Schema } from "effect" import { RawTransferSvelte } from "./raw-transfer.svelte.ts" -import type {AddressCanonicalBytes, Channel, Token, TokenRawDenom} from "@unionlabs/sdk/schema" +import { + Channel, + type AddressCanonicalBytes, + type Token, + type TokenRawDenom +} from "@unionlabs/sdk/schema" import { tokensStore } from "$lib/stores/tokens.svelte.ts" import { chains } from "$lib/stores/chains.svelte.ts" -import {type Address, fromHex, type Hex, isHex} from "viem" +import { type Address, fromHex, type Hex, isHex } from "viem" import { channels } from "$lib/stores/channels.svelte.ts" import { getChannelInfoSafe } from "$lib/services/transfer-ucs03-evm/channel.ts" import { getDerivedReceiverSafe, getParsedAmountSafe } from "$lib/services/shared" import { sortedBalancesStore } from "$lib/stores/sorted-balances.svelte.ts" import { validateTransfer, type ValidationResult } from "$lib/components/Transfer/validation.ts" import { WETH_DENOMS } from "$lib/constants/weth-denoms.ts" -import {wallets} from "$lib/stores/wallets.svelte.ts"; +import { wallets } from "$lib/stores/wallets.svelte.ts" export type TransferIntent = { - sender: AddressCanonicalBytes; - receiver: string; - baseToken: TokenRawDenom; - baseAmount: bigint; - quoteAmount: bigint; -}; -export type TransferIntents = Array; + sender: AddressCanonicalBytes + receiver: string + baseToken: TokenRawDenom + baseAmount: bigint + quoteAmount: bigint +} +export type TransferIntents = Array export class Transfer { raw = new RawTransferSvelte() @@ -86,19 +91,87 @@ export class Transfer { : wallets.getAddressForChain(this.sourceChain.value) ) - channel = $derived.by>(() => { - return Option.all([channels.data, this.sourceChain, this.destinationChain]).pipe( + // channel = $derived.by>(() => { + // return Option.all([channels.data, this.sourceChain, this.destinationChain]).pipe( + // Option.flatMap(([channelsData, sourceChain, destinationChain]) => + // Option.fromNullable( + // // getChannelInfoSafe( + // // sourceChain.universal_chain_id, + // // destinationChain.universal_chain_id, + // // channelsData + // // ) + // // { + // // destination_channel_id: 9, + // // destination_client_id: 3, + // // destination_connection_id: 6, + // // destination_port_id: + // // "0x62626e31357a6370746c643837386c757834346c76633063687a687a376463646836326e68307865687761387937637a757a33796c6a6c73706d32726536", + // // destination_universal_chain_id: "babylon.bbn-test-5", + // // source_channel_id: 1, + // // source_client_id: 5, + // // source_connection_id: 2, + // // source_port_id: "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962", + // // source_universal_chain_id: "bob.808813" + // // } + // { + // source_channel_id: 9, + // source_client_id: 3, + // source_connection_id: 6, + // source_port_id: + // "0x62626e31357a6370746c643837386c757834346c76633063687a687a376463646836326e68307865687761387937637a757a33796c6a6c73706d32726536", + // source_universal_chain_id: "babylon.bbn-test-5", + // destination_channel_id: 1, + // destination_client_id: 5, + // destination_connection_id: 2, + // destination_port_id: "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962", + // destination_universal_chain_id: "bob.808813" + // } + // ) + // ) + // ) + // }) + channel = $derived>( + Option.all([channels.data, this.sourceChain, this.destinationChain]).pipe( Option.flatMap(([channelsData, sourceChain, destinationChain]) => - Option.fromNullable( - getChannelInfoSafe( - sourceChain.universal_chain_id, - destinationChain.universal_chain_id, - channelsData + Match.value({ channelsData, sourceChain, destinationChain }).pipe( + Match.when( + { + sourceChain: { universal_chain_id: "bob.808813" }, + destinationChain: { universal_chain_id: "babylon.bbn-test-5" } + }, + ({ + destinationChain: { universal_chain_id: destination_universal_chain_id }, + sourceChain: { universal_chain_id: source_universal_chain_id } + }) => + Option.some( + Schema.decodeSync(Channel)({ + destination_channel_id: 9, + destination_client_id: 3, + destination_connection_id: 6, + destination_port_id: + "0x62626e31357a6370746c643837386c757834346c76633063687a687a376463646836326e68307865687761387937637a757a33796c6a6c73706d32726536", + destination_universal_chain_id: destination_universal_chain_id.toString(), + source_channel_id: 1, + source_client_id: 5, + source_connection_id: 2, + source_port_id: "0xe33534b7f8d38c6935a2f6ad35e09228da239962", + source_universal_chain_id: source_universal_chain_id.toString() + }) + ) + ), + Match.orElse(() => + Option.fromNullable( + getChannelInfoSafe( + sourceChain.universal_chain_id, + destinationChain.universal_chain_id, + channelsData + ) + ) ) ) ) ) - }) + ) ucs03address = $derived.by>(() => { return Option.all([ @@ -162,19 +235,19 @@ export class Transfer { }) intents = $derived.by(() => { - if (this.validation._tag !== "Success") return Option.none(); - const transferValue = this.validation.value; + if (this.validation._tag !== "Success") return Option.none() + const transferValue = this.validation.value - if (Option.isNone(this.derivedSender)) return Option.none(); + if (Option.isNone(this.derivedSender)) return Option.none() - const sender = Option.getOrUndefined(this.derivedSender); - if (!sender) return Option.none(); + const sender = Option.getOrUndefined(this.derivedSender) + if (!sender) return Option.none() return Match.value(transferValue.sourceChain.rpc_type).pipe( Match.when("evm", () => { - if (Option.isNone(this.wethBaseToken)) return Option.none(); - const wethToken = Option.getOrUndefined(this.wethBaseToken); - if (!wethToken) return Option.none(); + if (Option.isNone(this.wethBaseToken)) return Option.none() + const wethToken = Option.getOrUndefined(this.wethBaseToken) + if (!wethToken) return Option.none() return Option.some([ { @@ -191,7 +264,7 @@ export class Transfer { baseAmount: 500n, quoteAmount: 0n } - ]); + ]) }), Match.when("cosmos", () => { @@ -205,12 +278,12 @@ export class Transfer { baseAmount: transferValue.baseAmount, quoteAmount: transferValue.baseAmount } - ]); + ]) }), Match.orElse(() => Option.none()) - ); - }); + ) + }) validation = $derived.by(() => validateTransfer(this.args)) } diff --git a/ts-sdk/src/ucs03/instruction.ts b/ts-sdk/src/ucs03/instruction.ts index be90beed75..67d02b5cf1 100644 --- a/ts-sdk/src/ucs03/instruction.ts +++ b/ts-sdk/src/ucs03/instruction.ts @@ -2,7 +2,6 @@ import { encodeAbiParameters } from "viem" import { batchAbi, forwardAbi, fungibleAssetOrderAbi, multiplexAbi } from "../evm/abi/index.js" import { Data, Schema as S } from "effect" import { Hex, HexChecksum } from "../schema/hex.js" -import { Uint64 } from "../schema/uint64.js" import type { NonEmptyReadonlyArray } from "effect/Array" const Version = S.NonNegativeInt @@ -13,19 +12,35 @@ type OpCode = typeof OpCode.Type const Operand = S.Union( // [`0x${string}`, bigint, { version: number; opcode: number; operand: `0x${string}`; }] - S.Tuple(Hex, Uint64, S.Struct({ version: Version, opcode: OpCode, operand: Hex })), + S.Tuple(Hex, S.BigIntFromSelf, S.Struct({ version: Version, opcode: OpCode, operand: Hex })), // [number, number, `0x${string}`] S.Tuple(S.Number, S.Number, Hex), // [bigint, bigint, bigint, { version: number; opcode: number; operand: `0x${string}`; }] - S.Tuple(Uint64, Uint64, Uint64, S.Struct({ version: Version, opcode: OpCode, operand: Hex })), + S.Tuple( + S.BigIntFromSelf, + S.BigIntFromSelf, + S.BigIntFromSelf, + S.Struct({ version: Version, opcode: OpCode, operand: Hex }) + ), // [`0x${string}`, boolean, `0x${string}`, `0x${string}`] S.Tuple(Hex, S.Boolean, Hex, Hex), // [readonly { version: number; opcode: number; operand: `0x${string}`; }[]] S.Tuple(S.Array(S.Struct({ version: Version, opcode: OpCode, operand: Hex }))), // [`0x${string}`, `0x${string}`, `0x${string}`, bigint, string, string, number, bigint, `0x${string}`, bigint] - S.Tuple(Hex, Hex, Hex, Uint64, S.String, S.String, S.Uint8, Uint64, HexChecksum, Uint64), + S.Tuple( + Hex, + Hex, + Hex, + S.BigIntFromSelf, + S.String, + S.String, + S.Uint8, + S.BigIntFromSelf, + HexChecksum, + S.BigIntFromSelf + ), // [bigint, `0x${string}`] - S.Tuple(Uint64, Hex), + S.Tuple(S.BigIntFromSelf, Hex), // [readonly `0x${string}`[]] S.Tuple(S.NonEmptyArray(Hex)) ) From 067ba28d7a7c6c7055ca3c7e6bb2548d6a7f6a74 Mon Sep 17 00:00:00 2001 From: cor Date: Mon, 7 Apr 2025 00:55:00 +0000 Subject: [PATCH 07/43] fix(app2): timeout heights and hardcoded channels --- .../Transfer/pages/SubmitPage.svelte | 4 +-- .../components/Transfer/transfer.svelte.ts | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/app2/src/lib/components/Transfer/pages/SubmitPage.svelte b/app2/src/lib/components/Transfer/pages/SubmitPage.svelte index 00d1a5b3ed..8e366f6de8 100644 --- a/app2/src/lib/components/Transfer/pages/SubmitPage.svelte +++ b/app2/src/lib/components/Transfer/pages/SubmitPage.svelte @@ -125,7 +125,7 @@ export const submit = Effect.gen(function* () { args: [ lts.value.channel.source_channel_id, 0n, - 1000000000000n, + 9007199254740991n, generateSalt("evm"), { opcode: step.value.instruction.opcode, @@ -170,7 +170,7 @@ export const submit = Effect.gen(function* () { { send: { channel_id: lts.value.channel.source_channel_id, - timeout_height: 10000000, + timeout_height: Number.MAX_SAFE_INTEGER, timeout_timestamp: 0, salt: generateSalt("cosmos"), instruction: encodeAbiParameters(instructionAbi, [ diff --git a/app2/src/lib/components/Transfer/transfer.svelte.ts b/app2/src/lib/components/Transfer/transfer.svelte.ts index 0f1f74107a..2e46d5b49c 100644 --- a/app2/src/lib/components/Transfer/transfer.svelte.ts +++ b/app2/src/lib/components/Transfer/transfer.svelte.ts @@ -159,6 +159,31 @@ export class Transfer { }) ) ), + Match.when( + { + sourceChain: { universal_chain_id: "babylon.bbn-test-5" }, + destinationChain: { universal_chain_id: "bob.808813" } + }, + ({ + destinationChain: { universal_chain_id: destination_universal_chain_id }, + sourceChain: { universal_chain_id: source_universal_chain_id } + }) => + Option.some( + Schema.decodeSync(Channel)({ + destination_channel_id: 1, + destination_client_id: 3, + destination_connection_id: 6, + source_port_id: + "0x62626e31357a6370746c643837386c757834346c76633063687a687a376463646836326e68307865687761387937637a757a33796c6a6c73706d32726536", + destination_universal_chain_id: destination_universal_chain_id.toString(), + source_channel_id: 9, + source_client_id: 5, + source_connection_id: 2, + destination_port_id: "0xe33534b7f8d38c6935a2f6ad35e09228da239962", + source_universal_chain_id: source_universal_chain_id.toString() + }) + ) + ), Match.orElse(() => Option.fromNullable( getChannelInfoSafe( From 98159606d25ae60198ae4c58c7f1eaa73fd434b7 Mon Sep 17 00:00:00 2001 From: cor Date: Mon, 7 Apr 2025 01:41:39 +0000 Subject: [PATCH 08/43] fix(app2): use tokencomponent in transferasset --- .../Transfer/ChainAsset/AssetSelector.svelte | 4 +- .../Transfer/ChainAsset/TransferAsset.svelte | 48 +++++-------------- .../components/model/TokenComponent.svelte | 24 +++++++++- 3 files changed, 36 insertions(+), 40 deletions(-) diff --git a/app2/src/lib/components/Transfer/ChainAsset/AssetSelector.svelte b/app2/src/lib/components/Transfer/ChainAsset/AssetSelector.svelte index 7f2e1b47b7..ff833b5882 100644 --- a/app2/src/lib/components/Transfer/ChainAsset/AssetSelector.svelte +++ b/app2/src/lib/components/Transfer/ChainAsset/AssetSelector.svelte @@ -103,7 +103,7 @@ async function toggleSearch() {
{#each filteredTokens as token} {#key token.denom} - + {/key} {/each}
@@ -145,4 +145,4 @@ async function toggleSearch() { - \ No newline at end of file + diff --git a/app2/src/lib/components/Transfer/ChainAsset/TransferAsset.svelte b/app2/src/lib/components/Transfer/ChainAsset/TransferAsset.svelte index edce5be8b7..6ad9a7c4bd 100644 --- a/app2/src/lib/components/Transfer/ChainAsset/TransferAsset.svelte +++ b/app2/src/lib/components/Transfer/ChainAsset/TransferAsset.svelte @@ -1,19 +1,20 @@
{#if Option.isSome(step) && Option.isSome(sourceChain)}
-

Approve

+

Approve + +

- - + +
- - + +

- You need to approve Union to send . + You need to approve Union to send + + . This is a one-time approval for this token.

@@ -166,3 +204,4 @@ const submit = Effect.gen(function* () {
{/if} + diff --git a/app2/src/lib/components/Transfer/pages/SubmitPage.svelte b/app2/src/lib/components/Transfer/pages/SubmitPage.svelte index 09ab1547a5..e921795ce7 100644 --- a/app2/src/lib/components/Transfer/pages/SubmitPage.svelte +++ b/app2/src/lib/components/Transfer/pages/SubmitPage.svelte @@ -165,8 +165,8 @@ export const submit = Effect.gen(function* () { cts, lts.value.sourceChain, signingClient, - sender, - fromHex(lts.value.channel.source_port_id, "string"), + sender, //Sender address + fromHex(lts.value.channel.source_port_id, "string"), //contractAddress { send: { channel_id: lts.value.channel.source_channel_id, diff --git a/app2/src/lib/components/Transfer/state/filling/check-allowance.ts b/app2/src/lib/components/Transfer/state/filling/check-allowance.ts index aabf306b37..ffb6ac9b44 100644 --- a/app2/src/lib/components/Transfer/state/filling/check-allowance.ts +++ b/app2/src/lib/components/Transfer/state/filling/check-allowance.ts @@ -192,42 +192,101 @@ function handleCosmosAllowances( const rpcUrl = rpcUrlOpt.value; const cosmwasmClient = yield* createCosmWasmClient(rpcUrl); - // Filter out native tokens entirely - const cw20Addresses = tokenAddresses.filter(isHex); + // Function to identify native tokens (tokens that start with 'u' followed by letters) + const isNativeToken = (token: string): boolean => { + return /^u[a-zA-Z]+$/.test(token); + }; - // If everything was native, we can just return an empty array - if (cw20Addresses.length === 0) { - console.log("lukas: All tokens are native → no allowances needed"); + // Function to check if a token is a contract (either Bech32 or hex-encoded) + const isContractToken = (token: string): boolean => { + // Direct Bech32 contract check + if (isValidBech32ContractAddress(token)) { + return true; + } + + // Hex-encoded contract check + if (isHex(token)) { + try { + const decoded = fromHex(token, "string"); + return isValidBech32ContractAddress(decoded); + } catch { + return false; + } + } + + return false; + }; + + // Filter to separate native tokens and contract tokens + const nativeTokens = tokenAddresses.filter(isNativeToken); + const contractTokenCandidates = tokenAddresses.filter(token => !isNativeToken(token)); + + // Further check which of the non-native tokens are valid contracts + const contractTokens = contractTokenCandidates.filter(isContractToken); + + console.log("lukas: Identified native tokens:", nativeTokens); + console.log("lukas: Identified contract tokens:", contractTokens); + + // If all tokens are native, return empty array (no approvals needed) + if (contractTokens.length === 0) { + console.log("lukas: No contract tokens to check allowances for"); return Option.some([]); } + // Process contract tokens const checks = yield* Effect.all( - cw20Addresses.map(tokenAddress => + contractTokens.map(tokenAddress => Effect.gen(function* () { - console.log("lukas: Checking CW20 token:", tokenAddress); - const decoded = fromHex(tokenAddress, "string"); + console.log("lukas: Checking contract token:", tokenAddress); + + // For direct Bech32 addresses + if (!isHex(tokenAddress) && isValidBech32ContractAddress(tokenAddress)) { + console.log("lukas: Processing direct Bech32 address:", tokenAddress); + const owner = yield* sourceChain.toCosmosDisplay(sender); + const result = yield* Effect.tryPromise({ + try: () => + cosmwasmClient.queryContractSmart(tokenAddress, { + allowance: { owner, spender } + }), + catch: e => { + console.log("lukas: Error in queryContractSmart for direct address:", e); + return e; + } + }); - if (!isValidBech32ContractAddress(decoded)) { - console.log("lukas: Not valid bech32 contract address => skipping:", decoded); - return { token: tokenAddress, allowance: 0n }; + const allowance = result?.allowance ? BigInt(result.allowance) : 0n; + console.log("lukas: Query result allowance for direct address:", allowance); + return { token: tokenAddress, allowance }; } - const owner = yield* sourceChain.toCosmosDisplay(sender); - const result = yield* Effect.tryPromise({ - try: () => - cosmwasmClient.queryContractSmart(decoded, { - allowance: { owner, spender } - }), - catch: e => { - console.log("lukas: Error in queryContractSmart:", e); - return e; + // For hex-encoded addresses + if (isHex(tokenAddress)) { + const decoded = fromHex(tokenAddress, "string"); + + if (!isValidBech32ContractAddress(decoded)) { + console.log("lukas: Not valid bech32 contract address => skipping:", decoded); + return { token: tokenAddress, allowance: 0n }; } - }); - const allowance = result?.allowance ? BigInt(result.allowance) : 0n; - console.log("lukas: Query result allowance:", allowance); + const owner = yield* sourceChain.toCosmosDisplay(sender); + const result = yield* Effect.tryPromise({ + try: () => + cosmwasmClient.queryContractSmart(decoded, { + allowance: { owner, spender } + }), + catch: e => { + console.log("lukas: Error in queryContractSmart:", e); + return e; + } + }); - return { token: tokenAddress, allowance }; + const allowance = result?.allowance ? BigInt(result.allowance) : 0n; + console.log("lukas: Query result allowance:", allowance); + return { token: tokenAddress, allowance }; + } + + // This should not happen given our filtering, but just in case + return { token: tokenAddress, allowance: 0n }; }).pipe( Effect.provideService(CosmWasmClientSource, { client: cosmwasmClient }) ) From ab90050efa873316e5cf4bed6e5d68d132028289 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 7 Apr 2025 06:07:54 +0200 Subject: [PATCH 15/43] fix(app2): hardcoded fix for cw20 --- .../lib/components/Transfer/pages/ApprovalPage.svelte | 2 +- .../Transfer/state/filling/check-allowance.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte index 1285916b1d..344150fc86 100644 --- a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte +++ b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte @@ -133,7 +133,7 @@ step.value.token, { increase_allowance: { - spender: fromHex(lts.value.channel.source_port_id, "string"), + spender: "bbn1dy20pwy30hfqyxdzrmp33h47h4xdxht6phqecfp2jdnes6su9pysqq2kpw", amount: step.value.requiredAmount, } } diff --git a/app2/src/lib/components/Transfer/state/filling/check-allowance.ts b/app2/src/lib/components/Transfer/state/filling/check-allowance.ts index ffb6ac9b44..aedcef4341 100644 --- a/app2/src/lib/components/Transfer/state/filling/check-allowance.ts +++ b/app2/src/lib/components/Transfer/state/filling/check-allowance.ts @@ -244,10 +244,12 @@ function handleCosmosAllowances( console.log("lukas: Processing direct Bech32 address:", tokenAddress); const owner = yield* sourceChain.toCosmosDisplay(sender); const result = yield* Effect.tryPromise({ - try: () => - cosmwasmClient.queryContractSmart(tokenAddress, { - allowance: { owner, spender } - }), + try: () => { + console.log('zkgm', {allowance: { owner, spender }}) + return cosmwasmClient.queryContractSmart(tokenAddress, { + allowance: { owner, spender: "bbn1dy20pwy30hfqyxdzrmp33h47h4xdxht6phqecfp2jdnes6su9pysqq2kpw" } + }) + }, catch: e => { console.log("lukas: Error in queryContractSmart for direct address:", e); return e; From 22295085f735f0b077354942c3352893d0d72d6a Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 7 Apr 2025 06:12:05 +0200 Subject: [PATCH 16/43] fix(app2): to hex --- app2/src/lib/components/Transfer/pages/ApprovalPage.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte index 344150fc86..5074f74c50 100644 --- a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte +++ b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte @@ -5,7 +5,7 @@ import { lockedTransferStore } from "../locked-transfer.svelte.ts" import { ApprovalRequired } from "../transfer-step.ts" import { createViemPublicClient } from "@unionlabs/sdk/evm" - import {erc20Abi, fromHex, http} from "viem" + import {erc20Abi, fromHex, http, toHex} from "viem" import { hasFailedExit as evmHasFailedExit, isComplete as evmIsComplete, @@ -164,7 +164,7 @@ {#if Option.isSome(step) && Option.isSome(sourceChain)}

Approve - +

From 2d8924e6736b5ea0b92f5684762ae89cae8a2bae Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 7 Apr 2025 06:15:01 +0200 Subject: [PATCH 17/43] fix(app2): to hex --- app2/src/lib/components/Transfer/pages/ApprovalPage.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte index 5074f74c50..09285b066a 100644 --- a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte +++ b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte @@ -168,15 +168,15 @@
- +
- +

You need to approve Union to send - + . This is a one-time approval for this token.

From ce94af09d4a79af2ac50830db559a8fb12bc0476 Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Mon, 7 Apr 2025 10:01:36 -0400 Subject: [PATCH 18/43] chore(ts-sdk): enable static analysis for examples/ Signed-off-by: Eric Hegnes --- ts-sdk/tsconfig.examples.json | 9 +++++++++ ts-sdk/tsconfig.json | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ts-sdk/tsconfig.examples.json diff --git a/ts-sdk/tsconfig.examples.json b/ts-sdk/tsconfig.examples.json new file mode 100644 index 0000000000..575e7be42b --- /dev/null +++ b/ts-sdk/tsconfig.examples.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.base.json", + "include": ["examples"], + "references": [{ "path": "tsconfig.src.json" }], + "compilerOptions": { + "tsBuildInfoFile": ".tsbuildinfo/examples.tsbuildinfo", + "rootDir": "examples", + } +} diff --git a/ts-sdk/tsconfig.json b/ts-sdk/tsconfig.json index e236d527d9..c5ea01cf74 100644 --- a/ts-sdk/tsconfig.json +++ b/ts-sdk/tsconfig.json @@ -1,5 +1,9 @@ { "extends": "../tsconfig.base.json", "include": [], - "references": [{ "path": "tsconfig.src.json" }, { "path": "tsconfig.test.json" }] + "references": [ + { "path": "tsconfig.examples.json" }, + { "path": "tsconfig.src.json" }, + { "path": "tsconfig.test.json" } + ] } From 1c5cb466f8fc3d5af74539716e40b175610335ee Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Mon, 7 Apr 2025 10:05:40 -0400 Subject: [PATCH 19/43] chore(ts-sdk): fix examples/ imports Signed-off-by: Eric Hegnes --- ts-sdk/examples/aptos-get-quote-token.ts | 6 +++--- ts-sdk/examples/aptos-read-fa-metadata.ts | 4 ++-- ts-sdk/examples/aptos-read-fa-token-balance.ts | 4 ++-- ts-sdk/examples/aptos-write-transfer-fa-token.ts | 6 +++--- ts-sdk/examples/aptos-write-transfer-move.ts | 6 +++--- .../cosmos-cw20-read-allowance-write-allowance.ts | 4 ++-- .../examples/cosmos-cw20-read-metadata-and-balance.ts | 4 ++-- ts-sdk/examples/cosmos-execute-contract.ts | 4 ++-- ts-sdk/examples/cosmos-read-contract.ts | 4 ++-- ts-sdk/examples/cosmos-to-evm-transfer.ts | 10 +++++----- ts-sdk/examples/evm-erc20-increase-allowance.ts | 6 +++--- ts-sdk/examples/evm-erc20-read-allowance.ts | 4 ++-- ts-sdk/examples/evm-erc20-read-balance.ts | 4 ++-- ts-sdk/examples/evm-quote-token-sepolia.ts | 4 ++-- ts-sdk/examples/ucs03-encode-instruction.ts | 2 +- ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts | 2 +- .../ucs03-send-holesky-to-stargaze-with-approvals.ts | 4 ++-- .../ucs03-send-movement-to-union-testnet-10.ts | 2 +- .../examples/ucs03-send-sepolia-to-union-testnet-10.ts | 6 +++--- .../ucs03-send-union-testnet-10-to-movement.ts | 2 +- .../examples/ucs03-send-union-testnet-10-to-sepolia.ts | 2 +- 21 files changed, 45 insertions(+), 45 deletions(-) diff --git a/ts-sdk/examples/aptos-get-quote-token.ts b/ts-sdk/examples/aptos-get-quote-token.ts index 7cdd7ec5d9..c05700b992 100644 --- a/ts-sdk/examples/aptos-get-quote-token.ts +++ b/ts-sdk/examples/aptos-get-quote-token.ts @@ -1,7 +1,7 @@ import { Effect } from "effect" -import { AptosPublicClientDestination, createAptosPublicClient } from "../src/aptos/client.ts" -import { AptosChannelDestination } from "../src/aptos/channel.ts" -import { predictQuoteToken } from "../src/aptos/quote-token.ts" +import { AptosPublicClientDestination, createAptosPublicClient } from "../src/aptos/client.js" +import { AptosChannelDestination } from "../src/aptos/channel.js" +import { predictQuoteToken } from "../src/aptos/quote-token.js" import { AptosConfig, Network } from "@aptos-labs/ts-sdk" // @ts-ignore diff --git a/ts-sdk/examples/aptos-read-fa-metadata.ts b/ts-sdk/examples/aptos-read-fa-metadata.ts index 8456fa0876..f141a5887e 100644 --- a/ts-sdk/examples/aptos-read-fa-metadata.ts +++ b/ts-sdk/examples/aptos-read-fa-metadata.ts @@ -1,6 +1,6 @@ import { Effect } from "effect" -import { AptosPublicClient, createAptosPublicClient } from "../src/aptos/client.ts" -import { readFaName, readFaDecimals, readFaSymbol, readFaTokenInfo } from "../src/aptos/fa.ts" +import { AptosPublicClient, createAptosPublicClient } from "../src/aptos/client.js" +import { readFaName, readFaDecimals, readFaSymbol, readFaTokenInfo } from "../src/aptos/fa.js" import { Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk" import { AptosConfig, Network } from "@aptos-labs/ts-sdk" diff --git a/ts-sdk/examples/aptos-read-fa-token-balance.ts b/ts-sdk/examples/aptos-read-fa-token-balance.ts index 0349e17fa9..d15938bf14 100644 --- a/ts-sdk/examples/aptos-read-fa-token-balance.ts +++ b/ts-sdk/examples/aptos-read-fa-token-balance.ts @@ -1,6 +1,6 @@ import { Effect } from "effect" -import { AptosPublicClient, createAptosPublicClient } from "../src/aptos/client.ts" -import { readFaBalance } from "../src/aptos/fa.ts" +import { AptosPublicClient, createAptosPublicClient } from "../src/aptos/client.js" +import { readFaBalance } from "../src/aptos/fa.js" import { Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk" import { AptosConfig, Network } from "@aptos-labs/ts-sdk" diff --git a/ts-sdk/examples/aptos-write-transfer-fa-token.ts b/ts-sdk/examples/aptos-write-transfer-fa-token.ts index ef2effa2f6..401da3396c 100644 --- a/ts-sdk/examples/aptos-write-transfer-fa-token.ts +++ b/ts-sdk/examples/aptos-write-transfer-fa-token.ts @@ -1,7 +1,7 @@ import { Effect } from "effect" -import { AptosPublicClient, createAptosPublicClient } from "../src/aptos/client.ts" -import { readContract, writeContract } from "../src/aptos/contract.ts" -import { waitForTransactionReceipt } from "../src/aptos/receipts.ts" +import { AptosPublicClient, createAptosPublicClient } from "../src/aptos/client.js" +import { readContract, writeContract } from "../src/aptos/contract.js" +import { waitForTransactionReceipt } from "../src/aptos/receipts.js" import { Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk" import { AptosConfig, Network, MoveVector } from "@aptos-labs/ts-sdk" diff --git a/ts-sdk/examples/aptos-write-transfer-move.ts b/ts-sdk/examples/aptos-write-transfer-move.ts index ae142ab638..810b21174e 100644 --- a/ts-sdk/examples/aptos-write-transfer-move.ts +++ b/ts-sdk/examples/aptos-write-transfer-move.ts @@ -1,7 +1,7 @@ import { Effect } from "effect" -import { AptosPublicClient, createAptosPublicClient } from "../src/aptos/client.ts" -import { writeContract } from "../src/aptos/contract.ts" -import { waitForTransactionReceipt } from "../src/aptos/receipts.ts" +import { AptosPublicClient, createAptosPublicClient } from "../src/aptos/client.js" +import { writeContract } from "../src/aptos/contract.js" +import { waitForTransactionReceipt } from "../src/aptos/receipts.js" import { Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk" import { AptosConfig, Network } from "@aptos-labs/ts-sdk" diff --git a/ts-sdk/examples/cosmos-cw20-read-allowance-write-allowance.ts b/ts-sdk/examples/cosmos-cw20-read-allowance-write-allowance.ts index 8f3afca07a..197103e11d 100644 --- a/ts-sdk/examples/cosmos-cw20-read-allowance-write-allowance.ts +++ b/ts-sdk/examples/cosmos-cw20-read-allowance-write-allowance.ts @@ -4,8 +4,8 @@ import { createCosmWasmClient, createSigningCosmWasmClient, SigningCosmWasmClientContext -} from "../src/cosmos/client.ts" -import { readCw20Allowance, writeCw20IncreaseAllowance } from "../src/cosmos/cw20.ts" +} from "../src/cosmos/client.js" +import { readCw20Allowance, writeCw20IncreaseAllowance } from "../src/cosmos/cw20.js" import { DirectSecp256k1Wallet } from "@cosmjs/proto-signing" import type { SigningCosmWasmClientOptions } from "@cosmjs/cosmwasm-stargate" import { bytes } from "@scure/base" diff --git a/ts-sdk/examples/cosmos-cw20-read-metadata-and-balance.ts b/ts-sdk/examples/cosmos-cw20-read-metadata-and-balance.ts index 62c3a22718..82df951834 100644 --- a/ts-sdk/examples/cosmos-cw20-read-metadata-and-balance.ts +++ b/ts-sdk/examples/cosmos-cw20-read-metadata-and-balance.ts @@ -1,6 +1,6 @@ import { Effect } from "effect" -import { CosmWasmClientContext, createCosmWasmClient } from "../src/cosmos/client.ts" -import { readCw20TokenInfo, readCw20Balance, readCw20Allowance } from "../src/cosmos/cw20.ts" +import { CosmWasmClientContext, createCosmWasmClient } from "../src/cosmos/client.js" +import { readCw20TokenInfo, readCw20Balance, readCw20Allowance } from "../src/cosmos/cw20.js" Effect.runPromiseExit( Effect.gen(function* () { diff --git a/ts-sdk/examples/cosmos-execute-contract.ts b/ts-sdk/examples/cosmos-execute-contract.ts index 72a4ffeb63..c77851df8a 100644 --- a/ts-sdk/examples/cosmos-execute-contract.ts +++ b/ts-sdk/examples/cosmos-execute-contract.ts @@ -1,6 +1,6 @@ import { Effect } from "effect" -import { createSigningCosmWasmClient } from "../src/cosmos/client.ts" -import { executeContract } from "../src/cosmos/contract.ts" +import { createSigningCosmWasmClient } from "../src/cosmos/client.js" +import { executeContract } from "../src/cosmos/contract.js" import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing" Effect.runPromiseExit( diff --git a/ts-sdk/examples/cosmos-read-contract.ts b/ts-sdk/examples/cosmos-read-contract.ts index 133b533004..2e61c8652a 100644 --- a/ts-sdk/examples/cosmos-read-contract.ts +++ b/ts-sdk/examples/cosmos-read-contract.ts @@ -1,6 +1,6 @@ import { Effect } from "effect" -import { createCosmWasmClient } from "../src/cosmos/client.ts" -import { queryContract } from "../src/cosmos/contract.ts" +import { createCosmWasmClient } from "../src/cosmos/client.js" +import { queryContract } from "../src/cosmos/contract.js" // Example CW20 token balance query Effect.runPromiseExit( diff --git a/ts-sdk/examples/cosmos-to-evm-transfer.ts b/ts-sdk/examples/cosmos-to-evm-transfer.ts index 6eba097980..54ba261439 100644 --- a/ts-sdk/examples/cosmos-to-evm-transfer.ts +++ b/ts-sdk/examples/cosmos-to-evm-transfer.ts @@ -1,15 +1,15 @@ import { Effect } from "effect" -import { ViemPublicClientDestination } from "../src/evm/client.ts" +import { ViemPublicClientDestination } from "../src/evm/client.js" import { createPublicClient, http, parseEther } from "viem" import { sepolia } from "viem/chains" -import { DestinationConfig } from "../src/evm/quote-token.ts" -import { createCosmosToEvmFungibleAssetOrder } from "../src/evm/ucs03/fungible-asset-order.ts" +import { DestinationConfig } from "../src/evm/quote-token.js" +import { createCosmosToEvmFungibleAssetOrder } from "../src/evm/ucs03/fungible-asset-order.js" import { CosmWasmClientContext, CosmWasmClientSource, createCosmWasmClient -} from "../src/cosmos/client.ts" -import { readCw20TokenInfo, readCw20Balance } from "../src/cosmos/cw20.ts" +} from "../src/cosmos/client.js" +import { readCw20TokenInfo, readCw20Balance } from "../src/cosmos/cw20.js" // @ts-ignore BigInt["prototype"].toJSON = function () { diff --git a/ts-sdk/examples/evm-erc20-increase-allowance.ts b/ts-sdk/examples/evm-erc20-increase-allowance.ts index 78336f09bc..093a55158d 100644 --- a/ts-sdk/examples/evm-erc20-increase-allowance.ts +++ b/ts-sdk/examples/evm-erc20-increase-allowance.ts @@ -1,10 +1,10 @@ import { Effect } from "effect" -import { ViemPublicClient, ViemWalletClient } from "../src/evm/client.ts" +import { ViemPublicClient, ViemWalletClient } from "../src/evm/client.js" import { createPublicClient, createWalletClient, http } from "viem" import { sepolia } from "viem/chains" import { privateKeyToAccount } from "viem/accounts" -import { increaseErc20Allowance, readErc20Allowance, readErc20Meta } from "../src/evm/erc20.ts" -import { waitForTransactionReceipt } from "../src/evm/receipts.ts" +import { increaseErc20Allowance, readErc20Allowance, readErc20Meta } from "../src/evm/erc20.js" +import { waitForTransactionReceipt } from "../src/evm/receipts.js" // @ts-ignore BigInt["prototype"].toJSON = function () { diff --git a/ts-sdk/examples/evm-erc20-read-allowance.ts b/ts-sdk/examples/evm-erc20-read-allowance.ts index 8598b2dc8a..2c4ed5011a 100644 --- a/ts-sdk/examples/evm-erc20-read-allowance.ts +++ b/ts-sdk/examples/evm-erc20-read-allowance.ts @@ -1,8 +1,8 @@ import { Effect } from "effect" -import { ViemPublicClient } from "../src/evm/client.ts" +import { ViemPublicClient } from "../src/evm/client.js" import { createPublicClient, http } from "viem" import { sepolia } from "viem/chains" -import { readErc20Meta, readErc20Allowance } from "../src/evm/erc20.ts" +import { readErc20Meta, readErc20Allowance } from "../src/evm/erc20.js" // @ts-ignore BigInt["prototype"].toJSON = function () { diff --git a/ts-sdk/examples/evm-erc20-read-balance.ts b/ts-sdk/examples/evm-erc20-read-balance.ts index e94cba042f..4929dca7db 100644 --- a/ts-sdk/examples/evm-erc20-read-balance.ts +++ b/ts-sdk/examples/evm-erc20-read-balance.ts @@ -1,8 +1,8 @@ import { Effect } from "effect" -import { ViemPublicClient } from "../src/evm/client.ts" +import { ViemPublicClient } from "../src/evm/client.js" import { createPublicClient, http } from "viem" import { sepolia } from "viem/chains" -import { readErc20Meta, readErc20Balance } from "../src/evm/erc20.ts" +import { readErc20Meta, readErc20Balance } from "../src/evm/erc20.js" // @ts-ignore BigInt["prototype"].toJSON = function () { diff --git a/ts-sdk/examples/evm-quote-token-sepolia.ts b/ts-sdk/examples/evm-quote-token-sepolia.ts index 79722f9293..29ee7926c8 100644 --- a/ts-sdk/examples/evm-quote-token-sepolia.ts +++ b/ts-sdk/examples/evm-quote-token-sepolia.ts @@ -1,6 +1,6 @@ import { Effect } from "effect" -import { DestinationConfig, predictQuoteToken } from "../src/evm/quote-token.ts" -import { ViemPublicClientDestination } from "../src/evm/client.ts" +import { DestinationConfig, predictQuoteToken } from "../src/evm/quote-token.js" +import { ViemPublicClientDestination } from "../src/evm/client.js" import { createPublicClient, http, toHex } from "viem" import { sepolia } from "viem/chains" diff --git a/ts-sdk/examples/ucs03-encode-instruction.ts b/ts-sdk/examples/ucs03-encode-instruction.ts index 07387e66e3..284fd7beff 100644 --- a/ts-sdk/examples/ucs03-encode-instruction.ts +++ b/ts-sdk/examples/ucs03-encode-instruction.ts @@ -1,5 +1,5 @@ import { toHex } from "viem" -import { Instruction } from "../src/ucs03.ts" +import { Instruction } from "../src/ucs03.js" export const exampleBatchInstruction = new Instruction.Batch({ operand: [ diff --git a/ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts b/ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts index 0b6d1da331..fbb4caf5d3 100644 --- a/ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts +++ b/ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts @@ -5,7 +5,7 @@ import { holesky } from "viem/chains" import { CosmosDestinationConfig } from "../src/cosmos/quote-token.js" import { createEvmToCosmosFungibleAssetOrder } from "../src/ucs03/fungible-asset-order.js" import { CosmWasmClientDestination, createCosmWasmClient } from "../src/cosmos/client.js" -import { Instruction } from "../src/ucs03.ts" +import { Instruction } from "../src/ucs03.js" const createBatch = Effect.gen(function* () { const mainTransfer = yield* createEvmToCosmosFungibleAssetOrder({ diff --git a/ts-sdk/examples/ucs03-send-holesky-to-stargaze-with-approvals.ts b/ts-sdk/examples/ucs03-send-holesky-to-stargaze-with-approvals.ts index c858fe17cf..b7876373b0 100644 --- a/ts-sdk/examples/ucs03-send-holesky-to-stargaze-with-approvals.ts +++ b/ts-sdk/examples/ucs03-send-holesky-to-stargaze-with-approvals.ts @@ -15,8 +15,8 @@ import { sendInstructionEvm } from "../src/ucs03/send-instruction.js" import { privateKeyToAccount } from "viem/accounts" import { ViemWalletClient } from "../src/evm/client.js" import { SourceConfig } from "../src/evm/quote-token.js" -import { readErc20Allowance, increaseErc20Allowance } from "../src/evm/erc20.ts" -import { waitForTransactionReceipt } from "../src/evm/receipts.ts" +import { readErc20Allowance, increaseErc20Allowance } from "../src/evm/erc20.js" +import { waitForTransactionReceipt } from "../src/evm/receipts.js" // @ts-ignore BigInt["prototype"].toJSON = function () { diff --git a/ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts b/ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts index 0e2bfce58e..fc4c6d137a 100644 --- a/ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts +++ b/ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts @@ -11,7 +11,7 @@ import { CosmWasmClientDestination, createCosmWasmClient } from "../src/cosmos/c import { Batch } from "../src/ucs03/instruction.js" import { sendInstructionAptos } from "../src/ucs03/send-instruction.js" import { AptosChannelSource } from "../src/aptos/channel.js" -import { CosmosChannelDestination } from "../src/cosmos/channel.ts" +import { CosmosChannelDestination } from "../src/cosmos/channel.js" // @ts-ignore BigInt["prototype"].toJSON = function () { diff --git a/ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts b/ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts index 5ed9b2a592..56989f209d 100644 --- a/ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts +++ b/ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts @@ -14,9 +14,9 @@ import { sendInstructionEvm } from "../src/ucs03/send-instruction.js" import { privateKeyToAccount } from "viem/accounts" import { ViemWalletClient } from "../src/evm/client.js" import { EvmChannelSource } from "../src/evm/channel.js" -import { readErc20Allowance, increaseErc20Allowance } from "../src/evm/erc20.ts" -import { waitForTransactionReceipt } from "../src/evm/receipts.ts" -import { CosmosChannelDestination } from "../src/cosmos/channel.ts" +import { readErc20Allowance, increaseErc20Allowance } from "../src/evm/erc20.js" +import { waitForTransactionReceipt } from "../src/evm/receipts.js" +import { CosmosChannelDestination } from "../src/cosmos/channel.js" // @ts-ignore BigInt["prototype"].toJSON = function () { diff --git a/ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts b/ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts index 619e96206e..c48e0498a6 100644 --- a/ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts +++ b/ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts @@ -11,7 +11,7 @@ import { import { Batch, encodeAbi } from "../src/ucs03/instruction.js" import { AptosChannelDestination } from "../src/aptos/channel.js" import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing" -import { CosmosChannelSource } from "../src/cosmos/channel.ts" +import { CosmosChannelSource } from "../src/cosmos/channel.js" import { Decimal } from "@cosmjs/math" // @ts-ignore diff --git a/ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts b/ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts index a8c140c8c9..5c9253f525 100644 --- a/ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts +++ b/ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts @@ -17,7 +17,7 @@ import { Batch, encodeAbi } from "../src/ucs03/instruction.js" import { sendInstructionCosmos } from "../src/ucs03/send-instruction.js" import { EvmChannelDestination } from "../src/evm/channel.js" import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing" -import { CosmosChannelSource } from "../src/cosmos/channel.ts" +import { CosmosChannelSource } from "../src/cosmos/channel.js" import { Decimal } from "@cosmjs/math" // @ts-ignore From ce3f0d1160e7a184fcfdde5a7c572d78ee2912aa Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Mon, 7 Apr 2025 10:16:28 -0400 Subject: [PATCH 20/43] fix(ts-sdk): fix examples/ type checking and deps Signed-off-by: Eric Hegnes --- pnpm-lock.yaml | 98 ++++++++++++++++++++++++----------- ts-sdk/package.json | 13 ++++- ts-sdk/tsconfig.examples.json | 2 + 3 files changed, 82 insertions(+), 31 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3c6870de6..7b7c06f08e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -170,12 +170,21 @@ importers: '@babel/core': specifier: ^7.25.2 version: 7.26.10 + '@cosmjs/math': + specifier: ^0.33.1 + version: 0.33.1 + '@cosmjs/proto-signing': + specifier: ^0.33.0 + version: 0.33.1 '@effect/build-utils': specifier: ^0.7.7 version: 0.7.9 '@effect/vitest': specifier: ~0.19.10 version: 0.19.10(effect@3.14.2)(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) + '@types/node': + specifier: ^22.13.1 + version: 22.13.14 babel-plugin-annotate-pure-calls: specifier: ^0.5.0 version: 0.5.0(@babel/core@7.26.10) @@ -191,6 +200,9 @@ importers: viem: specifier: ^2.23.12 version: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4) + vite-node: + specifier: ^3.1.1 + version: 3.1.1(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) vitest: specifier: ^3.0.8 version: 3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) @@ -4231,6 +4243,11 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true + vite-node@3.1.1: + resolution: {integrity: sha512-V+IxPAE2FvXpTCHXyNem0M+gWm6J7eRyWPR6vYoG/Gl+IscNOjXzztUhimQgTxaAoUoj40Qqimaa0NLIOOAH4w==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + vite-tsconfig-paths@5.1.4: resolution: {integrity: sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==} peerDependencies: @@ -4877,8 +4894,8 @@ snapshots: dependencies: xstream: 11.14.0 - ? '@cosmjs/tendermint-rpc@0.33.1(patch_hash=d6d84acfc406c9bb60bb24c691bf474327d6a3a3140be568a3b77e1063897c4e)(bufferutil@4.0.9)(utf-8-validate@5.0.10)' - : dependencies: + '@cosmjs/tendermint-rpc@0.33.1(patch_hash=d6d84acfc406c9bb60bb24c691bf474327d6a3a3140be568a3b77e1063897c4e)(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: '@cosmjs/crypto': 0.33.1 '@cosmjs/encoding': 0.33.1 '@cosmjs/json-rpc': 0.33.1 @@ -4903,8 +4920,8 @@ snapshots: '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) '@csstools/css-tokenizer': 3.0.3 - ? '@csstools/css-color-parser@3.0.8(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)' - : dependencies: + '@csstools/css-color-parser@3.0.8(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + dependencies: '@csstools/color-helpers': 5.0.2 '@csstools/css-calc': 2.1.2(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) @@ -4930,8 +4947,8 @@ snapshots: find-my-way-ts: 0.1.5 multipasta: 0.2.5 - ? '@effect/vitest@0.19.10(effect@3.14.2)(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' - : dependencies: + '@effect/vitest@0.19.10(effect@3.14.2)(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': + dependencies: effect: 3.14.2 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) @@ -5221,8 +5238,8 @@ snapshots: '@metamask/safe-event-emitter@3.1.2': {} - ? '@metamask/sdk-communication-layer@0.32.0(cross-fetch@4.1.0)(eciesjs@0.4.14)(eventemitter2@6.4.9)(readable-stream@3.6.2)(socket.io-client@4.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))' - : dependencies: + '@metamask/sdk-communication-layer@0.32.0(cross-fetch@4.1.0)(eciesjs@0.4.14)(eventemitter2@6.4.9)(readable-stream@3.6.2)(socket.io-client@4.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))': + dependencies: bufferutil: 4.0.9 cross-fetch: 4.1.0 date-fns: 2.30.0 @@ -5555,12 +5572,12 @@ snapshots: dependencies: acorn: 8.14.1 - ? '@sveltejs/adapter-static@3.0.8(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))' - : dependencies: + '@sveltejs/adapter-static@3.0.8(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))': + dependencies: '@sveltejs/kit': 2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) - ? '@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' - : dependencies: + '@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': + dependencies: '@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) '@types/cookie': 0.6.0 cookie: 0.6.0 @@ -5576,8 +5593,8 @@ snapshots: svelte: 5.25.3 vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) - ? '@sveltejs/vite-plugin-svelte-inspector@4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' - : dependencies: + '@sveltejs/vite-plugin-svelte-inspector@4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': + dependencies: '@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) debug: 4.4.0 svelte: 5.25.3 @@ -5585,8 +5602,8 @@ snapshots: transitivePeerDependencies: - supports-color - ? '@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' - : dependencies: + '@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': + dependencies: '@sveltejs/vite-plugin-svelte-inspector': 4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) debug: 4.4.0 deepmerge: 4.3.1 @@ -5688,8 +5705,8 @@ snapshots: lodash: 4.17.21 redent: 3.0.0 - ? '@testing-library/svelte@5.2.7(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' - : dependencies: + '@testing-library/svelte@5.2.7(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': + dependencies: '@testing-library/dom': 10.4.0 svelte: 5.25.3 optionalDependencies: @@ -5745,8 +5762,8 @@ snapshots: dependencies: '@types/node': 22.13.14 - ? '@typescript-eslint/eslint-plugin@8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2)' - : dependencies: + '@typescript-eslint/eslint-plugin@8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2)': + dependencies: '@eslint-community/regexpp': 4.12.1 '@typescript-eslint/parser': 8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2) '@typescript-eslint/scope-manager': 8.28.0 @@ -5916,8 +5933,8 @@ snapshots: '@vue/shared@3.5.13': {} - ? '@wagmi/connectors@5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)' - : dependencies: + '@wagmi/connectors@5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)': + dependencies: '@coinbase/wallet-sdk': 4.3.0 '@metamask/sdk': 0.32.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@safe-global/safe-apps-provider': 0.18.5(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4) @@ -5955,8 +5972,8 @@ snapshots: - utf-8-validate - zod - ? '@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))' - : dependencies: + '@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))': + dependencies: eventemitter3: 5.0.1 mipd: 0.0.7(typescript@5.8.2) viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4) @@ -6402,8 +6419,8 @@ snapshots: lit: 3.1.0 qrcode: 1.5.3 - ? '@web3modal/wagmi@4.0.0(@wagmi/connectors@5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4))(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(typescript@5.8.2)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))' - : dependencies: + '@web3modal/wagmi@4.0.0(@wagmi/connectors@5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4))(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(typescript@5.8.2)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))': + dependencies: '@wagmi/connectors': 5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4) '@wagmi/core': 2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)) '@web3modal/polyfills': 4.0.0 @@ -9124,8 +9141,29 @@ snapshots: - tsx - yaml - ? vite-tsconfig-paths@5.1.4(typescript@5.8.2)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) - : dependencies: + vite-node@3.1.1(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0): + dependencies: + cac: 6.7.14 + debug: 4.4.0 + es-module-lexer: 1.6.0 + pathe: 2.0.3 + vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite-tsconfig-paths@5.1.4(typescript@5.8.2)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)): + dependencies: debug: 4.4.0 globrex: 0.1.2 tsconfck: 3.1.5(typescript@5.8.2) @@ -9152,8 +9190,8 @@ snapshots: optionalDependencies: vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) - ? vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) - : dependencies: + vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0): + dependencies: '@vitest/expect': 3.0.9 '@vitest/mocker': 3.0.9(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) '@vitest/pretty-format': 3.0.9 diff --git a/ts-sdk/package.json b/ts-sdk/package.json index 7a4f04d842..1ccb8bfe68 100644 --- a/ts-sdk/package.json +++ b/ts-sdk/package.json @@ -10,7 +10,13 @@ "url": "https://github.com/unionlabs/union.git", "directory": "ts-sdk" }, - "files": ["LICENSE", "README.md", "dist", "package.json", "src"], + "files": [ + "LICENSE", + "README.md", + "dist", + "package.json", + "src" + ], "exports": { ".": { "import": "./dist/index.js" @@ -45,6 +51,7 @@ "build-annotate": "babel dist/ --plugins annotate-pure-calls --out-dir dist/ --source-maps", "build-esm": "tsc -b tsconfig.build.json", "check": "tsc -b tsconfig.json", + "check:examples": "tsc -p tsconfig.examples.json", "check:circular": "dpdm -T src", "test": "vitest run", "test:watch": "vitest" @@ -56,13 +63,17 @@ "devDependencies": { "@babel/cli": "^7.24.8", "@babel/core": "^7.25.2", + "@cosmjs/math": "^0.33.1", + "@cosmjs/proto-signing": "^0.33.0", "@effect/build-utils": "^0.7.7", "@effect/vitest": "~0.19.10", + "@types/node": "^22.13.1", "babel-plugin-annotate-pure-calls": "^0.5.0", "biome": "^0.3.3", "dpdm": "^3.14.0", "effect": "^3.13.12", "viem": "^2.23.12", + "vite-node": "^3.1.1", "vitest": "^3.0.8" }, "dependencies": { diff --git a/ts-sdk/tsconfig.examples.json b/ts-sdk/tsconfig.examples.json index 575e7be42b..5d8d5bbafc 100644 --- a/ts-sdk/tsconfig.examples.json +++ b/ts-sdk/tsconfig.examples.json @@ -4,6 +4,8 @@ "references": [{ "path": "tsconfig.src.json" }], "compilerOptions": { "tsBuildInfoFile": ".tsbuildinfo/examples.tsbuildinfo", + "noEmit": true, + "types": ["node"], "rootDir": "examples", } } From 2f54930511fac10e55e73f28f62df4eb16535b49 Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Mon, 7 Apr 2025 10:32:44 -0400 Subject: [PATCH 21/43] fix(ts-sdk): migrate examples/ to new Instruction ADT Signed-off-by: Eric Hegnes --- ts-sdk/examples/evm-write-contract.ts | 1 + ts-sdk/examples/ucs03-create-fungible-asset-order.ts | 4 ++++ ts-sdk/examples/ucs03-encode-instruction.ts | 2 +- ts-sdk/examples/ucs03-encode-packet.ts | 6 +++--- ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts | 2 +- .../ucs03-send-holesky-to-stargaze-with-approvals.ts | 2 +- ts-sdk/examples/ucs03-send-holesky-to-stargaze.ts | 4 ++-- ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts | 2 +- ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts | 4 ++-- ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts | 6 +++--- ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts | 6 +++--- 11 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ts-sdk/examples/evm-write-contract.ts b/ts-sdk/examples/evm-write-contract.ts index 507ac19b32..b8862efd4f 100644 --- a/ts-sdk/examples/evm-write-contract.ts +++ b/ts-sdk/examples/evm-write-contract.ts @@ -5,6 +5,7 @@ import { createWalletClient, http, erc20Abi } from "viem" import { sepolia } from "viem/chains" import { privateKeyToAccount } from "viem/accounts" +// @ts-ignore BigInt["prototype"].toJSON = function () { return this.toString() } diff --git a/ts-sdk/examples/ucs03-create-fungible-asset-order.ts b/ts-sdk/examples/ucs03-create-fungible-asset-order.ts index 3f5b5a9d9f..0f13becf98 100644 --- a/ts-sdk/examples/ucs03-create-fungible-asset-order.ts +++ b/ts-sdk/examples/ucs03-create-fungible-asset-order.ts @@ -121,6 +121,10 @@ Effect.runPromiseExit( }).pipe( Effect.provideService(CosmWasmClientSource, { client: sourceClient }), Effect.provideService(CosmWasmClientDestination, { client: destClient }), + Effect.provideService(CosmosChannelDestination, { + ucs03address: "union15zcptld878lux44lvc0chzhz7dcdh62nh0xehwa8y7czuz3yljls7u4ry6", + channelId: 1 + }), Effect.provideService(CosmosDestinationConfig, { ucs03address: "union1x2jzeup7uwfxjxxrtfna2ktcugltntgu6kvc0eeayk0d82l247cqz669ee", channelId: 4 diff --git a/ts-sdk/examples/ucs03-encode-instruction.ts b/ts-sdk/examples/ucs03-encode-instruction.ts index 284fd7beff..fa2048c019 100644 --- a/ts-sdk/examples/ucs03-encode-instruction.ts +++ b/ts-sdk/examples/ucs03-encode-instruction.ts @@ -1,5 +1,5 @@ import { toHex } from "viem" -import { Instruction } from "../src/ucs03.js" +import { Instruction } from "@unionlabs/sdk/ucs03" export const exampleBatchInstruction = new Instruction.Batch({ operand: [ diff --git a/ts-sdk/examples/ucs03-encode-packet.ts b/ts-sdk/examples/ucs03-encode-packet.ts index 518ee3266c..b4c08a6a04 100644 --- a/ts-sdk/examples/ucs03-encode-packet.ts +++ b/ts-sdk/examples/ucs03-encode-packet.ts @@ -1,11 +1,11 @@ import { toHex } from "viem" -import { FungibleAssetOrder } from "../src/ucs03/instruction.js" +import { Instruction } from "@unionlabs/sdk/ucs03" import { encodeZkgmPacketAbi, type ZkgmPacket } from "../src/ucs03/zkgm-packet.js" const examplePacket: ZkgmPacket = { salt: "0x1234567890123456789012345678901234567890123456789012345678901234", path: 123456789n, - instruction: FungibleAssetOrder([ + instruction: Instruction.FungibleAssetOrder.make({ operand: [ toHex("stars1qcvavxpxw3t8d9j7mwaeq9wgytkf5vwputv5x4"), toHex("union1d95n4r6dnrfrps59szhl8mk7yqewsuzyw0zh5q"), toHex("stars1qrde534d4jwk44dn7w7gu9e2rayutr7kqx8lfjhsk3rd7z9rzxhq2gh3lr"), @@ -16,7 +16,7 @@ const examplePacket: ZkgmPacket = { 0n, "0x756e696f6e3170707865737461307064643038716537366779366b7438667563717978727a773076786a79366439767430676368357879707371656138377278", 1000000n - ]) + ]}) } console.log("ZkgmPacket:", examplePacket) diff --git a/ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts b/ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts index fbb4caf5d3..2295f7a318 100644 --- a/ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts +++ b/ts-sdk/examples/ucs03-holesky-to-stargaze-batch.ts @@ -5,7 +5,7 @@ import { holesky } from "viem/chains" import { CosmosDestinationConfig } from "../src/cosmos/quote-token.js" import { createEvmToCosmosFungibleAssetOrder } from "../src/ucs03/fungible-asset-order.js" import { CosmWasmClientDestination, createCosmWasmClient } from "../src/cosmos/client.js" -import { Instruction } from "../src/ucs03.js" +import { Instruction } from "@unionlabs/sdk/ucs03" const createBatch = Effect.gen(function* () { const mainTransfer = yield* createEvmToCosmosFungibleAssetOrder({ diff --git a/ts-sdk/examples/ucs03-send-holesky-to-stargaze-with-approvals.ts b/ts-sdk/examples/ucs03-send-holesky-to-stargaze-with-approvals.ts index b7876373b0..3eff8512c1 100644 --- a/ts-sdk/examples/ucs03-send-holesky-to-stargaze-with-approvals.ts +++ b/ts-sdk/examples/ucs03-send-holesky-to-stargaze-with-approvals.ts @@ -64,7 +64,7 @@ const createBatch = Effect.gen(function* () { yield* Effect.log("creating transfer 3 (fee transfer)") const transferFee = yield* createEvmToCosmosFungibleAssetOrder(TRANSFERS[2]) - return Batch([transfer1, transfer2, transferFee]) + return Batch.make({ operand: [transfer1, transfer2, transferFee] }) }).pipe(Effect.withLogSpan("batch creation")) // Check and increase allowances if needed diff --git a/ts-sdk/examples/ucs03-send-holesky-to-stargaze.ts b/ts-sdk/examples/ucs03-send-holesky-to-stargaze.ts index 16ae6d2584..800048a8cc 100644 --- a/ts-sdk/examples/ucs03-send-holesky-to-stargaze.ts +++ b/ts-sdk/examples/ucs03-send-holesky-to-stargaze.ts @@ -44,7 +44,7 @@ const createBatch = Effect.gen(function* () { quoteAmount: 0n }) - return Batch([transfer1, transfer2, transferFee]) + return Batch.make({ operand: [transfer1, transfer2, transferFee] }) }) Effect.runPromiseExit( @@ -61,7 +61,7 @@ Effect.runPromiseExit( const cosmWasmClientDestination = yield* createCosmWasmClient( "https://rpc.elgafar-1.stargaze-apis.com" ) - const account = privateKeyToAccount(PRIVATE_KEY) + const account = privateKeyToAccount(PRIVATE_KEY as `0x${string}`) const walletClient = createWalletClient({ account, chain: sepolia, diff --git a/ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts b/ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts index fc4c6d137a..cf6dc2d0a7 100644 --- a/ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts +++ b/ts-sdk/examples/ucs03-send-movement-to-union-testnet-10.ts @@ -49,7 +49,7 @@ const createBatch = Effect.gen(function* () { const transfer1 = yield* createAptosToCosmosFungibleAssetOrder(TRANSFERS[0]) yield* Effect.log("creating transfer 2") const transfer2 = yield* createAptosToCosmosFungibleAssetOrder(TRANSFERS[1]) - return Batch([transfer1, transfer2]) + return Batch.make({ operand: [transfer1, transfer2] }) }).pipe(Effect.withLogSpan("batch creation")) Effect.runPromiseExit( diff --git a/ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts b/ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts index 56989f209d..abed68f523 100644 --- a/ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts +++ b/ts-sdk/examples/ucs03-send-sepolia-to-union-testnet-10.ts @@ -64,7 +64,7 @@ const createBatch = Effect.gen(function* () { yield* Effect.log("creating transfer 3 (fee transfer)") const transferFee = yield* createEvmToCosmosFungibleAssetOrder(TRANSFERS[2]) - return Batch([transfer1, transfer2, transferFee]) + return Batch.make({ operand: [transfer1, transfer2, transferFee] }) }).pipe(Effect.withLogSpan("batch creation")) // Check and increase allowances if needed @@ -132,7 +132,7 @@ Effect.runPromiseExit( transport: http() }) - const account = privateKeyToAccount(PRIVATE_KEY) + const account = privateKeyToAccount(PRIVATE_KEY as `0x${string}`) const walletClient = yield* createViemWalletClient({ account, chain: sepolia, diff --git a/ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts b/ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts index c48e0498a6..cdcbd95ec3 100644 --- a/ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts +++ b/ts-sdk/examples/ucs03-send-union-testnet-10-to-movement.ts @@ -8,11 +8,11 @@ import { createCosmWasmClient, createSigningCosmWasmClient } from "../src/cosmos/client.js" -import { Batch, encodeAbi } from "../src/ucs03/instruction.js" import { AptosChannelDestination } from "../src/aptos/channel.js" import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing" import { CosmosChannelSource } from "../src/cosmos/channel.js" import { Decimal } from "@cosmjs/math" +import { Instruction } from "@unionlabs/sdk/ucs03" // @ts-ignore BigInt["prototype"].toJSON = function () { @@ -40,7 +40,7 @@ const createBatch = Effect.gen(function* () { yield* Effect.log("creating transfer 1") const transfer1 = yield* createCosmosToAptosFungibleAssetOrder(TRANSFERS[0]) - return Batch([transfer1]) + return Instruction.Batch.make({ operand: [transfer1] }) }).pipe(Effect.withLogSpan("batch creation")) Effect.runPromiseExit( @@ -85,7 +85,7 @@ Effect.runPromiseExit( yield* Effect.log("creating batch") const batch = yield* createBatch yield* Effect.log("batch created", JSON.stringify(batch, null, 2)) - yield* Effect.log("batch abi", encodeAbi(batch)) + yield* Effect.log("batch abi", Instruction.encodeAbi(batch)) // yield* Effect.log("sending batch") // return yield* sendInstructionCosmos(batch) diff --git a/ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts b/ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts index 5c9253f525..7ecf3b8b14 100644 --- a/ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts +++ b/ts-sdk/examples/ucs03-send-union-testnet-10-to-sepolia.ts @@ -13,7 +13,7 @@ import { createCosmWasmClient, createSigningCosmWasmClient } from "../src/cosmos/client.js" -import { Batch, encodeAbi } from "../src/ucs03/instruction.js" +import { Instruction } from "@unionlabs/sdk/ucs03" import { sendInstructionCosmos } from "../src/ucs03/send-instruction.js" import { EvmChannelDestination } from "../src/evm/channel.js" import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing" @@ -46,7 +46,7 @@ const createBatch = Effect.gen(function* () { yield* Effect.log("creating transfer 1") const transfer1 = yield* createCosmosToEvmFungibleAssetOrder(TRANSFERS[0]) - return Batch([transfer1]) + return Instruction.Batch.make({ operand: [transfer1] }) }).pipe(Effect.withLogSpan("batch creation")) // Check and increase allowances if needed @@ -140,7 +140,7 @@ Effect.runPromiseExit( yield* Effect.log("creating batch") const batch = yield* createBatch yield* Effect.log("batch created", JSON.stringify(batch, null, 2)) - yield* Effect.log("batch abi", encodeAbi(batch)) + yield* Effect.log("batch abi", Instruction.encodeAbi(batch)) // Check and increase allowances before sending the batch // yield* Effect.log("checking and increasing allowances if needed") From cbc054c27015780c14c2048d1d11d58bc46d6072 Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Mon, 7 Apr 2025 14:01:50 -0400 Subject: [PATCH 22/43] feat(ts-sdk): add bob -> babylon example Signed-off-by: Eric Hegnes --- ts-sdk/examples/ucs03-send-bob-to-babylon.ts | 172 +++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 ts-sdk/examples/ucs03-send-bob-to-babylon.ts diff --git a/ts-sdk/examples/ucs03-send-bob-to-babylon.ts b/ts-sdk/examples/ucs03-send-bob-to-babylon.ts new file mode 100644 index 0000000000..5a13287cb8 --- /dev/null +++ b/ts-sdk/examples/ucs03-send-bob-to-babylon.ts @@ -0,0 +1,172 @@ +import { Effect } from "effect" +import { http } from "viem" +import { bobSepolia } from "viem/chains" +import { privateKeyToAccount } from "viem/accounts" + +import { + EvmChannelSource, + readErc20Allowance, + increaseErc20Allowance, + waitForTransactionReceipt, + ViemPublicClientSource, + ViemPublicClient, + createViemPublicClient, + createViemWalletClient, + ViemWalletClient +} from "@unionlabs/sdk/evm" +import { Instruction, sendInstructionEvm, createEvmToCosmosFungibleAssetOrder } from "@unionlabs/sdk/ucs03" +import { CosmosChannelDestination, CosmWasmClientDestination, createCosmWasmClient } from "@unionlabs/sdk/cosmos" + +// @ts-ignore +BigInt["prototype"].toJSON = function () { + return this.toString() +} + +// SOURCE WALLET KEY +const PRIVATE_KEY = + process.env.PRIVATE_KEY || "0x0000000000000000000000000000000000000000000000000000000000000000" + +// Define transfer parameters as constants for reuse +const SENDER = "0xfaebe5bf141cc04a3f0598062b98d2df01ab3c4d" +const RECEIVER = "0x52a648eF2157Fd3baFa90BbAc510b9a4870fDF36" +const SOURCE_UCS03_ADDRESS = "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962" // UCS03 contract on Sepolia + +// Define token transfers +const TRANSFERS = [ + { + sender: SENDER, + receiver: RECEIVER, + // baseToken: "0x779877a7b0d9e8603169ddbd7836e478b4624789", // LINK on sepolia + baseToken: "0x2be4bf88014a6574cb10df3b7826be8356aa2499", // uniBTCd on Bob + baseAmount: 100n, + quoteAmount: 100n + }, + { + sender: SENDER, + receiver: RECEIVER, + // baseToken: "0x7b79995e5f793a07bc00c21412e50ecae098e7f9", // WETH on sepolia + baseToken: "0x4200000000000000000000000000000000000006", // WETH on on BOB + baseAmount: 50n, + quoteAmount: 0n + } +] as const + +const createBatch = Effect.gen(function* () { + yield* Effect.log("creating transfer 1") + const transfer1 = yield* createEvmToCosmosFungibleAssetOrder(TRANSFERS[0]) + yield* Effect.log("creating transfer 2 (fee transfer)") + const transferFee = yield* createEvmToCosmosFungibleAssetOrder(TRANSFERS[1]) + + return Instruction.Batch.make({ operand: [transfer1, transferFee] }) +}).pipe(Effect.withLogSpan("batch creation")) + +// Check and increase allowances if needed +const checkAndIncreaseAllowances = Effect.gen(function* () { + yield* Effect.log("Checking token allowances...") + + for (const transfer of TRANSFERS) { + yield* Effect.log(`checking ${transfer.baseToken} allowance...`) + + // Check current allowance + const currentAllowance = yield* readErc20Allowance( + transfer.baseToken, + transfer.sender, + SOURCE_UCS03_ADDRESS + ) + + yield* Effect.log(`current ${transfer.baseToken} allowance: ${currentAllowance}`) + + // If allowance is insufficient, increase it + if (currentAllowance < transfer.baseAmount) { + yield* Effect.log(`increasing ${transfer.baseToken} allowance...`) + + // Approve exact amount needed + const txHash = yield* increaseErc20Allowance( + transfer.baseToken, + SOURCE_UCS03_ADDRESS, + transfer.baseAmount + ) + + yield* Effect.log(`approval transaction sent: ${txHash}`) + + // Wait for transaction receipt + const receipt = yield* waitForTransactionReceipt(txHash) + + yield* Effect.log(`approval confirmed in block: ${receipt.blockNumber}`) + + // Verify new allowance + const newAllowance = yield* readErc20Allowance( + transfer.baseToken, + transfer.sender, + SOURCE_UCS03_ADDRESS + ) + + yield* Effect.log(`new ${transfer.baseToken} allowance: ${newAllowance}`) + } else { + yield* Effect.log(`${transfer.baseToken} allowance is sufficient`) + } + } + + yield* Effect.log("All allowances checked and increased if needed") +}).pipe(Effect.withLogSpan("allowance check and increase")) + +Effect.runPromiseExit( + Effect.gen(function* () { + // Create clients and setup + yield* Effect.log("transferring from sepolia to stargaze") + + yield* Effect.log("creating clients") + const cosmWasmClientDestination = yield* createCosmWasmClient( + "https://rpc.rpc-node.union-testnet-10.union.build" + ) + + const publicSourceClient = yield* createViemPublicClient({ + chain: bobSepolia, + transport: http() + }) + + const account = privateKeyToAccount(PRIVATE_KEY as `0x${string}`) + const walletClient = yield* createViemWalletClient({ + account, + chain: bobSepolia, + transport: http() + }) + + yield* Effect.log("clients created") + + // Main effect: create the batch and send it + return yield* Effect.gen(function* () { + yield* Effect.log("creating batch") + const batch = yield* createBatch + yield* Effect.log("batch created", JSON.stringify(batch)) + + // Check and increase allowances before sending the batch + yield* Effect.log("checking and increasing allowances if needed") + yield* checkAndIncreaseAllowances + yield* Effect.log("allowances verified") + + yield* Effect.log("sending batch") + return yield* sendInstructionEvm(batch) + }).pipe( + Effect.provideService(ViemPublicClient, { client: publicSourceClient }), + Effect.provideService(ViemPublicClientSource, { client: publicSourceClient }), + Effect.provideService(CosmWasmClientDestination, { client: cosmWasmClientDestination }), + Effect.provideService(CosmosChannelDestination, { + ucs03address: "union15zcptld878lux44lvc0chzhz7dcdh62nh0xehwa8y7czuz3yljls7u4ry6", + channelId: 1 + }), + Effect.provideService(EvmChannelSource, { + ucs03address: SOURCE_UCS03_ADDRESS, + channelId: 1 + }), + Effect.provideService(ViemWalletClient, { + client: walletClient, + account: account, + chain: bobSepolia + }) + ) + }) +).then(e => { + console.log(JSON.stringify(e, null, 2)) + console.log(e) +}) From efe567a399f68d83d1109796c829069425c8dbfd Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Mon, 7 Apr 2025 18:04:32 -0400 Subject: [PATCH 23/43] fix(ts-sdk,app2): bob -> babylon example; address formatting Signed-off-by: Eric Hegnes --- .../components/model/AddressComponent.svelte | 102 +++++----- ts-sdk/examples/ucs03-send-babylon-to-bob.ts | 177 ++++++++++++++++++ ts-sdk/examples/ucs03-send-bob-to-babylon.ts | 33 ++-- ts-sdk/src/constants/addr-mapping.ts | 0 ts-sdk/src/schema/address.ts | 6 +- ts-sdk/src/ucs03/fungible-asset-order.ts | 7 +- ts-sdk/src/ucs03/send-instruction.ts | 4 +- 7 files changed, 257 insertions(+), 72 deletions(-) create mode 100644 ts-sdk/examples/ucs03-send-babylon-to-bob.ts create mode 100644 ts-sdk/src/constants/addr-mapping.ts diff --git a/app2/src/lib/components/model/AddressComponent.svelte b/app2/src/lib/components/model/AddressComponent.svelte index f02a4ee4c3..95b7dc3449 100644 --- a/app2/src/lib/components/model/AddressComponent.svelte +++ b/app2/src/lib/components/model/AddressComponent.svelte @@ -1,55 +1,59 @@ @@ -94,10 +98,10 @@ const explorerName = $derived(chain.explorers.length > 0 ? chain.explorers[0].di

Explorer

- View on {explorerName || "Explorer"} diff --git a/ts-sdk/examples/ucs03-send-babylon-to-bob.ts b/ts-sdk/examples/ucs03-send-babylon-to-bob.ts new file mode 100644 index 0000000000..41d40c1d94 --- /dev/null +++ b/ts-sdk/examples/ucs03-send-babylon-to-bob.ts @@ -0,0 +1,177 @@ +import { Effect } from "effect" +import { http } from "viem" +import { sepolia } from "viem/chains" +import { + CosmWasmClientSource, + SigningCosmWasmClientContext, + createCosmWasmClient, + createSigningCosmWasmClient +} from "@unionlabs/sdk/cosmos" +import { Instruction, sendInstructionCosmos, createCosmosToEvmFungibleAssetOrder } from "@unionlabs/sdk/ucs03" +import { + EvmChannelDestination, + ViemPublicClient, + createViemPublicClient, + ViemPublicClientDestination +} from "@unionlabs/sdk/evm" +import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing" +import { CosmosChannelSource } from "@unionlabs/sdk/cosmos" +import { Decimal } from "@cosmjs/math" + +// @ts-ignore +BigInt["prototype"].toJSON = function () { + return this.toString() +} + +const MNEMONIC = process.env.MNEMONIC || "memo memo memo" + +const SENDER = "0x52a648ef2157fd3bafa90bbac510b9a4870fdf36" +const RECEIVER = "0xfaebe5bf141cc04a3f0598062b98d2df01ab3c4d" +const SOURCE_UCS03_ADDRESS = "bbn15zcptld878lux44lvc0chzhz7dcdh62nh0xehwa8y7czuz3yljlspm2re6" + +// toHex(intent.sender), +// intent.receiver, +// toHex(intent.baseToken), + +// Define token transfers +const TRANSFERS = [ + { + sender: SENDER, + receiver: RECEIVER, + // baseToken: "bbn1nznl7srgmtx9juevnrasr2srslqzze3083g30w8ug96f96rjpeuqg8f6uw", + baseToken: "ubbn", + baseAmount: 100n, + quoteAmount: 100n + } +] as const + +const createBatch = Effect.gen(function* () { + yield* Effect.log("creating transfer 1") + const transfer1 = yield* createCosmosToEvmFungibleAssetOrder(TRANSFERS[0]) + + console.log(JSON.stringify(transfer1, null, 2)) + + return Instruction.Batch.make({ operand: [transfer1] }) +}).pipe(Effect.withLogSpan("batch creation")) + +// Check and increase allowances if needed +const checkAndIncreaseAllowances = Effect.gen(function* () { + const publicClient = (yield* ViemPublicClient).client + + yield* Effect.log("Checking token allowances...") + + // for (const transfer of TRANSFERS) { + // yield* Effect.log(`checking ${transfer.baseToken} allowance...`) + + // // Check current allowance + // const currentAllowance = yield* readErc20Allowance( + // transfer.baseToken, + // transfer.sender, + // SOURCE_UCS03_ADDRESS + // ) + + // yield* Effect.log(`current ${transfer.baseToken} allowance: ${currentAllowance}`) + + // // If allowance is insufficient, increase it + // if (currentAllowance < transfer.baseAmount) { + // yield* Effect.log(`increasing ${transfer.baseToken} allowance...`) + + // // Approve exact amount needed + // const txHash = yield* increaseErc20Allowance( + // transfer.baseToken, + // SOURCE_UCS03_ADDRESS, + // transfer.baseAmount + // ) + + // yield* Effect.log(`approval transaction sent: ${txHash}`) + + // // Wait for transaction receipt + // const receipt = yield* waitForTransactionReceipt(txHash) + + // yield* Effect.log(`approval confirmed in block: ${receipt.blockNumber}`) + + // // Verify new allowance + // const newAllowance = yield* readErc20Allowance( + // transfer.baseToken, + // transfer.sender, + // SOURCE_UCS03_ADDRESS + // ) + + // yield* Effect.log(`new ${transfer.baseToken} allowance: ${newAllowance}`) + // } else { + // yield* Effect.log(`${transfer.baseToken} allowance is sufficient`) + // } + // } + + yield* Effect.log("All allowances checked and increased if needed") +}).pipe(Effect.withLogSpan("allowance check and increase")) + +Effect.runPromiseExit( + Effect.gen(function* () { + // Create clients and setup + yield* Effect.log("transferring from sepolia to stargaze") + + yield* Effect.log("creating clients") + const cosmWasmClientSource = yield* createCosmWasmClient( + "https://rpc.rpc-node.union-testnet-10.union.build" + ) + + const publicDestinationClient = yield* createViemPublicClient({ + chain: sepolia, + transport: http() + }) + + // Create a wallet from mnemonic (in a real app, use a secure method to get this) + const wallet = yield* Effect.tryPromise(() => + DirectSecp256k1HdWallet.fromMnemonic(MNEMONIC, { prefix: "union" }) + ) + + // Get the first account address + const [firstAccount] = yield* Effect.tryPromise(() => wallet.getAccounts()) + + // Create a signing client + const signingClient = yield* createSigningCosmWasmClient( + "https://rpc.rpc-node.union-testnet-10.union.build", + wallet, + { + gasPrice: { amount: Decimal.fromUserInput("1", 6), denom: "muno" } + } + ) + + yield* Effect.log("clients created") + + // Main effect: create the batch and send it + return yield* Effect.gen(function* () { + yield* Effect.log("creating batch") + const batch = yield* createBatch + yield* Effect.log("batch created", JSON.stringify(batch, null, 2)) + yield* Effect.log("batch abi", Instruction.encodeAbi(batch)) + + // Check and increase allowances before sending the batch + // yield* Effect.log("checking and increasing allowances if needed") + // yield* checkAndIncreaseAllowances + // yield* Effect.log("allowances verified") + + yield* Effect.log("sending batch") + return yield* sendInstructionCosmos(batch) + }).pipe( + Effect.provideService(SigningCosmWasmClientContext, { + client: signingClient, + address: firstAccount.address + }), + Effect.provideService(CosmWasmClientSource, { client: cosmWasmClientSource }), + Effect.provideService(ViemPublicClientDestination, { client: publicDestinationClient }), + Effect.provideService(EvmChannelDestination, { + ucs03address: "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962", + channelId: 1 + }), + Effect.provideService(CosmosChannelSource, { + ucs03address: SOURCE_UCS03_ADDRESS, + channelId: 1 + }) + ) + }) +).then(e => { + console.log(JSON.stringify(e, null, 2)) + console.log(e) +}) diff --git a/ts-sdk/examples/ucs03-send-bob-to-babylon.ts b/ts-sdk/examples/ucs03-send-bob-to-babylon.ts index 5a13287cb8..5c06909d72 100644 --- a/ts-sdk/examples/ucs03-send-bob-to-babylon.ts +++ b/ts-sdk/examples/ucs03-send-bob-to-babylon.ts @@ -1,5 +1,5 @@ import { Effect } from "effect" -import { http } from "viem" +import { http, toHex } from "viem" import { bobSepolia } from "viem/chains" import { privateKeyToAccount } from "viem/accounts" @@ -13,9 +13,10 @@ import { createViemPublicClient, createViemWalletClient, ViemWalletClient -} from "@unionlabs/sdk/evm" -import { Instruction, sendInstructionEvm, createEvmToCosmosFungibleAssetOrder } from "@unionlabs/sdk/ucs03" -import { CosmosChannelDestination, CosmWasmClientDestination, createCosmWasmClient } from "@unionlabs/sdk/cosmos" +} from "../src/evm/index.js" +import { Instruction, sendInstructionEvm, createEvmToCosmosFungibleAssetOrder } from "../src/ucs03/index.js" +import { CosmosChannelDestination, CosmWasmClientDestination, createCosmWasmClient } from "../src/cosmos/index.js" +import { AddressCosmosZkgm, AddressEvmZkgm } from "../src/schema/address.js" // @ts-ignore BigInt["prototype"].toJSON = function () { @@ -27,16 +28,15 @@ const PRIVATE_KEY = process.env.PRIVATE_KEY || "0x0000000000000000000000000000000000000000000000000000000000000000" // Define transfer parameters as constants for reuse -const SENDER = "0xfaebe5bf141cc04a3f0598062b98d2df01ab3c4d" -const RECEIVER = "0x52a648eF2157Fd3baFa90BbAc510b9a4870fDF36" -const SOURCE_UCS03_ADDRESS = "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962" // UCS03 contract on Sepolia +const SENDER = AddressEvmZkgm.make("0xfaebe5bf141cc04a3f0598062b98d2df01ab3c4d") +const RECEIVER = AddressCosmosZkgm.make(toHex("bbn122ny3mep2l7nhtafpwav2y9e5jrslhekrn8frh")) +const MINTER_UCS03_ADDRESS = "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962" // Define token transfers const TRANSFERS = [ { sender: SENDER, receiver: RECEIVER, - // baseToken: "0x779877a7b0d9e8603169ddbd7836e478b4624789", // LINK on sepolia baseToken: "0x2be4bf88014a6574cb10df3b7826be8356aa2499", // uniBTCd on Bob baseAmount: 100n, quoteAmount: 100n @@ -44,7 +44,6 @@ const TRANSFERS = [ { sender: SENDER, receiver: RECEIVER, - // baseToken: "0x7b79995e5f793a07bc00c21412e50ecae098e7f9", // WETH on sepolia baseToken: "0x4200000000000000000000000000000000000006", // WETH on on BOB baseAmount: 50n, quoteAmount: 0n @@ -71,7 +70,7 @@ const checkAndIncreaseAllowances = Effect.gen(function* () { const currentAllowance = yield* readErc20Allowance( transfer.baseToken, transfer.sender, - SOURCE_UCS03_ADDRESS + MINTER_UCS03_ADDRESS // TODO: should be ucs03 minter address from map (only on cosmos) ) yield* Effect.log(`current ${transfer.baseToken} allowance: ${currentAllowance}`) @@ -83,7 +82,7 @@ const checkAndIncreaseAllowances = Effect.gen(function* () { // Approve exact amount needed const txHash = yield* increaseErc20Allowance( transfer.baseToken, - SOURCE_UCS03_ADDRESS, + MINTER_UCS03_ADDRESS, // todo: same as above transfer.baseAmount ) @@ -98,7 +97,7 @@ const checkAndIncreaseAllowances = Effect.gen(function* () { const newAllowance = yield* readErc20Allowance( transfer.baseToken, transfer.sender, - SOURCE_UCS03_ADDRESS + MINTER_UCS03_ADDRESS // todo: same here ) yield* Effect.log(`new ${transfer.baseToken} allowance: ${newAllowance}`) @@ -117,7 +116,7 @@ Effect.runPromiseExit( yield* Effect.log("creating clients") const cosmWasmClientDestination = yield* createCosmWasmClient( - "https://rpc.rpc-node.union-testnet-10.union.build" + "https://babylon-testnet-rpc.nodes.guru" ) const publicSourceClient = yield* createViemPublicClient({ @@ -145,18 +144,18 @@ Effect.runPromiseExit( yield* checkAndIncreaseAllowances yield* Effect.log("allowances verified") - yield* Effect.log("sending batch") + yield* Effect.log("sending batch!") return yield* sendInstructionEvm(batch) }).pipe( Effect.provideService(ViemPublicClient, { client: publicSourceClient }), Effect.provideService(ViemPublicClientSource, { client: publicSourceClient }), Effect.provideService(CosmWasmClientDestination, { client: cosmWasmClientDestination }), Effect.provideService(CosmosChannelDestination, { - ucs03address: "union15zcptld878lux44lvc0chzhz7dcdh62nh0xehwa8y7czuz3yljls7u4ry6", - channelId: 1 + ucs03address: "bbn15zcptld878lux44lvc0chzhz7dcdh62nh0xehwa8y7czuz3yljlspm2re6", + channelId: 9 }), Effect.provideService(EvmChannelSource, { - ucs03address: SOURCE_UCS03_ADDRESS, + ucs03address: "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962", channelId: 1 }), Effect.provideService(ViemWalletClient, { diff --git a/ts-sdk/src/constants/addr-mapping.ts b/ts-sdk/src/constants/addr-mapping.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ts-sdk/src/schema/address.ts b/ts-sdk/src/schema/address.ts index 3cbdd28e0c..f47ea2c791 100644 --- a/ts-sdk/src/schema/address.ts +++ b/ts-sdk/src/schema/address.ts @@ -14,13 +14,15 @@ export type AddressCosmosCanonical = typeof AddressCosmosCanonical.Type export const AddressCosmosDisplay = Bech32.pipe(S.brand("AddressCosmosDisplay")) export type AddressCosmosDisplay = typeof AddressCosmosDisplay.Type -export const AddressCosmosZkgm = Hex.pipe(S.brand("AddressCosmosZkgm")) // Hex> +export const AddressCosmosZkgm = Hex.pipe(S.brand("AddressCosmosZkgm")) // TODO: Hex> +export type AddressCosmosZkgm = typeof AddressCosmosZkgm.Type // Evm Address Types export const AddressEvmCanonical = AddressCanonicalBytes.pipe(S.brand("AddressEvmCanonical")) export type AddressEvmCanonical = typeof AddressEvmCanonical.Type export const AddressEvmDisplay = HexChecksum.pipe(S.brand("AddressEvmDisplay")) -export const AddressEvmZkgm = AddressEvmCanonical +export const AddressEvmZkgm = AddressEvmCanonical.pipe(S.brand("AddressEvmZkgm")) +export type AddressEvmZkgm = typeof AddressEvmZkgm.Type // Aptos Address Types export const AddressAptosCanonical = AddressCanonicalBytes.pipe(S.brand("AddressAptosCanonical")) diff --git a/ts-sdk/src/ucs03/fungible-asset-order.ts b/ts-sdk/src/ucs03/fungible-asset-order.ts index aa52e9dc44..bb4d786e9a 100644 --- a/ts-sdk/src/ucs03/fungible-asset-order.ts +++ b/ts-sdk/src/ucs03/fungible-asset-order.ts @@ -10,6 +10,7 @@ import { readFaTokenInfo } from "../aptos/fa.js" import { predictQuoteToken as predictCosmosQuoteToken } from "../cosmos/quote-token.js" import { predictQuoteToken as predictAptosQuoteToken } from "../aptos/quote-token.js" import { FungibleAssetOrder } from "./instruction.js" +import { AddressCosmosZkgm, AddressEvmZkgm } from "../schema/address.js" export type FungibleAssetOrderIntent = { sender: Address @@ -65,8 +66,8 @@ export const createEvmToEvmFungibleAssetOrder = (intent: { * Creates a fungible asset order from EVM to Cosmos */ export const createEvmToCosmosFungibleAssetOrder = (intent: { - sender: Address - receiver: string + sender: AddressEvmZkgm + receiver: AddressCosmosZkgm baseToken: Hex baseAmount: bigint quoteAmount: bigint @@ -87,7 +88,7 @@ export const createEvmToCosmosFungibleAssetOrder = (intent: { _tag: "FungibleAssetOrder", operand: [ intent.sender, - toHex(intent.receiver), + intent.receiver, intent.baseToken, intent.baseAmount, tokenMeta.symbol, diff --git a/ts-sdk/src/ucs03/send-instruction.ts b/ts-sdk/src/ucs03/send-instruction.ts index 818ae1984e..eccb7cd144 100644 --- a/ts-sdk/src/ucs03/send-instruction.ts +++ b/ts-sdk/src/ucs03/send-instruction.ts @@ -19,6 +19,8 @@ export const sendInstructionEvm = (instruction: Instruction) => const walletClient = yield* ViemWalletClient const sourceConfig = yield* EvmChannelSource + yield* Effect.log("SENDING INSTRUCTION EVM W/ TIMEOTU") + return yield* writeContractEvm(walletClient.client, { account: walletClient.account, abi: ucs03abi, @@ -27,8 +29,8 @@ export const sendInstructionEvm = (instruction: Instruction) => address: sourceConfig.ucs03address, args: [ sourceConfig.channelId, + 10000000000000001n, 0n, - 1000000000000n, generateSalt("evm"), { opcode: instruction.opcode, From 92ed07fdf1d4e676892292aba878eaec14f3091f Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Mon, 7 Apr 2025 18:09:18 -0400 Subject: [PATCH 24/43] chore: cleanup example Signed-off-by: Eric Hegnes --- ts-sdk/examples/ucs03-send-bob-to-babylon.ts | 14 +++++++------- ts-sdk/src/constants/addr-mapping.ts | 0 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 ts-sdk/src/constants/addr-mapping.ts diff --git a/ts-sdk/examples/ucs03-send-bob-to-babylon.ts b/ts-sdk/examples/ucs03-send-bob-to-babylon.ts index 5c06909d72..0677d26afa 100644 --- a/ts-sdk/examples/ucs03-send-bob-to-babylon.ts +++ b/ts-sdk/examples/ucs03-send-bob-to-babylon.ts @@ -13,10 +13,10 @@ import { createViemPublicClient, createViemWalletClient, ViemWalletClient -} from "../src/evm/index.js" -import { Instruction, sendInstructionEvm, createEvmToCosmosFungibleAssetOrder } from "../src/ucs03/index.js" -import { CosmosChannelDestination, CosmWasmClientDestination, createCosmWasmClient } from "../src/cosmos/index.js" -import { AddressCosmosZkgm, AddressEvmZkgm } from "../src/schema/address.js" +} from "@unionlabs/sdk/evm" +import { Instruction, sendInstructionEvm, createEvmToCosmosFungibleAssetOrder } from "@unionlabs/sdk/ucs03" +import { CosmosChannelDestination, CosmWasmClientDestination, createCosmWasmClient } from "@unionlabs/sdk/cosmos" +import { AddressCosmosZkgm, AddressEvmZkgm } from "@unionlabs/sdk/schema" // @ts-ignore BigInt["prototype"].toJSON = function () { @@ -70,7 +70,7 @@ const checkAndIncreaseAllowances = Effect.gen(function* () { const currentAllowance = yield* readErc20Allowance( transfer.baseToken, transfer.sender, - MINTER_UCS03_ADDRESS // TODO: should be ucs03 minter address from map (only on cosmos) + MINTER_UCS03_ADDRESS ) yield* Effect.log(`current ${transfer.baseToken} allowance: ${currentAllowance}`) @@ -82,7 +82,7 @@ const checkAndIncreaseAllowances = Effect.gen(function* () { // Approve exact amount needed const txHash = yield* increaseErc20Allowance( transfer.baseToken, - MINTER_UCS03_ADDRESS, // todo: same as above + MINTER_UCS03_ADDRESS, transfer.baseAmount ) @@ -97,7 +97,7 @@ const checkAndIncreaseAllowances = Effect.gen(function* () { const newAllowance = yield* readErc20Allowance( transfer.baseToken, transfer.sender, - MINTER_UCS03_ADDRESS // todo: same here + MINTER_UCS03_ADDRESS ) yield* Effect.log(`new ${transfer.baseToken} allowance: ${newAllowance}`) diff --git a/ts-sdk/src/constants/addr-mapping.ts b/ts-sdk/src/constants/addr-mapping.ts deleted file mode 100644 index e69de29bb2..0000000000 From 4749232e2909b1c130a7817ac4810c26e769befb Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Mon, 7 Apr 2025 18:52:34 -0400 Subject: [PATCH 25/43] fix(ts-sdk): declare export type paths Signed-off-by: Eric Hegnes --- ts-sdk/package.json | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/ts-sdk/package.json b/ts-sdk/package.json index 1ccb8bfe68..9bccec7bde 100644 --- a/ts-sdk/package.json +++ b/ts-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@unionlabs/sdk", - "version": "1.8.0", + "version": "1.8.1", "type": "module", "license": "MIT", "author": "@unionlabs", @@ -19,31 +19,40 @@ ], "exports": { ".": { - "import": "./dist/index.js" + "import": "./dist/index.js", + "types": "./dist/index.d.ts" }, "./ucs03": { - "import": "./dist/ucs03/index.js" + "import": "./dist/ucs03/index.js", + "types": "./dist/ucs03/index.d.ts" }, "./evm": { - "import": "./dist/evm/index.js" + "import": "./dist/evm/index.js", + "types": "./dist/evm/index.d.ts" }, "./cosmos": { - "import": "./dist/cosmos/index.js" + "import": "./dist/cosmos/index.js", + "types": "./dist/cosmos/index.d.ts" }, "./evm/abi": { - "import": "./dist/evm/abi/index.js" + "import": "./dist/evm/abi/index.js", + "types": "./dist/evm/abi/index.d.ts" }, "./evm/ucs03": { - "import": "./dist/evm/ucs03/index.js" + "import": "./dist/evm/ucs03/index.js", + "types": "./dist/evm/ucs03/index.d.ts" }, "./evm/erc20": { - "import": "./dist/evm/erc20.js" + "import": "./dist/evm/erc20.js", + "types": "./dist/evm/erc20.d.ts" }, "./utils": { - "import": "./dist/utils/index.js" + "import": "./dist/utils/index.js", + "types": "./dist/utils/index.d.ts" }, "./schema": { - "import": "./dist/schema/index.js" + "import": "./dist/schema/index.js", + "types": "./dist/schema/index.d.ts" } }, "scripts": { From 9002cfb7a0dabdfc310ad614b47b1fdd5420b927 Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Tue, 8 Apr 2025 13:37:16 -0400 Subject: [PATCH 26/43] feat(ts-sdk): add corn -> babylon example --- ts-sdk/examples/ucs03-send-corn-to-babylon.ts | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 ts-sdk/examples/ucs03-send-corn-to-babylon.ts diff --git a/ts-sdk/examples/ucs03-send-corn-to-babylon.ts b/ts-sdk/examples/ucs03-send-corn-to-babylon.ts new file mode 100644 index 0000000000..2f2c10ea4a --- /dev/null +++ b/ts-sdk/examples/ucs03-send-corn-to-babylon.ts @@ -0,0 +1,162 @@ +import { Effect } from "effect" +import { http, toHex } from "viem" +import { cornTestnet } from "viem/chains" +import { privateKeyToAccount } from "viem/accounts" + +import { + EvmChannelSource, + readErc20Allowance, + increaseErc20Allowance, + waitForTransactionReceipt, + ViemPublicClientSource, + ViemPublicClient, + createViemPublicClient, + createViemWalletClient, + ViemWalletClient +} from "@unionlabs/sdk/evm" +import { Instruction, sendInstructionEvm, createEvmToCosmosFungibleAssetOrder } from "@unionlabs/sdk/ucs03" +import { CosmosChannelDestination, CosmWasmClientDestination, createCosmWasmClient } from "@unionlabs/sdk/cosmos" +import { AddressCosmosZkgm, AddressEvmZkgm } from "@unionlabs/sdk/schema" + +// @ts-ignore +BigInt["prototype"].toJSON = function () { + return this.toString() +} + +// SOURCE WALLET KEY +const PRIVATE_KEY = + process.env.PRIVATE_KEY || "0x0000000000000000000000000000000000000000000000000000000000000000" + +// Define transfer parameters as constants for reuse +const SENDER = AddressEvmZkgm.make("0xfaebe5bf141cc04a3f0598062b98d2df01ab3c4d") +const RECEIVER = AddressCosmosZkgm.make(toHex("bbn122ny3mep2l7nhtafpwav2y9e5jrslhekrn8frh")) +const MINTER_UCS03_ADDRESS = "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962".toLowerCase() + +// Define token transfers +const TRANSFERS = [ + { + sender: SENDER, + receiver: RECEIVER, + baseToken: "0x2be4bf88014a6574cb10df3b7826be8356aa2499", + baseAmount: 100n, + quoteAmount: 100n + }, +] as const + +const createBatch = Effect.gen(function* () { + yield* Effect.log("creating transfer 1") + const transfer1 = yield* createEvmToCosmosFungibleAssetOrder(TRANSFERS[0]) + + return Instruction.Batch.make({ operand: [transfer1] }) +}).pipe(Effect.withLogSpan("batch creation")) + +// Check and increase allowances if needed +const checkAndIncreaseAllowances = Effect.gen(function* () { + yield* Effect.log("Checking token allowances...") + + for (const transfer of TRANSFERS) { + yield* Effect.log(`checking ${transfer.baseToken} allowance...`) + + // Check current allowance + const currentAllowance = yield* readErc20Allowance( + transfer.baseToken, + transfer.sender, + MINTER_UCS03_ADDRESS + ) + + yield* Effect.log(`current ${transfer.baseToken} allowance: ${currentAllowance}`) + + // If allowance is insufficient, increase it + if (currentAllowance < transfer.baseAmount) { + yield* Effect.log(`increasing ${transfer.baseToken} allowance...`) + + // Approve exact amount needed + const txHash = yield* increaseErc20Allowance( + transfer.baseToken, + MINTER_UCS03_ADDRESS, + transfer.baseAmount + ) + + yield* Effect.log(`approval transaction sent: ${txHash}`) + + // Wait for transaction receipt + const receipt = yield* waitForTransactionReceipt(txHash) + + yield* Effect.log(`approval confirmed in block: ${receipt.blockNumber}`) + + // Verify new allowance + const newAllowance = yield* readErc20Allowance( + transfer.baseToken, + transfer.sender, + MINTER_UCS03_ADDRESS + ) + + yield* Effect.log(`new ${transfer.baseToken} allowance: ${newAllowance}`) + } else { + yield* Effect.log(`${transfer.baseToken} allowance is sufficient`) + } + } + + yield* Effect.log("All allowances checked and increased if needed") +}).pipe(Effect.withLogSpan("allowance check and increase")) + +Effect.runPromiseExit( + Effect.gen(function* () { + // Create clients and setup + yield* Effect.log("transferring from sepolia to stargaze") + + yield* Effect.log("creating clients") + const cosmWasmClientDestination = yield* createCosmWasmClient( + "https://babylon-testnet-rpc.nodes.guru" + ) + + const publicSourceClient = yield* createViemPublicClient({ + chain: cornTestnet, + transport: http() + }) + + const account = privateKeyToAccount(PRIVATE_KEY as `0x${string}`) + const walletClient = yield* createViemWalletClient({ + account, + chain: cornTestnet, + transport: http() + }) + + yield* Effect.log("clients created") + + // Main effect: create the batch and send it + return yield* Effect.gen(function* () { + yield* Effect.log("creating batch") + const batch = yield* createBatch + yield* Effect.log("batch created", JSON.stringify(batch)) + + // Check and increase allowances before sending the batch + yield* Effect.log("checking and increasing allowances if needed") + yield* checkAndIncreaseAllowances + yield* Effect.log("allowances verified") + + yield* Effect.log("sending batch!") + return yield* sendInstructionEvm(batch) + }).pipe( + Effect.provideService(ViemPublicClient, { client: publicSourceClient }), + Effect.provideService(ViemPublicClientSource, { client: publicSourceClient }), + Effect.provideService(CosmWasmClientDestination, { client: cosmWasmClientDestination }), + Effect.provideService(CosmosChannelDestination, { + ucs03address: "bbn15zcptld878lux44lvc0chzhz7dcdh62nh0xehwa8y7czuz3yljlspm2re6", + channelId: 11 + }), + Effect.provideService(EvmChannelSource, { + ucs03address: "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962", + channelId: 5 + }), + Effect.provideService(ViemWalletClient, { + client: walletClient, + account: account, + chain: cornTestnet + }) + ) + }) +).then(e => { + console.log(JSON.stringify(e, null, 2)) + console.log(e) +}) From 1eac038e9da7986b8af20c7d762b7c3a82867506 Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 18:55:10 +0000 Subject: [PATCH 27/43] feat(app2): add WBTCN for corn (WETH) --- app2/src/lib/constants/weth-denoms.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app2/src/lib/constants/weth-denoms.ts b/app2/src/lib/constants/weth-denoms.ts index fbaeaf7de5..d7be4924a8 100644 --- a/app2/src/lib/constants/weth-denoms.ts +++ b/app2/src/lib/constants/weth-denoms.ts @@ -2,17 +2,21 @@ import { TokenRawDenom, UniversalChainId } from "@unionlabs/sdk/schema" export const WETH_DENOMS: Record = { [UniversalChainId.make("ethereum.11155111")]: TokenRawDenom.make( - "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9".toLowerCase() as `0x${string}` + "0x7b79995e5f793a07bc00c21412e50ecae098e7f9" ), [UniversalChainId.make("ethereum.17000")]: TokenRawDenom.make( - "0x94373a4919B3240D86eA41593D5eBa789FEF3848".toLowerCase() as `0x${string}` + "0x94373a4919b3240d86ea41593d5eba789fef3848" ), //Bob mainnet [UniversalChainId.make("bob.60808")]: TokenRawDenom.make( - "0x4200000000000000000000000000000000000006".toLowerCase() as `0x${string}` + "0x4200000000000000000000000000000000000006" ), //Bob testnet [UniversalChainId.make("bob.808813")]: TokenRawDenom.make( - "0x4200000000000000000000000000000000000006".toLowerCase() as `0x${string}` + "0x4200000000000000000000000000000000000006" + ), + //Corn testnet + [UniversalChainId.make("corn.21000001")]: TokenRawDenom.make( + "0xda5ddd7270381a7c2717ad10d1c0ecb19e3cdfb2" ) } From 6e4eb3ff84b8250130742fd00b6407944b5e6b22 Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 19:23:18 +0000 Subject: [PATCH 28/43] fix(app2): disable hardcoded channels --- .../components/Transfer/transfer.svelte.ts | 146 +++++++++--------- 1 file changed, 74 insertions(+), 72 deletions(-) diff --git a/app2/src/lib/components/Transfer/transfer.svelte.ts b/app2/src/lib/components/Transfer/transfer.svelte.ts index 2e46d5b49c..63ed6e735b 100644 --- a/app2/src/lib/components/Transfer/transfer.svelte.ts +++ b/app2/src/lib/components/Transfer/transfer.svelte.ts @@ -134,56 +134,56 @@ export class Transfer { Option.all([channels.data, this.sourceChain, this.destinationChain]).pipe( Option.flatMap(([channelsData, sourceChain, destinationChain]) => Match.value({ channelsData, sourceChain, destinationChain }).pipe( - Match.when( - { - sourceChain: { universal_chain_id: "bob.808813" }, - destinationChain: { universal_chain_id: "babylon.bbn-test-5" } - }, - ({ - destinationChain: { universal_chain_id: destination_universal_chain_id }, - sourceChain: { universal_chain_id: source_universal_chain_id } - }) => - Option.some( - Schema.decodeSync(Channel)({ - destination_channel_id: 9, - destination_client_id: 3, - destination_connection_id: 6, - destination_port_id: - "0x62626e31357a6370746c643837386c757834346c76633063687a687a376463646836326e68307865687761387937637a757a33796c6a6c73706d32726536", - destination_universal_chain_id: destination_universal_chain_id.toString(), - source_channel_id: 1, - source_client_id: 5, - source_connection_id: 2, - source_port_id: "0xe33534b7f8d38c6935a2f6ad35e09228da239962", - source_universal_chain_id: source_universal_chain_id.toString() - }) - ) - ), - Match.when( - { - sourceChain: { universal_chain_id: "babylon.bbn-test-5" }, - destinationChain: { universal_chain_id: "bob.808813" } - }, - ({ - destinationChain: { universal_chain_id: destination_universal_chain_id }, - sourceChain: { universal_chain_id: source_universal_chain_id } - }) => - Option.some( - Schema.decodeSync(Channel)({ - destination_channel_id: 1, - destination_client_id: 3, - destination_connection_id: 6, - source_port_id: - "0x62626e31357a6370746c643837386c757834346c76633063687a687a376463646836326e68307865687761387937637a757a33796c6a6c73706d32726536", - destination_universal_chain_id: destination_universal_chain_id.toString(), - source_channel_id: 9, - source_client_id: 5, - source_connection_id: 2, - destination_port_id: "0xe33534b7f8d38c6935a2f6ad35e09228da239962", - source_universal_chain_id: source_universal_chain_id.toString() - }) - ) - ), + // Match.when( + // { + // sourceChain: { universal_chain_id: "bob.808813" }, + // destinationChain: { universal_chain_id: "babylon.bbn-test-5" } + // }, + // ({ + // destinationChain: { universal_chain_id: destination_universal_chain_id }, + // sourceChain: { universal_chain_id: source_universal_chain_id } + // }) => + // Option.some( + // Schema.decodeSync(Channel)({ + // destination_channel_id: 9, + // destination_client_id: 3, + // destination_connection_id: 6, + // destination_port_id: + // "0x62626e31357a6370746c643837386c757834346c76633063687a687a376463646836326e68307865687761387937637a757a33796c6a6c73706d32726536", + // destination_universal_chain_id: destination_universal_chain_id.toString(), + // source_channel_id: 1, + // source_client_id: 5, + // source_connection_id: 2, + // source_port_id: "0xe33534b7f8d38c6935a2f6ad35e09228da239962", + // source_universal_chain_id: source_universal_chain_id.toString() + // }) + // ) + // ), + // Match.when( + // { + // sourceChain: { universal_chain_id: "babylon.bbn-test-5" }, + // destinationChain: { universal_chain_id: "bob.808813" } + // }, + // ({ + // destinationChain: { universal_chain_id: destination_universal_chain_id }, + // sourceChain: { universal_chain_id: source_universal_chain_id } + // }) => + // Option.some( + // Schema.decodeSync(Channel)({ + // destination_channel_id: 1, + // destination_client_id: 3, + // destination_connection_id: 6, + // source_port_id: + // "0x62626e31357a6370746c643837386c757834346c76633063687a687a376463646836326e68307865687761387937637a757a33796c6a6c73706d32726536", + // destination_universal_chain_id: destination_universal_chain_id.toString(), + // source_channel_id: 9, + // source_client_id: 5, + // source_connection_id: 2, + // destination_port_id: "0xe33534b7f8d38c6935a2f6ad35e09228da239962", + // source_universal_chain_id: source_universal_chain_id.toString() + // }) + // ) + // ), Match.orElse(() => Option.fromNullable( getChannelInfoSafe( @@ -214,12 +214,12 @@ export class Transfer { ) }) - wethBaseToken = $derived.by(() => { - if (Option.isNone(this.sourceChain)) return Option.none() - return this.sourceChain.value.universal_chain_id in WETH_DENOMS - ? Option.some(WETH_DENOMS[this.sourceChain.value.universal_chain_id]) - : Option.none() - }) + // wethBaseToken = $derived.by(() => { + // if (Option.isNone(this.sourceChain)) return Option.none() + // return this.sourceChain.value.universal_chain_id in WETH_DENOMS + // ? Option.some(WETH_DENOMS[this.sourceChain.value.universal_chain_id]) + // : Option.none() + // }) args = $derived.by(() => { const { @@ -229,8 +229,8 @@ export class Transfer { baseToken, parsedAmount, derivedReceiver, - ucs03address, - wethBaseToken + ucs03address + // wethBaseToken } = { sourceChain: Option.getOrNull(this.sourceChain), destinationChain: Option.getOrNull(this.destinationChain), @@ -238,8 +238,8 @@ export class Transfer { baseToken: Option.getOrNull(this.baseToken), parsedAmount: Option.getOrNull(this.parsedAmount), derivedReceiver: Option.getOrNull(this.derivedReceiver), - ucs03address: Option.getOrNull(this.ucs03address), - wethBaseToken: Option.getOrNull(this.wethBaseToken) + ucs03address: Option.getOrNull(this.ucs03address) + // wethBaseToken: Option.getOrNull(this.wethBaseToken) } return { @@ -254,8 +254,8 @@ export class Transfer { quoteAmount: parsedAmount, receiver: derivedReceiver, timeoutHeight: "0", - timeoutTimestamp: "0x000000000000000000000000000000000000000000000000fffffffffffffffa", - wethBaseToken: wethBaseToken + timeoutTimestamp: "0x000000000000000000000000000000000000000000000000fffffffffffffffa" + // wethBaseToken: wethBaseToken } }) @@ -268,11 +268,13 @@ export class Transfer { const sender = Option.getOrUndefined(this.derivedSender) if (!sender) return Option.none() + console.log("calculating intents") + return Match.value(transferValue.sourceChain.rpc_type).pipe( Match.when("evm", () => { - if (Option.isNone(this.wethBaseToken)) return Option.none() - const wethToken = Option.getOrUndefined(this.wethBaseToken) - if (!wethToken) return Option.none() + // if (Option.isNone(this.wethBaseToken)) return Option.none() + // const wethToken = Option.getOrUndefined(this.wethBaseToken) + // if (!wethToken) return Option.none() return Option.some([ { @@ -281,14 +283,14 @@ export class Transfer { baseToken: transferValue.baseToken, baseAmount: transferValue.baseAmount, quoteAmount: transferValue.baseAmount - }, - { - sender: sender, - receiver: transferValue.receiver, - baseToken: wethToken, - baseAmount: 500n, - quoteAmount: 0n } + // { + // sender: sender, + // receiver: transferValue.receiver, + // baseToken: wethToken, + // baseAmount: 500n, + // quoteAmount: 0n + // } ]) }), From 0b264773e294081388af92d7247d142f4b530831 Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 19:23:34 +0000 Subject: [PATCH 29/43] fix(app2): temporarily disable weth quote token --- .../lib/components/Transfer/state/filling/check-balance.ts | 4 ++-- app2/src/lib/components/Transfer/validation.ts | 1 + ts-sdk/src/schema/hex.ts | 2 +- ts-sdk/src/schema/transfer-args.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app2/src/lib/components/Transfer/state/filling/check-balance.ts b/app2/src/lib/components/Transfer/state/filling/check-balance.ts index 1fbdc8762d..9ec9aaba73 100644 --- a/app2/src/lib/components/Transfer/state/filling/check-balance.ts +++ b/app2/src/lib/components/Transfer/state/filling/check-balance.ts @@ -1,4 +1,4 @@ -import { Effect, Option } from "effect" +import { Effect, identity, Option } from "effect" import { Chain } from "@unionlabs/sdk/schema" import { balancesStore } from "$lib/stores/balances.svelte.ts" import type { TransferIntents } from "$lib/components/Transfer/transfer.svelte.ts" @@ -56,5 +56,5 @@ export const checkBalanceForIntents = (source: Chain, intents: TransferIntents) }) } ) - ).pipe(Effect.map(results => results.every(result => result === true))) + ).pipe(Effect.map(results => results.every(identity))) } diff --git a/app2/src/lib/components/Transfer/validation.ts b/app2/src/lib/components/Transfer/validation.ts index baeccf0647..40ca00bade 100644 --- a/app2/src/lib/components/Transfer/validation.ts +++ b/app2/src/lib/components/Transfer/validation.ts @@ -45,6 +45,7 @@ export const isValid = (result: ValidationResult): boolean => result._tag === "S export function validateTransfer(args: unknown): ValidationResult { const decodeEither = Effect.runSync(Effect.either(decodeAll(args))) + console.log(decodeEither) if (Either.isRight(decodeEither)) { return ValidationResultInternal.Success({ diff --git a/ts-sdk/src/schema/hex.ts b/ts-sdk/src/schema/hex.ts index fd4b835274..c3e06ab898 100644 --- a/ts-sdk/src/schema/hex.ts +++ b/ts-sdk/src/schema/hex.ts @@ -6,7 +6,7 @@ import * as S from "effect/Schema" * Note: To be used ineroperably with `viem`. */ export const Hex = S.NonEmptyString.pipe( - S.pattern(/^0x[0-9a-f]+$/), + S.pattern(/^0x[0-9a-fA-F]+$/), // TODO: remove uppercase S.minLength(3) ) as unknown as S.TemplateLiteral<`0x${string}`> export type Hex = typeof Hex.Type diff --git a/ts-sdk/src/schema/transfer-args.ts b/ts-sdk/src/schema/transfer-args.ts index 232790adfa..d904f39c0e 100644 --- a/ts-sdk/src/schema/transfer-args.ts +++ b/ts-sdk/src/schema/transfer-args.ts @@ -32,7 +32,7 @@ const EvmTransferSchema = S.Struct({ sourceRpcType: S.Literal("evm").annotations({ message: () => "sourceRpcType must be 'evm'" }), - wethBaseToken: EvmWethToken, + // wethBaseToken: EvmWethToken, receiver: S.String.pipe( S.nonEmptyString({ message: () => "receiver must be a non-empty string" }) ) From 055ad8bbc3b80b8023259fac1f3f8d3797fad9f9 Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 19:33:31 +0000 Subject: [PATCH 30/43] fix(app2): filter bitcoin chains --- .../Transfer/ChainAsset/ChainSelector.svelte | 21 ++++++++++++++++--- .../src/lib/components/Transfer/validation.ts | 1 - app2/src/lib/queries/channels.svelte.ts | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte b/app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte index 98af191246..c121c02ac1 100644 --- a/app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte +++ b/app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte @@ -6,6 +6,7 @@ import { tokensStore } from "$lib/stores/tokens.svelte.ts" import { transfer } from "$lib/components/Transfer/transfer.svelte.ts" import type { Chain } from "@unionlabs/sdk/schema" import { chainLogoMap } from "$lib/constants/chain-logos.ts" +import { Array as Arr } from "effect" type Props = { type: "source" | "destination" @@ -29,12 +30,26 @@ function selectChain(chain: Chain) { onSelect() } + +// For btc.union.build, only show bitcoin chains +const filteredChains = $derived( + chains.data.pipe( + Option.map( + Arr.filter(c => + ["corn.21000001", "bob.60808", "bob.808813", "babylon.bbn-test-5"].includes( + c.universal_chain_id + ) + ) + ) + ) +)
- {#if Option.isSome(chains.data)} + {#if Option.isSome(filteredChains)} + {@const chainss = filteredChains.value}
- {#each chains.data.value as chain} + {#each chainss as chain} {@const isSelected = (type === "source" && transfer.raw.source === chain.chain_id) || (type === "destination" && transfer.raw.destination === chain.chain_id)} {@const isDisabled = type === "destination" && transfer.raw.source === chain.chain_id} @@ -73,4 +88,4 @@ function selectChain(chain: Chain) { Loading chains...
{/if} -
\ No newline at end of file +
diff --git a/app2/src/lib/components/Transfer/validation.ts b/app2/src/lib/components/Transfer/validation.ts index 40ca00bade..baeccf0647 100644 --- a/app2/src/lib/components/Transfer/validation.ts +++ b/app2/src/lib/components/Transfer/validation.ts @@ -45,7 +45,6 @@ export const isValid = (result: ValidationResult): boolean => result._tag === "S export function validateTransfer(args: unknown): ValidationResult { const decodeEither = Effect.runSync(Effect.either(decodeAll(args))) - console.log(decodeEither) if (Either.isRight(decodeEither)) { return ValidationResultInternal.Success({ diff --git a/app2/src/lib/queries/channels.svelte.ts b/app2/src/lib/queries/channels.svelte.ts index 54a5cd5b74..163447afbb 100644 --- a/app2/src/lib/queries/channels.svelte.ts +++ b/app2/src/lib/queries/channels.svelte.ts @@ -9,7 +9,7 @@ export const channelsQuery = () => schema: Schema.Struct({ v2_channels: Channels }), document: graphql(` query Ucs03Channels @cached(ttl: 60) { - v2_channels(args: { p_tags: ["experimental"]}) { + v2_channels(args: { p_tags: ["canonical"]}) { destination_channel_id destination_client_id destination_connection_id From 0a8335fe225075a5dfd033660066a2e95a31039c Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Tue, 8 Apr 2025 15:40:18 -0400 Subject: [PATCH 31/43] fix(app2): fix approvalpage denom formatting --- .../Transfer/pages/ApprovalPage.svelte | 185 ++++++++++-------- 1 file changed, 100 insertions(+), 85 deletions(-) diff --git a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte index 09285b066a..9748f38c58 100644 --- a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte +++ b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte @@ -1,59 +1,63 @@
{#if Option.isSome(step) && Option.isSome(sourceChain)}
-

Approve - +

+ Approve +

- +
- +

You need to approve Union to send - - . - This is a one-time approval for this token. + + . This is a one-time approval for this token.

- @@ -204,4 +220,3 @@
{/if}
- From b05a7892cbd5846fb6df2417fd6a49f12d44b4ab Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 19:40:40 +0000 Subject: [PATCH 32/43] fix(app2): from chain formatting --- .../src/lib/components/Transfer/ChainAsset/ChainSelector.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte b/app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte index c121c02ac1..cb84675d84 100644 --- a/app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte +++ b/app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte @@ -78,7 +78,7 @@ const filteredChains = $derived( {chain.display_name} {#if isDisabled} - From chain + From Chain {/if} {/each} From 58b111d55f1f3f2cef82b802d5d00cbc33b3c1b4 Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 20:17:05 +0000 Subject: [PATCH 33/43] feat(app2): looping background video --- app2/src/routes/+layout.svelte | 35 ++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/app2/src/routes/+layout.svelte b/app2/src/routes/+layout.svelte index 75612c639d..d5864043bd 100644 --- a/app2/src/routes/+layout.svelte +++ b/app2/src/routes/+layout.svelte @@ -54,9 +54,40 @@ $effect(() => { -
+
- {@render children()} + + +
+ +
+ +
+ + +
+ {@render children()} +
+
From b033571263376ccffc2964f5e8afb8c3750334da Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 20:25:55 +0000 Subject: [PATCH 34/43] feat(app2): btc edition styling --- app2/src/app.css | 1 + app2/src/lib/components/layout/Sidebar/index.svelte | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app2/src/app.css b/app2/src/app.css index 3c9aac1dea..bcf5b62416 100644 --- a/app2/src/app.css +++ b/app2/src/app.css @@ -20,6 +20,7 @@ @theme { --color-zinc-925: oklch(0.1755 0.0055 285.854); + --color-babylon-orange: #cf6533; --color-union: oklch(0.84 0.1281 215.6); --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; diff --git a/app2/src/lib/components/layout/Sidebar/index.svelte b/app2/src/lib/components/layout/Sidebar/index.svelte index 9fca61eda9..f296f3c600 100644 --- a/app2/src/lib/components/layout/Sidebar/index.svelte +++ b/app2/src/lib/components/layout/Sidebar/index.svelte @@ -74,13 +74,14 @@ onMount(() => {
-
+
Union +
BTC
{#each navigation as section, i} @@ -101,7 +102,7 @@ onMount(() => { )} > {item.title} From 0eda2d01da0b06d5b8e861b125bf3eea29b7bd51 Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Tue, 8 Apr 2025 16:51:24 -0400 Subject: [PATCH 35/43] fix(app2): approval denom display formatting --- .../components/Transfer/pages/ApprovalPage.svelte | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte index 9748f38c58..02bb74ae87 100644 --- a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte +++ b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte @@ -5,7 +5,7 @@ import { lockedTransferStore } from "../locked-transfer.svelte.ts"; import { ApprovalRequired } from "../transfer-step.ts"; import { createViemPublicClient } from "@unionlabs/sdk/evm"; - import { erc20Abi, fromHex, http, toHex } from "viem"; + import { erc20Abi, fromHex, http, isHex, toHex } from "viem"; import { hasFailedExit as evmHasFailedExit, isComplete as evmIsComplete, @@ -170,6 +170,10 @@ ), ); }); + + const massagedDenom = $derived( + isHex(step.value.token) ? step.value.token : toHex(step.value.token), + );
@@ -177,13 +181,13 @@

Approve - +

@@ -191,13 +195,13 @@

You need to approve Union to send - + . This is a one-time approval for this token.

From e00f8a943e38de0dc5be1a34bbe5206fcbc863ab Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 22:01:49 +0000 Subject: [PATCH 36/43] feat(app2): copy url button in header --- .../components/layout/Header/CopyLink.svelte | 69 +++++++++++++++++++ .../lib/components/layout/Header/index.svelte | 14 ++-- 2 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 app2/src/lib/components/layout/Header/CopyLink.svelte diff --git a/app2/src/lib/components/layout/Header/CopyLink.svelte b/app2/src/lib/components/layout/Header/CopyLink.svelte new file mode 100644 index 0000000000..ebe3f8c375 --- /dev/null +++ b/app2/src/lib/components/layout/Header/CopyLink.svelte @@ -0,0 +1,69 @@ + + +
+ + + + {#if isOpen} +
+
+ + +
+
+ {/if} +
diff --git a/app2/src/lib/components/layout/Header/index.svelte b/app2/src/lib/components/layout/Header/index.svelte index 478f0cffcc..8dafd7acce 100644 --- a/app2/src/lib/components/layout/Header/index.svelte +++ b/app2/src/lib/components/layout/Header/index.svelte @@ -3,13 +3,17 @@ import Button from "../../ui/Button.svelte" import { uiStore } from "$lib/stores/ui.svelte" import { totalErrorCount } from "$lib/stores/app-errors.svelte" import Breadcrumbs from "./Breadcrumbs.svelte" +import CopyLink from "./CopyLink.svelte"
- {#if totalErrorCount() > 0} - - {/if} +
+ + {#if totalErrorCount() > 0} + + {/if} +
From 57987c9dbef9c4f2eb9f43895b651984514715d2 Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 22:17:10 +0000 Subject: [PATCH 37/43] feat(app2): packethashcomponent and cleanup --- .../components/layout/Sidebar/navigation.ts | 24 ++++++++-------- .../model/PacketHashComponent.svelte | 28 +++++++++++++++++++ .../model/PacketListItemComponent.svelte | 7 ++--- .../model/TransactionHashComponent.svelte | 3 +- 4 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 app2/src/lib/components/model/PacketHashComponent.svelte diff --git a/app2/src/lib/components/layout/Sidebar/navigation.ts b/app2/src/lib/components/layout/Sidebar/navigation.ts index 65dec8bd74..95134db458 100644 --- a/app2/src/lib/components/layout/Sidebar/navigation.ts +++ b/app2/src/lib/components/layout/Sidebar/navigation.ts @@ -56,19 +56,19 @@ export const navigation: Array = [ { path: "/explorer/packets", title: "Packets" - }, - { - path: "/explorer/connections", - title: "Connections" - }, - { - path: "/explorer/channels", - title: "Channels" - }, - { - path: "/explorer/clients", - title: "Clients" } + // { + // path: "/explorer/connections", + // title: "Connections" + // }, + // { + // path: "/explorer/channels", + // title: "Channels" + // }, + // { + // path: "/explorer/clients", + // title: "Clients" + // } ] } ] diff --git a/app2/src/lib/components/model/PacketHashComponent.svelte b/app2/src/lib/components/model/PacketHashComponent.svelte new file mode 100644 index 0000000000..b3138e2b27 --- /dev/null +++ b/app2/src/lib/components/model/PacketHashComponent.svelte @@ -0,0 +1,28 @@ + + + + {#snippet trigger()} + + {/snippet} + + {#snippet content()} +
+ + {hash} + +
+ {/snippet} +
diff --git a/app2/src/lib/components/model/PacketListItemComponent.svelte b/app2/src/lib/components/model/PacketListItemComponent.svelte index fc44a1bccd..af04176f5c 100644 --- a/app2/src/lib/components/model/PacketListItemComponent.svelte +++ b/app2/src/lib/components/model/PacketListItemComponent.svelte @@ -7,7 +7,7 @@ import ChainComponent from "./ChainComponent.svelte" import DateTimeComponent from "$lib/components/ui/DateTimeComponent.svelte" import { goto } from "$app/navigation" import SharpRightArrowIcon from "../icons/SharpRightArrowIcon.svelte" -import LongMonoWord from "../ui/LongMonoWord.svelte" +import PacketHashComponent from "./PacketHashComponent.svelte" type Props = { packet: PacketListItem @@ -37,9 +37,7 @@ const handleClick = () => { onclick={handleClick} >
- - {packet.packet_hash} - +
{#if Option.isSome(sourceChain)} @@ -54,6 +52,5 @@ const handleClick = () => { {/if}
-
{packet.channel_version}
diff --git a/app2/src/lib/components/model/TransactionHashComponent.svelte b/app2/src/lib/components/model/TransactionHashComponent.svelte index 6f563ce865..d360b9e31c 100644 --- a/app2/src/lib/components/model/TransactionHashComponent.svelte +++ b/app2/src/lib/components/model/TransactionHashComponent.svelte @@ -9,6 +9,7 @@ import ChainComponent from "$lib/components/model/ChainComponent.svelte" import Label from "../ui/Label.svelte" import A from "../ui/A.svelte" import { pipe, Array, Struct, String } from "effect" +import { cn } from "$lib/utils" type Props = HTMLAttributes & { hash: string @@ -45,7 +46,7 @@ const explorerName = $derived( {#snippet trigger()} - + {/snippet} {#snippet content()} From e119f08a493d7a60692fd2e12ef70aec281b801e Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 22:23:07 +0000 Subject: [PATCH 38/43] fix(app2): remove faucet --- app/src/generated/graphql-env.d.ts | 69 +++++++++++++++++-- .../components/layout/Sidebar/navigation.ts | 8 +-- 2 files changed, 68 insertions(+), 9 deletions(-) diff --git a/app/src/generated/graphql-env.d.ts b/app/src/generated/graphql-env.d.ts index 2068212bcb..235811160e 100644 --- a/app/src/generated/graphql-env.d.ts +++ b/app/src/generated/graphql-env.d.ts @@ -13,6 +13,10 @@ export type introspection_types = { 'Request': { kind: 'OBJECT'; name: 'Request'; fields: { 'address': { name: 'address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'time': { name: 'time'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'txHash': { name: 'txHash'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; 'String': unknown; '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 }]; }; + 'address_types': { kind: 'OBJECT'; name: 'address_types'; fields: { 'canonical': { name: 'canonical'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'display': { name: 'display'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'zkgm': { name: 'zkgm'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; + 'address_types_bool_exp_bool_exp': { kind: 'INPUT_OBJECT'; name: 'address_types_bool_exp_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'address_types_bool_exp_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'address_types_bool_exp_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'address_types_bool_exp_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'canonical'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'display'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'zkgm'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'address_types_enum_name': { name: 'address_types_enum_name'; enumValues: 'canonical' | 'display' | 'zkgm'; }; + 'address_types_order_by': { kind: 'INPUT_OBJECT'; name: 'address_types_order_by'; isOneOf: false; inputFields: [{ name: 'canonical'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'display'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'zkgm'; type: { kind: 'ENUM'; name: 'order_by'; 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; @@ -30,15 +34,26 @@ export type introspection_types = { 'count_enum_name': { name: 'count_enum_name'; enumValues: 'count'; }; 'count_order_by': { kind: 'INPUT_OBJECT'; name: 'count_order_by'; isOneOf: false; inputFields: [{ name: 'count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; 'cursor_ordering': { name: 'cursor_ordering'; enumValues: 'ASC' | 'DESC'; }; + 'dashboard_count_by_chain_type': { kind: 'OBJECT'; name: 'dashboard_count_by_chain_type'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'phase': { name: 'phase'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'universal_chain_id': { name: 'universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'dashboard_count_by_chain_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'dashboard_count_by_chain_type_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'dashboard_count_by_chain_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'dashboard_count_by_chain_type_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'dashboard_count_by_chain_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'count'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'phase'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'dashboard_count_by_chain_type_order_by': { kind: 'INPUT_OBJECT'; name: 'dashboard_count_by_chain_type_order_by'; isOneOf: false; inputFields: [{ name: 'count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'phase'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'dashboard_count_by_chain_type_select_column': { name: 'dashboard_count_by_chain_type_select_column'; enumValues: 'count' | 'phase' | 'universal_chain_id'; }; + 'dashboard_days_by_chain_type': { kind: 'OBJECT'; name: 'dashboard_days_by_chain_type'; fields: { 'day_count': { name: 'day_count'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'universal_chain_id': { name: 'universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'dashboard_days_by_chain_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'dashboard_days_by_chain_type_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'dashboard_days_by_chain_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'dashboard_days_by_chain_type_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'dashboard_days_by_chain_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'day_count'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'dashboard_days_by_chain_type_order_by': { kind: 'INPUT_OBJECT'; name: 'dashboard_days_by_chain_type_order_by'; isOneOf: false; inputFields: [{ name: 'day_count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'dashboard_days_by_chain_type_select_column': { name: 'dashboard_days_by_chain_type_select_column'; enumValues: 'day_count' | 'universal_chain_id'; }; + 'dashboard_transfer_count_by_chain_args': { kind: 'INPUT_OBJECT'; name: 'dashboard_transfer_count_by_chain_args'; isOneOf: false; inputFields: [{ name: 'p_addresses_dashboard'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'p_phase'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'dashboard_transfer_days_count_by_chain_args': { kind: 'INPUT_OBJECT'; name: 'dashboard_transfer_days_count_by_chain_args'; isOneOf: false; inputFields: [{ name: 'p_addresses_dashboard'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }]; }; '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 }]; }; - 'dydx_faucetMutation': { kind: 'OBJECT'; name: 'dydx_faucetMutation'; fields: { 'send': { name: 'send'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; - 'dydx_faucetQuery': { kind: 'OBJECT'; name: 'dydx_faucetQuery'; fields: { 'handledTransfers': { name: 'handledTransfers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; 'transfersForAddress': { name: 'transfersForAddress'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; 'unhandledTransfers': { name: 'unhandledTransfers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; }; }; + 'get_address_types_for_display_address_arguments': { kind: 'INPUT_OBJECT'; name: 'get_address_types_for_display_address_arguments'; isOneOf: false; inputFields: [{ name: 'chain_type'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'display_address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; + 'get_days_for_addresses_arguments': { kind: 'INPUT_OBJECT'; name: 'get_days_for_addresses_arguments'; isOneOf: false; inputFields: [{ name: 'addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; }; defaultValue: null }]; }; 'get_route_arguments': { kind: 'INPUT_OBJECT'; name: 'get_route_arguments'; isOneOf: false; inputFields: [{ name: 'destination_chain_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'forward_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'receiver'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'source_chain_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'get_streaks_for_addresses_arguments': { kind: 'INPUT_OBJECT'; name: 'get_streaks_for_addresses_arguments'; isOneOf: false; inputFields: [{ name: 'addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; }; defaultValue: null }]; }; 'get_transfer_counts_for_addresses_arguments': { kind: 'INPUT_OBJECT'; name: 'get_transfer_counts_for_addresses_arguments'; isOneOf: false; inputFields: [{ name: 'addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; }; defaultValue: null }]; }; 'get_transfer_counts_for_addresses_by_dest_universal_chain_arguments': { kind: 'INPUT_OBJECT'; name: 'get_transfer_counts_for_addresses_by_dest_universal_chain_arguments'; isOneOf: false; inputFields: [{ name: 'p_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; }; defaultValue: null }, { name: 'p_phase'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; 'get_transfer_counts_for_addresses_by_destination_chain_arguments': { kind: 'INPUT_OBJECT'; name: 'get_transfer_counts_for_addresses_by_destination_chain_arguments'; isOneOf: false; inputFields: [{ name: 'addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; }; defaultValue: null }]; }; + 'get_transfer_request_details_arguments': { kind: 'INPUT_OBJECT'; name: 'get_transfer_request_details_arguments'; isOneOf: false; inputFields: [{ name: 'p_base_token'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'p_destination_universal_chain_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'p_source_universal_chain_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'hubble_streaks': { kind: 'OBJECT'; name: 'hubble_streaks'; fields: { 'address': { name: 'address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'bytea'; ofType: null; }; } }; 'end_timestamp': { name: 'end_timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; } }; 'internal_destination_chain_id': { name: 'internal_destination_chain_id'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'start_timestamp': { name: 'start_timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; } }; }; }; 'hubble_streaks_bool_exp': { kind: 'INPUT_OBJECT'; name: 'hubble_streaks_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'hubble_streaks_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'hubble_streaks_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'hubble_streaks_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'address'; type: { kind: 'INPUT_OBJECT'; name: 'bytea_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'end_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'internal_destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'start_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }]; }; 'hubble_streaks_order_by': { kind: 'INPUT_OBJECT'; name: 'hubble_streaks_order_by'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'end_timestamp'; 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: 'start_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; @@ -50,18 +65,26 @@ export type introspection_types = { 'jsonb_comparison_exp': { kind: 'INPUT_OBJECT'; name: 'jsonb_comparison_exp'; isOneOf: false; inputFields: [{ name: '_cast'; type: { kind: 'INPUT_OBJECT'; name: 'jsonb_cast_exp'; ofType: null; }; defaultValue: null }, { name: '_contained_in'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: '_contains'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: '_eq'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: '_gt'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: '_gte'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: '_has_key'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: '_has_keys_all'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; defaultValue: null }, { name: '_has_keys_any'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { 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: 'jsonb'; ofType: null; }; }; }; defaultValue: null }, { name: '_is_null'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: '_lt'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: '_lte'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: '_neq'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: '_nin'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; }; }; defaultValue: null }]; }; 'latency_percentiles_scalar': unknown; 'latency_percentiles_scalar_comparison_exp': { kind: 'INPUT_OBJECT'; name: 'latency_percentiles_scalar_comparison_exp'; isOneOf: false; inputFields: [{ name: '_eq'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; }; defaultValue: null }, { name: '_gt'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; }; defaultValue: null }, { name: '_gte'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; }; defaultValue: null }, { name: '_in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; }; }; }; defaultValue: null }, { name: '_is_null'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: '_lt'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; }; defaultValue: null }, { name: '_lte'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; }; defaultValue: null }, { name: '_neq'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; }; defaultValue: null }, { name: '_nin'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; }; }; }; defaultValue: null }]; }; - 'mutation_root': { kind: 'OBJECT'; name: 'mutation_root'; fields: { 'dydx_faucet': { name: 'dydx_faucet'; type: { kind: 'OBJECT'; name: 'dydx_faucetMutation'; ofType: null; } }; 'send': { name: 'send'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; + 'mutation_root': { kind: 'OBJECT'; name: 'mutation_root'; fields: { 'send': { name: 'send'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; 'numeric': unknown; 'numeric_comparison_exp': { kind: 'INPUT_OBJECT'; name: 'numeric_comparison_exp'; isOneOf: false; inputFields: [{ name: '_eq'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: '_gt'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: '_gte'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: '_in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; }; }; defaultValue: null }, { name: '_is_null'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: '_lt'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: '_lte'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: '_neq'; type: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; defaultValue: null }, { name: '_nin'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'numeric'; ofType: null; }; }; }; defaultValue: null }]; }; 'order_by': { name: 'order_by'; enumValues: 'asc' | 'asc_nulls_first' | 'asc_nulls_last' | 'desc' | 'desc_nulls_first' | 'desc_nulls_last'; }; - 'query_root': { kind: 'OBJECT'; name: 'query_root'; fields: { 'dydx_faucet': { name: 'dydx_faucet'; type: { kind: 'OBJECT'; name: 'dydx_faucetQuery'; ofType: null; } }; 'get_route': { name: 'get_route'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PfmArgs'; ofType: null; }; }; }; } }; 'get_streaks_for_addresses': { name: 'get_streaks_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'streak'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses': { name: 'get_transfer_counts_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses_by_dest_universal_chain': { name: 'get_transfer_counts_for_addresses_by_dest_universal_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count_by_universal_chain_id'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses_by_destination_chain': { name: 'get_transfer_counts_for_addresses_by_destination_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count_by_chain_id'; ofType: null; }; }; }; } }; 'handledTransfers': { name: 'handledTransfers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; 'hubble_streaks': { name: 'hubble_streaks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'hubble_streaks'; ofType: null; }; }; }; } }; 'transfersForAddress': { name: 'transfersForAddress'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; 'unhandledTransfers': { name: 'unhandledTransfers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; 'v1_ibc_union_app_chain_configurations': { name: 'v1_ibc_union_app_chain_configurations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_app_chain_configurations'; ofType: null; }; }; }; } }; 'v1_ibc_union_assets': { name: 'v1_ibc_union_assets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_assets'; ofType: null; }; }; }; } }; 'v1_ibc_union_chains': { name: 'v1_ibc_union_chains'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; }; }; }; } }; 'v1_ibc_union_channel_recommendations': { name: 'v1_ibc_union_channel_recommendations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channel_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_channels': { name: 'v1_ibc_union_channels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channels'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights': { name: 'v1_ibc_union_client_heights'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights_max': { name: 'v1_ibc_union_client_heights_max'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights_max'; ofType: null; }; }; }; } }; 'v1_ibc_union_clients': { name: 'v1_ibc_union_clients'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_clients'; ofType: null; }; }; }; } }; 'v1_ibc_union_config': { name: 'v1_ibc_union_config'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_config'; ofType: null; }; }; }; } }; 'v1_ibc_union_connection_recommendations': { name: 'v1_ibc_union_connection_recommendations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connection_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_connections': { name: 'v1_ibc_union_connections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connections'; ofType: null; }; }; }; } }; 'v1_ibc_union_contracts': { name: 'v1_ibc_union_contracts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_contracts'; ofType: null; }; }; }; } }; 'v1_ibc_union_cw20_instantiate': { name: 'v1_ibc_union_cw20_instantiate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_cw20_instantiate'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_fungible_asset_orders': { name: 'v1_ibc_union_daily_fungible_asset_orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_packets': { name: 'v1_ibc_union_daily_packets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_explorers': { name: 'v1_ibc_union_explorers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_explorers'; ofType: null; }; }; }; } }; 'v1_ibc_union_faucets': { name: 'v1_ibc_union_faucets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_faucets'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats': { name: 'v1_ibc_union_fungible_asset_order_stats'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats_2': { name: 'v1_ibc_union_fungible_asset_order_stats_2'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats_2'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_orders': { name: 'v1_ibc_union_fungible_asset_orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_health_check': { name: 'v1_ibc_union_health_check'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_health_check'; ofType: null; }; }; }; } }; 'v1_ibc_union_index_status': { name: 'v1_ibc_union_index_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_index_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_missing_token_details': { name: 'v1_ibc_union_missing_token_details'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_missing_token_details'; ofType: null; }; }; }; } }; 'v1_ibc_union_packets': { name: 'v1_ibc_union_packets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_relayer_status': { name: 'v1_ibc_union_relayer_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_relayer_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_rpcs': { name: 'v1_ibc_union_rpcs'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_rpcs'; ofType: null; }; }; }; } }; 'v1_ibc_union_statistics': { name: 'v1_ibc_union_statistics'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_statistics'; ofType: null; }; }; }; } }; 'v1_ibc_union_streaks': { name: 'v1_ibc_union_streaks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_streaks'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_source_unwrapping': { name: 'v1_ibc_union_token_representation_source_unwrapping'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_source_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_sources': { name: 'v1_ibc_union_token_representation_sources'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representations': { name: 'v1_ibc_union_token_representations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representations'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_sources': { name: 'v1_ibc_union_token_sources'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_unwrapping': { name: 'v1_ibc_union_token_unwrapping'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_tokens': { name: 'v1_ibc_union_tokens'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_tokens'; ofType: null; }; }; }; } }; 'v1_ibc_union_trace_previews_type': { name: 'v1_ibc_union_trace_previews_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_trace_previews_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_traces_type': { name: 'v1_ibc_union_traces_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_traces_type'; ofType: null; }; }; }; } }; }; }; + 'query_root': { kind: 'OBJECT'; name: 'query_root'; fields: { 'dashboard_transfer_count_by_chain': { name: 'dashboard_transfer_count_by_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'dashboard_count_by_chain_type'; ofType: null; }; }; }; } }; 'dashboard_transfer_days_count_by_chain': { name: 'dashboard_transfer_days_count_by_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'dashboard_days_by_chain_type'; ofType: null; }; }; }; } }; 'get_address_types_for_display_address': { name: 'get_address_types_for_display_address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'address_types'; ofType: null; }; }; }; } }; 'get_days_for_addresses': { name: 'get_days_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'transfer_days'; ofType: null; }; }; }; } }; 'get_route': { name: 'get_route'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PfmArgs'; ofType: null; }; }; }; } }; 'get_streaks_for_addresses': { name: 'get_streaks_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'streak'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses': { name: 'get_transfer_counts_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses_by_dest_universal_chain': { name: 'get_transfer_counts_for_addresses_by_dest_universal_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count_by_universal_chain_id'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses_by_destination_chain': { name: 'get_transfer_counts_for_addresses_by_destination_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count_by_chain_id'; ofType: null; }; }; }; } }; 'get_transfer_request_details': { name: 'get_transfer_request_details'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'transfer_request_details'; ofType: null; }; }; }; } }; 'handledTransfers': { name: 'handledTransfers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; 'hubble_streaks': { name: 'hubble_streaks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'hubble_streaks'; ofType: null; }; }; }; } }; 'transfersForAddress': { name: 'transfersForAddress'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; 'unhandledTransfers': { name: 'unhandledTransfers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Request'; ofType: null; }; }; }; } }; 'v1_ibc_union_app_chain_configurations': { name: 'v1_ibc_union_app_chain_configurations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_app_chain_configurations'; ofType: null; }; }; }; } }; 'v1_ibc_union_assets': { name: 'v1_ibc_union_assets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_assets'; ofType: null; }; }; }; } }; 'v1_ibc_union_chains': { name: 'v1_ibc_union_chains'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; }; }; }; } }; 'v1_ibc_union_channel_recommendations': { name: 'v1_ibc_union_channel_recommendations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channel_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_channels': { name: 'v1_ibc_union_channels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channels'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights': { name: 'v1_ibc_union_client_heights'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights_max': { name: 'v1_ibc_union_client_heights_max'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights_max'; ofType: null; }; }; }; } }; 'v1_ibc_union_clients': { name: 'v1_ibc_union_clients'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_clients'; ofType: null; }; }; }; } }; 'v1_ibc_union_config': { name: 'v1_ibc_union_config'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_config'; ofType: null; }; }; }; } }; 'v1_ibc_union_connection_recommendations': { name: 'v1_ibc_union_connection_recommendations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connection_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_connections': { name: 'v1_ibc_union_connections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connections'; ofType: null; }; }; }; } }; 'v1_ibc_union_contracts': { name: 'v1_ibc_union_contracts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_contracts'; ofType: null; }; }; }; } }; 'v1_ibc_union_cw20_instantiate': { name: 'v1_ibc_union_cw20_instantiate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_cw20_instantiate'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_fungible_asset_orders': { name: 'v1_ibc_union_daily_fungible_asset_orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_packets': { name: 'v1_ibc_union_daily_packets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_explorers': { name: 'v1_ibc_union_explorers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_explorers'; ofType: null; }; }; }; } }; 'v1_ibc_union_faucets': { name: 'v1_ibc_union_faucets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_faucets'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats': { name: 'v1_ibc_union_fungible_asset_order_stats'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats_2': { name: 'v1_ibc_union_fungible_asset_order_stats_2'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats_2'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_orders': { name: 'v1_ibc_union_fungible_asset_orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_health_check': { name: 'v1_ibc_union_health_check'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_health_check'; ofType: null; }; }; }; } }; 'v1_ibc_union_index_status': { name: 'v1_ibc_union_index_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_index_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_missing_token_details': { name: 'v1_ibc_union_missing_token_details'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_missing_token_details'; ofType: null; }; }; }; } }; 'v1_ibc_union_packets': { name: 'v1_ibc_union_packets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_relayer_status': { name: 'v1_ibc_union_relayer_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_relayer_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_rpcs': { name: 'v1_ibc_union_rpcs'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_rpcs'; ofType: null; }; }; }; } }; 'v1_ibc_union_statistics': { name: 'v1_ibc_union_statistics'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_statistics'; ofType: null; }; }; }; } }; 'v1_ibc_union_streaks': { name: 'v1_ibc_union_streaks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_streaks'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_source_unwrapping': { name: 'v1_ibc_union_token_representation_source_unwrapping'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_source_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_sources': { name: 'v1_ibc_union_token_representation_sources'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representations': { name: 'v1_ibc_union_token_representations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representations'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_sources': { name: 'v1_ibc_union_token_sources'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_unwrapping': { name: 'v1_ibc_union_token_unwrapping'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_tokens': { name: 'v1_ibc_union_tokens'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_tokens'; ofType: null; }; }; }; } }; 'v1_ibc_union_trace_previews_type': { name: 'v1_ibc_union_trace_previews_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_trace_previews_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_traces_type': { name: 'v1_ibc_union_traces_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_traces_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_transfer_days_type': { name: 'v1_ibc_union_transfer_days_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_transfer_days_type'; ofType: null; }; }; }; } }; 'v2_stats_count': { name: 'v2_stats_count'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_type'; ofType: null; }; }; }; } }; 'v2_stats_latency': { name: 'v2_stats_latency'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_latency_type'; ofType: null; }; }; }; } }; 'v2_stats_packets_chain': { name: 'v2_stats_packets_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_packets_chain_type'; ofType: null; }; }; }; } }; 'v2_stats_packets_daily_count': { name: 'v2_stats_packets_daily_count'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_daily_count_type'; ofType: null; }; }; }; } }; 'v2_stats_transfers_address': { name: 'v2_stats_transfers_address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_transfers_address_type'; ofType: null; }; }; }; } }; 'v2_stats_transfers_chain': { name: 'v2_stats_transfers_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_transfers_chain_type'; ofType: null; }; }; }; } }; 'v2_stats_transfers_daily_count': { name: 'v2_stats_transfers_daily_count'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_daily_count_type'; ofType: null; }; }; }; } }; }; }; 'streak': { kind: 'OBJECT'; name: 'streak'; fields: { 'destination_chain_id': { name: 'destination_chain_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'destination_universal_chain_id': { name: 'destination_universal_chain_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'end_timestamp': { name: 'end_timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; } }; 'seconds': { name: 'seconds'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'start_timestamp': { name: 'start_timestamp'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; } }; }; }; 'streak_bool_exp_bool_exp': { kind: 'INPUT_OBJECT'; name: 'streak_bool_exp_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'streak_bool_exp_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'streak_bool_exp_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'streak_bool_exp_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'destination_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'end_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'seconds'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'start_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; ofType: null; }; defaultValue: null }]; }; 'streak_enum_name': { name: 'streak_enum_name'; enumValues: 'destination_chain_id' | 'destination_universal_chain_id' | 'end_timestamp' | 'seconds' | 'start_timestamp'; }; 'streak_order_by': { kind: 'INPUT_OBJECT'; name: 'streak_order_by'; isOneOf: false; inputFields: [{ name: 'destination_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'end_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'seconds'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'start_timestamp'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; - 'subscription_root': { kind: 'OBJECT'; name: 'subscription_root'; fields: { 'get_route': { name: 'get_route'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PfmArgs'; ofType: null; }; }; }; } }; 'get_streaks_for_addresses': { name: 'get_streaks_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'streak'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses': { name: 'get_transfer_counts_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses_by_dest_universal_chain': { name: 'get_transfer_counts_for_addresses_by_dest_universal_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count_by_universal_chain_id'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses_by_destination_chain': { name: 'get_transfer_counts_for_addresses_by_destination_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count_by_chain_id'; ofType: null; }; }; }; } }; 'hubble_streaks': { name: 'hubble_streaks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'hubble_streaks'; ofType: null; }; }; }; } }; 'hubble_streaks_stream': { name: 'hubble_streaks_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'hubble_streaks'; ofType: null; }; }; }; } }; 'v1_ibc_union_app_chain_configurations': { name: 'v1_ibc_union_app_chain_configurations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_app_chain_configurations'; ofType: null; }; }; }; } }; 'v1_ibc_union_app_chain_configurations_stream': { name: 'v1_ibc_union_app_chain_configurations_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_app_chain_configurations'; ofType: null; }; }; }; } }; 'v1_ibc_union_assets': { name: 'v1_ibc_union_assets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_assets'; ofType: null; }; }; }; } }; 'v1_ibc_union_assets_stream': { name: 'v1_ibc_union_assets_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_assets'; ofType: null; }; }; }; } }; 'v1_ibc_union_chains': { name: 'v1_ibc_union_chains'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; }; }; }; } }; 'v1_ibc_union_chains_stream': { name: 'v1_ibc_union_chains_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; }; }; }; } }; 'v1_ibc_union_channel_recommendations': { name: 'v1_ibc_union_channel_recommendations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channel_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_channel_recommendations_stream': { name: 'v1_ibc_union_channel_recommendations_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channel_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_channels': { name: 'v1_ibc_union_channels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channels'; ofType: null; }; }; }; } }; 'v1_ibc_union_channels_stream': { name: 'v1_ibc_union_channels_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channels'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights': { name: 'v1_ibc_union_client_heights'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights_max': { name: 'v1_ibc_union_client_heights_max'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights_max'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights_max_stream': { name: 'v1_ibc_union_client_heights_max_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights_max'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights_stream': { name: 'v1_ibc_union_client_heights_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights'; ofType: null; }; }; }; } }; 'v1_ibc_union_clients': { name: 'v1_ibc_union_clients'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_clients'; ofType: null; }; }; }; } }; 'v1_ibc_union_clients_stream': { name: 'v1_ibc_union_clients_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_clients'; ofType: null; }; }; }; } }; 'v1_ibc_union_config': { name: 'v1_ibc_union_config'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_config'; ofType: null; }; }; }; } }; 'v1_ibc_union_config_stream': { name: 'v1_ibc_union_config_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_config'; ofType: null; }; }; }; } }; 'v1_ibc_union_connection_recommendations': { name: 'v1_ibc_union_connection_recommendations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connection_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_connection_recommendations_stream': { name: 'v1_ibc_union_connection_recommendations_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connection_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_connections': { name: 'v1_ibc_union_connections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connections'; ofType: null; }; }; }; } }; 'v1_ibc_union_connections_stream': { name: 'v1_ibc_union_connections_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connections'; ofType: null; }; }; }; } }; 'v1_ibc_union_contracts': { name: 'v1_ibc_union_contracts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_contracts'; ofType: null; }; }; }; } }; 'v1_ibc_union_contracts_stream': { name: 'v1_ibc_union_contracts_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_contracts'; ofType: null; }; }; }; } }; 'v1_ibc_union_cw20_instantiate': { name: 'v1_ibc_union_cw20_instantiate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_cw20_instantiate'; ofType: null; }; }; }; } }; 'v1_ibc_union_cw20_instantiate_stream': { name: 'v1_ibc_union_cw20_instantiate_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_cw20_instantiate'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_fungible_asset_orders': { name: 'v1_ibc_union_daily_fungible_asset_orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_fungible_asset_orders_stream': { name: 'v1_ibc_union_daily_fungible_asset_orders_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_packets': { name: 'v1_ibc_union_daily_packets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_packets_stream': { name: 'v1_ibc_union_daily_packets_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_explorers': { name: 'v1_ibc_union_explorers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_explorers'; ofType: null; }; }; }; } }; 'v1_ibc_union_explorers_stream': { name: 'v1_ibc_union_explorers_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_explorers'; ofType: null; }; }; }; } }; 'v1_ibc_union_faucets': { name: 'v1_ibc_union_faucets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_faucets'; ofType: null; }; }; }; } }; 'v1_ibc_union_faucets_stream': { name: 'v1_ibc_union_faucets_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_faucets'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats': { name: 'v1_ibc_union_fungible_asset_order_stats'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats_2': { name: 'v1_ibc_union_fungible_asset_order_stats_2'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats_2'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats_2_stream': { name: 'v1_ibc_union_fungible_asset_order_stats_2_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats_2'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats_stream': { name: 'v1_ibc_union_fungible_asset_order_stats_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_orders': { name: 'v1_ibc_union_fungible_asset_orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_orders_stream': { name: 'v1_ibc_union_fungible_asset_orders_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_health_check': { name: 'v1_ibc_union_health_check'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_health_check'; ofType: null; }; }; }; } }; 'v1_ibc_union_health_check_stream': { name: 'v1_ibc_union_health_check_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_health_check'; ofType: null; }; }; }; } }; 'v1_ibc_union_index_status': { name: 'v1_ibc_union_index_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_index_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_index_status_stream': { name: 'v1_ibc_union_index_status_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_index_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_missing_token_details': { name: 'v1_ibc_union_missing_token_details'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_missing_token_details'; ofType: null; }; }; }; } }; 'v1_ibc_union_missing_token_details_stream': { name: 'v1_ibc_union_missing_token_details_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_missing_token_details'; ofType: null; }; }; }; } }; 'v1_ibc_union_packets': { name: 'v1_ibc_union_packets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_packets_stream': { name: 'v1_ibc_union_packets_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_relayer_status': { name: 'v1_ibc_union_relayer_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_relayer_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_relayer_status_stream': { name: 'v1_ibc_union_relayer_status_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_relayer_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_rpcs': { name: 'v1_ibc_union_rpcs'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_rpcs'; ofType: null; }; }; }; } }; 'v1_ibc_union_rpcs_stream': { name: 'v1_ibc_union_rpcs_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_rpcs'; ofType: null; }; }; }; } }; 'v1_ibc_union_statistics': { name: 'v1_ibc_union_statistics'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_statistics'; ofType: null; }; }; }; } }; 'v1_ibc_union_statistics_stream': { name: 'v1_ibc_union_statistics_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_statistics'; ofType: null; }; }; }; } }; 'v1_ibc_union_streaks': { name: 'v1_ibc_union_streaks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_streaks'; ofType: null; }; }; }; } }; 'v1_ibc_union_streaks_stream': { name: 'v1_ibc_union_streaks_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_streaks'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_source_unwrapping': { name: 'v1_ibc_union_token_representation_source_unwrapping'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_source_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_source_unwrapping_stream': { name: 'v1_ibc_union_token_representation_source_unwrapping_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_source_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_sources': { name: 'v1_ibc_union_token_representation_sources'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_sources_stream': { name: 'v1_ibc_union_token_representation_sources_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representations': { name: 'v1_ibc_union_token_representations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representations'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representations_stream': { name: 'v1_ibc_union_token_representations_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representations'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_sources': { name: 'v1_ibc_union_token_sources'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_sources_stream': { name: 'v1_ibc_union_token_sources_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_unwrapping': { name: 'v1_ibc_union_token_unwrapping'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_unwrapping_stream': { name: 'v1_ibc_union_token_unwrapping_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_tokens': { name: 'v1_ibc_union_tokens'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_tokens'; ofType: null; }; }; }; } }; 'v1_ibc_union_tokens_stream': { name: 'v1_ibc_union_tokens_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_tokens'; ofType: null; }; }; }; } }; 'v1_ibc_union_trace_previews_type': { name: 'v1_ibc_union_trace_previews_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_trace_previews_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_trace_previews_type_stream': { name: 'v1_ibc_union_trace_previews_type_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_trace_previews_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_traces_type': { name: 'v1_ibc_union_traces_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_traces_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_traces_type_stream': { name: 'v1_ibc_union_traces_type_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_traces_type'; ofType: null; }; }; }; } }; }; }; + 'subscription_root': { kind: 'OBJECT'; name: 'subscription_root'; fields: { 'dashboard_transfer_count_by_chain': { name: 'dashboard_transfer_count_by_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'dashboard_count_by_chain_type'; ofType: null; }; }; }; } }; 'dashboard_transfer_days_count_by_chain': { name: 'dashboard_transfer_days_count_by_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'dashboard_days_by_chain_type'; ofType: null; }; }; }; } }; 'get_address_types_for_display_address': { name: 'get_address_types_for_display_address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'address_types'; ofType: null; }; }; }; } }; 'get_days_for_addresses': { name: 'get_days_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'transfer_days'; ofType: null; }; }; }; } }; 'get_route': { name: 'get_route'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PfmArgs'; ofType: null; }; }; }; } }; 'get_streaks_for_addresses': { name: 'get_streaks_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'streak'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses': { name: 'get_transfer_counts_for_addresses'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses_by_dest_universal_chain': { name: 'get_transfer_counts_for_addresses_by_dest_universal_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count_by_universal_chain_id'; ofType: null; }; }; }; } }; 'get_transfer_counts_for_addresses_by_destination_chain': { name: 'get_transfer_counts_for_addresses_by_destination_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'count_by_chain_id'; ofType: null; }; }; }; } }; 'get_transfer_request_details': { name: 'get_transfer_request_details'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'transfer_request_details'; ofType: null; }; }; }; } }; 'hubble_streaks': { name: 'hubble_streaks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'hubble_streaks'; ofType: null; }; }; }; } }; 'hubble_streaks_stream': { name: 'hubble_streaks_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'hubble_streaks'; ofType: null; }; }; }; } }; 'v1_ibc_union_app_chain_configurations': { name: 'v1_ibc_union_app_chain_configurations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_app_chain_configurations'; ofType: null; }; }; }; } }; 'v1_ibc_union_app_chain_configurations_stream': { name: 'v1_ibc_union_app_chain_configurations_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_app_chain_configurations'; ofType: null; }; }; }; } }; 'v1_ibc_union_assets': { name: 'v1_ibc_union_assets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_assets'; ofType: null; }; }; }; } }; 'v1_ibc_union_assets_stream': { name: 'v1_ibc_union_assets_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_assets'; ofType: null; }; }; }; } }; 'v1_ibc_union_chains': { name: 'v1_ibc_union_chains'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; }; }; }; } }; 'v1_ibc_union_chains_stream': { name: 'v1_ibc_union_chains_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; }; }; }; } }; 'v1_ibc_union_channel_recommendations': { name: 'v1_ibc_union_channel_recommendations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channel_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_channel_recommendations_stream': { name: 'v1_ibc_union_channel_recommendations_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channel_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_channels': { name: 'v1_ibc_union_channels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channels'; ofType: null; }; }; }; } }; 'v1_ibc_union_channels_stream': { name: 'v1_ibc_union_channels_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_channels'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights': { name: 'v1_ibc_union_client_heights'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights_max': { name: 'v1_ibc_union_client_heights_max'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights_max'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights_max_stream': { name: 'v1_ibc_union_client_heights_max_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights_max'; ofType: null; }; }; }; } }; 'v1_ibc_union_client_heights_stream': { name: 'v1_ibc_union_client_heights_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_client_heights'; ofType: null; }; }; }; } }; 'v1_ibc_union_clients': { name: 'v1_ibc_union_clients'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_clients'; ofType: null; }; }; }; } }; 'v1_ibc_union_clients_stream': { name: 'v1_ibc_union_clients_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_clients'; ofType: null; }; }; }; } }; 'v1_ibc_union_config': { name: 'v1_ibc_union_config'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_config'; ofType: null; }; }; }; } }; 'v1_ibc_union_config_stream': { name: 'v1_ibc_union_config_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_config'; ofType: null; }; }; }; } }; 'v1_ibc_union_connection_recommendations': { name: 'v1_ibc_union_connection_recommendations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connection_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_connection_recommendations_stream': { name: 'v1_ibc_union_connection_recommendations_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connection_recommendations'; ofType: null; }; }; }; } }; 'v1_ibc_union_connections': { name: 'v1_ibc_union_connections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connections'; ofType: null; }; }; }; } }; 'v1_ibc_union_connections_stream': { name: 'v1_ibc_union_connections_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_connections'; ofType: null; }; }; }; } }; 'v1_ibc_union_contracts': { name: 'v1_ibc_union_contracts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_contracts'; ofType: null; }; }; }; } }; 'v1_ibc_union_contracts_stream': { name: 'v1_ibc_union_contracts_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_contracts'; ofType: null; }; }; }; } }; 'v1_ibc_union_cw20_instantiate': { name: 'v1_ibc_union_cw20_instantiate'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_cw20_instantiate'; ofType: null; }; }; }; } }; 'v1_ibc_union_cw20_instantiate_stream': { name: 'v1_ibc_union_cw20_instantiate_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_cw20_instantiate'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_fungible_asset_orders': { name: 'v1_ibc_union_daily_fungible_asset_orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_fungible_asset_orders_stream': { name: 'v1_ibc_union_daily_fungible_asset_orders_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_packets': { name: 'v1_ibc_union_daily_packets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_daily_packets_stream': { name: 'v1_ibc_union_daily_packets_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_daily_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_explorers': { name: 'v1_ibc_union_explorers'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_explorers'; ofType: null; }; }; }; } }; 'v1_ibc_union_explorers_stream': { name: 'v1_ibc_union_explorers_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_explorers'; ofType: null; }; }; }; } }; 'v1_ibc_union_faucets': { name: 'v1_ibc_union_faucets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_faucets'; ofType: null; }; }; }; } }; 'v1_ibc_union_faucets_stream': { name: 'v1_ibc_union_faucets_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_faucets'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats': { name: 'v1_ibc_union_fungible_asset_order_stats'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats_2': { name: 'v1_ibc_union_fungible_asset_order_stats_2'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats_2'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats_2_stream': { name: 'v1_ibc_union_fungible_asset_order_stats_2_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats_2'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_order_stats_stream': { name: 'v1_ibc_union_fungible_asset_order_stats_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_order_stats'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_orders': { name: 'v1_ibc_union_fungible_asset_orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_fungible_asset_orders_stream': { name: 'v1_ibc_union_fungible_asset_orders_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_fungible_asset_orders'; ofType: null; }; }; }; } }; 'v1_ibc_union_health_check': { name: 'v1_ibc_union_health_check'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_health_check'; ofType: null; }; }; }; } }; 'v1_ibc_union_health_check_stream': { name: 'v1_ibc_union_health_check_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_health_check'; ofType: null; }; }; }; } }; 'v1_ibc_union_index_status': { name: 'v1_ibc_union_index_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_index_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_index_status_stream': { name: 'v1_ibc_union_index_status_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_index_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_missing_token_details': { name: 'v1_ibc_union_missing_token_details'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_missing_token_details'; ofType: null; }; }; }; } }; 'v1_ibc_union_missing_token_details_stream': { name: 'v1_ibc_union_missing_token_details_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_missing_token_details'; ofType: null; }; }; }; } }; 'v1_ibc_union_packets': { name: 'v1_ibc_union_packets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_packets_stream': { name: 'v1_ibc_union_packets_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_packets'; ofType: null; }; }; }; } }; 'v1_ibc_union_relayer_status': { name: 'v1_ibc_union_relayer_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_relayer_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_relayer_status_stream': { name: 'v1_ibc_union_relayer_status_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_relayer_status'; ofType: null; }; }; }; } }; 'v1_ibc_union_rpcs': { name: 'v1_ibc_union_rpcs'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_rpcs'; ofType: null; }; }; }; } }; 'v1_ibc_union_rpcs_stream': { name: 'v1_ibc_union_rpcs_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_rpcs'; ofType: null; }; }; }; } }; 'v1_ibc_union_statistics': { name: 'v1_ibc_union_statistics'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_statistics'; ofType: null; }; }; }; } }; 'v1_ibc_union_statistics_stream': { name: 'v1_ibc_union_statistics_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_statistics'; ofType: null; }; }; }; } }; 'v1_ibc_union_streaks': { name: 'v1_ibc_union_streaks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_streaks'; ofType: null; }; }; }; } }; 'v1_ibc_union_streaks_stream': { name: 'v1_ibc_union_streaks_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_streaks'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_source_unwrapping': { name: 'v1_ibc_union_token_representation_source_unwrapping'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_source_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_source_unwrapping_stream': { name: 'v1_ibc_union_token_representation_source_unwrapping_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_source_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_sources': { name: 'v1_ibc_union_token_representation_sources'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representation_sources_stream': { name: 'v1_ibc_union_token_representation_sources_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representation_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representations': { name: 'v1_ibc_union_token_representations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representations'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_representations_stream': { name: 'v1_ibc_union_token_representations_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_representations'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_sources': { name: 'v1_ibc_union_token_sources'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_sources_stream': { name: 'v1_ibc_union_token_sources_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_sources'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_unwrapping': { name: 'v1_ibc_union_token_unwrapping'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_token_unwrapping_stream': { name: 'v1_ibc_union_token_unwrapping_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_token_unwrapping'; ofType: null; }; }; }; } }; 'v1_ibc_union_tokens': { name: 'v1_ibc_union_tokens'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_tokens'; ofType: null; }; }; }; } }; 'v1_ibc_union_tokens_stream': { name: 'v1_ibc_union_tokens_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_tokens'; ofType: null; }; }; }; } }; 'v1_ibc_union_trace_previews_type': { name: 'v1_ibc_union_trace_previews_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_trace_previews_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_trace_previews_type_stream': { name: 'v1_ibc_union_trace_previews_type_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_trace_previews_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_traces_type': { name: 'v1_ibc_union_traces_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_traces_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_traces_type_stream': { name: 'v1_ibc_union_traces_type_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_traces_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_transfer_days_type': { name: 'v1_ibc_union_transfer_days_type'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_transfer_days_type'; ofType: null; }; }; }; } }; 'v1_ibc_union_transfer_days_type_stream': { name: 'v1_ibc_union_transfer_days_type_stream'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v1_ibc_union_transfer_days_type'; ofType: null; }; }; }; } }; 'v2_stats_count': { name: 'v2_stats_count'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_type'; ofType: null; }; }; }; } }; 'v2_stats_latency': { name: 'v2_stats_latency'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_latency_type'; ofType: null; }; }; }; } }; 'v2_stats_packets_chain': { name: 'v2_stats_packets_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_packets_chain_type'; ofType: null; }; }; }; } }; 'v2_stats_packets_daily_count': { name: 'v2_stats_packets_daily_count'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_daily_count_type'; ofType: null; }; }; }; } }; 'v2_stats_transfers_address': { name: 'v2_stats_transfers_address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_transfers_address_type'; ofType: null; }; }; }; } }; 'v2_stats_transfers_chain': { name: 'v2_stats_transfers_chain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_transfers_chain_type'; ofType: null; }; }; }; } }; 'v2_stats_transfers_daily_count': { name: 'v2_stats_transfers_daily_count'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'v2_stats_daily_count_type'; ofType: null; }; }; }; } }; }; }; 'timestamptz': unknown; 'timestamptz_comparison_exp': { kind: 'INPUT_OBJECT'; name: 'timestamptz_comparison_exp'; isOneOf: false; inputFields: [{ name: '_eq'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: '_gt'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: '_gte'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: '_in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; }; }; defaultValue: null }, { name: '_is_null'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: '_lt'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: '_lte'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: '_neq'; type: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; defaultValue: null }, { name: '_nin'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'timestamptz'; ofType: null; }; }; }; defaultValue: null }]; }; + 'transfer_days': { kind: 'OBJECT'; name: 'transfer_days'; fields: { 'day_count': { name: 'day_count'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; } }; 'destination_universal_chain_id': { name: 'destination_universal_chain_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; + 'transfer_days_bool_exp_bool_exp': { kind: 'INPUT_OBJECT'; name: 'transfer_days_bool_exp_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'transfer_days_bool_exp_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'transfer_days_bool_exp_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'transfer_days_bool_exp_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'day_count'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_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 }]; }; + 'transfer_days_enum_name': { name: 'transfer_days_enum_name'; enumValues: 'day_count' | 'destination_universal_chain_id' | 'internal_destination_chain_id'; }; + 'transfer_days_order_by': { kind: 'INPUT_OBJECT'; name: 'transfer_days_order_by'; isOneOf: false; inputFields: [{ name: 'day_count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_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 }]; }; + 'transfer_request_details': { kind: 'OBJECT'; name: 'transfer_request_details'; fields: { 'already_exists': { name: 'already_exists'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'destination_channel_id': { name: 'destination_channel_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'quote_token': { name: 'quote_token'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'source_channel_id': { name: 'source_channel_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'wrap_direction': { name: 'wrap_direction'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; + 'transfer_request_details_bool_exp_bool_exp': { kind: 'INPUT_OBJECT'; name: 'transfer_request_details_bool_exp_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'transfer_request_details_bool_exp_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'transfer_request_details_bool_exp_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'transfer_request_details_bool_exp_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'already_exists'; type: { kind: 'INPUT_OBJECT'; name: 'Boolean_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'quote_token'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_channel_id'; type: { kind: 'INPUT_OBJECT'; name: 'Int_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'wrap_direction'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'transfer_request_details_enum_name': { name: 'transfer_request_details_enum_name'; enumValues: 'already_exists' | 'destination_channel_id' | 'quote_token' | 'source_channel_id' | 'wrap_direction'; }; + 'transfer_request_details_order_by': { kind: 'INPUT_OBJECT'; name: 'transfer_request_details_order_by'; isOneOf: false; inputFields: [{ name: 'already_exists'; 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: 'quote_token'; 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: 'wrap_direction'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_app_chain_configurations': { kind: 'OBJECT'; name: 'v1_ibc_union_app_chain_configurations'; fields: { 'chain': { name: 'chain'; type: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; } }; 'channel_list': { name: 'channel_list'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'connection_list': { name: 'connection_list'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'environment': { name: 'environment'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'index_status': { name: 'index_status'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'packet_list': { name: 'packet_list'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'transfer_list': { name: 'transfer_list'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'transfer_submission': { name: 'transfer_submission'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; }; }; 'v1_ibc_union_app_chain_configurations_aggregate_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_app_chain_configurations_aggregate_order_by'; isOneOf: false; inputFields: [{ name: 'count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'max'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_app_chain_configurations_max_order_by'; ofType: null; }; defaultValue: null }, { name: 'min'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_app_chain_configurations_min_order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_app_chain_configurations_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_app_chain_configurations_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_app_chain_configurations_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_app_chain_configurations_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_app_chain_configurations_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_bool_exp'; ofType: null; }; defaultValue: null }, { name: 'channel_list'; type: { kind: 'INPUT_OBJECT'; name: 'Boolean_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'connection_list'; type: { kind: 'INPUT_OBJECT'; name: 'Boolean_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'environment'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'index_status'; type: { kind: 'INPUT_OBJECT'; name: 'Boolean_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'packet_list'; type: { kind: 'INPUT_OBJECT'; name: 'Boolean_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'transfer_list'; type: { kind: 'INPUT_OBJECT'; name: 'Boolean_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'transfer_submission'; type: { kind: 'INPUT_OBJECT'; name: 'Boolean_comparison_exp'; ofType: null; }; defaultValue: null }]; }; @@ -354,6 +377,42 @@ export type introspection_types = { 'v1_ibc_union_traces_type_var_pop_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_traces_type_var_pop_order_by'; isOneOf: false; inputFields: [{ name: 'event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_traces_type_var_samp_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_traces_type_var_samp_order_by'; isOneOf: false; inputFields: [{ name: 'event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; 'v1_ibc_union_traces_type_variance_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_traces_type_variance_order_by'; isOneOf: false; inputFields: [{ name: 'event_index'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'height'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_transfer_days_type': { kind: 'OBJECT'; name: 'v1_ibc_union_transfer_days_type'; fields: { 'chain': { name: 'chain'; type: { kind: 'OBJECT'; name: 'v1_ibc_union_chains'; ofType: null; } }; 'day_count': { name: 'day_count'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; } }; 'destination_universial_chain_id': { name: 'destination_universial_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'v1_ibc_union_transfer_days_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_transfer_days_type_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_transfer_days_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_transfer_days_type_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_transfer_days_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_bool_exp'; ofType: null; }; defaultValue: null }, { name: 'day_count'; type: { kind: 'INPUT_OBJECT'; name: 'bigint_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_universial_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_transfer_days_type_order_by': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_transfer_days_type_order_by'; isOneOf: false; inputFields: [{ name: 'chain'; type: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_chains_order_by'; ofType: null; }; defaultValue: null }, { name: 'day_count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_universial_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_transfer_days_type_select_column': { name: 'v1_ibc_union_transfer_days_type_select_column'; enumValues: 'day_count' | 'destination_universial_chain_id'; }; + 'v1_ibc_union_transfer_days_type_stream_cursor_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_transfer_days_type_stream_cursor_input'; isOneOf: false; inputFields: [{ name: 'initial_value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_transfer_days_type_stream_cursor_value_input'; ofType: null; }; }; defaultValue: null }, { name: 'ordering'; type: { kind: 'ENUM'; name: 'cursor_ordering'; ofType: null; }; defaultValue: null }]; }; + 'v1_ibc_union_transfer_days_type_stream_cursor_value_input': { kind: 'INPUT_OBJECT'; name: 'v1_ibc_union_transfer_days_type_stream_cursor_value_input'; isOneOf: false; inputFields: [{ name: 'day_count'; type: { kind: 'SCALAR'; name: 'bigint'; ofType: null; }; defaultValue: null }, { name: 'destination_universial_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_daily_count_type': { kind: 'OBJECT'; name: 'v2_stats_daily_count_type'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'day_date': { name: 'day_date'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; } }; }; }; + 'v2_stats_daily_count_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v2_stats_daily_count_type_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_daily_count_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v2_stats_daily_count_type_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_daily_count_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'count'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'day_date'; type: { kind: 'INPUT_OBJECT'; name: 'date_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_daily_count_type_order_by': { kind: 'INPUT_OBJECT'; name: 'v2_stats_daily_count_type_order_by'; isOneOf: false; inputFields: [{ name: 'count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'day_date'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_daily_count_type_select_column': { name: 'v2_stats_daily_count_type_select_column'; enumValues: 'count' | 'day_date'; }; + 'v2_stats_latency_args': { kind: 'INPUT_OBJECT'; name: 'v2_stats_latency_args'; isOneOf: false; inputFields: [{ name: 'p_destination_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'p_phase'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'p_source_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_latency_type': { kind: 'OBJECT'; name: 'v2_stats_latency_type'; fields: { 'secs_until_packet_ack': { name: 'secs_until_packet_ack'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; } }; 'secs_until_packet_recv': { name: 'secs_until_packet_recv'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; } }; 'secs_until_write_ack': { name: 'secs_until_write_ack'; type: { kind: 'SCALAR'; name: 'latency_percentiles_scalar'; ofType: null; } }; }; }; + 'v2_stats_latency_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v2_stats_latency_type_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_latency_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v2_stats_latency_type_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_latency_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'secs_until_packet_ack'; type: { kind: 'INPUT_OBJECT'; name: 'latency_percentiles_scalar_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'secs_until_packet_recv'; type: { kind: 'INPUT_OBJECT'; name: 'latency_percentiles_scalar_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'secs_until_write_ack'; type: { kind: 'INPUT_OBJECT'; name: 'latency_percentiles_scalar_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_latency_type_order_by': { kind: 'INPUT_OBJECT'; name: 'v2_stats_latency_type_order_by'; isOneOf: false; inputFields: [{ name: 'secs_until_packet_ack'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'secs_until_packet_recv'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'secs_until_write_ack'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_latency_type_select_column': { name: 'v2_stats_latency_type_select_column'; enumValues: 'secs_until_packet_ack' | 'secs_until_packet_recv' | 'secs_until_write_ack'; }; + 'v2_stats_packets_chain_args': { kind: 'INPUT_OBJECT'; name: 'v2_stats_packets_chain_args'; isOneOf: false; inputFields: [{ name: 'p_days_back'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'p_destination_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'p_source_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_packets_chain_type': { kind: 'OBJECT'; name: 'v2_stats_packets_chain_type'; fields: { 'day_date': { name: 'day_date'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; } }; 'destination_universal_chain_id': { name: 'destination_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_universal_chain_id': { name: 'source_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'total_packets': { name: 'total_packets'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'v2_stats_packets_chain_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v2_stats_packets_chain_type_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_packets_chain_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v2_stats_packets_chain_type_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_packets_chain_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'day_date'; type: { kind: 'INPUT_OBJECT'; name: 'date_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'total_packets'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_packets_chain_type_order_by': { kind: 'INPUT_OBJECT'; name: 'v2_stats_packets_chain_type_order_by'; isOneOf: false; inputFields: [{ name: 'day_date'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'total_packets'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_packets_chain_type_select_column': { name: 'v2_stats_packets_chain_type_select_column'; enumValues: 'day_date' | 'destination_universal_chain_id' | 'source_universal_chain_id' | 'total_packets'; }; + 'v2_stats_packets_daily_count_args': { kind: 'INPUT_OBJECT'; name: 'v2_stats_packets_daily_count_args'; isOneOf: false; inputFields: [{ name: 'p_days_back'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_transfers_address_args': { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_address_args'; isOneOf: false; inputFields: [{ name: 'p_addresses_canonical'; type: { kind: 'SCALAR'; name: 'jsonb'; ofType: null; }; defaultValue: null }, { name: 'p_days_back'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'p_destination_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'p_source_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_transfers_address_type': { kind: 'OBJECT'; name: 'v2_stats_transfers_address_type'; fields: { 'canonical_address': { name: 'canonical_address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'day_date': { name: 'day_date'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; } }; 'destination_universal_chain_id': { name: 'destination_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_universal_chain_id': { name: 'source_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'transfer_count': { name: 'transfer_count'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'v2_stats_transfers_address_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_address_type_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_address_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_address_type_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_address_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'canonical_address'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'day_date'; type: { kind: 'INPUT_OBJECT'; name: 'date_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'transfer_count'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_transfers_address_type_order_by': { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_address_type_order_by'; isOneOf: false; inputFields: [{ name: 'canonical_address'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'day_date'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'transfer_count'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_transfers_address_type_select_column': { name: 'v2_stats_transfers_address_type_select_column'; enumValues: 'canonical_address' | 'day_date' | 'destination_universal_chain_id' | 'source_universal_chain_id' | 'transfer_count'; }; + 'v2_stats_transfers_chain_args': { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_chain_args'; isOneOf: false; inputFields: [{ name: 'p_days_back'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'p_destination_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'p_source_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_transfers_chain_type': { kind: 'OBJECT'; name: 'v2_stats_transfers_chain_type'; fields: { 'day_date': { name: 'day_date'; type: { kind: 'SCALAR'; name: 'date'; ofType: null; } }; 'destination_universal_chain_id': { name: 'destination_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'source_universal_chain_id': { name: 'source_universal_chain_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'total_transfers': { name: 'total_transfers'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'v2_stats_transfers_chain_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_chain_type_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_chain_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_chain_type_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_chain_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'day_date'; type: { kind: 'INPUT_OBJECT'; name: 'date_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'source_universal_chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'total_transfers'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_transfers_chain_type_order_by': { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_chain_type_order_by'; isOneOf: false; inputFields: [{ name: 'day_date'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'destination_universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'source_universal_chain_id'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'total_transfers'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_transfers_chain_type_select_column': { name: 'v2_stats_transfers_chain_type_select_column'; enumValues: 'day_date' | 'destination_universal_chain_id' | 'source_universal_chain_id' | 'total_transfers'; }; + 'v2_stats_transfers_daily_count_args': { kind: 'INPUT_OBJECT'; name: 'v2_stats_transfers_daily_count_args'; isOneOf: false; inputFields: [{ name: 'p_days_back'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_type': { kind: 'OBJECT'; name: 'v2_stats_type'; fields: { 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'value': { name: 'value'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'v2_stats_type_bool_exp': { kind: 'INPUT_OBJECT'; name: 'v2_stats_type_bool_exp'; isOneOf: false; inputFields: [{ name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: '_not'; type: { kind: 'INPUT_OBJECT'; name: 'v2_stats_type_bool_exp'; ofType: null; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'v2_stats_type_bool_exp'; ofType: null; }; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }, { name: 'value'; type: { kind: 'INPUT_OBJECT'; name: 'String_comparison_exp'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_type_order_by': { kind: 'INPUT_OBJECT'; name: 'v2_stats_type_order_by'; isOneOf: false; inputFields: [{ name: 'name'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }, { name: 'value'; type: { kind: 'ENUM'; name: 'order_by'; ofType: null; }; defaultValue: null }]; }; + 'v2_stats_type_select_column': { name: 'v2_stats_type_select_column'; enumValues: 'name' | 'value'; }; }; /** An IntrospectionQuery representation of your schema. diff --git a/app2/src/lib/components/layout/Sidebar/navigation.ts b/app2/src/lib/components/layout/Sidebar/navigation.ts index 95134db458..3c4466e5b9 100644 --- a/app2/src/lib/components/layout/Sidebar/navigation.ts +++ b/app2/src/lib/components/layout/Sidebar/navigation.ts @@ -33,11 +33,11 @@ export const navigation: Array = [ { path: "/transfers", title: "History" - }, - { - path: "/faucet", - title: "Faucet" } + // { + // path: "/faucet", + // title: "Faucet" + // } ] } ] From ff0bb7c2f3fdfedcebc6d5792086d92eaa0c2a82 Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Tue, 8 Apr 2025 09:04:44 -0400 Subject: [PATCH 39/43] chore(app2,ts-sdk): fix nix fmt Signed-off-by: Eric Hegnes --- .../Transfer/pages/FillingPage.svelte | 43 +++++++++++-------- .../model/BlockHashComponent.svelte | 10 ++--- .../model/TransactionHashComponent.svelte | 10 ++--- app2/src/lib/queries/packet-details.svelte.ts | 4 +- ts-sdk/test/evm/fungible-asset-order.test.ts | 8 ++-- 5 files changed, 41 insertions(+), 34 deletions(-) diff --git a/app2/src/lib/components/Transfer/pages/FillingPage.svelte b/app2/src/lib/components/Transfer/pages/FillingPage.svelte index 670e9f2320..537ccc19da 100644 --- a/app2/src/lib/components/Transfer/pages/FillingPage.svelte +++ b/app2/src/lib/components/Transfer/pages/FillingPage.svelte @@ -10,6 +10,7 @@ import { Option, pipe, Data, Match } from "effect" import { wallets } from "$lib/stores/wallets.svelte.ts" import { Chain } from "@unionlabs/sdk/schema" import { uiStore } from "$lib/stores/ui.svelte.ts" +import { constVoid } from "effect/Function" type Props = { onContinue: () => void @@ -153,50 +154,54 @@ const isButtonEnabled = $derived.by(() => { // Handle button click based on state function handleButtonClick() { FillingState.$match(transferState, { - Loading: () => {}, + Loading: constVoid, WalletNeeded: () => uiStore.openWalletModal(), ChainWalletNeeded: () => uiStore.openWalletModal(), ReadyToReview: ({ isValid }) => { if (isValid) onContinue() }, - ChainNeeded: () => {}, - AssetNeeded: () => {}, - DestinationNeeded: () => {}, - AmountNeeded: () => {}, - ReceiverNeeded: () => {}, - NoStepsAvailable: () => {} + ChainNeeded: constVoid, + AssetNeeded: constVoid, + DestinationNeeded: constVoid, + AmountNeeded: constVoid, + ReceiverNeeded: constVoid, + NoStepsAvailable: constVoid }) }
- - - + + +
{#if transfer.args.receiver && transfer.args.destinationChain}

- +

{:else} -

No receiver

+

No receiver

{/if} - +
- +
-
\ No newline at end of file +
diff --git a/app2/src/lib/components/model/BlockHashComponent.svelte b/app2/src/lib/components/model/BlockHashComponent.svelte index 4cb0b71beb..786a421959 100644 --- a/app2/src/lib/components/model/BlockHashComponent.svelte +++ b/app2/src/lib/components/model/BlockHashComponent.svelte @@ -7,7 +7,7 @@ import LongMonoWord from "$lib/components/ui/LongMonoWord.svelte" import ChainComponent from "$lib/components/model/ChainComponent.svelte" import Label from "../ui/Label.svelte" import A from "../ui/A.svelte" -import { pipe, Array, Struct, String } from "effect" +import { pipe, Array as Arr, Struct, String as Str } from "effect" type Props = HTMLAttributes & { hash: string @@ -25,16 +25,16 @@ const formattedHash = $derived( const explorerUrl = $derived( pipe( chain.explorers, - Array.head, + Arr.head, Option.map(Struct.get("block_url")), - Option.map(String.concat(formattedHash)) + Option.map(Str.concat(formattedHash)) ) ) const explorerName = $derived( pipe( chain.explorers, - Array.head, + Arr.head, Option.map(Struct.get("display_name")), Option.getOrElse(() => "Explorer") ) @@ -51,7 +51,7 @@ const explorerName = $derived( {#snippet content()}
- +
diff --git a/app2/src/lib/components/model/TransactionHashComponent.svelte b/app2/src/lib/components/model/TransactionHashComponent.svelte index d360b9e31c..1b309e9ecf 100644 --- a/app2/src/lib/components/model/TransactionHashComponent.svelte +++ b/app2/src/lib/components/model/TransactionHashComponent.svelte @@ -8,7 +8,7 @@ import LongMonoWord from "$lib/components/ui/LongMonoWord.svelte" import ChainComponent from "$lib/components/model/ChainComponent.svelte" import Label from "../ui/Label.svelte" import A from "../ui/A.svelte" -import { pipe, Array, Struct, String } from "effect" +import { pipe, Array as Arr, Struct, String as Str } from "effect" import { cn } from "$lib/utils" type Props = HTMLAttributes & { @@ -28,16 +28,16 @@ const formattedHash = $derived( const explorerUrl = $derived( pipe( chain.explorers, - Array.head, + Arr.head, Option.map(Struct.get("tx_url")), - Option.map(String.concat(formattedHash)) + Option.map(Str.concat(formattedHash)) ) ) const explorerName = $derived( pipe( chain.explorers, - Array.head, + Arr.head, Option.map(Struct.get("display_name")), Option.getOrElse(() => "explorer") ) @@ -53,7 +53,7 @@ const explorerName = $derived( {#if chain}
- +
{/if} diff --git a/app2/src/lib/queries/packet-details.svelte.ts b/app2/src/lib/queries/packet-details.svelte.ts index 12d1fa35f7..461cdbb1f2 100644 --- a/app2/src/lib/queries/packet-details.svelte.ts +++ b/app2/src/lib/queries/packet-details.svelte.ts @@ -72,12 +72,14 @@ export const packetDetailsQuery = (packetHash: PacketHash) => data.pipe( Option.map(d => { if (d.v2_packets.length === 0) { - throw { _tag: "NotFound", message: "Packet not found" } + // TODO: make tagged error + throw new Error("Packet not found") } return d.v2_packets[0] }), Option.tap(packet => { packetDetails.data = Option.some(packet) + return Option.some(packet) }) ) }, diff --git a/ts-sdk/test/evm/fungible-asset-order.test.ts b/ts-sdk/test/evm/fungible-asset-order.test.ts index ac03f0655a..f78ca10cef 100644 --- a/ts-sdk/test/evm/fungible-asset-order.test.ts +++ b/ts-sdk/test/evm/fungible-asset-order.test.ts @@ -32,7 +32,7 @@ const mockCosmosQuoteToken = "0x123" as const // Mock clients const mockViemPublicClientSource = { client: { - readContract: async (params: any) => { + readContract: (params: any) => { // This simulates reading ERC20 metadata based on the function name if (params.functionName === "name") return mockErc20Meta.name if (params.functionName === "symbol") return mockErc20Meta.symbol @@ -44,7 +44,7 @@ const mockViemPublicClientSource = { const mockViemPublicClientDestination = { client: { - readContract: async () => { + readContract: () => { // This simulates predicting a quote token return [mockEvmQuoteToken] } @@ -53,7 +53,7 @@ const mockViemPublicClientDestination = { const mockCosmWasmClientSource = { client: { - queryContractSmart: async (_contractAddress: string, query: any) => { + queryContractSmart: (_contractAddress: string, query: any) => { // This simulates reading CW20 token info if (query.token_info) { return mockCw20TokenInfo @@ -68,7 +68,7 @@ const mockCosmWasmClientSource = { const mockCosmWasmClientDestination = { client: { - queryContractSmart: async (_contractAddress: string, query: any) => { + queryContractSmart: (_contractAddress: string, query: any) => { // This simulates predicting a quote token if (query.predict_wrapped_token) { return { wrapped_token: mockCosmosQuoteToken } From 396de5063a3ecaf5385e83a06bfcbd6002794c9e Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Tue, 8 Apr 2025 09:32:07 -0400 Subject: [PATCH 40/43] fix(ts-sdk): preserve promise type, overriding linter Signed-off-by: Eric Hegnes --- ts-sdk/test/evm/fungible-asset-order.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ts-sdk/test/evm/fungible-asset-order.test.ts b/ts-sdk/test/evm/fungible-asset-order.test.ts index f78ca10cef..9d99f5b20b 100644 --- a/ts-sdk/test/evm/fungible-asset-order.test.ts +++ b/ts-sdk/test/evm/fungible-asset-order.test.ts @@ -29,10 +29,11 @@ const mockCw20TokenInfo = { const mockEvmQuoteToken = "0x123" as const const mockCosmosQuoteToken = "0x123" as const +// biome-ignore-start lint/suspicious/useAwait: reason // Mock clients const mockViemPublicClientSource = { client: { - readContract: (params: any) => { + readContract: async (params: any) => { // This simulates reading ERC20 metadata based on the function name if (params.functionName === "name") return mockErc20Meta.name if (params.functionName === "symbol") return mockErc20Meta.symbol @@ -44,7 +45,7 @@ const mockViemPublicClientSource = { const mockViemPublicClientDestination = { client: { - readContract: () => { + readContract: async () => { // This simulates predicting a quote token return [mockEvmQuoteToken] } @@ -53,7 +54,7 @@ const mockViemPublicClientDestination = { const mockCosmWasmClientSource = { client: { - queryContractSmart: (_contractAddress: string, query: any) => { + queryContractSmart: async (_contractAddress: string, query: any) => { // This simulates reading CW20 token info if (query.token_info) { return mockCw20TokenInfo @@ -68,7 +69,7 @@ const mockCosmWasmClientSource = { const mockCosmWasmClientDestination = { client: { - queryContractSmart: (_contractAddress: string, query: any) => { + queryContractSmart: async (_contractAddress: string, query: any) => { // This simulates predicting a quote token if (query.predict_wrapped_token) { return { wrapped_token: mockCosmosQuoteToken } @@ -77,6 +78,7 @@ const mockCosmWasmClientDestination = { } } } +// biome-ignore-end lint/suspicious/useAwait: reason // Test data const evmIntent = { From c4bad66eab9d7c405a0ff0b6cf36590c8f20f137 Mon Sep 17 00:00:00 2001 From: cor Date: Tue, 8 Apr 2025 22:39:29 +0000 Subject: [PATCH 41/43] chore: fmt --- .../Transfer/pages/ApprovalPage.svelte | 327 ++++++++---------- .../Transfer/pages/SubmitPage.svelte | 4 +- .../Transfer/state/filling/check-allowance.ts | 217 ++++++------ .../Transfer/state/filling/check-balance.ts | 2 +- .../Transfer/state/filling/create-orders.ts | 177 +++++----- .../Transfer/state/filling/index.ts | 20 +- .../components/Transfer/transfer.svelte.ts | 10 +- .../components/model/AddressComponent.svelte | 94 +++-- app2/src/lib/components/model/BarChart.svelte | 3 +- pnpm-lock.yaml | 60 ++-- ts-sdk/examples/ucs03-encode-packet.ts | 26 +- ts-sdk/examples/ucs03-send-babylon-to-bob.ts | 6 +- ts-sdk/examples/ucs03-send-bob-to-babylon.ts | 12 +- ts-sdk/examples/ucs03-send-corn-to-babylon.ts | 16 +- ts-sdk/package.json | 8 +- ts-sdk/src/schema/transfer-args.ts | 2 +- ts-sdk/src/ucs03/fungible-asset-order.ts | 2 +- ts-sdk/test/evm/fungible-asset-order.test.ts | 8 +- ts-sdk/tsconfig.examples.json | 2 +- 19 files changed, 487 insertions(+), 509 deletions(-) diff --git a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte index 02bb74ae87..7f17364ed8 100644 --- a/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte +++ b/app2/src/lib/components/Transfer/pages/ApprovalPage.svelte @@ -1,179 +1,158 @@
diff --git a/app2/src/lib/components/Transfer/pages/SubmitPage.svelte b/app2/src/lib/components/Transfer/pages/SubmitPage.svelte index e921795ce7..5c28734649 100644 --- a/app2/src/lib/components/Transfer/pages/SubmitPage.svelte +++ b/app2/src/lib/components/Transfer/pages/SubmitPage.svelte @@ -1,7 +1,7 @@ diff --git a/app2/src/lib/components/model/BarChart.svelte b/app2/src/lib/components/model/BarChart.svelte index cdb88d3b8f..9ac91f04f6 100644 --- a/app2/src/lib/components/model/BarChart.svelte +++ b/app2/src/lib/components/model/BarChart.svelte @@ -3,6 +3,7 @@ import { Option } from "effect" import type { DailyTransfer } from "@unionlabs/sdk/schema" import ErrorComponent from "$lib/components/model/ErrorComponent.svelte" import type { FetchDecodeGraphqlError } from "$lib/utils/queries" +import { constVoid } from "effect/Function" type Props = { data: Option.Option> @@ -11,7 +12,7 @@ type Props = { onHoverChange?: (day: Option.Option) => void } -const { data, error, class: className = "", onHoverChange = () => {} }: Props = $props() +const { data, error, class: className = "", onHoverChange = constVoid }: Props = $props() // Format large numbers with commas (used for chart tooltips) function formatNumber(num: string | number): string { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b7c06f08e..0e059498df 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4894,8 +4894,8 @@ snapshots: dependencies: xstream: 11.14.0 - '@cosmjs/tendermint-rpc@0.33.1(patch_hash=d6d84acfc406c9bb60bb24c691bf474327d6a3a3140be568a3b77e1063897c4e)(bufferutil@4.0.9)(utf-8-validate@5.0.10)': - dependencies: + ? '@cosmjs/tendermint-rpc@0.33.1(patch_hash=d6d84acfc406c9bb60bb24c691bf474327d6a3a3140be568a3b77e1063897c4e)(bufferutil@4.0.9)(utf-8-validate@5.0.10)' + : dependencies: '@cosmjs/crypto': 0.33.1 '@cosmjs/encoding': 0.33.1 '@cosmjs/json-rpc': 0.33.1 @@ -4920,8 +4920,8 @@ snapshots: '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) '@csstools/css-tokenizer': 3.0.3 - '@csstools/css-color-parser@3.0.8(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': - dependencies: + ? '@csstools/css-color-parser@3.0.8(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)' + : dependencies: '@csstools/color-helpers': 5.0.2 '@csstools/css-calc': 2.1.2(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) @@ -4947,8 +4947,8 @@ snapshots: find-my-way-ts: 0.1.5 multipasta: 0.2.5 - '@effect/vitest@0.19.10(effect@3.14.2)(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': - dependencies: + ? '@effect/vitest@0.19.10(effect@3.14.2)(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' + : dependencies: effect: 3.14.2 vitest: 3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) @@ -5238,8 +5238,8 @@ snapshots: '@metamask/safe-event-emitter@3.1.2': {} - '@metamask/sdk-communication-layer@0.32.0(cross-fetch@4.1.0)(eciesjs@0.4.14)(eventemitter2@6.4.9)(readable-stream@3.6.2)(socket.io-client@4.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))': - dependencies: + ? '@metamask/sdk-communication-layer@0.32.0(cross-fetch@4.1.0)(eciesjs@0.4.14)(eventemitter2@6.4.9)(readable-stream@3.6.2)(socket.io-client@4.8.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))' + : dependencies: bufferutil: 4.0.9 cross-fetch: 4.1.0 date-fns: 2.30.0 @@ -5572,12 +5572,12 @@ snapshots: dependencies: acorn: 8.14.1 - '@sveltejs/adapter-static@3.0.8(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))': - dependencies: + ? '@sveltejs/adapter-static@3.0.8(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))' + : dependencies: '@sveltejs/kit': 2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) - '@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': - dependencies: + ? '@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' + : dependencies: '@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) '@types/cookie': 0.6.0 cookie: 0.6.0 @@ -5593,8 +5593,8 @@ snapshots: svelte: 5.25.3 vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) - '@sveltejs/vite-plugin-svelte-inspector@4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': - dependencies: + ? '@sveltejs/vite-plugin-svelte-inspector@4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' + : dependencies: '@sveltejs/vite-plugin-svelte': 5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) debug: 4.4.0 svelte: 5.25.3 @@ -5602,8 +5602,8 @@ snapshots: transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': - dependencies: + ? '@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' + : dependencies: '@sveltejs/vite-plugin-svelte-inspector': 4.0.1(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)))(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) debug: 4.4.0 deepmerge: 4.3.1 @@ -5705,8 +5705,8 @@ snapshots: lodash: 4.17.21 redent: 3.0.0 - '@testing-library/svelte@5.2.7(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))': - dependencies: + ? '@testing-library/svelte@5.2.7(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0))' + : dependencies: '@testing-library/dom': 10.4.0 svelte: 5.25.3 optionalDependencies: @@ -5762,8 +5762,8 @@ snapshots: dependencies: '@types/node': 22.13.14 - '@typescript-eslint/eslint-plugin@8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2)': - dependencies: + ? '@typescript-eslint/eslint-plugin@8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2))(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2)' + : dependencies: '@eslint-community/regexpp': 4.12.1 '@typescript-eslint/parser': 8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.2) '@typescript-eslint/scope-manager': 8.28.0 @@ -5933,8 +5933,8 @@ snapshots: '@vue/shared@3.5.13': {} - '@wagmi/connectors@5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)': - dependencies: + ? '@wagmi/connectors@5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4)' + : dependencies: '@coinbase/wallet-sdk': 4.3.0 '@metamask/sdk': 0.32.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@safe-global/safe-apps-provider': 0.18.5(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4) @@ -5972,8 +5972,8 @@ snapshots: - utf-8-validate - zod - '@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))': - dependencies: + ? '@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))' + : dependencies: eventemitter3: 5.0.1 mipd: 0.0.7(typescript@5.8.2) viem: 2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4) @@ -6419,8 +6419,8 @@ snapshots: lit: 3.1.0 qrcode: 1.5.3 - '@web3modal/wagmi@4.0.0(@wagmi/connectors@5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4))(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(typescript@5.8.2)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))': - dependencies: + ? '@web3modal/wagmi@4.0.0(@wagmi/connectors@5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4))(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(typescript@5.8.2)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))' + : dependencies: '@wagmi/connectors': 5.7.11(@wagmi/core@2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)))(bufferutil@4.0.9)(react@19.1.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4))(zod@3.22.4) '@wagmi/core': 2.16.7(react@19.1.0)(typescript@5.8.2)(use-sync-external-store@1.2.0(react@19.1.0))(viem@2.24.1(bufferutil@4.0.9)(typescript@5.8.2)(utf-8-validate@5.0.10)(zod@3.22.4)) '@web3modal/polyfills': 4.0.0 @@ -9162,8 +9162,8 @@ snapshots: - tsx - yaml - vite-tsconfig-paths@5.1.4(typescript@5.8.2)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)): - dependencies: + ? vite-tsconfig-paths@5.1.4(typescript@5.8.2)(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) + : dependencies: debug: 4.4.0 globrex: 0.1.2 tsconfck: 3.1.5(typescript@5.8.2) @@ -9190,8 +9190,8 @@ snapshots: optionalDependencies: vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) - vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0): - dependencies: + ? vitest@3.0.9(@types/debug@4.1.12)(@types/node@22.13.14)(jiti@2.4.2)(jsdom@26.0.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0) + : dependencies: '@vitest/expect': 3.0.9 '@vitest/mocker': 3.0.9(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(lightningcss@1.29.2)(tsx@4.19.3)(yaml@2.7.0)) '@vitest/pretty-format': 3.0.9 diff --git a/ts-sdk/examples/ucs03-encode-packet.ts b/ts-sdk/examples/ucs03-encode-packet.ts index b4c08a6a04..2f26264ec2 100644 --- a/ts-sdk/examples/ucs03-encode-packet.ts +++ b/ts-sdk/examples/ucs03-encode-packet.ts @@ -5,18 +5,20 @@ import { encodeZkgmPacketAbi, type ZkgmPacket } from "../src/ucs03/zkgm-packet.j const examplePacket: ZkgmPacket = { salt: "0x1234567890123456789012345678901234567890123456789012345678901234", path: 123456789n, - instruction: Instruction.FungibleAssetOrder.make({ operand: [ - toHex("stars1qcvavxpxw3t8d9j7mwaeq9wgytkf5vwputv5x4"), - toHex("union1d95n4r6dnrfrps59szhl8mk7yqewsuzyw0zh5q"), - toHex("stars1qrde534d4jwk44dn7w7gu9e2rayutr7kqx8lfjhsk3rd7z9rzxhq2gh3lr"), - 1000000n, - "WETH", - "WETH", - 0, - 0n, - "0x756e696f6e3170707865737461307064643038716537366779366b7438667563717978727a773076786a79366439767430676368357879707371656138377278", - 1000000n - ]}) + instruction: Instruction.FungibleAssetOrder.make({ + operand: [ + toHex("stars1qcvavxpxw3t8d9j7mwaeq9wgytkf5vwputv5x4"), + toHex("union1d95n4r6dnrfrps59szhl8mk7yqewsuzyw0zh5q"), + toHex("stars1qrde534d4jwk44dn7w7gu9e2rayutr7kqx8lfjhsk3rd7z9rzxhq2gh3lr"), + 1000000n, + "WETH", + "WETH", + 0, + 0n, + "0x756e696f6e3170707865737461307064643038716537366779366b7438667563717978727a773076786a79366439767430676368357879707371656138377278", + 1000000n + ] + }) } console.log("ZkgmPacket:", examplePacket) diff --git a/ts-sdk/examples/ucs03-send-babylon-to-bob.ts b/ts-sdk/examples/ucs03-send-babylon-to-bob.ts index 41d40c1d94..876b03a13b 100644 --- a/ts-sdk/examples/ucs03-send-babylon-to-bob.ts +++ b/ts-sdk/examples/ucs03-send-babylon-to-bob.ts @@ -7,7 +7,11 @@ import { createCosmWasmClient, createSigningCosmWasmClient } from "@unionlabs/sdk/cosmos" -import { Instruction, sendInstructionCosmos, createCosmosToEvmFungibleAssetOrder } from "@unionlabs/sdk/ucs03" +import { + Instruction, + sendInstructionCosmos, + createCosmosToEvmFungibleAssetOrder +} from "@unionlabs/sdk/ucs03" import { EvmChannelDestination, ViemPublicClient, diff --git a/ts-sdk/examples/ucs03-send-bob-to-babylon.ts b/ts-sdk/examples/ucs03-send-bob-to-babylon.ts index 0677d26afa..c95020bc18 100644 --- a/ts-sdk/examples/ucs03-send-bob-to-babylon.ts +++ b/ts-sdk/examples/ucs03-send-bob-to-babylon.ts @@ -14,8 +14,16 @@ import { createViemWalletClient, ViemWalletClient } from "@unionlabs/sdk/evm" -import { Instruction, sendInstructionEvm, createEvmToCosmosFungibleAssetOrder } from "@unionlabs/sdk/ucs03" -import { CosmosChannelDestination, CosmWasmClientDestination, createCosmWasmClient } from "@unionlabs/sdk/cosmos" +import { + Instruction, + sendInstructionEvm, + createEvmToCosmosFungibleAssetOrder +} from "@unionlabs/sdk/ucs03" +import { + CosmosChannelDestination, + CosmWasmClientDestination, + createCosmWasmClient +} from "@unionlabs/sdk/cosmos" import { AddressCosmosZkgm, AddressEvmZkgm } from "@unionlabs/sdk/schema" // @ts-ignore diff --git a/ts-sdk/examples/ucs03-send-corn-to-babylon.ts b/ts-sdk/examples/ucs03-send-corn-to-babylon.ts index 2f2c10ea4a..7cd93f5b93 100644 --- a/ts-sdk/examples/ucs03-send-corn-to-babylon.ts +++ b/ts-sdk/examples/ucs03-send-corn-to-babylon.ts @@ -14,8 +14,16 @@ import { createViemWalletClient, ViemWalletClient } from "@unionlabs/sdk/evm" -import { Instruction, sendInstructionEvm, createEvmToCosmosFungibleAssetOrder } from "@unionlabs/sdk/ucs03" -import { CosmosChannelDestination, CosmWasmClientDestination, createCosmWasmClient } from "@unionlabs/sdk/cosmos" +import { + Instruction, + sendInstructionEvm, + createEvmToCosmosFungibleAssetOrder +} from "@unionlabs/sdk/ucs03" +import { + CosmosChannelDestination, + CosmWasmClientDestination, + createCosmWasmClient +} from "@unionlabs/sdk/cosmos" import { AddressCosmosZkgm, AddressEvmZkgm } from "@unionlabs/sdk/schema" // @ts-ignore @@ -40,7 +48,7 @@ const TRANSFERS = [ baseToken: "0x2be4bf88014a6574cb10df3b7826be8356aa2499", baseAmount: 100n, quoteAmount: 100n - }, + } ] as const const createBatch = Effect.gen(function* () { @@ -143,7 +151,7 @@ Effect.runPromiseExit( Effect.provideService(CosmWasmClientDestination, { client: cosmWasmClientDestination }), Effect.provideService(CosmosChannelDestination, { ucs03address: "bbn15zcptld878lux44lvc0chzhz7dcdh62nh0xehwa8y7czuz3yljlspm2re6", - channelId: 11 + channelId: 11 }), Effect.provideService(EvmChannelSource, { ucs03address: "0xe33534b7f8D38C6935a2F6Ad35E09228dA239962", diff --git a/ts-sdk/package.json b/ts-sdk/package.json index 9bccec7bde..92aa836637 100644 --- a/ts-sdk/package.json +++ b/ts-sdk/package.json @@ -10,13 +10,7 @@ "url": "https://github.com/unionlabs/union.git", "directory": "ts-sdk" }, - "files": [ - "LICENSE", - "README.md", - "dist", - "package.json", - "src" - ], + "files": ["LICENSE", "README.md", "dist", "package.json", "src"], "exports": { ".": { "import": "./dist/index.js", diff --git a/ts-sdk/src/schema/transfer-args.ts b/ts-sdk/src/schema/transfer-args.ts index d904f39c0e..5d0d8e2933 100644 --- a/ts-sdk/src/schema/transfer-args.ts +++ b/ts-sdk/src/schema/transfer-args.ts @@ -1,6 +1,6 @@ import * as S from "effect/Schema" import { Chain, RpcType } from "./chain.js" -import { EvmWethToken, TokenRawAmount, TokenRawDenom } from "./token.js" +import { TokenRawAmount, TokenRawDenom } from "./token.js" import { ChannelId } from "./channel.js" const BaseTransferFields = { diff --git a/ts-sdk/src/ucs03/fungible-asset-order.ts b/ts-sdk/src/ucs03/fungible-asset-order.ts index bb4d786e9a..a2e8f9ebec 100644 --- a/ts-sdk/src/ucs03/fungible-asset-order.ts +++ b/ts-sdk/src/ucs03/fungible-asset-order.ts @@ -10,7 +10,7 @@ import { readFaTokenInfo } from "../aptos/fa.js" import { predictQuoteToken as predictCosmosQuoteToken } from "../cosmos/quote-token.js" import { predictQuoteToken as predictAptosQuoteToken } from "../aptos/quote-token.js" import { FungibleAssetOrder } from "./instruction.js" -import { AddressCosmosZkgm, AddressEvmZkgm } from "../schema/address.js" +import type { AddressCosmosZkgm, AddressEvmZkgm } from "../schema/address.js" export type FungibleAssetOrderIntent = { sender: Address diff --git a/ts-sdk/test/evm/fungible-asset-order.test.ts b/ts-sdk/test/evm/fungible-asset-order.test.ts index 9d99f5b20b..e6ec109307 100644 --- a/ts-sdk/test/evm/fungible-asset-order.test.ts +++ b/ts-sdk/test/evm/fungible-asset-order.test.ts @@ -29,10 +29,10 @@ const mockCw20TokenInfo = { const mockEvmQuoteToken = "0x123" as const const mockCosmosQuoteToken = "0x123" as const -// biome-ignore-start lint/suspicious/useAwait: reason // Mock clients const mockViemPublicClientSource = { client: { + // biome-ignore lint/suspicious/useAwait: reason readContract: async (params: any) => { // This simulates reading ERC20 metadata based on the function name if (params.functionName === "name") return mockErc20Meta.name @@ -45,6 +45,7 @@ const mockViemPublicClientSource = { const mockViemPublicClientDestination = { client: { + // biome-ignore lint/suspicious/useAwait: reason readContract: async () => { // This simulates predicting a quote token return [mockEvmQuoteToken] @@ -54,6 +55,7 @@ const mockViemPublicClientDestination = { const mockCosmWasmClientSource = { client: { + // biome-ignore lint/suspicious/useAwait: reason queryContractSmart: async (_contractAddress: string, query: any) => { // This simulates reading CW20 token info if (query.token_info) { @@ -69,6 +71,7 @@ const mockCosmWasmClientSource = { const mockCosmWasmClientDestination = { client: { + // biome-ignore lint/suspicious/useAwait: reason queryContractSmart: async (_contractAddress: string, query: any) => { // This simulates predicting a quote token if (query.predict_wrapped_token) { @@ -78,7 +81,6 @@ const mockCosmWasmClientDestination = { } } } -// biome-ignore-end lint/suspicious/useAwait: reason // Test data const evmIntent = { @@ -145,6 +147,7 @@ const EvmToEvmError = Layer.mergeAll( EvmToEvm, Layer.succeed(ViemPublicClientSource, { client: { + // biome-ignore lint/suspicious/useAwait: reason readContract: async () => { throw new Error("Mock error") } @@ -156,6 +159,7 @@ const CosmosToCosmosError = Layer.mergeAll( CosmosToCosmos, Layer.succeed(CosmWasmClientSource, { client: { + // biome-ignore lint/suspicious/useAwait: reason queryContractSmart: async () => { throw new Error("Mock error") } diff --git a/ts-sdk/tsconfig.examples.json b/ts-sdk/tsconfig.examples.json index 5d8d5bbafc..9779f213ea 100644 --- a/ts-sdk/tsconfig.examples.json +++ b/ts-sdk/tsconfig.examples.json @@ -6,6 +6,6 @@ "tsBuildInfoFile": ".tsbuildinfo/examples.tsbuildinfo", "noEmit": true, "types": ["node"], - "rootDir": "examples", + "rootDir": "examples" } } From eace82eb57a60d394fe73b75b39a85602f2c58de Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Tue, 8 Apr 2025 18:45:35 -0400 Subject: [PATCH 42/43] fix(ts-sdk): fao test case --- ts-sdk/test/evm/fungible-asset-order.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts-sdk/test/evm/fungible-asset-order.test.ts b/ts-sdk/test/evm/fungible-asset-order.test.ts index e6ec109307..ee8ca197e4 100644 --- a/ts-sdk/test/evm/fungible-asset-order.test.ts +++ b/ts-sdk/test/evm/fungible-asset-order.test.ts @@ -203,7 +203,7 @@ describe("Fungible Asset Order Tests", () => { version: 1, operand: [ evmIntent.sender, - "0x3078313233", + "0x123", evmIntent.baseToken, evmIntent.baseAmount, mockErc20Meta.symbol, From 4b3221e8e84696ff220500692044f0170ef3a28a Mon Sep 17 00:00:00 2001 From: Eric Hegnes Date: Tue, 8 Apr 2025 19:10:40 -0400 Subject: [PATCH 43/43] fix(app2,ts-sdk): flake derivation deps hash --- app2/app2.nix | 2 +- ts-sdk/ts-sdk.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app2/app2.nix b/app2/app2.nix index 166f7562d3..cab3f47c87 100644 --- a/app2/app2.nix +++ b/app2/app2.nix @@ -28,7 +28,7 @@ _: { ../typescript-sdk ../ts-sdk ]; - hash = "sha256-5ha02SZhT3J7I+KFphc1KdcpMbJb5UHa3oUlyiXduqU="; + hash = "sha256-v5h5l2fwD01PlcrSzKWIk6swc3m6wqgjDzbti3DnAxI="; buildInputs = deps; nativeBuildInputs = buildInputs; pnpmWorkspaces = [ diff --git a/ts-sdk/ts-sdk.nix b/ts-sdk/ts-sdk.nix index 3abe12c57c..eb164a3458 100644 --- a/ts-sdk/ts-sdk.nix +++ b/ts-sdk/ts-sdk.nix @@ -19,7 +19,7 @@ _: { packageJsonPath = ./package.json; extraSrcs = [ ../ts-sdk ]; pnpmWorkspaces = [ "@unionlabs/sdk" ]; - hash = "sha256-WVg23MBZnXun6IjD9BWVy+UntOnReX+k5crpliAaFXA="; + hash = "sha256-iXnoKDbjkWh8xltgSti5QpOGnUJS5tRUPMzuUjMqq8o="; doCheck = true; buildPhase = '' runHook preBuild