Skip to content

Commit

Permalink
Chore/223 (#290)
Browse files Browse the repository at this point in the history
* chore: missing docs

* chore: remove public

---------

Co-authored-by: Fabio Rigamonti <[email protected]>
  • Loading branch information
claytonneal and fabiorigam authored Nov 23, 2023
1 parent 7a7b173 commit 0a94b66
Show file tree
Hide file tree
Showing 39 changed files with 143 additions and 159 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -50,6 +51,7 @@
"tsup": "^7.2.0",
"turbo": "^1.10.15",
"typedoc": "^0.25.3",
"typedoc-plugin-missing-exports": "^2.1.0",
"typescript": "*"
}
}
7 changes: 0 additions & 7 deletions packages/core/src/abi/fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ class Function<ABIType> {
/**
* The main fragment handled by ethers.js.
*
* @public
*/
public fragment: FunctionFragment;

/**
* The main interface handled by ethers.js.
*
* @public
*/
public iface: Interface;

Expand Down Expand Up @@ -146,15 +143,11 @@ class Function<ABIType> {
class Event<ABIType> {
/**
* The main fragment handled by ethers.js.
*
* @public
*/
public fragment: ethers.EventFragment;

/**
* The main interface handled by ethers.js.
*
* @public
*/
public iface: Interface;

Expand Down
12 changes: 0 additions & 12 deletions packages/core/src/abi/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/hash/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { type BytesLike } from 'ethers';

/**
* Input to hash function.
*
* @public
*/
type HashInput = BytesLike;

Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/hdnode/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
10 changes: 0 additions & 10 deletions packages/core/src/keystore/types.d.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -20,8 +16,6 @@ interface ScryptParams {

/**
* PBKDF2SHA256 parameters for keystore encryption
*
* @public
*/
interface PBKDF2SHA256Params {
c: number;
Expand All @@ -33,8 +27,6 @@ interface PBKDF2SHA256Params {
/**
* Keystore type.
* Output of encryption function.
*
* @public
*/
interface Keystore {
crypto: {
Expand All @@ -55,8 +47,6 @@ interface Keystore {
/**
* Keystore account type
* Output of decryption function.
*
* @public
*/
interface KeystoreAccount {
address: string;
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/mnemonic/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* Type of the wordlist size.
* Every 4 bytes produce 3 words.
* @public
*/
type WordlistSizeType = 12 | 15 | 18 | 21 | 24;

Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/transaction/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Simple type for transaction clause.
* @public
*/
interface TransactionClause {
/**
Expand All @@ -25,7 +24,6 @@ interface TransactionClause {

/**
* Type for transaction body.
* @public
*/
interface TransactionBody {
/**
Expand Down Expand Up @@ -105,6 +103,9 @@ interface TransactionBody {
* Tx feature bits
*/
features?: number;
/**
* Unused
*/
unused?: Buffer[];
};
}
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/utils/const/data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Zero buffer
* @public
* @internal
*
* @example ZERO_BUFFER(8) -> 0x00000000 , ... , ZERO_BUFFER(n) -> 0x0...0
*/
Expand All @@ -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]*$/;

Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/utils/const/hdnode.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
/**
* Default VET derivation path.
* @public
*
* See https://github.com/satoshilabs/slips/blob/master/slip-0044.md for more info.
*/
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');

Expand Down
1 change: 0 additions & 1 deletion packages/core/src/utils/const/keystore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Keystore Scrypt params
* @public
*/
const SCRYPT_PARAMS = {
N: 131072,
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/utils/const/mnemonic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { type WordlistSizeType } from '../../mnemonic';

/**
* Mnemonic wordlist size
* @public
*/
const MNEMONIC_WORDLIST_ALLOWED_SIZES: WordlistSizeType[] = [
12, 15, 18, 21, 24
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/const/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/const/secp256k1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Biggest value of private key
* @public
* @internal
*/
const PRIVATE_KEY_MAX_VALUE = Buffer.from(
'fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141',
Expand Down
17 changes: 12 additions & 5 deletions packages/core/src/utils/const/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
/**
Expand Down Expand Up @@ -96,7 +100,7 @@ const TRANSACTION_FIELDS = [

/**
* Kind for transaction features
* @public
* @internal
*/
const TRANSACTION_FEATURES_KIND = {
name: 'reserved.features',
Expand All @@ -105,6 +109,7 @@ const TRANSACTION_FEATURES_KIND = {

/**
* Kind for transaction signature
* @internal
*/
const TRANSACTION_SIGNATURE_KIND = {
name: 'signature',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/utils/data/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/**
* Confirugation for hex values.
* In particular, whether or not to include the `0x` prefix.
*
* @public
*/
interface HexConfig {
withPrefix: boolean;
Expand Down
2 changes: 0 additions & 2 deletions packages/errors/src/model/core/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ class ContractInterfaceError extends ErrorBase<

/**
* Errors enum.
*
* @public
*/
enum ABI {
INVALID_FUNCTION = 'INVALID_FUNCTION',
Expand Down
2 changes: 0 additions & 2 deletions packages/errors/src/model/core/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class InvalidAddressError extends ErrorBase<

/**
* Errors enum.
*
* @public
*/
enum ADDRESS {
INVALID_ADDRESS = 'INVALID_ADDRESS'
Expand Down
2 changes: 0 additions & 2 deletions packages/errors/src/model/core/bloom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class InvalidKError extends ErrorBase<BLOOM.INVALID_K, DefaultErrorData> {}

/**
* Errors enum.
*
* @public
*/
enum BLOOM {
INVALID_BLOOM = 'INVALID_BLOOM',
Expand Down
2 changes: 0 additions & 2 deletions packages/errors/src/model/core/certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class CertificateInvalidSignerError extends ErrorBase<

/**
* Errors enum.
*
* @public
*/
enum CERTIFICATE {
CERTIFICATE_NOT_SIGNED = 'CERTIFICATE_NOT_SIGNED',
Expand Down
Loading

1 comment on commit 0a94b66

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Coverage

Summary

Lines Statements Branches Functions
Coverage: 100%
100% (1094/1094) 100% (261/261) 100% (218/218)
Title Tests Skipped Failures Errors Time
core 319 0 💤 0 ❌ 0 🔥 1m 16s ⏱️
network 71 0 💤 0 ❌ 0 🔥 37.986s ⏱️
errors 30 0 💤 0 ❌ 0 🔥 9.383s ⏱️

Please sign in to comment.