Skip to content
Open
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
10 changes: 5 additions & 5 deletions src/deriveData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TA extends TxWithOrder, TB extends TxWithOrder>(
txWithOrderA: TA,
Expand Down Expand Up @@ -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<Utxo, TxId> = {}; //Means: Utxo was spent in txId

//Note that txWithOrderArray cannot be assumed to be in correct order if
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -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
),
Expand Down
6 changes: 3 additions & 3 deletions src/discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down