Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cat tags #169

Merged
merged 3 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/address/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function getContractAddress(from: string, nonce: BigNumberish, data: Byte
*
* The key may be any standard form of public key or a private key.
*
* @category Transaction
* @category Address
* @param {string | SigningKey} key - The key to compute the address for.
*
* @returns {string} The address.
Expand All @@ -120,7 +120,7 @@ export function computeAddress(key: string | SigningKey): string {
/**
* Returns the recovered address for the private key that was used to sign `digest` that resulted in `signature`.
*
* @category Transaction
* @category Address
* @param {BytesLike} digest - The digest of the message.
* @param {SignatureLike} signature - The signature.
*
Expand Down
2 changes: 0 additions & 2 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* Some common constants useful for Ethereum.
*
* @_section: api/constants: Constants [about-constants]
*/

export { ZeroAddress } from './addresses.js';
Expand Down
2 changes: 0 additions & 2 deletions src/contract/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* A **Contract** object is a meta-class (a class whose definition is defined at runtime), which communicates with a
* deployed smart contract on the blockchain and provides a simple JavaScript interface to call methods, send
* transaction, query historic logs and listen for its events.
*
* @_section: api/contract:Contracts [about-contracts]
*/
export { BaseContract, Contract } from './contract.js';

Expand Down
6 changes: 3 additions & 3 deletions src/contract/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { EventFragment, FunctionFragment, Result, Typed } from '../abi/index.js';
import type { ContractTransactionResponse } from './wrappers.js';
import type {
import type {
Provider,
TopicFilter,
QuaiTransactionRequest,
QuaiPreparedTransactionRequest,
TransactionResponse,
TransactionRequest
TransactionRequest,
} from '../providers/index.js';

/**
Expand Down Expand Up @@ -303,7 +303,7 @@ export interface WrappedFallback {
* The most common ContractRunners are [Providers](../classes/Provider) which enable read-only access and
* [Signers](../classes/Signer) which enable write-access.
*
* @category Providers
* @category Contract
*/
export interface ContractRunner {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/contract/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class ContractUnknownEventPayload extends EventPayload<ContractEventName>
readonly log!: Log;

/**
* @_event:
* @ignore
*/
constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log) {
super(contract, listener, filter);
Expand Down
1 change: 0 additions & 1 deletion src/crypto/hmac.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* An **HMAC** enables verification that a given key was used to authenticate a payload.
*
* @_subsection: api/crypto:HMAC [about-hmac]
* @see {@link https://en.wikipedia.org/wiki/HMAC | HMAC - Wikipedia}
*/
import { createHmac } from './crypto.js';
Expand Down
3 changes: 0 additions & 3 deletions src/crypto/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* A fundamental building block of Ethereum is the underlying cryptographic primitives.
*
* @_section: api/crypto:Cryptographic Functions [about-crypto]
*/

null;
Expand Down Expand Up @@ -49,4 +47,3 @@ export { musigCrypto } from './musig.js';
export type { ProgressCallback } from './scrypt.js';

export type { SignatureLike } from './signature.js';

2 changes: 0 additions & 2 deletions src/crypto/keccak.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* Cryptographic hashing functions
*
* @_subsection: api/crypto:Hash Functions [about-crypto-hashing]
*/

import { keccak_256 } from '@noble/hashes/sha3';
Expand Down
2 changes: 0 additions & 2 deletions src/crypto/pbkdf2.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/**
* A **Password-Based Key-Derivation Function** is designed to create a sequence of bytes suitible as a **key** from a
* human-rememberable password.
*
* @_subsection: api/crypto:Passwords [about-pbkdf]
*/

import { pbkdf2Sync } from './crypto.js';
Expand Down
2 changes: 0 additions & 2 deletions src/crypto/random.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* A **Cryptographically Secure Random Value** is one that has been generated with additional care take to prevent
* side-channels from allowing others to detect it and prevent others from through coincidence generate the same
* values.
*
* @_subsection: api/crypto:Random Values [about-crypto-random]
*/
import { randomBytes as crypto_random } from './crypto.js';

Expand Down
2 changes: 0 additions & 2 deletions src/crypto/signing-key.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* Add details about signing here.
*
* @_subsection: api/crypto:Signing [about-signing]
*/

import { secp256k1 } from '@noble/curves/secp256k1';
Expand Down
6 changes: 2 additions & 4 deletions src/encoding/base58.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* Note that Base58 encodes a **numeric** value, not arbitrary bytes, since any zero-bytes on the left would get
* removed. To mitigate this issue most schemes that use Base58 choose specific high-order values to ensure non-zero
* prefixes.
*
* @_subsection: api/utils:Base58 Encoding [about-base58]
*/

import { getBytes } from '../utils/data.js';
Expand Down Expand Up @@ -37,7 +35,7 @@ const BN_58 = BigInt(58);
/**
* Encode `value` as a Base58-encoded string.
*
* @category Utils
* @category Encoding
* @param {BytesLike} _value - The value to encode.
*
* @returns {string} The Base58-encoded string.
Expand Down Expand Up @@ -66,7 +64,7 @@ export function encodeBase58(_value: BytesLike): string {
/**
* Decode the Base58-encoded `value`.
*
* @category Utils
* @category Encoding
* @param {string} value - The Base58-encoded value.
*
* @returns {bigint} The decoded value.
Expand Down
6 changes: 2 additions & 4 deletions src/encoding/base64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* [Base64 encoding](https://en.wikipedia.org/wiki/Base64) using 6-bit words to encode arbitrary bytes into a string
* using 65 printable symbols, the upper-case and lower-case alphabet, the digits `0` through `9`, `"+"` and `"/"` with
* the `"="` used for padding.
*
* @_subsection: api/utils:Base64 Encoding [about-base64]
*/
import { getBytes, getBytesCopy } from '../utils/data.js';

Expand All @@ -12,7 +10,7 @@ import type { BytesLike } from '../utils/data.js';
/**
* Decodes the base-64 encoded `value`.
*
* @category Utils
* @category Encoding
* @example
*
* ```ts
Expand Down Expand Up @@ -40,7 +38,7 @@ export function decodeBase64(value: string): Uint8Array {
/**
* Encodes `data` as a base-64 encoded string.
*
* @category Utils
* @category Encoding
* @example
*
* ```ts
Expand Down
12 changes: 6 additions & 6 deletions src/encoding/proto-decode.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ProtoTransaction } from "../transaction/abstract-transaction.js";
import { ProtoWorkObject } from "../transaction/work-object.js";
import * as Proto from "./protoc/proto_block.js"
import { ProtoTransaction } from '../transaction/abstract-transaction.js';
import { ProtoWorkObject } from '../transaction/work-object.js';
import * as Proto from './protoc/proto_block.js';

/**
* @category Utils
* @category Encoding
* @param {Uint8Array} bytes - Write variable description
*
* @returns {ProtoTransaction} Write return description
Expand All @@ -15,11 +15,11 @@ export function decodeProtoTransaction(bytes: Uint8Array): ProtoTransaction {
if (result.to?.length == 0) {
result.to = null;
}
return result
return result;
}

/**
* @category Utils
* @category Encoding
* @param {Uint8Array} bytes - Write variable description
*
* @returns {ProtoWorkObject} Write return description
Expand Down
12 changes: 6 additions & 6 deletions src/encoding/proto-encode.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ProtoTransaction } from "../transaction/abstract-transaction.js";
import { ProtoWorkObject } from "../transaction/work-object.js";
import { hexlify } from "../utils/index.js";
import * as Proto from "./protoc/proto_block.js"
import { ProtoTransaction } from '../transaction/abstract-transaction.js';
import { ProtoWorkObject } from '../transaction/work-object.js';
import { hexlify } from '../utils/index.js';
import * as Proto from './protoc/proto_block.js';

/**
* @category Utils
* @category Encoding
* @param {ProtoTransaction} protoTx - Write variable description
*
* @returns {string} Write return description
Expand All @@ -16,7 +16,7 @@ export function encodeProtoTransaction(protoTx: ProtoTransaction): string {
}

/**
* @category Utils
* @category Encoding
* @param {ProtoWorkObject} protoWo - Write variable description
*
* @returns {string} Write return description
Expand Down
14 changes: 7 additions & 7 deletions src/encoding/utf8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { BytesLike } from '../utils/index.js';
/**
* The stanard normalization forms.
*
* @category Utils
* @category Encoding
*/
export type UnicodeNormalizationForm = 'NFC' | 'NFD' | 'NFKC' | 'NFKD';

Expand All @@ -40,7 +40,7 @@ export type UnicodeNormalizationForm = 'NFC' | 'NFD' | 'NFKC' | 'NFKD';
* **`"OVERLONG"`** - the string is an overlong representation. The `badCodepoint` indicates the computed codepoint,
* which has already been bounds checked.
*
* @category Utils
* @category Encoding
*/
export type Utf8ErrorReason =
| 'UNEXPECTED_CONTINUE'
Expand Down Expand Up @@ -69,7 +69,7 @@ export type Utf8ErrorReason =
*
* The function should return the number of bytes that should be skipped when control resumes to the FSM.
*
* @category Utils
* @category Encoding
*/
export type Utf8ErrorFunc = (
reason: Utf8ErrorReason,
Expand Down Expand Up @@ -160,7 +160,7 @@ function replaceFunc(
* **`"replace"`** - replace any illegal UTF-8 sequence with the UTF-8 replacement character (i.e. `"\\ufffd"`) and
* accepts non-canonical (overlong) codepoints
*
* @category Utils
* @category Encoding
* @returns Record<"error" | "ignore" | "replace", Utf8ErrorFunc>
*/
export const Utf8ErrorFuncs: Readonly<Record<'error' | 'ignore' | 'replace', Utf8ErrorFunc>> = Object.freeze({
Expand Down Expand Up @@ -276,7 +276,7 @@ function getUtf8CodePoints(_bytes: BytesLike, onError?: Utf8ErrorFunc): Array<nu
*
* If `form` is specified, the string is normalized.
*
* @category Utils
* @category Encoding
* @param {string} str - The string to convert.
* @param {UnicodeNormalizationForm} [form] - The normalization form to use.
*
Expand Down Expand Up @@ -339,7 +339,7 @@ function _toUtf8String(codePoints: Array<number>): string {
* When `onError` function is specified, it is called on UTF-8 errors allowing recovery using the
* {@link Utf8ErrorFunc | **Utf8ErrorFunc**} API. (default: [error](Utf8ErrorFuncs))
*
* @category Utils
* @category Encoding
* @param {BytesLike} bytes - The UTF-8 data to convert.
* @param {Utf8ErrorFunc} [onError] - The error handling function.
*
Expand All @@ -354,7 +354,7 @@ export function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string
*
* If `form` is specified, the string is normalized.
*
* @category Utils
* @category Encoding
* @param {string} str - The string to convert.
* @param {UnicodeNormalizationForm} [form] - The normalization form to use.
*
Expand Down
2 changes: 0 additions & 2 deletions src/hash/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* Utilities for common tasks involving hashing. Also see [cryptographic hashing](about-crypto-hashing).
*
* @_section: api/hashing:Hashing Utilities [about-hashing]
*/

export { id } from './id.js';
Expand Down
11 changes: 4 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/**
* The Application Programming Interface (API) is the collection of
* functions, classes and types offered by the quais library.
*
* @_section: api:Application Programming Interface [about-api]
* @_navTitle: API
* The Application Programming Interface (API) is the collection of functions, classes and types offered by the quais
* library.
*/
import * as quais from "./quais.js";
import * as quais from './quais.js';

export { quais };

export * from "./quais.js";
export * from './quais.js';
2 changes: 0 additions & 2 deletions src/providers/abstract-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* The available providers should suffice for most developers purposes, but the
* {@link AbstractProvider | **AbstractProvider**} class has many features which enable sub-classing it for specific
* purposes.
*
* @section api/providers/abstract-provider: Subclassing Provider [abstract-provider]
*/

// @TODO
Expand Down
6 changes: 0 additions & 6 deletions src/providers/formatting.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/**
* About provider formatting?
*
* @section api/providers/formatting:Formatting [provider-formatting]
*/

import type { Signature } from '../crypto/index.js';
import type { AccessList, TxInput, TxOutput } from '../transaction/index.js';

Expand Down
6 changes: 2 additions & 4 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
*
* It is one of the most fundamental components of interacting with a blockchain application, and there are many ways to
* connect, such as over HTTP, WebSockets or injected providers such as [MetaMask](https://metamask.io/).
*
* @_section: api/providers:Providers [about-providers]
*/

export { AbstractProvider, UnmanagedSubscriber } from './abstract-provider.js';

export { Network } from './network.js';

export { JsonRpcApiProvider, JsonRpcProvider } from "./provider-jsonrpc.js"
export { JsonRpcApiProvider, JsonRpcProvider } from './provider-jsonrpc.js';

export { BrowserProvider } from './provider-browser.js';

Expand Down Expand Up @@ -82,4 +80,4 @@ export type {
QiJsonRpcTransactionRequest,
} from './provider-jsonrpc.js';

export type { WebSocketCreator, WebSocketLike } from './provider-websocket.js';
export type { WebSocketCreator, WebSocketLike } from './provider-websocket.js';
4 changes: 0 additions & 4 deletions src/providers/network.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* A **Network** encapsulates the various properties required to interact with a specific chain.
*
* @_subsection: api/providers:Networks [networks]
*/

import { getBigInt, assertArgument } from '../utils/index.js';
Expand All @@ -28,7 +26,6 @@ export type Networkish =
chainId?: number;
};


const Networks: Map<string | bigint, () => Network> = new Map();

/**
Expand Down Expand Up @@ -141,7 +138,6 @@ export class Network {
* @returns {Network} The Network instance.
*/
static from(network?: Networkish): Network {

// Default network
if (network == null) {
return Network.from('mainnet');
Expand Down
Loading
Loading