From 741e63a225374325332f51982f32760dd5faf439 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Fri, 13 May 2022 10:40:09 -0400 Subject: [PATCH] Added some docs comments to better identify fields that are just named `id` and to better spot where transaction hash can be found --- chain/near.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/chain/near.ts b/chain/near.ts index 56c9897..c5d4d0e 100644 --- a/chain/near.ts +++ b/chain/near.ts @@ -229,6 +229,9 @@ export namespace near { // We don't map ReceiptData export class ActionReceipt { + /** + * @param id This represents the `receiptId` in which this action have been executed. + */ constructor( // Receipt fields public predecessorId: string, @@ -305,6 +308,12 @@ export namespace near { export class MerklePath extends Array {} export class ExecutionOutcome { + /** + * @param blockHash This is the block hash in which this execution outcome has been executed, + * could be from a different block than the transaction that initially generated this execution outcome. + * @param id This is the `transactionHash` of the transaction that generated this execution outcome. + * @param logs The logs that were generated by the smart contract a part of this execution. + */ constructor( public gasBurnt: u64, public proof: MerklePath, @@ -392,7 +401,22 @@ export namespace near { ) {} } + /** + * This is a container object holding the `outcome` of a single synchronous + * computation, the receipt this execution generated and the `block` as well as the + * `block` in which this execution happened. + * + * To obtain the `transactionHash` that generated this execution outcome, you can + * refers to the {@link ExecutionOutcome} `id` field, which is actually the transaction + * hash. + */ export class ReceiptWithOutcome { + /** + * @param outcome The execution outcome of a single synchronous computation, contains the `transactionHash`, + * the `logs`, the exeuction outcome `status` as well as a few others. + * @param receipt The receipt this execution outcome generated. + * @param block The block in which this execution happened. + */ constructor( public outcome: ExecutionOutcome, public receipt: ActionReceipt,