From b71cdae03421e2ff940b5185d4d59dd7a808a2d6 Mon Sep 17 00:00:00 2001 From: David Mohl Date: Tue, 28 Jun 2022 11:17:03 +0900 Subject: [PATCH] Fix nits - formatting, order, whitespace --- packages/wallets/saifu/package.json | 3 +-- packages/wallets/saifu/src/adapter.ts | 17 ++++++----------- packages/wallets/wallets/package.json | 4 ++-- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/packages/wallets/saifu/package.json b/packages/wallets/saifu/package.json index 0b83899f8..7c9464e66 100644 --- a/packages/wallets/saifu/package.json +++ b/packages/wallets/saifu/package.json @@ -30,8 +30,7 @@ "@solana/web3.js": "^1.36.0" }, "dependencies": { - "@solana/wallet-adapter-base": "^0.9.4", - "@solflare-wallet/sdk": "^1.0.11" + "@solana/wallet-adapter-base": "^0.9.4" }, "devDependencies": { "@solana/web3.js": "^1.36.0" diff --git a/packages/wallets/saifu/src/adapter.ts b/packages/wallets/saifu/src/adapter.ts index 21f4457ef..f4e6ea156 100644 --- a/packages/wallets/saifu/src/adapter.ts +++ b/packages/wallets/saifu/src/adapter.ts @@ -16,7 +16,7 @@ import { WalletSignTransactionError, WalletWindowClosedError, } from '@solana/wallet-adapter-base'; -import {Connection, PublicKey, SendOptions, Transaction, TransactionSignature} from '@solana/web3.js'; +import { Connection, PublicKey, SendOptions, Transaction, TransactionSignature } from '@solana/web3.js'; interface SaifuWalletEvents { connect(...args: unknown[]): unknown; @@ -29,14 +29,13 @@ interface SaifuWallet extends EventEmitter { isConnected: boolean; signTransaction(transaction: Transaction): Promise; signAllTransactions(transactions: Transaction[]): Promise; - signAndSendTransaction( + signAndSendTransaction?( transaction: Transaction, options?: SendOptions ): Promise<{ signature: TransactionSignature }>; signMessage(message: Uint8Array): Promise<{ signature: Uint8Array }>; connect(): Promise; disconnect(): Promise; - _handleDisconnect(...args: unknown[]): unknown; } interface SolanaWindow extends Window { @@ -45,16 +44,14 @@ interface SolanaWindow extends Window { declare const window: SolanaWindow; -export interface SaifuWalletAdapterConfig { -} +export interface SaifuWalletAdapterConfig {} export const SaifuWalletName = 'Saifu' as WalletName; export class SaifuWalletAdapter extends BaseMessageSignerWalletAdapter { name = SaifuWalletName; url = 'https://saifuwallet.com'; - icon = - 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNTQxcHgiIGhlaWdodD0iNTQxcHgiIHZpZXdCb3g9IjAgMCA1NDEgNTQxIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPHRpdGxlPkFydGJvYXJkIENvcHkgOTwvdGl0bGU+CiAgICA8ZGVmcz4KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9IjEuNzk5ODcyMTYlIiB5MT0iMCUiIHgyPSI5OC4zOTcxMDUxJSIgeTI9Ijk3Ljk5MDI5MSUiIGlkPSJsaW5lYXJHcmFkaWVudC0xIj4KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0ZCOTIzQyIgb2Zmc2V0PSIwJSI+PC9zdG9wPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjRUM0ODk5IiBvZmZzZXQ9IjEwMCUiPjwvc3RvcD4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPC9kZWZzPgogICAgPGcgaWQ9IkFydGJvYXJkLUNvcHktOSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZD0iTTIzMi4yNzAwNDQsLTcuODU2NzI5NzFlLTE1IEwzMDcuNzI5OTU2LDcuODU2NzI5NzFlLTE1IEMzNzkuNDY1Mzc2LC01LjMyMDg1MzMyZS0xNSA0MTIuMzM3Mzc5L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NywzMTQuMDkwNTk0IDI1MS44MzY3NDQsMzE1LjQ5ODgyNyBDMjQ2LjQyNTAwMSwzMTYuOTA3MDYxIDIzNi41OTcyNDIsMzE4LjkxNDY5IDIyOS45OTcyMzYsMzE5Ljk2MDI4NCBDMjIzLjM5NzIzLDMyMS4wMDU4NDYgMjEyLjUxOTc4OCwzMjIuMzM3NjY0IDIwNS44MjUxNDcsMzIyLjkxOTg0OCBDMTk5LjEzMDUwNiwzMjMuNTAyMDYyIDE3OS4xMDU0OTcsMzIzLjkyNjY4NCAxNjEuMzI1MTQ3LDMyMy44NjM0MjEgWiIgaWQ9IlNoYXBlIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4='; private _connecting: boolean; private _wallet: SaifuWallet | null; @@ -115,7 +112,6 @@ export class SaifuWalletAdapter extends BaseMessageSignerWalletAdapter { // 3. Wallet with authorize the user and emit 'connect' // 4. 'connect' will resolve the full promise await new Promise((resolve, reject) => { - // connect will get called post auth // resolving this promise will unblock the outer part // so this should happen last @@ -133,7 +129,6 @@ export class SaifuWalletAdapter extends BaseMessageSignerWalletAdapter { }); }); } catch (error: any) { - if (error instanceof WalletError) throw error; throw new WalletConnectionError(error?.message, error); } } @@ -189,7 +184,7 @@ export class SaifuWalletAdapter extends BaseMessageSignerWalletAdapter { if (!wallet) throw new WalletNotConnectedError(); // fallback to parent if not implemented yet - if (!('signAndSendTransaction' in wallet)) { + if (!wallet.signAndSendTransaction) { return super.sendTransaction(transaction, connection, options); } @@ -239,7 +234,7 @@ export class SaifuWalletAdapter extends BaseMessageSignerWalletAdapter { if (!wallet) throw new WalletNotConnectedError(); try { - const {signature} = await wallet.signMessage(message); + const { signature } = await wallet.signMessage(message); return signature; } catch (error: any) { throw new WalletSignTransactionError(error?.message, error); diff --git a/packages/wallets/wallets/package.json b/packages/wallets/wallets/package.json index fe6cee31d..1aa4a3c4b 100644 --- a/packages/wallets/wallets/package.json +++ b/packages/wallets/wallets/package.json @@ -41,13 +41,13 @@ "@solana/wallet-adapter-mathwallet": "^0.9.2", "@solana/wallet-adapter-phantom": "^0.9.2", "@solana/wallet-adapter-safepal": "^0.5.2", + "@solana/wallet-adapter-saifu": "^0.1.0", "@solana/wallet-adapter-slope": "^0.5.2", "@solana/wallet-adapter-solflare": "^0.6.3", "@solana/wallet-adapter-sollet": "^0.11.0", "@solana/wallet-adapter-solong": "^0.9.2", "@solana/wallet-adapter-tokenpocket": "^0.4.2", "@solana/wallet-adapter-torus": "^0.11.10", - "@solana/wallet-adapter-walletconnect": "^0.1.0", - "@solana/wallet-adapter-saifu": "^0.1.0" + "@solana/wallet-adapter-walletconnect": "^0.1.0" } }