Proposal represents a transaction proposal that can be sent to peers for endorsement or evaluated as a query.

interface Proposal {
    endorse(options?: CallOptions): Promise<Transaction>;
    evaluate(options?: CallOptions): Promise<Uint8Array>;
    getBytes(): Uint8Array;
    getDigest(): Uint8Array;
    getTransactionId(): string;
}

Hierarchy (view full)

Methods

  • Obtain endorsement for the transaction proposal from sufficient peers to allow it to be committed to the ledger.

    Parameters

    Returns Promise<Transaction>

    An endorsed transaction that can be submitted to the ledger.

    EndorseError Thrown if the gRPC service invocation fails.

  • Evaluate the transaction proposal and obtain its result, without updating the ledger. This runs the transaction on a peer to obtain a transaction result, but does not submit the endorsed transaction to the orderer to be committed to the ledger.

    Parameters

    Returns Promise<Uint8Array>

    The result returned by the transaction function.

    GatewayError Thrown if the gRPC service invocation fails.

  • Get the serialized bytes of the signable object. Serialized bytes can be used to recreate the object using methods on Gateway.

    Returns Uint8Array

  • Get the digest of the signable object. This is used to generate a digital signature.

    Returns Uint8Array

  • Get the transaction ID for this proposal.

    Returns string