unionlabs/union · error · Error

NOT IMPLEMENTED

Error message

NOT IMPLEMENTED

What it means

The quote-token prediction service implements only the Cosmos branch (an Effect that predicts a wrapped token). When destinationChain.rpc_type === "evm" the function throws a bare Error('NOT IMPLEMENTED') with the real implementation left as a commented-out line below it. Because this throw happens inside Effect.gen, it surfaces as a defect (die), bypassing the typed GetQuoteError channel used for the unsupported-rpc_type case.

Source

Thrown at app2/src/lib/services/shared/quote-token.ts:58

          client.queryContractSmart(fromHex(channel.destination_port_id, "string"), {
            predict_wrapped_token: {
              path: "0",
              channel: channel.destination_channel_id,
              token: base_token,
            },
          }),
        catch: error =>
          new GetQuoteError({ cause: `Failed to predict quote token (Cosmos): ${error}` }),
      }).pipe(
        Effect.map(res => res.wrapped_token as Hex),
        Effect.retry(retryPolicy),
      )

      return { type: "NEW_WRAPPED" as const, quote_token: predictedQuoteToken }
    }

    if (destinationChain.rpc_type === "evm") {
      throw new Error("NOT IMPLEMENTED")

      // return { type: "NEW_WRAPPED" as const, quote_token: predictedQuoteToken }
    }

    return yield* Effect.fail(
      new GetQuoteError({ cause: `${destinationChain.rpc_type} not supported` }),
    )
  })

View on GitHub (pinned to 031785bb6d)

Solutions

  1. Pre-filter by destinationChain.rpc_type in the caller/UI so prediction is never requested for EVM destinations; show 'unsupported' instead
  2. If you own this code, replace the bare throw with yield* Effect.fail(new GetQuoteError({ cause: "evm destination not supported yet" })) so it fails as a typed error instead of a defect
  3. Implement the EVM branch (predict the wrapped quote token via the EVM gateway contract) and delete the dead commented line

Example fix

// before
if (destinationChain.rpc_type === "evm") {
  throw new Error("NOT IMPLEMENTED")
  // return { type: "NEW_WRAPPED" as const, quote_token: predictedQuoteToken }
}

// after
if (destinationChain.rpc_type === "evm") {
  return yield* Effect.fail(
    new GetQuoteError({ cause: "evm destination not supported yet" }),
  )
}
Defensive patterns

Strategy: validation

Validate before calling

const isPredictableDestination = (c: { rpc_type: string }) => c.rpc_type !== "evm"

if (!isPredictableDestination(destinationChain)) {
  // skip prediction; show unsupported / use fallback quote token
}

Try / catch

// bare throws inside Effect.gen become defects — catch them at the run boundary
const result = await Effect.runPromise(program).catch(e => {
  if (e instanceof Error && e.message === "NOT IMPLEMENTED") {
    return fallbackQuoteToken()
  }
  throw e
})

Prevention

When it happens

Trigger: Invoking the quote-token prediction flow for a transfer whose destination chain has rpc_type "evm" (Cosmos-source transfers predicting a new wrapped token on an EVM destination).

Common situations: Enabling an EVM destination chain in app config before SDK support lands; regression tests that iterate all configured chains and hit the stub branch.

Related errors


AI-assisted analysis of unionlabs/union@031785bb6d (2026-08-16). Data as JSON: /api/errors/d235fed023b1d530. Report an issue: GitHub.