@robertprp/intents-sdk
Version:
Shogun Network Intent-based cross-chain swaps SDK
62 lines • 2.1 kB
TypeScript
import type { TupleToUnion } from './utils/type-utils.js';
/**
* Represents the blockchain platform type
* Used to distinguish between different blockchain ecosystems
*/
export declare enum ChainType {
EVM = "EVM",
Solana = "Solana",
Sui = "Sui"
}
/**
* Enum of chain IDs for supported blockchains
* EVM chains use their standard chain IDs
* Non-EVM chains use custom assigned IDs
*/
export declare enum ChainID {
Arbitrum = 42161,
Optimism = 10,
Base = 8453,
Hyperliquid = 999,
Solana = 7565164,
Sui = 101
}
/**
* Array of chain IDs that are supported by the SDK
* Used as a source of truth for type generation
*/
export declare const SupportedChains: readonly [ChainID.Arbitrum, ChainID.Base, ChainID.Optimism, ChainID.Hyperliquid, ChainID.Solana, ChainID.Sui];
/**
* Type utility to identify chains not in the SupportedChains array
* @internal
*/
type UnsupportedChain = Exclude<ChainID, TupleToUnion<typeof SupportedChains>>;
/**
* Type representing chains that are supported by the SDK
* Derived from the SupportedChains array
*/
export type SupportedChain = Exclude<ChainID, UnsupportedChain>;
export type SupportedSolanaChain = 7565164;
export type SupportedSuiChain = 101;
export type SupportedEvmChain = Exclude<ChainID, SupportedSolanaChain | SupportedSuiChain>;
export declare function isEvmChain(chainId: ChainID): chainId is SupportedEvmChain;
/**
* Type guard that checks if a chain ID is among the supported chains
* @param chain - The chain ID to check
* @returns Boolean indicating if the chain is supported
*/
export declare const isSupportedChain: (chain: unknown) => chain is SupportedChain;
/**
* Maps chain IDs to their corresponding chain types
* Used to determine which SDK implementation to use for a given chain
*/
export declare const chainIdToChainTypeMap: {
readonly 42161: ChainType.EVM;
readonly 8453: ChainType.EVM;
readonly 10: ChainType.EVM;
readonly 999: ChainType.EVM;
readonly 7565164: ChainType.Solana;
readonly 101: ChainType.Sui;
};
export {};
//# sourceMappingURL=chains.d.ts.map