-
Notifications
You must be signed in to change notification settings - Fork 69
/
index.ts
30 lines (28 loc) · 1.71 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import BaseError from 'standard-error';
function createError(name: string) {
const Error = class extends BaseError {};
Error.prototype.name = name;
return Error;
}
export const StandardError = createError('StandardError');
export const ProviderNotFoundError = createError('ProviderNotFoundError');
export const InvalidProviderError = createError('InvalidProviderError');
export const DuplicateProviderError = createError('DuplicateProviderError');
export const NoProviderError = createError('NoProviderError');
export const UnsupportedMethodError = createError('UnsupportedMethodError');
export const UnimplementedMethodError = createError('UnimplementedMethodError');
export const InvalidProviderResponseError = createError('InvalidProviderResponseError');
export const PendingTxError = createError('PendingTxError');
export const TxNotFoundError = createError('TxNotFoundError');
export const TxFailedError = createError('TxFailedError');
export const BlockNotFoundError = createError('BlockNotFoundError');
export const InvalidDestinationAddressError = createError('InvalidDestinationAddressError');
export const WalletError = createError('WalletError');
export const NodeError = createError('NodeError');
export const InvalidSecretError = createError('InvalidSecretError');
export const InvalidAddressError = createError('InvalidAddressError');
export const InvalidExpirationError = createError('InvalidExpirationError');
export const InsufficientBalanceError = createError('InsufficientBalanceError');
export const ReplaceFeeInsufficientError = createError('ReplaceFeeInsufficientError');
export const InvalidSwapParamsError = createError('InvalidSwapParamsError');
export const InvalidValueError = createError('InvalidValueError');