From 0a94b66ba64ebbb21474523832aedb44d740aa63 Mon Sep 17 00:00:00 2001 From: Clayton Neal Date: Thu, 23 Nov 2023 11:08:01 +0000 Subject: [PATCH] Chore/223 (#290) * chore: missing docs * chore: remove public --------- Co-authored-by: Fabio Rigamonti <73019897+fabiorigam@users.noreply.github.com> --- package.json | 4 +- packages/core/src/abi/fragment.ts | 7 -- packages/core/src/abi/types.d.ts | 12 --- packages/core/src/hash/types.d.ts | 2 - packages/core/src/hdnode/types.d.ts | 2 - packages/core/src/keystore/types.d.ts | 10 --- packages/core/src/mnemonic/types.d.ts | 1 - packages/core/src/transaction/types.d.ts | 5 +- packages/core/src/utils/const/data.ts | 3 +- packages/core/src/utils/const/hdnode.ts | 3 - packages/core/src/utils/const/keystore.ts | 1 - packages/core/src/utils/const/mnemonic.ts | 1 - packages/core/src/utils/const/network.ts | 2 +- packages/core/src/utils/const/secp256k1.ts | 2 +- packages/core/src/utils/const/transaction.ts | 17 ++-- packages/core/src/utils/data/types.d.ts | 2 - packages/errors/src/model/core/abi.ts | 2 - packages/errors/src/model/core/address.ts | 2 - packages/errors/src/model/core/bloom.ts | 2 - packages/errors/src/model/core/certificate.ts | 2 - packages/errors/src/model/core/data.ts | 2 - packages/errors/src/model/core/hdnode.ts | 2 - packages/errors/src/model/core/keystore.ts | 2 - packages/errors/src/model/core/rlp.ts | 4 - packages/errors/src/model/core/secp256k1.ts | 2 - packages/errors/src/model/core/transaction.ts | 2 - .../errors/src/model/network/http-client.ts | 4 - packages/errors/src/types/errorTypes.ts | 10 --- .../thorest-client/accounts/types.d.ts | 8 +- .../clients/thorest-client/blocks/types.d.ts | 2 - .../clients/thorest-client/logs/types.d.ts | 88 ++++++++++++------- .../transactions/transactions-client.ts | 3 + .../thorest-client/transactions/types.d.ts | 72 ++++++++++----- .../network/src/utils/const/client/nodes.ts | 2 - .../network/src/utils/http/http-client.ts | 5 +- packages/network/src/utils/http/types.d.ts | 3 - packages/network/src/utils/thorest/thorest.ts | 2 - typedoc.base.json | 2 +- yarn.lock | 5 ++ 39 files changed, 143 insertions(+), 159 deletions(-) diff --git a/package.json b/package.json index 7a1ebd65a..1650dd496 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "format": "turbo format", "test:examples": "turbo test:examples", "merge-coverage": "ts-node scripts/merge-coverage.ts", - "generate:apidocs": "typedoc --options typedoc.json --logLevel Verbose" + "generate:apidocs": "typedoc --options typedoc.json --logLevel Error", + "generate:apidocs-debug": "typedoc --options typedoc.json --logLevel Verbose --plugin typedoc-plugin-missing-exports --validation.notDocumented" }, "private": true, "workspaces": [ @@ -50,6 +51,7 @@ "tsup": "^7.2.0", "turbo": "^1.10.15", "typedoc": "^0.25.3", + "typedoc-plugin-missing-exports": "^2.1.0", "typescript": "*" } } diff --git a/packages/core/src/abi/fragment.ts b/packages/core/src/abi/fragment.ts index 0e1332dd1..d6edd11de 100644 --- a/packages/core/src/abi/fragment.ts +++ b/packages/core/src/abi/fragment.ts @@ -47,14 +47,11 @@ class Function { /** * The main fragment handled by ethers.js. * - * @public */ public fragment: FunctionFragment; /** * The main interface handled by ethers.js. - * - * @public */ public iface: Interface; @@ -146,15 +143,11 @@ class Function { class Event { /** * The main fragment handled by ethers.js. - * - * @public */ public fragment: ethers.EventFragment; /** * The main interface handled by ethers.js. - * - * @public */ public iface: Interface; diff --git a/packages/core/src/abi/types.d.ts b/packages/core/src/abi/types.d.ts index 314059840..f90d9e513 100644 --- a/packages/core/src/abi/types.d.ts +++ b/packages/core/src/abi/types.d.ts @@ -2,45 +2,33 @@ import { type ethers } from 'ethers'; /** * Represents a wrapped Param Type for ethers.js types. - * - * @public */ type ParamType = ethers.ParamType; /** * Represents a wrapped Function Fragment for ethers.js types. - * - * @public */ type FunctionFragment = ethers.FunctionFragment; /** * Represents a wrapped Interface for ethers.js types. - * - * @public */ type Interface = ethers.Interface; /** * Represents a wrapped Result for ethers.js types. * It represents the decoded data from a transaction (after decoding). - * - * @public */ type Result = ethers.Result; /** * Represents a wrapped BytesLike for ethers.js types. - * - * @public */ type BytesLike = ethers.BytesLike; /** * Represents a wrapped FormatType for ethers.js types. * It is used to represents the format of the signature of a function. - * - * @public */ type FormatType = ethers.FormatType; diff --git a/packages/core/src/hash/types.d.ts b/packages/core/src/hash/types.d.ts index 61bca9e07..99c7a8ac1 100644 --- a/packages/core/src/hash/types.d.ts +++ b/packages/core/src/hash/types.d.ts @@ -2,8 +2,6 @@ import { type BytesLike } from 'ethers'; /** * Input to hash function. - * - * @public */ type HashInput = BytesLike; diff --git a/packages/core/src/hdnode/types.d.ts b/packages/core/src/hdnode/types.d.ts index e6808c505..1488dc3ac 100644 --- a/packages/core/src/hdnode/types.d.ts +++ b/packages/core/src/hdnode/types.d.ts @@ -3,8 +3,6 @@ * * BIP32 HD nodes allow for the derivation of child nodes from a master node, * enabling the generation of a tree structure of key pairs from a single seed. - * - * @public */ interface IHDNode { /** diff --git a/packages/core/src/keystore/types.d.ts b/packages/core/src/keystore/types.d.ts index e9f26e038..cff4150bd 100644 --- a/packages/core/src/keystore/types.d.ts +++ b/packages/core/src/keystore/types.d.ts @@ -1,14 +1,10 @@ /** * Types of ciphers for keystore encryption - * - * @public */ type Cipher = 'aes-128-ctr' | 'aes-128-cbc' | 'aes-256-cbc'; /** * Scrypt parameters for keystore encryption - * - * @public */ interface ScryptParams { dklen: number; @@ -20,8 +16,6 @@ interface ScryptParams { /** * PBKDF2SHA256 parameters for keystore encryption - * - * @public */ interface PBKDF2SHA256Params { c: number; @@ -33,8 +27,6 @@ interface PBKDF2SHA256Params { /** * Keystore type. * Output of encryption function. - * - * @public */ interface Keystore { crypto: { @@ -55,8 +47,6 @@ interface Keystore { /** * Keystore account type * Output of decryption function. - * - * @public */ interface KeystoreAccount { address: string; diff --git a/packages/core/src/mnemonic/types.d.ts b/packages/core/src/mnemonic/types.d.ts index 166b70568..621bc3ab5 100644 --- a/packages/core/src/mnemonic/types.d.ts +++ b/packages/core/src/mnemonic/types.d.ts @@ -1,7 +1,6 @@ /** * Type of the wordlist size. * Every 4 bytes produce 3 words. - * @public */ type WordlistSizeType = 12 | 15 | 18 | 21 | 24; diff --git a/packages/core/src/transaction/types.d.ts b/packages/core/src/transaction/types.d.ts index 25b78b1a3..8e2fa7192 100644 --- a/packages/core/src/transaction/types.d.ts +++ b/packages/core/src/transaction/types.d.ts @@ -1,6 +1,5 @@ /** * Simple type for transaction clause. - * @public */ interface TransactionClause { /** @@ -25,7 +24,6 @@ interface TransactionClause { /** * Type for transaction body. - * @public */ interface TransactionBody { /** @@ -105,6 +103,9 @@ interface TransactionBody { * Tx feature bits */ features?: number; + /** + * Unused + */ unused?: Buffer[]; }; } diff --git a/packages/core/src/utils/const/data.ts b/packages/core/src/utils/const/data.ts index 5c11ceb14..eef956f05 100644 --- a/packages/core/src/utils/const/data.ts +++ b/packages/core/src/utils/const/data.ts @@ -1,6 +1,6 @@ /** * Zero buffer - * @public + * @internal * * @example ZERO_BUFFER(8) -> 0x00000000 , ... , ZERO_BUFFER(n) -> 0x0...0 */ @@ -9,7 +9,6 @@ const ZERO_BUFFER = (size: number): Buffer => Buffer.alloc(size, 0); /** * Regular expression for validating hexadecimal strings. * Allows optional "0x" prefix and validates both lower and uppercase hex characters. - * @public */ const HEX_REGEX_OPTIONAL_PREFIX = /^(0x)?[0-9a-fA-F]*$/; diff --git a/packages/core/src/utils/const/hdnode.ts b/packages/core/src/utils/const/hdnode.ts index 9d2402601..7efd116e9 100644 --- a/packages/core/src/utils/const/hdnode.ts +++ b/packages/core/src/utils/const/hdnode.ts @@ -1,6 +1,5 @@ /** * Default VET derivation path. - * @public * * See https://github.com/satoshilabs/slips/blob/master/slip-0044.md for more info. */ @@ -8,13 +7,11 @@ const VET_DERIVATION_PATH = "m/44'/818'/0'/0"; /** * Prefix for extended public key - * @public */ const X_PUB_PREFIX = Buffer.from('0488b21e000000000000000000', 'hex'); /** * Prefix for extended private key - * @public */ const X_PRIV_PREFIX = Buffer.from('0488ade4000000000000000000', 'hex'); diff --git a/packages/core/src/utils/const/keystore.ts b/packages/core/src/utils/const/keystore.ts index 71d778052..f9c370504 100644 --- a/packages/core/src/utils/const/keystore.ts +++ b/packages/core/src/utils/const/keystore.ts @@ -1,6 +1,5 @@ /** * Keystore Scrypt params - * @public */ const SCRYPT_PARAMS = { N: 131072, diff --git a/packages/core/src/utils/const/mnemonic.ts b/packages/core/src/utils/const/mnemonic.ts index a4295354d..68b9ae86c 100644 --- a/packages/core/src/utils/const/mnemonic.ts +++ b/packages/core/src/utils/const/mnemonic.ts @@ -2,7 +2,6 @@ import { type WordlistSizeType } from '../../mnemonic'; /** * Mnemonic wordlist size - * @public */ const MNEMONIC_WORDLIST_ALLOWED_SIZES: WordlistSizeType[] = [ 12, 15, 18, 21, 24 diff --git a/packages/core/src/utils/const/network.ts b/packages/core/src/utils/const/network.ts index 6a3f568d9..8b85b8cb2 100644 --- a/packages/core/src/utils/const/network.ts +++ b/packages/core/src/utils/const/network.ts @@ -97,8 +97,8 @@ const soloGenesisBlock = { }; /** - * @ignore since no relevant information is displayed in the documentation * Constants defining Vechain mainnet and testnet network information + * @internal */ const networkInfo = { mainnet: { diff --git a/packages/core/src/utils/const/secp256k1.ts b/packages/core/src/utils/const/secp256k1.ts index 7591dca06..d579fad11 100644 --- a/packages/core/src/utils/const/secp256k1.ts +++ b/packages/core/src/utils/const/secp256k1.ts @@ -1,6 +1,6 @@ /** * Biggest value of private key - * @public + * @internal */ const PRIVATE_KEY_MAX_VALUE = Buffer.from( 'fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141', diff --git a/packages/core/src/utils/const/transaction.ts b/packages/core/src/utils/const/transaction.ts index a0fb6ca05..5fafdbf2a 100644 --- a/packages/core/src/utils/const/transaction.ts +++ b/packages/core/src/utils/const/transaction.ts @@ -2,38 +2,42 @@ import { RLP } from '../../encoding'; /** * Transaction gas constants - * @public */ const TRANSACTIONS_GAS_CONSTANTS = { /** * Default gas for a transaction + * @internal */ TX_GAS: 5000, /** * Default gas for a clause + * @internal */ CLAUSE_GAS: 16000, /** * Default gas for a contract creation clause + * @internal */ CLAUSE_GAS_CONTRACT_CREATION: 48000, /** * Zero gas data + * @internal */ ZERO_GAS_DATA: 4, /** * Non-zero gas data + * @internal */ NON_ZERO_GAS_DATA: 68 }; /** * Main transaction fields - * @private + * @internal */ const TRANSACTION_FIELDS = [ /** @@ -96,7 +100,7 @@ const TRANSACTION_FIELDS = [ /** * Kind for transaction features - * @public + * @internal */ const TRANSACTION_FEATURES_KIND = { name: 'reserved.features', @@ -105,6 +109,7 @@ const TRANSACTION_FEATURES_KIND = { /** * Kind for transaction signature + * @internal */ const TRANSACTION_SIGNATURE_KIND = { name: 'signature', @@ -113,7 +118,7 @@ const TRANSACTION_SIGNATURE_KIND = { /** * RLP profiler for simple unsigned transactions - * @public + * @internal */ const UNSIGNED_TRANSACTION_RLP = new RLP.Profiler({ name: 'tx', @@ -122,7 +127,7 @@ const UNSIGNED_TRANSACTION_RLP = new RLP.Profiler({ /** * RLP profiler for simple signed transactions - * @public + * @internal */ const SIGNED_TRANSACTION_RLP = new RLP.Profiler({ name: 'tx', @@ -133,11 +138,13 @@ const SIGNED_TRANSACTION_RLP = new RLP.Profiler({ /** * Signature length + * @internal */ const SIGNATURE_LENGTH = 65; /** * Block ref field length + * @internal */ const BLOCK_REF_LENGTH = 8; diff --git a/packages/core/src/utils/data/types.d.ts b/packages/core/src/utils/data/types.d.ts index fa2aa0951..872eb66a0 100644 --- a/packages/core/src/utils/data/types.d.ts +++ b/packages/core/src/utils/data/types.d.ts @@ -1,8 +1,6 @@ /** * Confirugation for hex values. * In particular, whether or not to include the `0x` prefix. - * - * @public */ interface HexConfig { withPrefix: boolean; diff --git a/packages/errors/src/model/core/abi.ts b/packages/errors/src/model/core/abi.ts index 49847a113..121a1c4b0 100644 --- a/packages/errors/src/model/core/abi.ts +++ b/packages/errors/src/model/core/abi.ts @@ -75,8 +75,6 @@ class ContractInterfaceError extends ErrorBase< /** * Errors enum. - * - * @public */ enum ABI { INVALID_FUNCTION = 'INVALID_FUNCTION', diff --git a/packages/errors/src/model/core/address.ts b/packages/errors/src/model/core/address.ts index 3f3ec602f..1f1fe5758 100644 --- a/packages/errors/src/model/core/address.ts +++ b/packages/errors/src/model/core/address.ts @@ -15,8 +15,6 @@ class InvalidAddressError extends ErrorBase< /** * Errors enum. - * - * @public */ enum ADDRESS { INVALID_ADDRESS = 'INVALID_ADDRESS' diff --git a/packages/errors/src/model/core/bloom.ts b/packages/errors/src/model/core/bloom.ts index 444ef8ecf..450d6d351 100644 --- a/packages/errors/src/model/core/bloom.ts +++ b/packages/errors/src/model/core/bloom.ts @@ -24,8 +24,6 @@ class InvalidKError extends ErrorBase {} /** * Errors enum. - * - * @public */ enum BLOOM { INVALID_BLOOM = 'INVALID_BLOOM', diff --git a/packages/errors/src/model/core/certificate.ts b/packages/errors/src/model/core/certificate.ts index d7cd7733b..107507d11 100644 --- a/packages/errors/src/model/core/certificate.ts +++ b/packages/errors/src/model/core/certificate.ts @@ -42,8 +42,6 @@ class CertificateInvalidSignerError extends ErrorBase< /** * Errors enum. - * - * @public */ enum CERTIFICATE { CERTIFICATE_NOT_SIGNED = 'CERTIFICATE_NOT_SIGNED', diff --git a/packages/errors/src/model/core/data.ts b/packages/errors/src/model/core/data.ts index 8be233942..76258f386 100644 --- a/packages/errors/src/model/core/data.ts +++ b/packages/errors/src/model/core/data.ts @@ -27,8 +27,6 @@ class InvalidDataReturnTypeError extends ErrorBase< /** * Errors enum. - * - * @public */ enum DATA { INVALID_DATA_TYPE = 'INVALID_DATA_TYPE', diff --git a/packages/errors/src/model/core/hdnode.ts b/packages/errors/src/model/core/hdnode.ts index ad866179b..567c3e248 100644 --- a/packages/errors/src/model/core/hdnode.ts +++ b/packages/errors/src/model/core/hdnode.ts @@ -63,8 +63,6 @@ class InvalidHDNodeDerivationPathError extends ErrorBase< /** * Errors enum. - * - * @public */ enum HDNODE { INVALID_HDNODE_PUBLIC_KEY = 'INVALID_HDNODE_PUBLIC_KEY', diff --git a/packages/errors/src/model/core/keystore.ts b/packages/errors/src/model/core/keystore.ts index bdae71d60..a9c9c7760 100644 --- a/packages/errors/src/model/core/keystore.ts +++ b/packages/errors/src/model/core/keystore.ts @@ -27,8 +27,6 @@ class InvalidKeystorePasswordError extends ErrorBase< /** * Errors enum. - * - * @public */ enum KEYSTORE { INVALID_KEYSTORE = 'INVALID_KEYSTORE', diff --git a/packages/errors/src/model/core/rlp.ts b/packages/errors/src/model/core/rlp.ts index 9ed01f791..bd5032661 100644 --- a/packages/errors/src/model/core/rlp.ts +++ b/packages/errors/src/model/core/rlp.ts @@ -2,8 +2,6 @@ import { ErrorBase } from '../base'; /** * Invalid RLP error data interface. - * - * @public */ interface InvalidRLPErrorData { context: string; @@ -20,8 +18,6 @@ class InvalidRLPError extends ErrorBase {} /** * Errors enum. - * - * @public */ enum RLP { INVALID_RLP = 'INVALID_RLP' diff --git a/packages/errors/src/model/core/secp256k1.ts b/packages/errors/src/model/core/secp256k1.ts index 3f93d7167..dbf6d9136 100644 --- a/packages/errors/src/model/core/secp256k1.ts +++ b/packages/errors/src/model/core/secp256k1.ts @@ -51,8 +51,6 @@ class InvalidSecp256k1SignatureRecoveryError extends ErrorBase< /** * Errors enum. - * - * @public */ enum SECP256K1 { INVALID_SECP256k1_PRIVATE_KEY = 'INVALID_SECP256k1_PRIVATE_KEY', diff --git a/packages/errors/src/model/core/transaction.ts b/packages/errors/src/model/core/transaction.ts index 0d41119e3..348ae4e66 100644 --- a/packages/errors/src/model/core/transaction.ts +++ b/packages/errors/src/model/core/transaction.ts @@ -55,8 +55,6 @@ class TransactionDelegationError extends ErrorBase< /** * Errors enum. - * - * @public */ enum TRANSACTION { ALREADY_SIGNED = 'ALREADY_SIGNED', diff --git a/packages/errors/src/model/network/http-client.ts b/packages/errors/src/model/network/http-client.ts index 4abeace4f..966c54d0e 100644 --- a/packages/errors/src/model/network/http-client.ts +++ b/packages/errors/src/model/network/http-client.ts @@ -2,8 +2,6 @@ import { ErrorBase } from '../base'; /** * HTTP Client Error. - * - * @public */ interface HTTPClientErrorData { status?: number; @@ -29,8 +27,6 @@ class HTTPClientError extends ErrorBase< /** * Errors enum. - * - * @public */ enum HTTP_CLIENT { INVALID_HTTP_REQUEST = 'INVALID_HTTP_REQUEST' diff --git a/packages/errors/src/types/errorTypes.ts b/packages/errors/src/types/errorTypes.ts index 856b16bab..e3a534501 100644 --- a/packages/errors/src/types/errorTypes.ts +++ b/packages/errors/src/types/errorTypes.ts @@ -59,8 +59,6 @@ type DefaultErrorData = Record | { innerError: Error }; /** * Error code type. - * - * @public */ type ErrorCode = | SECP256K1 @@ -80,8 +78,6 @@ type ErrorCode = * The type is used to specify the data type of the error builder. * * @param ErrorCodeT - The error code type from the error types enum. - * - * @public */ type DataType = ErrorCodeT extends RLP.INVALID_RLP ? InvalidRLPErrorData @@ -91,8 +87,6 @@ type DataType = ErrorCodeT extends RLP.INVALID_RLP /** * Default error codes. - * - * @public */ const ERROR_CODES = { SECP256K1, @@ -115,8 +109,6 @@ const ERROR_CODES = { * @note When adding a new error, add the error code and the error class to the type. * * @param ErrorCodeT - The error code type from the error types enum. - * - * @public */ type ErrorType = ErrorCodeT extends SECP256K1.INVALID_SECP256k1_PRIVATE_KEY @@ -190,8 +182,6 @@ type ErrorType = * @note When adding a new error, add the error code and the error class to the map. * * @param ErrorCodeT - The error code type from the error types enum. - * - * @public */ const ErrorClassMap = new Map< ErrorCode, diff --git a/packages/network/src/clients/thorest-client/accounts/types.d.ts b/packages/network/src/clients/thorest-client/accounts/types.d.ts index f7c601192..782fd976c 100644 --- a/packages/network/src/clients/thorest-client/accounts/types.d.ts +++ b/packages/network/src/clients/thorest-client/accounts/types.d.ts @@ -6,8 +6,6 @@ * * getBytecode * * getStorage * Methods - * - * @public */ interface AccountInputOptions { /** @@ -45,6 +43,9 @@ interface AccountDetail { * The bytecode is represented in hex string. */ interface ResponseBytecode { + /** + * Bytecode of the smart contract + */ code: string; } @@ -53,6 +54,9 @@ interface ResponseBytecode { * The storage data is represented in hex string. */ interface ResponseStorage { + /** + * Hex string of the storage data + */ value: string; } diff --git a/packages/network/src/clients/thorest-client/blocks/types.d.ts b/packages/network/src/clients/thorest-client/blocks/types.d.ts index f183c58f4..0274c6535 100644 --- a/packages/network/src/clients/thorest-client/blocks/types.d.ts +++ b/packages/network/src/clients/thorest-client/blocks/types.d.ts @@ -8,8 +8,6 @@ import { type Event, type Transfer } from '../logs'; * * getBytecode * * getStorage * Methods - * - * @public */ interface BlockInputOptions { /** diff --git a/packages/network/src/clients/thorest-client/logs/types.d.ts b/packages/network/src/clients/thorest-client/logs/types.d.ts index d0bb30109..3971a0f32 100644 --- a/packages/network/src/clients/thorest-client/logs/types.d.ts +++ b/packages/network/src/clients/thorest-client/logs/types.d.ts @@ -2,8 +2,6 @@ /** * Range interface for specifying a range of data. - * - * @private */ interface Range { /** @@ -24,8 +22,6 @@ interface Range { /** * Options interface for specifying Pagination Options (offset and limits). - * - * @private */ interface PaginationOptions { /** @@ -41,8 +37,6 @@ interface PaginationOptions { /** * EventCriteria interface for filtering event logs. - * - * @private */ interface EventCriteria { /** @@ -61,32 +55,50 @@ interface EventCriteria { /** * Order interface for filtering event logs. - * - * @private */ type EventDisplayOrder = 'asc' | 'desc'; /** * FilterEventLogsArg interface for filtering event logs. - * - * @public */ interface FilterEventLogsOptions { + /** + * Block range + */ range?: Range; + /** + * Pagination options + */ options?: PaginationOptions; + /** + * Event filters + */ criteriaSet: EventCriteria[]; + /** + * Sorting order + */ order: EventDisplayOrder; } /** * FilterTransferLogsArg interface for filtering transfer logs. - * - * @public */ interface FilterTransferLogsOptions { + /** + * Block range to query + */ range?: Range; + /** + * Pagination options + */ options?: PaginationOptions; + /** + * Criteria to filter transfers by + */ criteriaSet: TransferCriteria[]; + /** + * Ordering of results + */ order: EventDisplayOrder; } @@ -96,22 +108,36 @@ interface FilterTransferLogsOptions { /** * Event metadata for an entity. - * - * @private */ interface Metadata { - blockID: string; // Block identifier associated with the entity. - blockNumber: number; // Block number associated with the entity. - blockTimestamp: number; // Timestamp of the block. - txID: string; // Transaction ID associated with the entity. - txOrigin: string; // Transaction origin information. - clauseIndex: number; // Index of the clause. + /** + * Block identifier associated with the entity + */ + blockID: string; + /** + * Block number associated with the entity + */ + blockNumber: number; + /** + * Timestamp of the block + */ + blockTimestamp: number; + /** + * Transaction ID associated with the entity + */ + txID: string; + /** + * Transaction origin information + */ + txOrigin: string; + /** + * Index of the clause + */ + clauseIndex: number; } /** * TransferCriteria interface for filtering transfer logs. - * - * @private */ interface TransferCriteria { txOrigin?: string; // Transaction origin filter for transfer criteria. @@ -121,8 +147,6 @@ interface TransferCriteria { /** * Event interface representing event data. - * - * @public */ interface Event { /** @@ -143,8 +167,6 @@ interface Event { /** * Transfer interface representing transfer data. - * - * @public */ interface Transfer { /** @@ -165,20 +187,22 @@ interface Transfer { /** * EventLogs interface, combining Event and EventMetadata. - * - * @public */ interface EventLogs extends Event { - meta: Metadata; // Event logs with associated metadata. + /** + * // Event logs with associated metadata + */ + meta: Metadata; } /** * TransferLogs interface, combining Transfer and WithMeta. - * - * @public */ interface TransferLogs extends Transfer { - meta: Metadata; // Transfer logs with associated metadata. + /** + * Transfer logs with associated metadata + */ + meta: Metadata; } /* --- Responses Outputs end --- */ diff --git a/packages/network/src/clients/thorest-client/transactions/transactions-client.ts b/packages/network/src/clients/thorest-client/transactions/transactions-client.ts index 59e6a688d..04d294945 100644 --- a/packages/network/src/clients/thorest-client/transactions/transactions-client.ts +++ b/packages/network/src/clients/thorest-client/transactions/transactions-client.ts @@ -24,6 +24,9 @@ import { DATA } from '@vechainfoundation/vechain-sdk-errors'; +/** + * Client for reading and creating transactions + */ class TransactionsClient { /** * Initializes a new instance of the `TransactionClient` class. diff --git a/packages/network/src/clients/thorest-client/transactions/types.d.ts b/packages/network/src/clients/thorest-client/transactions/types.d.ts index 38b347b94..2432fd52e 100644 --- a/packages/network/src/clients/thorest-client/transactions/types.d.ts +++ b/packages/network/src/clients/thorest-client/transactions/types.d.ts @@ -3,8 +3,6 @@ import { type Output, type Clause } from '../blocks'; /** * Transaction clause type for transaction simulation having value only string. - * - * @public */ type SimulateTransactionClause = Clause; @@ -14,8 +12,6 @@ type SimulateTransactionClause = Clause; * Input options for: * * getTransactionReceipt * Methods - * - * @public */ interface GetTransactionReceiptInputOptions { /** @@ -28,8 +24,6 @@ interface GetTransactionReceiptInputOptions { * Input options for: * * getTransaction * Methods - * - * @public */ type GetTransactionInputOptions = GetTransactionReceiptInputOptions & { /** @@ -45,8 +39,6 @@ type GetTransactionInputOptions = GetTransactionReceiptInputOptions & { /** * Type for transaction simulation options. - * - * @public */ interface SimulateTransactionOptions { /** @@ -97,8 +89,6 @@ interface SimulateTransactionOptions { /** * Transaction Metadata interface. - * - * @private */ interface TransactionMetadata { blockID: string; @@ -111,19 +101,21 @@ interface TransactionMetadata { /** * Type for RAW transaction detail. * It is the response of `getTransaction` with `raw` set to `true`. - * - * @private */ interface TransactionDetailRaw { + /** + * Raw data + */ raw: string; + /** + * Transaction meta data + */ meta: Omit; } /** * Type for NO RAW transaction detail. * It is the response of `getTransaction` with `raw` set to `false`. - * - * @private */ type TransactionDetailNoRaw = TransactionBody & { id: string; @@ -135,55 +127,87 @@ type TransactionDetailNoRaw = TransactionBody & { /** * Type for transaction detail. - * - * @public */ type TransactionDetail = TransactionDetailRaw | TransactionDetailNoRaw; /** * Type for transaction receipt. - * - * @public */ interface TransactionReceipt { + /** + * Gas used in the transaction + */ gasUsed: number; + /** + * For delegated transactions the gas payer + * */ gasPayer: string; + /** + * Energy paid for used gas + */ paid: string; + /** + * Energy reward given to block proposer + */ reward: string; + /** + * If the transaction has been reverted + */ reverted: boolean; + /** + * Outputs of the transaction, e.g. contract, events, transfers + */ outputs: Output[]; + /** + * Data associated with the transaction e.g. blockID, blockNumber, txID + */ meta: TransactionMetadata; } /** * Type for transaction call simulation. - * - * @public */ type TransactionCallSimulation = [ { + /** + * Returned data from the simulation + */ data: string; + /** + * Events from the siluation + */ events: TransactionEventsType; + /** + * Details of transfers from the simulation + */ transfers: TransactionTransfersType; + /** + * Gas used from the simulation + */ gasUsed: number; + /** + * If the transaction would be reverted + */ reverted: boolean; + /** + * Details of any VM errors + */ vmError: string; } ]; /** * Type for transaction send result. - * - * @public */ interface TransactionSendResult { + /** + * Transaction id + */ id: string; } /** * Type for transaction call simulation result. - * - * @public */ interface TransactionSimulationResult { /** diff --git a/packages/network/src/utils/const/client/nodes.ts b/packages/network/src/utils/const/client/nodes.ts index 22be4cf56..5caa2a450 100644 --- a/packages/network/src/utils/const/client/nodes.ts +++ b/packages/network/src/utils/const/client/nodes.ts @@ -1,8 +1,6 @@ /** * Node healtcheck Tolerance in seconds. * @example When set to 30, it means that we consider a node healthy even when it's off-sync by roughly 3 blocks. - * - * @public */ const NODE_HEALTHCHECK_TOLERANCE_IN_SECONDS = 30; diff --git a/packages/network/src/utils/http/http-client.ts b/packages/network/src/utils/http/http-client.ts index d0e8fdb34..dc488ff5d 100644 --- a/packages/network/src/utils/http/http-client.ts +++ b/packages/network/src/utils/http/http-client.ts @@ -10,10 +10,11 @@ import { buildError, HTTP_CLIENT } from '@vechainfoundation/vechain-sdk-errors'; * * This class leverages Axios for handling HTTP requests and allows for interaction with HTTP services. * It is configured with a base URL and request timeout upon instantiation. - * - * @public */ class HttpClient { + /** + * Axios instance to make http requests + */ protected readonly axios: AxiosInstance; /** diff --git a/packages/network/src/utils/http/types.d.ts b/packages/network/src/utils/http/types.d.ts index 2190c62d8..ed38bde70 100644 --- a/packages/network/src/utils/http/types.d.ts +++ b/packages/network/src/utils/http/types.d.ts @@ -5,8 +5,6 @@ import { type AxiosInstance } from 'axios'; * * This interface specifies options for configuring an HTTP request, including query parameters, * request body, custom headers, and a function to validate response headers. - * - * @public */ interface HttpParams { /** @@ -33,7 +31,6 @@ interface HttpParams { /** * Represents the options for configuring an HTTP client. - * @public */ interface HttpClientOptions { /** diff --git a/packages/network/src/utils/thorest/thorest.ts b/packages/network/src/utils/thorest/thorest.ts index a2f07a305..7923f82a7 100644 --- a/packages/network/src/utils/thorest/thorest.ts +++ b/packages/network/src/utils/thorest/thorest.ts @@ -1,7 +1,5 @@ /** * Endpoints for the REST API. - * - * @public */ const thorest = { /** diff --git a/typedoc.base.json b/typedoc.base.json index 5ac41dd95..4a8944080 100644 --- a/typedoc.base.json +++ b/typedoc.base.json @@ -10,6 +10,6 @@ "**/node_modules/**" ], "readme": "none", - "excludeReferences": true, "excludePrivate": true, + "excludeInternal": true } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 1823c6a1f..0cc4e4073 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5683,6 +5683,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +typedoc-plugin-missing-exports@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-2.1.0.tgz#f283a407eb7b3a43dafc598f44bbfc2d36dc1704" + integrity sha512-+1DhqZCEu7Vu5APnrqpPwl31D+hXpt1fV0Le9ycCRL1eLVdatdl6KVt4SEVwPxnEpKwgOn2dNX6I9+0F1aO2aA== + typedoc@^0.25.3: version "0.25.3" resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.25.3.tgz#53c6d668e1001b3d488e9a750fcdfb05433554c0"