Skip to content

Commit

Permalink
chore: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Nov 21, 2024
1 parent 04ca3ef commit 0779ea2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions src/Porto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ export function create<
...Chains.Chain[],
] = typeof defaultConfig.chains,
>(config?: Config<chains>): Porto<chains>
export function create(config?: Config | undefined): Porto {
export function create(config: Config | undefined = {}): Porto {
const {
announceProvider = defaultConfig.announceProvider,
chains = defaultConfig.chains,
headless = defaultConfig.headless,
transports = defaultConfig.transports,
} = config ?? {}
} = config

const keystoreHost = (() => {
if (config?.keystoreHost === 'self') return undefined
Expand Down Expand Up @@ -91,11 +91,7 @@ export function create(config?: Config | undefined): Porto {
...account,
keys: account.keys.map((key) => ({
...key,
...('raw' in key
? {
raw: undefined,
}
: {}),
...('raw' in key ? { raw: undefined } : {}),
})),
})),
chain: state.chain,
Expand All @@ -115,7 +111,7 @@ export function create(config?: Config | undefined): Porto {
headless,
keystoreHost,
transports,
} as Config,
} satisfies Config,
store,
})

Expand Down
2 changes: 1 addition & 1 deletion src/internal/provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as Mipd from 'mipd'
import type { RpcSchema } from 'ox'
import * as Address from 'ox/Address'
import * as Hex from 'ox/Hex'
import * as Json from 'ox/Json'
Expand All @@ -7,7 +8,6 @@ import * as ox_Provider from 'ox/Provider'
import * as PublicKey from 'ox/PublicKey'
import * as RpcResponse from 'ox/RpcResponse'
import * as TypedData from 'ox/TypedData'
import type { RpcSchema } from 'ox'

import type * as Chains from '../Chains.js'
import type { Config, Store } from '../Porto.js'
Expand Down
6 changes: 3 additions & 3 deletions src/internal/wagmi/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import {
type Hex,
} from 'viem'
import {
ConnectorAlreadyConnectedError,
ProviderNotFoundError,
type BaseErrorType,
type Config,
type Connector,
ConnectorAlreadyConnectedError,
type CreateConnectorFn,
ProviderNotFoundError,
} from 'wagmi'
import {
type ConnectReturnType,
getConnectorClient,
disconnect as wagmi_disconnect,
type ConnectReturnType,
} from 'wagmi/actions'

import type {
Expand Down

0 comments on commit 0779ea2

Please sign in to comment.