Function substrateSocketConnect

  • Connects to a Substrate node using WebSockets API by creating a new WsProvider instance with the given socket address.

    Returns

    • An instance of the ApiPromise class.

    Parameters

    • state: {
          apiState: undefined | null | string;
          jsonrpc: {
              [x: string]: Record<string, DefinitionRpcExt>;
          };
          socket: string;
      }

      An object that contains the state of the API, including the connection status, socket address, and JSON-RPC interface.

      • apiState: undefined | null | string
      • jsonrpc: {
            [x: string]: Record<string, DefinitionRpcExt>;
        }
        • [x: string]: Record<string, DefinitionRpcExt>
      • socket: string
    • Optional callbacks: SubstrateSocketConnectionCallbacksType

      Optional callbacks

    Returns undefined | ApiPromise

Generated using TypeDoc