Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Added some docs comments to better identify fields that are just named id #275

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions chain/near.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -305,6 +308,12 @@ export namespace near {
export class MerklePath extends Array<MerklePathItem> {}

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,
Expand Down Expand Up @@ -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,
Expand Down