For use with async-flow contracts: can be used as a creator facet that allows developers to add new chain configurations to a local chainHub, in the event the information is not available widely in agoricNames.

const chainHubAdmin = prepareChainHubAdmin(zone, chainHub);
chainHubAdmin.initChain(
'hotNewChain',
hotNewChainInfo,
agoricTohotNewChainConnectionInfo,
);
  • Parameters

    • zone: Zone
    • chainHub: Guarded<{
          getAsset(denom: string, srcChainName: string): undefined | DenomDetail;
          getChainInfo<K>(chainName: K): Vow<ActualChainInfo<K>>;
          getChainsAndConnection<C1, C2>(primaryName: C1, counterName: C2): Vow<[ActualChainInfo<C1>, ActualChainInfo<C2>, IBCConnectionInfo]>;
          getConnectionInfo(primary: string | {
              chainId: string;
          }, counter: string | {
              chainId: string;
          }): Vow<IBCConnectionInfo>;
          getDenom(brand: Brand): undefined | string;
          makeChainAddress(address: string): ChainAddress;
          makeTransferRoute(destination: ChainAddress, denomAmount: DenomAmount, srcChainName: string, forwardOpts?: {
              intermediateRecipient?: ChainAddress;
              retries?: number;
              timeout?:
                  | `${number}s`
                  | `${number}m`
                  | `${number}h`
                  | `${number}ms`
                  | `${number}us`
                  | `${number}ns`;
          }): TransferRoute;
          registerAsset(denom: string, detail: DenomDetail): void;
          registerChain(name: string, chainInfo: Readonly<{
              bech32Prefix?: string;
              chainId: string;
              connections?: Record<string, IBCConnectionInfo>;
              icqEnabled?: boolean;
              pfmEnabled?: boolean;
              stakingTokens?: readonly {
                  denom: string;
              }[];
          }>): void;
          registerConnection(primaryChainId: string, counterpartyChainId: string, connectionInfo: IBCConnectionInfo): void;
      }>

    Returns Guarded<{
        registerAsset(denom: string, detail: DenomDetail): Promise<void>;
        registerChain(chainName: string, chainInfo: Readonly<{
            bech32Prefix?: string;
            chainId: string;
            connections?: Record<string, IBCConnectionInfo>;
            icqEnabled?: boolean;
            pfmEnabled?: boolean;
            stakingTokens?: readonly {
                denom: string;
            }[];
        }>, connectionInfo: IBCConnectionInfo): Promise<void>;
    }>