arktypea
arktype16mo ago
Cobain

Use native ts type

I was wondering if I could use an already created type:
type BlockainsName = "bitcoin" | "ethereum" | "solana" | "polygon-pos" | "binance-smart-chain" | "avalanche"

inside an arktype type declaration:
export const walletType = type({
  address: "string",
  blockchain: "BlockainsName",
  {...}


I would go on and create an arktype literal as suggested in the docs, but this type is being declared from another object:
export type BlockainsName = keyof typeof blockchains

And I want it to be tighly coupled with that object
Was this page helpful?