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): Network;
    newBlockAndPrivateDataEventsRequest(bytes): BlockAndPrivateDataEventsRequest;
    newBlockEventsRequest(bytes): BlockEventsRequest;
    newChaincodeEventsRequest(bytes): ChaincodeEventsRequest;
    newCommit(bytes): Commit;
    newFilteredBlockEventsRequest(bytes): FilteredBlockEventsRequest;
    newProposal(bytes): Proposal;
    newSignedBlockAndPrivateDataEventsRequest(bytes, signature): BlockAndPrivateDataEventsRequest;
    newSignedBlockEventsRequest(bytes, signature): BlockEventsRequest;
    newSignedChaincodeEventsRequest(bytes, signature): ChaincodeEventsRequest;
    newSignedCommit(bytes, signature): Commit;
    newSignedFilteredBlockEventsRequest(bytes, signature): FilteredBlockEventsRequest;
    newSignedProposal(bytes, signature): Proposal;
    newSignedTransaction(bytes, signature): Transaction;
    newTransaction(bytes): 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.