From e012fc418687639df585bd00fa9a6548a83b3182 Mon Sep 17 00:00:00 2001 From: LukassF Date: Fri, 23 Feb 2024 13:31:53 +0100 Subject: [PATCH] fix: remove partial --- sdk/packages/modal/package.json | 4 ++-- sdk/packages/selector-base/package.json | 4 ++-- sdk/packages/selector-base/src/types.ts | 12 ++++------ sdk/packages/selector-polkadot/package.json | 2 +- .../selector-polkadot/src/detection.ts | 24 ++++++++----------- sdk/packages/selector-solana/package.json | 2 +- sdk/packages/selector-solana/src/adapter.ts | 5 ++-- sdk/packages/selector-solana/src/detection.ts | 19 ++------------- sdk/pnpm-lock.yaml | 6 ++--- 9 files changed, 29 insertions(+), 49 deletions(-) diff --git a/sdk/packages/modal/package.json b/sdk/packages/modal/package.json index b994bca5..e4f0ff2b 100644 --- a/sdk/packages/modal/package.json +++ b/sdk/packages/modal/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/wallet-selector-modal", - "version": "0.2.0", + "version": "0.2.1", "type": "module", "exports": { ".": { @@ -55,4 +55,4 @@ "typescript": "^5.0.2", "vite": "^4.3.9" } -} \ No newline at end of file +} diff --git a/sdk/packages/selector-base/package.json b/sdk/packages/selector-base/package.json index ddd40cb2..9dfb8f4d 100644 --- a/sdk/packages/selector-base/package.json +++ b/sdk/packages/selector-base/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/wallet-selector-base", - "version": "0.3.1", + "version": "0.4.0", "description": "", "type": "module", "exports": { @@ -25,7 +25,7 @@ "license": "ISC", "dependencies": { "@nightlylabs/nightly-connect-base": "0.0.27", - "@nightlylabs/wallet-selector-modal": "0.2.0", + "@nightlylabs/wallet-selector-modal": "0.2.1", "@wallet-standard/core": "^1.0.3", "isomorphic-localstorage": "^1.0.2" }, diff --git a/sdk/packages/selector-base/src/types.ts b/sdk/packages/selector-base/src/types.ts index 4c828419..e920e9ff 100644 --- a/sdk/packages/selector-base/src/types.ts +++ b/sdk/packages/selector-base/src/types.ts @@ -20,13 +20,11 @@ export interface MetadataWallet { walletType: WalletType } -export interface IWalletListItem extends Partial { - slug: string - name: string - walletType: WalletType - mobile: Deeplink | null - desktop: Deeplink | null - image: Images +export interface IWalletListItem + extends Pick< + WalletMetadata, + 'name' | 'slug' | 'walletType' | 'mobile' | 'desktop' | 'image' | 'homepage' + > { recent?: boolean detected?: boolean standardWallet?: Wallet diff --git a/sdk/packages/selector-polkadot/package.json b/sdk/packages/selector-polkadot/package.json index b3969395..b66c0271 100644 --- a/sdk/packages/selector-polkadot/package.json +++ b/sdk/packages/selector-polkadot/package.json @@ -25,7 +25,7 @@ "license": "ISC", "dependencies": { "@nightlylabs/nightly-connect-polkadot": "^0.0.15", - "@nightlylabs/wallet-selector-base": "^0.3.1", + "@nightlylabs/wallet-selector-base": "^0.4.0", "@polkadot/extension-inject": "0.46.5", "@polkadot/api": "10.10.1", "@wallet-standard/core": "^1.0.3" diff --git a/sdk/packages/selector-polkadot/src/detection.ts b/sdk/packages/selector-polkadot/src/detection.ts index c3c14840..97d57e42 100644 --- a/sdk/packages/selector-polkadot/src/detection.ts +++ b/sdk/packages/selector-polkadot/src/detection.ts @@ -1,10 +1,7 @@ -import { type Injected, type InjectedExtension } from '@polkadot/extension-inject/types' -import { type WalletIcon } from '@wallet-standard/core' +import { Injected, InjectedExtension } from '@polkadot/extension-inject/types' +import { WalletIcon } from '@wallet-standard/core' import { appToIcon } from './tempIcons' -import { WalletMetadata } from '../../../bindings/WalletMetadata' -import { WalletType } from '../../../bindings/WalletType' -import { Deeplink } from '../../../bindings/Deeplink' -import { Images } from '../../../bindings/Images' +import { WalletMetadata } from '@nightlylabs/wallet-selector-base' export interface PolkadotWalletInjected { // Default Polkadot standard @@ -35,13 +32,11 @@ export const getPolkadotWallets = (): PolkadotWalletInjected[] => { } } -export interface IPolkadotWalletListItem extends Partial { - slug: string - name: string - walletType: WalletType - mobile: Deeplink | null - desktop: Deeplink | null - image: Images +export interface IPolkadotWalletListItem + extends Pick< + WalletMetadata, + 'name' | 'slug' | 'walletType' | 'mobile' | 'desktop' | 'image' | 'homepage' + > { recent?: boolean detected?: boolean injectedWallet?: PolkadotWalletInjected @@ -108,7 +103,8 @@ export const getPolkadotWalletsList = (presetList: WalletMetadata[], recentWalle recent: recentWalletName === wallet.name, detected: true, injectedWallet: wallet, - walletType: 'hybrid' + walletType: 'hybrid', + homepage: '' } } diff --git a/sdk/packages/selector-solana/package.json b/sdk/packages/selector-solana/package.json index fe77830c..a63cdc6b 100644 --- a/sdk/packages/selector-solana/package.json +++ b/sdk/packages/selector-solana/package.json @@ -25,7 +25,7 @@ "license": "ISC", "dependencies": { "@nightlylabs/nightly-connect-solana": "^0.0.29", - "@nightlylabs/wallet-selector-base": "^0.3.1", + "@nightlylabs/wallet-selector-base": "^0.4.0", "@solana/wallet-adapter-base": "^0.9.22", "@solana/wallet-standard": "^1.0.2", "@solana/web3.js": "^1.77.2", diff --git a/sdk/packages/selector-solana/src/adapter.ts b/sdk/packages/selector-solana/src/adapter.ts index 0d96ace9..6bd10e5e 100644 --- a/sdk/packages/selector-solana/src/adapter.ts +++ b/sdk/packages/selector-solana/src/adapter.ts @@ -14,7 +14,8 @@ import { ConnectionType, ConnectionOptions, defaultConnectionOptions, - WalletMetadata + WalletMetadata, + IWalletListItem } from '@nightlylabs/wallet-selector-base' import { BaseMessageSignerWalletAdapter, @@ -32,7 +33,7 @@ import { } from '@solana/wallet-adapter-base' import { StandardWalletAdapter } from '@solana/wallet-standard' import { PublicKey, Transaction, TransactionVersion, VersionedTransaction } from '@solana/web3.js' -import { getSolanaWalletsList, IWalletListItem } from './detection' +import { getSolanaWalletsList } from './detection' import { StandardEventsChangeProperties } from '@wallet-standard/core' type NightlyConnectAdapterEvents = WalletAdapterEvents & { diff --git a/sdk/packages/selector-solana/src/detection.ts b/sdk/packages/selector-solana/src/detection.ts index 359b14a9..23a75fd6 100644 --- a/sdk/packages/selector-solana/src/detection.ts +++ b/sdk/packages/selector-solana/src/detection.ts @@ -1,21 +1,6 @@ -import { getWallets, type Wallet } from '@wallet-standard/core' +import { getWallets, Wallet } from '@wallet-standard/core' import { isWalletAdapterCompatibleStandardWallet } from '@solana/wallet-adapter-base' -import { WalletMetadata } from '../../../bindings/WalletMetadata' -import { WalletType } from '../../../bindings/WalletType' -import { Deeplink } from '../../../bindings/Deeplink' -import { Images } from '../../../bindings/Images' - -export interface IWalletListItem extends Partial { - slug: string - name: string - walletType: WalletType - mobile: Deeplink | null - desktop: Deeplink | null - image: Images - recent?: boolean - detected?: boolean - standardWallet?: Wallet -} +import { IWalletListItem, WalletMetadata } from '@nightlylabs/wallet-selector-base' export const solanaWalletsFilter = (wallet: Wallet) => isWalletAdapterCompatibleStandardWallet(wallet) diff --git a/sdk/pnpm-lock.yaml b/sdk/pnpm-lock.yaml index 30d55e12..468594e4 100644 --- a/sdk/pnpm-lock.yaml +++ b/sdk/pnpm-lock.yaml @@ -592,7 +592,7 @@ importers: specifier: 0.0.27 version: link:../../apps/base '@nightlylabs/wallet-selector-modal': - specifier: 0.2.0 + specifier: 0.2.1 version: link:../modal '@wallet-standard/core': specifier: ^1.0.3 @@ -632,7 +632,7 @@ importers: specifier: ^0.0.15 version: link:../../apps/polkadot '@nightlylabs/wallet-selector-base': - specifier: ^0.3.1 + specifier: ^0.4.0 version: link:../selector-base '@polkadot/api': specifier: 10.10.1 @@ -675,7 +675,7 @@ importers: specifier: ^0.0.29 version: link:../../apps/solana '@nightlylabs/wallet-selector-base': - specifier: ^0.3.1 + specifier: ^0.4.0 version: link:../selector-base '@solana/wallet-adapter-base': specifier: ^0.9.22