import { Message } from "@keplr-wallet/router" ; import { ChainInfoWithEmbed } from "./types" ; import { ChainInfo } from "@keplr-wallet/types" ; import { ROUTE } from "./constants" ; export class GetChainInfosMsg extends Message < { chainInfos : ChainInfoWithEmbed [ ] ; } > { public static type ( ) { return "get-chain-infos" ; } validateBasic ( ) { } route ( ) { return ROUTE ; } type ( ) { return GetChainInfosMsg . type ( ) ; } } export class SuggestChainInfoMsg extends Message < void > { public static type ( ) { return "suggest-chain-info" ; } constructor ( public readonly chainInfo ) { super ( ) ; } validateBasic ( ) { if ( ! this . chainInfo ) { throw new Error ( "chain info not set" ) ; } } approveExternal ( ) { return true ; } route ( ) { return ROUTE ; } type ( ) { return SuggestChainInfoMsg . type ( ) ; } } export class RemoveSuggestedChainInfoMsg extends Message < ChainInfoWithEmbed [ ] > { public static type ( ) { return "remove-suggested-chain-info" ; } constructor ( public readonly chainId ) { super ( ) ; } validateBasic ( ) { if ( ! this . chainId ) { throw new Error ( "Chain id not set" ) ; } } route ( ) { return ROUTE ; } type ( ) { return RemoveSuggestedChainInfoMsg . type ( ) ; } }