Skip to content

Commit

Permalink
fix(error): messages (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanosync authored Sep 23, 2024
1 parent 925b66c commit 3c8a5ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
16 changes: 4 additions & 12 deletions packages/sdk/src/browser-wallets/magiceden/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ async function getMagicEdenWalletProvider(): Promise<MagicEdenBitcoinProvider> {
) as MagicEdenWallet | undefined;

if (!meWallet) {
throw new BrowserWalletNotInstalledError(
"Magic Eden Wallet not installed.",
);
throw new BrowserWalletNotInstalledError("Magic Eden Wallet not installed");
}

return meWallet.features["sats-connect:"].provider;
Expand Down Expand Up @@ -78,9 +76,7 @@ async function getAddresses(
network: BrowserWalletNetwork = "mainnet",
): Promise<WalletAddress[]> {
if (!isInstalled()) {
throw new BrowserWalletNotInstalledError(
"Magic Eden Wallet not installed.",
);
throw new BrowserWalletNotInstalledError("Magic Eden Wallet not installed");
}

if (network !== "mainnet") {
Expand All @@ -102,9 +98,7 @@ async function signPsbt(
}: SatsConnectSignPSBTOptions = { network: "mainnet", inputsToSign: [] },
): Promise<BrowserWalletSignResponse> {
if (!isInstalled()) {
throw new BrowserWalletNotInstalledError(
"Magic Eden Wallet not installed.",
);
throw new BrowserWalletNotInstalledError("Magic Eden Wallet not installed");
}

if (network !== "mainnet") {
Expand All @@ -127,9 +121,7 @@ async function signMessage(
network: BrowserWalletNetwork = "mainnet",
): Promise<BrowserWalletSignResponse> {
if (!isInstalled()) {
throw new BrowserWalletNotInstalledError(
"Magic Eden Wallet not installed.",
);
throw new BrowserWalletNotInstalledError("Magic Eden Wallet not installed");
}

if (network !== "mainnet") {
Expand Down
8 changes: 4 additions & 4 deletions packages/sdk/src/browser-wallets/xverse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function isInstalled(): boolean {

async function getXverseWalletProvider(): Promise<BitcoinProvider> {
if (!isInstalled()) {
throw new BrowserWalletNotInstalledError("Selected wallet not installed");
throw new BrowserWalletNotInstalledError("Xverse not installed");
}

return window.XverseProviders!.BitcoinProvider!;
Expand All @@ -37,7 +37,7 @@ async function getAddresses(
network: BrowserWalletNetwork = "mainnet",
): Promise<WalletAddress[]> {
if (!isInstalled()) {
throw new BrowserWalletNotInstalledError("Selected wallet not installed");
throw new BrowserWalletNotInstalledError("Xverse not installed");
}

return satsConnectWalletGetAddresses(getXverseWalletProvider, network);
Expand All @@ -53,7 +53,7 @@ async function signPsbt(
}: SatsConnectSignPSBTOptions = { network: "mainnet", inputsToSign: [] },
): Promise<BrowserWalletSignResponse> {
if (!isInstalled()) {
throw new BrowserWalletNotInstalledError("Selected wallet not installed");
throw new BrowserWalletNotInstalledError("Xverse not installed");
}

return satsConnectWalletSignPsbt(getXverseWalletProvider, psbt, {
Expand All @@ -70,7 +70,7 @@ async function signMessage(
network: BrowserWalletNetwork = "mainnet",
): Promise<BrowserWalletSignResponse> {
if (!isInstalled()) {
throw new BrowserWalletNotInstalledError("Selected wallet not installed");
throw new BrowserWalletNotInstalledError("Xverse not installed");
}

return satsConnectWalletSignMessage(
Expand Down

0 comments on commit 3c8a5ad

Please sign in to comment.