Skip to content

Commit

Permalink
fix: remove partial
Browse files Browse the repository at this point in the history
  • Loading branch information
LukassF committed Feb 23, 2024
1 parent 11fce53 commit e012fc4
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 49 deletions.
4 changes: 2 additions & 2 deletions sdk/packages/modal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nightlylabs/wallet-selector-modal",
"version": "0.2.0",
"version": "0.2.1",
"type": "module",
"exports": {
".": {
Expand Down Expand Up @@ -55,4 +55,4 @@
"typescript": "^5.0.2",
"vite": "^4.3.9"
}
}
}
4 changes: 2 additions & 2 deletions sdk/packages/selector-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nightlylabs/wallet-selector-base",
"version": "0.3.1",
"version": "0.4.0",
"description": "",
"type": "module",
"exports": {
Expand All @@ -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"
},
Expand Down
12 changes: 5 additions & 7 deletions sdk/packages/selector-base/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ export interface MetadataWallet {
walletType: WalletType
}

export interface IWalletListItem extends Partial<WalletMetadata> {
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
Expand Down
2 changes: 1 addition & 1 deletion sdk/packages/selector-polkadot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 10 additions & 14 deletions sdk/packages/selector-polkadot/src/detection.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -35,13 +32,11 @@ export const getPolkadotWallets = (): PolkadotWalletInjected[] => {
}
}

export interface IPolkadotWalletListItem extends Partial<WalletMetadata> {
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
Expand Down Expand Up @@ -108,7 +103,8 @@ export const getPolkadotWalletsList = (presetList: WalletMetadata[], recentWalle
recent: recentWalletName === wallet.name,
detected: true,
injectedWallet: wallet,
walletType: 'hybrid'
walletType: 'hybrid',
homepage: ''
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/packages/selector-solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions sdk/packages/selector-solana/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
ConnectionType,
ConnectionOptions,
defaultConnectionOptions,
WalletMetadata
WalletMetadata,
IWalletListItem
} from '@nightlylabs/wallet-selector-base'
import {
BaseMessageSignerWalletAdapter,
Expand All @@ -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 & {
Expand Down
19 changes: 2 additions & 17 deletions sdk/packages/selector-solana/src/detection.ts
Original file line number Diff line number Diff line change
@@ -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<WalletMetadata> {
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)
Expand Down
6 changes: 3 additions & 3 deletions sdk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e012fc4

Please sign in to comment.