diff --git a/src/deriveData.ts b/src/deriveData.ts index 3ccf5e8..4131a16 100644 --- a/src/deriveData.ts +++ b/src/deriveData.ts @@ -74,7 +74,7 @@ export function deriveDataFactory({ * in the mempool) and either `tx` (`Transaction` type) or `txHex` (the * hexadecimal representation of the transaction) * - * @returns < 0 if txWithOrderA is older than txWithOrderB, > 01 if txWithOrderA is newer than txWithOrderB, and 0 if undecided. + * @returns < 0 if txWithOrderA is older than txWithOrderB, > 0 if txWithOrderA is newer than txWithOrderB, and 0 if undecided. */ function compareTxOrder( txWithOrderA: TA, @@ -165,7 +165,7 @@ export function deriveDataFactory({ //All prev outputs (spent or unspent) sent to this output descriptor: const allPrevOutputs: Utxo[] = []; //all outputs in txWithOrderArray which have been spent. - //May be outputs NOT snt to thil output descriptor: + //May be outputs NOT sent to this output descriptor: const spendingTxIdByOutput: Record = {}; //Means: Utxo was spent in txId //Note that txWithOrderArray cannot be assumed to be in correct order if @@ -342,7 +342,7 @@ export function deriveDataFactory({ descriptorOrDescriptors, txStatus ); - //Suposedly Set.has is faster than Array.includes: + //Supposedly Set.has is faster than Array.includes: //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#performance const txoSet = new Set([ ...utxos, @@ -478,7 +478,7 @@ export function deriveDataFactory({ ), { primitive: true } //unbounded cache (no max setting) since Search Space is small ), - { primitive: true } //unbounced cache for networkId + { primitive: true } //unbounded cache for networkId ), { primitive: true } //unbounded cache (no max setting) since withAttributions is space is 2 ); @@ -685,7 +685,7 @@ export function deriveDataFactory({ { max: 1 } ); }, - { primitive: true, max: descriptorsCacheSize } //potentially ininite search space. limit to 100 descriptorOrDescriptors per txStatus combination + { primitive: true, max: descriptorsCacheSize } //potentially infinite search space. limit to 100 descriptorOrDescriptors per txStatus combination ), { primitive: true } //unbounded cache (no max setting) since Search Space is small ), diff --git a/src/discovery.ts b/src/discovery.ts index 3674a47..65599dc 100644 --- a/src/discovery.ts +++ b/src/discovery.ts @@ -206,7 +206,7 @@ export function DiscoveryFactory( } if (typeof index === 'number') { if (maxUsedIndex === 'non-ranged') - throw new Error('maxUsedIndex shoulnt be set as non-ranged'); + throw new Error("maxUsedIndex shouldn't be set as non-ranged"); if (index > maxUsedIndex && range[index]?.txIds.length) maxUsedIndex = index; } @@ -717,7 +717,7 @@ export function DiscoveryFactory( * discovery. * * @param options - * @returns Resolves when all the standrd accounts from the master node have + * @returns Resolves when all the standard accounts from the master node have * been discovered. */ async fetchStandardAccounts({ @@ -1422,7 +1422,7 @@ export function DiscoveryFactory( * function). * * The `gapLimit` parameter is essential for managing descriptor discovery. - * When addint a transaction, there is a possibility the transaction is + * When adding a transaction, there is a possibility the transaction is * adding new funds as change (for example). If the range for that index * does not exist yet, the `gapLimit` helps to update the descriptor * corresponding to a new UTXO for new indices within the gap limit. diff --git a/src/types.ts b/src/types.ts index 49d1b4b..fdfcf03 100644 --- a/src/types.ts +++ b/src/types.ts @@ -92,9 +92,9 @@ export enum TxStatus { * An `IndexedDescriptor` is a descriptor representation what must correspond to * a single output. * - * - If it is ranged, then add an integer after the separaror (a + * - If it is ranged, then add an integer after the separator (a * tilde "\~"). - * - It it is non-ranged, add the string "non-ranged" after the tilde "\~". + * - If it is non-ranged, add the string "non-ranged" after the tilde "\~". * * Examples: * pkh([73c5da0a/44'/1'/0']tpubDC5FSnBiZDMmhiuCmWAYsLwgLYrrT9rAqvTySfuCCrgsWz8wxMXUS9Tb9iVMvcRbvFcAHGkMD5Kx8koh4GquNGNTfohfk7pgjhaPCdXpoba/0/*)\~12 @@ -103,7 +103,7 @@ export enum TxStatus { export type IndexedDescriptor = string; /** * a Txo is represented in a similar manner as a Utxo, that is, - * prevtxId:vout. Hovewer, we use a different type name to denote we're dealing + * prevtxId:vout. However, we use a different type name to denote we're dealing * here with tx outputs that may have been spent or not */ export type Txo = string;