Gateway represents the connection of a specific client identity to a Fabric Gateway. A Gateway is obtained using the connect function.

This type implements the Disposable interface, allowing instances to be disposed of with ECMAScript explicit resource management and the using keyword instead of calling close directly.

interface Gateway {
    [dispose](): void;
    close(): void;
    getIdentity(): Identity;
    getNetwork(channelName: string): Network;
    newBlockAndPrivateDataEventsRequest(bytes: Uint8Array): BlockAndPrivateDataEventsRequest;
    newBlockEventsRequest(bytes: Uint8Array): BlockEventsRequest;
    newChaincodeEventsRequest(bytes: Uint8Array): ChaincodeEventsRequest;
    newCommit(bytes: Uint8Array): Commit;
    newFilteredBlockEventsRequest(bytes: Uint8Array): FilteredBlockEventsRequest;
    newProposal(bytes: Uint8Array): Proposal;
    newSignedBlockAndPrivateDataEventsRequest(bytes: Uint8Array, signature: Uint8Array): BlockAndPrivateDataEventsRequest;
    newSignedBlockEventsRequest(bytes: Uint8Array, signature: Uint8Array): BlockEventsRequest;
    newSignedChaincodeEventsRequest(bytes: Uint8Array, signature: Uint8Array): ChaincodeEventsRequest;
    newSignedCommit(bytes: Uint8Array, signature: Uint8Array): Commit;
    newSignedFilteredBlockEventsRequest(bytes: Uint8Array, signature: Uint8Array): FilteredBlockEventsRequest;
    newSignedProposal(bytes: Uint8Array, signature: Uint8Array): Proposal;
    newSignedTransaction(bytes: Uint8Array, signature: Uint8Array): Transaction;
    newTransaction(bytes: Uint8Array): Transaction;
}

Methods

  • Close the gateway when it is no longer required. This releases all resources associated with networks and contracts obtained using the Gateway, including removing event listeners.

    Returns void

  • Get a network representing the named Fabric channel.

    Parameters

    • channelName: string

      Fabric channel name.

    Returns Network

  • Recreate a commit status request from serialized data.

    Parameters

    • bytes: Uint8Array

      Serialized commit status request.

    Returns Commit

    A commit status request.

  • Recreate a proposal from serialized data.

    Parameters

    • bytes: Uint8Array

      Serialized proposal.

    Returns Proposal

    A proposal.

  • Create a block and private data events request with the specified digital signature. Supports off-line signing flow.

    Parameters

    • bytes: Uint8Array

      Serialized block and private data events request.

    • signature: Uint8Array

      Digital signature.

    Returns BlockAndPrivateDataEventsRequest

    A signed block and private data events request.

  • Create a block events request with the specified digital signature. Supports off-line signing flow.

    Parameters

    • bytes: Uint8Array

      Serialized block events request.

    • signature: Uint8Array

      Digital signature.

    Returns BlockEventsRequest

    A signed block events request.

  • Create a chaincode events request with the specified digital signature. Supports off-line signing flow.

    Parameters

    • bytes: Uint8Array

      Serialized chaincode events request.

    • signature: Uint8Array

      Digital signature.

    Returns ChaincodeEventsRequest

    A signed chaincode events request.

  • Create a commit with the specified digital signature, which can be used to access information about a transaction that is committed to the ledger. Supports off-line signing flow.

    Parameters

    • bytes: Uint8Array

      Serialized commit status request.

    • signature: Uint8Array

      Digital signature.

    Returns Commit

    A signed commit status request.

  • Create a filtered block events request with the specified digital signature. Supports off-line signing flow.

    Parameters

    • bytes: Uint8Array

      Serialized filtered block events request.

    • signature: Uint8Array

      Digital signature.

    Returns FilteredBlockEventsRequest

    A signed filtered block events request.

  • Create a proposal with the specified digital signature. Supports off-line signing flow.

    Parameters

    • bytes: Uint8Array

      Serialized proposal.

    • signature: Uint8Array

      Digital signature.

    Returns Proposal

    A signed proposal.

  • Create a transaction with the specified digital signature. Supports off-line signing flow.

    Parameters

    • bytes: Uint8Array

      Serialized proposal.

    • signature: Uint8Array

      Digital signature.

    Returns Transaction

    A signed transaction.