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>>;
          getChainInfoByChainId(chainId: `${string}:${string}`): ChainInfo;
          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(partialId: string): CosmosChainAddress;
          makeTransferRoute(destination: AccountIdArg | `${string}1${string}`, denomAmount: DenomAmount, srcChainName: string, forwardOpts?: {
              intermediateRecipient?: CosmosChainAddress;
              retries?: number;
              timeout?:
                  | `${number}ms`
                  | `${number}s`
                  | `${number}m`
                  | `${number}h`
                  | `${number}us`
                  | `${number}ns`;
          }): TransferRoute;
          registerAsset(denom: string, detail: DenomDetail): void;
          registerChain(name: string, chainInfo: ChainInfo): void;
          registerConnection(primaryChainId: string, counterpartyChainId: string, connectionInfo: IBCConnectionInfo): void;
          resolveAccountId(partialId: string): `${string}:${string}:${string}`;
          updateAsset(denom: string, detail: DenomDetail): void;
          updateChain(chainName: string, chainInfo: ChainInfo): void;
          updateConnection(primaryChainId: string, counterpartyChainId: string, connectionInfo: IBCConnectionInfo): void;
      }>

    Returns Guarded<{
        registerAsset(denom: string, detail: DenomDetail): Promise<void>;
        registerChain(chainName: string, chainInfo: ChainInfo, ibcConnectionInfo?: IBCConnectionInfo): Promise<void>;
    }>