@bsv/wallet-toolbox-client
Version:
Client only Wallet Storage
136 lines • 5.1 kB
TypeScript
import { AtomicBEEF, OutpointString, SendWithResult, TXIDHexString, WalletNetwork } from '@bsv/sdk';
import { WalletError } from './WalletError';
import { ReviewActionResult } from './WalletStorage.interfaces';
/**
* Not implemented.
*/
export declare class WERR_NOT_IMPLEMENTED extends WalletError {
constructor(message?: string);
}
/**
* An internal error has occurred.
*
* This is an example of an error with an optional custom `message`.
*/
export declare class WERR_INTERNAL extends WalletError {
constructor(message?: string);
}
/**
* The ${parameter} parameter is invalid.
*
* This is an example of an error object with a custom property `parameter` and templated `message`.
*/
export declare class WERR_INVALID_OPERATION extends WalletError {
constructor(message?: string);
}
/**
* Unable to broadcast transaction at this time.
*/
export declare class WERR_BROADCAST_UNAVAILABLE extends WalletError {
constructor(message?: string);
}
/**
* The ${parameter} parameter is invalid.
*
* This is an example of an error object with a custom property `parameter` and templated `message`.
*/
export declare class WERR_INVALID_PARAMETER extends WalletError {
parameter: string;
constructor(parameter: string, mustBe?: string);
toJson(): string;
}
/**
* Invalid merkleRoot ${merkleRoot} for block ${blockHash} at height ${blockHeight}${txid ? ` for txid ${txid}` : ''}.
*
* Typically thrown when a chain tracker fails to validate a merkle root.
*/
export declare class WERR_INVALID_MERKLE_ROOT extends WalletError {
blockHash: string;
blockHeight: number;
merkleRoot: string;
txid?: string | undefined;
constructor(blockHash: string, blockHeight: number, merkleRoot: string, txid?: string | undefined);
toJson(): string;
}
/**
* The required ${parameter} parameter is missing.
*
* This is an example of an error object with a custom property `parameter`
*/
export declare class WERR_MISSING_PARAMETER extends WalletError {
parameter: string;
constructor(parameter: string);
toJson(): string;
}
/**
* The request is invalid.
*/
export declare class WERR_BAD_REQUEST extends WalletError {
constructor(message?: string);
}
/**
* Configured network chain is invalid or does not match across services.
*/
export declare class WERR_NETWORK_CHAIN extends WalletError {
constructor(message?: string);
}
/**
* Access is denied due to an authorization error.
*/
export declare class WERR_UNAUTHORIZED extends WalletError {
constructor(message?: string);
}
/**
* WalletStorageManager is not accessing user's active storage or there are conflicting active stores configured.
*/
export declare class WERR_NOT_ACTIVE extends WalletError {
constructor(message?: string);
}
/**
* Insufficient funds in the available inputs to cover the cost of the required outputs
* and the transaction fee (${moreSatoshisNeeded} more satoshis are needed,
* for a total of ${totalSatoshisNeeded}), plus whatever would be required in order
* to pay the fee to unlock and spend the outputs used to provide the additional satoshis.
*/
export declare class WERR_INSUFFICIENT_FUNDS extends WalletError {
totalSatoshisNeeded: number;
moreSatoshisNeeded: number;
/**
* @param totalSatoshisNeeded Total satoshis required to fund transactions after net of required inputs and outputs.
* @param moreSatoshisNeeded Shortfall on total satoshis required to fund transactions after net of required inputs and outputs.
*/
constructor(totalSatoshisNeeded: number, moreSatoshisNeeded: number);
toJson(): string;
}
export declare class WERR_INVALID_PUBLIC_KEY extends WalletError {
key: string;
/**
* @param key The invalid public key that caused the error.
* @param environment Optional environment flag to control whether the key is included in the message.
*/
constructor(key: string, network?: WalletNetwork);
protected toJson(): string;
}
/**
* When a `createAction` or `signAction` is completed in undelayed mode (`acceptDelayedBroadcast`: false),
* any unsucccessful result will return the results by way of this exception to ensure attention is
* paid to processing errors.
*/
export declare class WERR_REVIEW_ACTIONS extends WalletError {
reviewActionResults: ReviewActionResult[];
sendWithResults: SendWithResult[];
txid?: TXIDHexString | undefined;
tx?: AtomicBEEF | undefined;
noSendChange?: OutpointString[] | undefined;
/**
* All parameters correspond to their comparable `createAction` or `signSction` results
* with the exception of `reviewActionResults`;
* which contains more details, particularly for double spend results.
*/
constructor(reviewActionResults: ReviewActionResult[], sendWithResults: SendWithResult[], txid?: TXIDHexString | undefined, tx?: AtomicBEEF | undefined, noSendChange?: OutpointString[] | undefined);
toJson(): string;
}
/**
* IF YOU ADD NEW ERRORS, ALSO UPDATE THE WalletError.fromJson METHOD IN src/sdk/WalletError.ts
*/
//# sourceMappingURL=WERR_errors.d.ts.map