diff --git a/src.ts/_admin/update-changelog.ts b/src.ts/_admin/update-changelog.ts index 7f02cf7e96..a825dfcc55 100644 --- a/src.ts/_admin/update-changelog.ts +++ b/src.ts/_admin/update-changelog.ts @@ -128,7 +128,7 @@ type PresentVersion = { } // If this is a new version (not present in npm) add the changes - // from the lastest version until HEAD. + // from the latest version until HEAD. const curVer = loadJson(resolve("package.json")).version; if (curVer !== lastVer) { // Include any present entry, as it was placed here by a @@ -140,7 +140,7 @@ type PresentVersion = { entries.push(pres); } - // Also include theentry from git + // Also include the entry from git const latest = await getChanges(lastVer.gitHead, "HEAD"); if (latest.length) { entries.push({ @@ -151,7 +151,7 @@ type PresentVersion = { } } - // Gerenate the CHANGELOG.md output + // Generate the CHANGELOG.md output const output: Array = [ ]; output.push("Change Log"); output.push("=========="); diff --git a/src.ts/_tests/test-providers-errors.ts b/src.ts/_tests/test-providers-errors.ts index 9ee7fc9e61..fbadcd78ad 100644 --- a/src.ts/_tests/test-providers-errors.ts +++ b/src.ts/_tests/test-providers-errors.ts @@ -74,7 +74,7 @@ describe("Tests Provider Call Exception", function() { assert.equal(error.action, method, `error.action == ${ method }`); assert.equal(error.reason, `Panic due to ${ reason }(${ code })`, "error.reason"); - // Check the transaciton + // Check the transaction assert.equal(error.transaction.to, tx.to, `error.transaction.to`); assert.equal(error.transaction.data, tx.data, `error.transaction.data`); diff --git a/src.ts/_tests/test-utils-maths.ts b/src.ts/_tests/test-utils-maths.ts index a22339f58e..3c15db4f5f 100644 --- a/src.ts/_tests/test-utils-maths.ts +++ b/src.ts/_tests/test-utils-maths.ts @@ -190,14 +190,14 @@ describe("Tests Twos Compliemnts Functions", function() { ]; for (const { twos, width, value } of tests) { - it(`computes twos compliment values: ${ value }[${ width } bits]`, function() { + it(`computes twos complement values: ${ value }[${ width } bits]`, function() { const result = toTwos(value, width); assert.equal(result, twos); }); } for (const { twos, width, value } of tests) { - it(`computes values from twos compliment: ${ value }[${ width } bits]`, function() { + it(`computes values from twos complement: ${ value }[${ width } bits]`, function() { const result = fromTwos(twos, width); assert.equal(result, value); }); diff --git a/src.ts/abi/coders/abstract-coder.ts b/src.ts/abi/coders/abstract-coder.ts index 99f635edef..42cef1aaf0 100644 --- a/src.ts/abi/coders/abstract-coder.ts +++ b/src.ts/abi/coders/abstract-coder.ts @@ -457,7 +457,7 @@ export class Reader { // Allows incomplete unpadded data to be read; otherwise an error // is raised if attempting to overrun the buffer. This is required // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. + // external (not public though) was tightly packed. readonly allowLoose!: boolean; readonly #data: Uint8Array; diff --git a/src.ts/abi/fragments.ts b/src.ts/abi/fragments.ts index 202b7a93f7..def45df394 100644 --- a/src.ts/abi/fragments.ts +++ b/src.ts/abi/fragments.ts @@ -152,7 +152,7 @@ const regexWhitespacePrefix = new RegExp("^(\\s*)"); const regexNumberPrefix = new RegExp("^([0-9]+)"); const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -// Parser regexs to check validity +// Parser regexes to check validity const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); @@ -669,7 +669,7 @@ export class ParamType { /** * Returns true if %%this%% is an Array type. * - * This provides a type gaurd ensuring that [[arrayChildren]] + * This provides a type guard ensuring that [[arrayChildren]] * and [[arrayLength]] are non-null. */ isArray(): this is (ParamType & { arrayChildren: ParamType, arrayLength: number }) { @@ -679,7 +679,7 @@ export class ParamType { /** * Returns true if %%this%% is a Tuple type. * - * This provides a type gaurd ensuring that [[components]] + * This provides a type guard ensuring that [[components]] * is non-null. */ isTuple(): this is (ParamType & { components: ReadonlyArray }) { @@ -689,7 +689,7 @@ export class ParamType { /** * Returns true if %%this%% is an Indexable type. * - * This provides a type gaurd ensuring that [[indexed]] + * This provides a type guard ensuring that [[indexed]] * is non-null. */ isIndexable(): this is (ParamType & { indexed: boolean }) { @@ -936,8 +936,8 @@ export abstract class Fragment { abstract format(format?: FormatType): string; /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. + * Creates a new **Fragment** for %%obj%%, which can be any supported + * ABI fragment type. */ static from(obj: any): Fragment { if (typeof(obj) === "string") { @@ -984,7 +984,7 @@ export abstract class Fragment { }); } - assertArgument(false, "unsupported frgament object", "obj", obj); + assertArgument(false, "unsupported fragment object", "obj", obj); } /** diff --git a/src.ts/abi/typed.ts b/src.ts/abi/typed.ts index 346b2d570a..87207b9126 100644 --- a/src.ts/abi/typed.ts +++ b/src.ts/abi/typed.ts @@ -131,9 +131,9 @@ export class Typed { /** * @_ignore: */ - constructor(gaurd: any, type: string, value: any, options?: any) { + constructor(guard: any, type: string, value: any, options?: any) { if (options == null) { options = null; } - assertPrivate(_gaurd, gaurd, "Typed"); + assertPrivate(_gaurd, guard, "Typed"); defineProperties(this, { _typedSymbol, type, value }); this.#options = options; diff --git a/src.ts/address/address.ts b/src.ts/address/address.ts index 9398027b68..b1d441f8bb 100644 --- a/src.ts/address/address.ts +++ b/src.ts/address/address.ts @@ -98,7 +98,7 @@ function fromBase36(value: string): bigint { * If you wish the checksum of %%address%% to be ignore, it should * be converted to lower-case (i.e. ``.toLowercase()``) before * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect + * that you wish to bypass the safeguards in place to protect * against an address that has been incorrectly copied from another * source. * diff --git a/src.ts/address/index.ts b/src.ts/address/index.ts index 4feb02b7f9..aa1b4954fa 100644 --- a/src.ts/address/index.ts +++ b/src.ts/address/index.ts @@ -17,7 +17,7 @@ null; /** * An interface for objects which have an address, and can - * resolve it asyncronously. + * resolve it asynchronously. * * This allows objects such as [[Signer]] or [[Contract]] to * be used most places an address can be, for example getting @@ -42,7 +42,7 @@ export interface NameResolver { /** * Resolve to the address for the ENS %%name%%. * - * Resolves to ``null`` if the name is unconfigued. Use + * Resolves to ``null`` if the name is unconfigured. Use * [[resolveAddress]] (passing this object as %%resolver%%) to * throw for names that are unconfigured. */ diff --git a/src.ts/contract/contract.ts b/src.ts/contract/contract.ts index b0595fc9d8..782dce4425 100644 --- a/src.ts/contract/contract.ts +++ b/src.ts/contract/contract.ts @@ -431,7 +431,7 @@ type Sub = { }; -// The combination of TypeScrype, Private Fields and Proxies makes +// The combination of TypeScript, Private Fields and Proxies makes // the world go boom; so we hide variables with some trickery keeping // a symbol attached to each BaseContract which its sub-class (even // via a Proxy) can reach and use to look up its internal values. @@ -643,7 +643,7 @@ export class BaseContract implements Addressable, EventEmitterable { - // We have the deployement transaction; just use that (throws if deployement fails) + // We have the deployment transaction; just use that (throws if deployment fails) const deployTx = this.deploymentTransaction(); if (deployTx) { await deployTx.wait(); @@ -884,7 +884,7 @@ export class BaseContract implements Addressable, EventEmitterable(key: string | FunctionFragment): T { if (typeof(key) !== "string") { key = key.format(); } @@ -895,7 +895,7 @@ export class BaseContract implements Addressable, EventEmitterable).add(child); } @@ -343,7 +343,7 @@ export class TypedDataEncoder { } /** - * Returnthe encoder for the specific %%type%%. + * Return the encoder for the specific %%type%%. */ getEncoder(type: string): (value: any) => string { let encoder = this.#encoderCache.get(type); @@ -464,7 +464,7 @@ export class TypedDataEncoder { } /** - * Call %%calback%% for each value in %%value%%, passing the type and + * Call %%callback%% for each value in %%value%%, passing the type and * component within %%value%%. * * This is useful for replacing addresses or other transformation that diff --git a/src.ts/providers/abstract-provider.ts b/src.ts/providers/abstract-provider.ts index 0d75b435cc..01b8bf8ee9 100644 --- a/src.ts/providers/abstract-provider.ts +++ b/src.ts/providers/abstract-provider.ts @@ -9,7 +9,7 @@ // @TODO // Event coalescence // When we register an event with an async value (e.g. address is a Signer -// or ENS name), we need to add it immeidately for the Event API, but also +// or ENS name), we need to add it immediately for the Event API, but also // need time to resolve the address. Upon resolving the address, we need to // migrate the listener to the static event. We also need to maintain a map // of Signer/ENS name to address so we can sync respond to listenerCount. @@ -190,7 +190,7 @@ export interface Subscriber { */ export class UnmanagedSubscriber implements Subscriber { /** - * The name fof the event. + * The name for the event. */ name!: string; @@ -1236,7 +1236,7 @@ export class AbstractProvider implements Provider { return null; } - // Something reerted + // Something reverted if (isError(error, "CALL_EXCEPTION")) { return null; } throw error; @@ -1548,7 +1548,7 @@ export class AbstractProvider implements Provider { // Stop all listeners this.removeAllListeners(); - // Shut down all tiemrs + // Shut down all timers for (const timerId of this.#timers.keys()) { this._clearTimeout(timerId); } @@ -1618,7 +1618,7 @@ export class AbstractProvider implements Provider { let timeout = timer.time; if (timeout < 0) { timeout = 0; } - // Start time (in cause paused, so we con compute remaininf time) + // Start time (in cause paused, so we con compute remaining time) timer.time = getTime(); // Start the timer diff --git a/src.ts/providers/abstract-signer.ts b/src.ts/providers/abstract-signer.ts index 3087624d85..b40b745327 100644 --- a/src.ts/providers/abstract-signer.ts +++ b/src.ts/providers/abstract-signer.ts @@ -1,7 +1,7 @@ /** * Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes * are sufficent for most developers, but this is provided to - * fascilitate more complex Signers. + * facilitate more complex Signers. * * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] */ @@ -52,7 +52,7 @@ async function populate(signer: AbstractSigner, tx: TransactionRequest): Promise /** - * An **AbstractSigner** includes most of teh functionality required + * An **AbstractSigner** includes most of the functionality required * to get a [[Signer]] working as expected, but requires a few * Signer-specific methods be overridden. * @@ -185,7 +185,7 @@ export abstract class AbstractSigner

2) { quorum = 2; } - // Testnets don't need as strong a security gaurantee and speed is + // Testnets don't need as strong a security guarantee and speed is // more useful during testing if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) { quorum = 1; } diff --git a/src.ts/providers/ens-resolver.ts b/src.ts/providers/ens-resolver.ts index 5265be133f..152f07048d 100644 --- a/src.ts/providers/ens-resolver.ts +++ b/src.ts/providers/ens-resolver.ts @@ -39,7 +39,7 @@ function getIpfsLink(link: string): string { } /** - * The type of data found during a steip during avatar resolution. + * The type of data found during a step during avatar resolution. */ export type AvatarLinkageType = "name" | "avatar" | "!avatar" | "url" | "data" | "ipfs" | "erc721" | "erc1155" | "!erc721-caip" | "!erc1155-caip" | @@ -68,7 +68,7 @@ export interface AvatarLinkage { * steps involved, fetching metadata, validating results, et cetera. * * Some applications may wish to analyse this data, or use this data - * to diagnose promblems, so an **AvatarResult** provides details of + * to diagnose problems, so an **AvatarResult** provides details of * each completed step during avatar resolution. */ export interface AvatarResult { @@ -324,7 +324,7 @@ export class EnsResolver { } /** - * Rsolves to the content-hash or ``null`` if unconfigured. + * Resolves to the content-hash or ``null`` if unconfigured. */ async getContentHash(): Promise { // keccak256("contenthash()") diff --git a/src.ts/providers/formatting.ts b/src.ts/providers/formatting.ts index d0637bb204..3ba8dc9bc3 100644 --- a/src.ts/providers/formatting.ts +++ b/src.ts/providers/formatting.ts @@ -127,7 +127,7 @@ export interface BlockParams { */ export interface LogParams { /** - * The transaction hash for the transaxction the log occurred in. + * The transaction hash for the transaction the log occurred in. */ transactionHash: string; @@ -145,7 +145,7 @@ export interface LogParams { /** * Whether this log was removed due to the transaction it was included - * in being removed dur to an orphaned block. + * in being removed due to an orphaned block. */ removed: boolean; @@ -186,7 +186,7 @@ export interface LogParams { export interface TransactionReceiptParams { /** * The target of the transaction. If null, the transaction was trying - * to deploy a transaction with the ``data`` as the initi=code. + * to deploy a transaction with the ``data`` as the initcode. */ to: null | string; @@ -234,7 +234,7 @@ export interface TransactionReceiptParams { logs: ReadonlyArray; /** - * The amount of gas consumed executing this transaciton. + * The amount of gas consumed executing this transaction. */ gasUsed: bigint; diff --git a/src.ts/providers/index.ts b/src.ts/providers/index.ts index 47316dd2a1..ed121ce5fe 100644 --- a/src.ts/providers/index.ts +++ b/src.ts/providers/index.ts @@ -1,5 +1,5 @@ /** - * A **Provider** provides a connection to the blockchain, whch can be + * A **Provider** provides a connection to the blockchain, which can be * used to query its current state, simulate execution and send transactions * to update the state. * diff --git a/src.ts/providers/network.ts b/src.ts/providers/network.ts index 46d2aacd7d..4c9ff985e0 100644 --- a/src.ts/providers/network.ts +++ b/src.ts/providers/network.ts @@ -19,7 +19,7 @@ import type { NetworkPlugin } from "./plugins-network.js"; /** - * A Networkish can be used to allude to a Network, by specifing: + * A Networkish can be used to allude to a Network, by specifying: * - a [[Network]] object * - a well-known (or registered) network name * - a well-known (or registered) chain ID @@ -87,7 +87,7 @@ export class Network { /** * The network common name. * - * This is the canonical name, as networks migh have multiple + * This is the canonical name, as networks might have multiple * names. */ get name(): string { return this.#name; } @@ -168,7 +168,7 @@ export class Network { } /** - * Gets a list of all plugins that match %%name%%, with otr without + * Gets a list of all plugins that match %%name%%, with or without * a fragment. */ getPlugins(basename: string): Array { @@ -307,7 +307,7 @@ function parseUnits(_value: number | string, decimals: number): bigint { throw new Error(`invalid gwei value: ${ _value }`); } - // Pad the fraction to 9 decimalplaces + // Pad the fraction to 9 decimal places while (comps[1].length < decimals) { comps[1] += "0"; } // Too many decimals and some non-zero ending, take the ceiling diff --git a/src.ts/providers/plugin-fallback.ts b/src.ts/providers/plugin-fallback.ts index 777b128a58..5ce34e0e42 100644 --- a/src.ts/providers/plugin-fallback.ts +++ b/src.ts/providers/plugin-fallback.ts @@ -18,7 +18,7 @@ export class CheckQualifiedPlugin implements AbstractProviderPlugin { return this; } - // Retruns true if this value should be considered qualified for + // Returns true if this value should be considered qualified for // inclusion in the quorum. isQualified(action: PerformActionRequest, result: any): boolean { return true; diff --git a/src.ts/providers/provider-etherscan.ts b/src.ts/providers/provider-etherscan.ts index 469417b9d4..11a3bfae23 100644 --- a/src.ts/providers/provider-etherscan.ts +++ b/src.ts/providers/provider-etherscan.ts @@ -649,7 +649,7 @@ export class EtherscanProvider extends AbstractProvider { /** * Resolves to a [Contract]] for %%address%%, using the - * Etherscan API to retreive the Contract ABI. + * Etherscan API to retrieve the Contract ABI. */ async getContract(_address: string): Promise { let address = this._getAddress(_address); diff --git a/src.ts/providers/provider-fallback.ts b/src.ts/providers/provider-fallback.ts index 342359a58b..29c01f58c4 100644 --- a/src.ts/providers/provider-fallback.ts +++ b/src.ts/providers/provider-fallback.ts @@ -168,7 +168,7 @@ export type FallbackProviderOptions = { quorum?: number; // How many providers must have reported the same event - // for it to be emitted (currently unimplmented) + // for it to be emitted (currently unimplemented) eventQuorum?: number; // How many providers to dispatch each event to simultaneously. @@ -358,7 +358,7 @@ export class FallbackProvider extends AbstractProvider { /** * The number of backends that must agree on a value before it is - * accpeted. + * accepted. */ readonly quorum: number; @@ -733,7 +733,7 @@ export class FallbackProvider extends AbstractProvider { // Check for a legit broadcast error (one which we cannot // recover from; some nodes may return the following red // herring events: - // - alredy seend (UNKNOWN_ERROR) + // - already seen (UNKNOWN_ERROR) // - NONCE_EXPIRED // - REPLACEMENT_UNDERPRICED const result = checkQuorum(this.quorum, >results.filter((r) => (r != null))); diff --git a/src.ts/providers/provider-jsonrpc.ts b/src.ts/providers/provider-jsonrpc.ts index f59cc77ecb..0e4414f111 100644 --- a/src.ts/providers/provider-jsonrpc.ts +++ b/src.ts/providers/provider-jsonrpc.ts @@ -300,7 +300,7 @@ export class JsonRpcSigner extends AbstractSigner { return this.address; } - // JSON-RPC will automatially fill in nonce, etc. so we just check from + // JSON-RPC will automatically fill in nonce, etc. so we just check from async populateTransaction(tx: TransactionRequest): Promise> { return await this.populateCall(tx); } @@ -609,7 +609,7 @@ export abstract class JsonRpcApiProvider extends AbstractProvider { } } else if (staticNetwork) { - // Make sure any static network is compatbile with the provided netwrok + // Make sure any static network is compatible with the provided network assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); this.#network = staticNetwork; @@ -794,7 +794,7 @@ export abstract class JsonRpcApiProvider extends AbstractProvider { */ _getSubscriber(sub: Subscription): Subscriber { - // Pending Filters aren't availble via polling + // Pending Filters aren't available via polling if (sub.type === "pending") { return new FilterIdPendingSubscriber(this); } if (sub.type === "event") { diff --git a/src.ts/providers/provider-socket.ts b/src.ts/providers/provider-socket.ts index db14b70e84..dfd426e2d8 100644 --- a/src.ts/providers/provider-socket.ts +++ b/src.ts/providers/provider-socket.ts @@ -136,7 +136,7 @@ export class SocketBlockSubscriber extends SocketSubscriber { } /** - * A **SocketPendingSubscriber** listens for pending transacitons and emits + * A **SocketPendingSubscriber** listens for pending transactions and emits * ``"pending"`` events. */ export class SocketPendingSubscriber extends SocketSubscriber { @@ -250,7 +250,7 @@ export class SocketProvider extends JsonRpcApiProvider { } /** - * Register a new subscriber. This is used internalled by Subscribers + * Register a new subscriber. This is used internally by Subscribers * and generally is unecessary unless extending capabilities. */ _register(filterId: number | string, subscriber: SocketSubscriber): void { diff --git a/src.ts/providers/provider-websocket.ts b/src.ts/providers/provider-websocket.ts index ee1cf847fa..153f0a2323 100644 --- a/src.ts/providers/provider-websocket.ts +++ b/src.ts/providers/provider-websocket.ts @@ -33,7 +33,7 @@ export type WebSocketCreator = () => WebSocketLike; * WebSockets are often preferred because they retain a live connection * to a server, which permits more instant access to events. * - * However, this incurs higher server infrasturture costs, so additional + * However, this incurs higher server infrastructure costs, so additional * resources may be required to host your own WebSocket nodes and many * third-party services charge additional fees for WebSocket endpoints. */ diff --git a/src.ts/providers/signer-noncemanager.ts b/src.ts/providers/signer-noncemanager.ts index 724bfe89ed..91b60ea9ac 100644 --- a/src.ts/providers/signer-noncemanager.ts +++ b/src.ts/providers/signer-noncemanager.ts @@ -56,7 +56,7 @@ export class NonceManager extends AbstractSigner { } /** - * Manually increment the nonce. This may be useful when managng + * Manually increment the nonce. This may be useful when managing * offline transactions. */ increment(): void { diff --git a/src.ts/transaction/transaction.ts b/src.ts/transaction/transaction.ts index 883aa9c122..d784884af4 100644 --- a/src.ts/transaction/transaction.ts +++ b/src.ts/transaction/transaction.ts @@ -1086,7 +1086,7 @@ export class Transaction implements TransactionLike { } /** - * Create a copy of this transaciton. + * Create a copy of this transaction. */ clone(): Transaction { return Transaction.from(this); diff --git a/src.ts/utils/errors.ts b/src.ts/utils/errors.ts index f90e94ce29..7194454937 100644 --- a/src.ts/utils/errors.ts +++ b/src.ts/utils/errors.ts @@ -69,7 +69,7 @@ function stringify(value: any): any { * All errors emitted by ethers have an **ErrorCode** to help * identify and coalesce errors to simplify programmatic analysis. * - * Each **ErrorCode** is the %%code%% proerty of a coresponding + * Each **ErrorCode** is the %%code%% property of a corresponding * [[EthersError]]. * * **Generic Errors** diff --git a/src.ts/utils/events.ts b/src.ts/utils/events.ts index 532cb404b1..4359c373e6 100644 --- a/src.ts/utils/events.ts +++ b/src.ts/utils/events.ts @@ -70,7 +70,7 @@ export interface EventEmitterable { /** * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is + * callback always has one additional argument passed, which is * an **EventPayload**. */ export class EventPayload { diff --git a/src.ts/utils/fixednumber.ts b/src.ts/utils/fixednumber.ts index cc364af742..47ce6f819c 100644 --- a/src.ts/utils/fixednumber.ts +++ b/src.ts/utils/fixednumber.ts @@ -191,7 +191,7 @@ function toString(val: bigint, decimals: number) { * arithmetic field. * * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. + * values which have decimal places. * * A FixedNumber has a fixed bit-width to store values in, and stores all * values internally by multiplying the value by 10 raised to the power of @@ -276,7 +276,7 @@ export class FixedNumber { get width(): number { return this.#format.width; } /** - * The number of decimal places in the fixed-point arithment field. + * The number of decimal places in the fixed-point arithmetic field. */ get decimals(): number { return this.#format.decimals; } @@ -541,7 +541,7 @@ export class FixedNumber { /** * Returns a float approximation. * - * Due to IEEE 754 precission (or lack thereof), this function + * Due to IEEE 754 precision (or lack thereof), this function * can only return an approximation and most values will contain * rounding errors. */ diff --git a/src.ts/utils/geturl.ts b/src.ts/utils/geturl.ts index 571eaaa731..2881407507 100644 --- a/src.ts/utils/geturl.ts +++ b/src.ts/utils/geturl.ts @@ -109,7 +109,7 @@ export function createGetUrl(options?: Record): FetchGetUrlFunc { }); resp.on("error", (error) => { - //@TODO: Should this just return nornal response with a server error? + //@TODO: Should this just return normal response with a server error? (error).response = { statusCode, statusMessage, headers, body }; reject(error); }); diff --git a/src.ts/utils/maths.ts b/src.ts/utils/maths.ts index 0200c27a3b..5f4633d6e4 100644 --- a/src.ts/utils/maths.ts +++ b/src.ts/utils/maths.ts @@ -29,7 +29,7 @@ const BN_1 = BigInt(1); const maxValue = 0x1fffffffffffff; /** - * Convert %%value%% from a twos-compliment representation of %%width%% + * Convert %%value%% from a twos-complement representation of %%width%% * bits to its value. * * If the highest bit is ``1``, the result will be negative. @@ -52,7 +52,7 @@ export function fromTwos(_value: BigNumberish, _width: Numeric): bigint { } /** - * Convert %%value%% to a twos-compliment representation of + * Convert %%value%% to a twos-complement representation of * %%width%% bits. * * The result will always be positive. @@ -229,7 +229,7 @@ export function toBeArray(_value: BigNumberish): Uint8Array { * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. * * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC + * the literal value `0x0`. This is most commonly used for JSON-RPC * numeric values. */ export function toQuantity(value: BytesLike | BigNumberish): string { diff --git a/src.ts/utils/utf8.ts b/src.ts/utils/utf8.ts index 7706c5b1ac..b5c4b51637 100644 --- a/src.ts/utils/utf8.ts +++ b/src.ts/utils/utf8.ts @@ -1,5 +1,5 @@ /** - * Using strings in Ethereum (or any security-basd system) requires + * Using strings in Ethereum (or any security-based system) requires * additional care. These utilities attempt to mitigate some of the * safety issues as well as provide the ability to recover and analyse * strings. @@ -15,7 +15,7 @@ import type { BytesLike } from "./index.js"; /////////////////////////////// /** - * The stanard normalization forms. + * The standard normalization forms. */ export type UnicodeNormalizationForm = "NFC" | "NFD" | "NFKC" | "NFKD"; @@ -106,7 +106,7 @@ function ignoreFunc(reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, function replaceFunc(reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number): number { - // Overlong representations are otherwise "valid" code points; just non-deistingtished + // Overlong representations are otherwise "valid" code points; just non-distinguished if (reason === "OVERLONG") { assertArgument(typeof(badCodepoint) === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); output.push(badCodepoint); diff --git a/src.ts/wallet/base-wallet.ts b/src.ts/wallet/base-wallet.ts index 21aae068cd..4c871dd9bc 100644 --- a/src.ts/wallet/base-wallet.ts +++ b/src.ts/wallet/base-wallet.ts @@ -97,7 +97,7 @@ export class BaseWallet extends AbstractSigner { return this.signMessageSync(message); } - // @TODO: Add a secialized signTx and signTyped sync that enforces + // @TODO: Add a specialized signTx and signTyped sync that enforces // all parameters are known? /** * Returns the signature for %%message%% signed with this wallet. diff --git a/src.ts/wallet/hdwallet.ts b/src.ts/wallet/hdwallet.ts index ce0cce4e53..ee63cb4656 100644 --- a/src.ts/wallet/hdwallet.ts +++ b/src.ts/wallet/hdwallet.ts @@ -118,7 +118,7 @@ function derivePath>(node: T, path: string): T { /** * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. + * from an HD Node using the [[link-bip-32]] standard. * * An HD Node forms a hierarchal structure with each HD Node having a * private key and the ability to derive child HD Nodes, defined by @@ -133,7 +133,7 @@ export class HDNodeWallet extends BaseWallet { /** * The fingerprint. * - * A fingerprint allows quick qay to detect parent and child nodes, + * A fingerprint allows quick way to detect parent and child nodes, * but developers should be prepared to deal with collisions as it * is only 4 bytes. */ @@ -221,14 +221,14 @@ export class HDNodeWallet extends BaseWallet { * %%password%%. * * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. + * updates as the encryption process progresses. */ async encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise { return await encryptKeystoreJson(this.#account(), password, { progressCallback }); } /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with + * Returns a [JSON Keystore Wallet](json-wallets) encrypted with * %%password%%. * * It is preferred to use the [async version](encrypt) instead, @@ -406,7 +406,7 @@ export class HDNodeWallet extends BaseWallet { * * The can be created by using an extended ``xpub`` key to * [[HDNodeWallet_fromExtendedKey]] or by - * [nuetering](HDNodeWallet-neuter) a [[HDNodeWallet]]. + * [neutering](HDNodeWallet-neuter) a [[HDNodeWallet]]. */ export class HDNodeVoidWallet extends VoidSigner { /** @@ -417,7 +417,7 @@ export class HDNodeVoidWallet extends VoidSigner { /** * The fingerprint. * - * A fingerprint allows quick qay to detect parent and child nodes, + * A fingerprint allows quick way to detect parent and child nodes, * but developers should be prepared to deal with collisions as it * is only 4 bytes. */ @@ -439,7 +439,7 @@ export class HDNodeVoidWallet extends VoidSigner { * * Since extended keys do not provider full path details, this * may be ``null``, if instantiated from a source that does not - * enocde it. + * encode it. */ readonly path!: null | string; diff --git a/src.ts/wallet/json-keystore.ts b/src.ts/wallet/json-keystore.ts index 0a53bbc922..c2b3190bce 100644 --- a/src.ts/wallet/json-keystore.ts +++ b/src.ts/wallet/json-keystore.ts @@ -189,7 +189,7 @@ function getDecryptKdfParams(data: any): KdfParams { * * This method will block the event loop (freezing all UI) until decryption * is complete, which can take quite some time, depending on the wallet - * paramters and platform. + * parameters and platform. */ export function decryptKeystoreJsonSync(json: string, _password: string | Uint8Array): KeystoreAccount { const data = JSON.parse(json); @@ -219,7 +219,7 @@ function stall(duration: number): Promise { * %%password%%. * * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns + * decryption to provide feedback, and if the function returns * ``false`` will halt decryption. * * The %%progressCallback%% will **always** receive ``0`` before @@ -358,7 +358,7 @@ function _encryptKeystore(key: Uint8Array, kdf: ScryptParams, account: KeystoreA * * The %%options%% can be used to tune the password-based key * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. + * used. Any provided [[ProgressCallback]] is ignored. */ export function encryptKeystoreJsonSync(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): string { if (options == null) { options = { }; } diff --git a/src.ts/wallet/wallet.ts b/src.ts/wallet/wallet.ts index ed17f79f9b..82a1002d8a 100644 --- a/src.ts/wallet/wallet.ts +++ b/src.ts/wallet/wallet.ts @@ -29,7 +29,7 @@ function stall(duration: number): Promise { * This class is generally the main entry point for developers * that wish to use a private key directly, as it can create * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON + * raw private key, [[link-bip-39]] mnemonics and encrypt JSON * wallets. */ export class Wallet extends BaseWallet { @@ -56,7 +56,7 @@ export class Wallet extends BaseWallet { * %%password%%. * * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. + * updates as the encryption process progresses. */ async encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise { const account = { address: this.address, privateKey: this.privateKey }; @@ -64,7 +64,7 @@ export class Wallet extends BaseWallet { } /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with + * Returns a [JSON Keystore Wallet](json-wallets) encrypted with * %%password%%. * * It is preferred to use the [async version](encrypt) instead, diff --git a/src.ts/wordlists/wordlist.ts b/src.ts/wordlists/wordlist.ts index 1a6bc6df23..56ad35416a 100644 --- a/src.ts/wordlists/wordlist.ts +++ b/src.ts/wordlists/wordlist.ts @@ -24,7 +24,7 @@ export abstract class Wordlist { /** * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. + * method for splitting %%phrase%% into individual words. * * By default, %%phrase%% is split using any sequences of * white-space as defined by regular expressions (i.e. ``/\s+/``). @@ -44,7 +44,7 @@ export abstract class Wordlist { } /** - * Maps an 11-bit value into its coresponding word in the list. + * Maps an 11-bit value into its corresponding word in the list. * * Sub-classes MUST override this. */