UNPKG

@bigmi/client

Version:

Reactive primitives for Bitcoin apps.

86 lines (85 loc) 4.09 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); let _bigmi_core = require("@bigmi/core"); //#region src/errors/connectors.ts var ProviderNotFoundError = class extends _bigmi_core.BaseError { constructor() { super("Provider not found."); this.name = "ProviderNotFoundError"; this.message = "Provider not found"; this.code = 243; } }; var ChainNotSupportedError = class extends _bigmi_core.BaseError { constructor(chainId, connector) { super(`Chain ${chainId.toString()} is not supported by ${connector} `); this.name = "ChainNotSupportedError"; } }; var ConnectorChainIdDetectionError = class extends _bigmi_core.BaseError { constructor({ connector }) { super(`Chain ID detection failed for connector "${connector}".`, { metaMessages: [ "The connector needs at least one account to analyze the address format and determine the Bitcoin network.", "Please ensure the wallet is connected and has accounts available.", "Try reconnecting the wallet or checking if the wallet extension is properly installed." ] }); this.name = "ConnectorChainIdDetectionError"; } }; var ConnectorAlreadyConnectedError = class extends _bigmi_core.BaseError { constructor() { super("Connector already connected."); this.name = "ConnectorAlreadyConnectedError"; } }; var ConnectorNotConnectedError = class extends _bigmi_core.BaseError { constructor() { super("Connector not connected."); this.name = "ConnectorNotConnectedError"; } }; var ConnectorNotFoundError = class extends _bigmi_core.BaseError { constructor() { super("Connector not found."); this.name = "ConnectorNotFoundError"; } }; var ConnectorAccountNotFoundError = class extends _bigmi_core.BaseError { constructor({ address, connector }) { super(`Account "${address}" not found for connector "${connector}".`); this.name = "ConnectorAccountNotFoundError"; } }; var ConnectorChainMismatchError = class extends _bigmi_core.BaseError { constructor({ connectionChainId, connectorChainId }) { super(`The current chain of the connector (id: ${connectorChainId}) does not match the connection's chain (id: ${connectionChainId}).`, { metaMessages: [`Current Chain ID: ${connectorChainId}`, `Expected Chain ID: ${connectionChainId}`] }); this.name = "ConnectorChainMismatchError"; } }; var ConnectorNetworkMismatchError = class extends _bigmi_core.BaseError { constructor({ connectionNetwork, connectorNetwork }) { super(`The current network of the connector (${connectorNetwork}) does not match the connection's network (${connectionNetwork}).`, { metaMessages: [`Current Network: ${connectorNetwork}`, `Expected Network: ${connectionNetwork}`] }); this.name = "ConnectorNetworkMismatchError"; } }; var ConnectorUnavailableReconnectingError = class extends _bigmi_core.BaseError { constructor({ connector }) { super(`Connector "${connector.name}" unavailable while reconnecting.`, { details: [ "During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.", "All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.", "This error commonly occurs for connectors that asynchronously inject after reconnection has already started." ].join(" ") }); this.name = "ConnectorUnavailableReconnectingError"; } }; //#endregion exports.ChainNotSupportedError = ChainNotSupportedError; exports.ConnectorAccountNotFoundError = ConnectorAccountNotFoundError; exports.ConnectorAlreadyConnectedError = ConnectorAlreadyConnectedError; exports.ConnectorChainIdDetectionError = ConnectorChainIdDetectionError; exports.ConnectorChainMismatchError = ConnectorChainMismatchError; exports.ConnectorNetworkMismatchError = ConnectorNetworkMismatchError; exports.ConnectorNotConnectedError = ConnectorNotConnectedError; exports.ConnectorNotFoundError = ConnectorNotFoundError; exports.ConnectorUnavailableReconnectingError = ConnectorUnavailableReconnectingError; exports.ProviderNotFoundError = ProviderNotFoundError; //# sourceMappingURL=connectors.js.map