Skip to content

Commit

Permalink
chore: checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jul 18, 2023
1 parent 58bfbd7 commit 9bbda59
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/actions/getChainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export type WatchChainIdReturnType = () => void
/** https://wagmi.sh/core/actions/getChainId#watcher */
export function watchChainId<config extends Config>(
config: config,
{ onChange }: WatchChainIdParameters<config>,
parameters: WatchChainIdParameters<config>,
): WatchChainIdReturnType {
const { onChange } = parameters
return config.subscribe((state) => state.chainId, onChange)
}
3 changes: 2 additions & 1 deletion packages/core/src/actions/getConnections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export type WatchConnectionsReturnType = () => void
/** https://wagmi.sh/core/actions/getConnections#watcher */
export function watchConnections(
config: Config,
{ onChange }: WatchConnectionsParameters,
parameters: WatchConnectionsParameters,
): WatchConnectionsReturnType {
const { onChange } = parameters
return config.subscribe(() => getConnections(config), onChange, {
equalityFn: deepEqual,
})
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/actions/reconnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let isReconnecting = false
/** https://wagmi.sh/core/actions/reconnect */
export async function reconnect(
config: Config,
{ connectors: connectors_ }: ReconnectParameters = {},
parameters: ReconnectParameters = {},
): Promise<ReconnectReturnType> {
// If already reconnecting, do nothing
if (isReconnecting) return []
Expand All @@ -28,8 +28,8 @@ export async function reconnect(
}))

const connectors: Connector[] = []
if (connectors_?.length) {
for (const connector_ of connectors_) {
if (parameters.connectors?.length) {
for (const connector_ of parameters.connectors) {
let connector: Connector
// "Register" connector if not already created
if (typeof connector_ === 'function')
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/signMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export type SignMessageError =
/** https://wagmi.sh/core/actions/signMessage */
export async function signMessage(
config: Config,
{ message }: SignMessageParameters,
parameters: SignMessageParameters,
): Promise<SignMessageReturnType> {
const client = await getConnectorClient(config)
if (!client) throw new ConnectorNotFoundError()
return viem_signMessage(client, { message })
return viem_signMessage(client, parameters)
}
3 changes: 2 additions & 1 deletion packages/core/src/actions/switchAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ export type SwitchAccountError = ConnectorNotFoundError | BaseError | Error
/** https://wagmi.sh/core/actions/switchAccount */
export async function switchAccount<config extends Config>(
config: config,
{ connector }: SwitchAccountParameters,
parameters: SwitchAccountParameters,
): Promise<SwitchAccountReturnType<config>> {
const { connector } = parameters
const connection = config.state.connections.get(connector.uid)
if (!connection) throw new ConnectorNotFoundError()

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export function createConfig<
client = createClient({
batch: { multicall: true },
chain,
pollingInterval: rest.pollingInterval as number,
pollingInterval: rest.pollingInterval,
transport: rest.transports[chain.id as chains[number]['id']],
})

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ResolvedRegister } from '@wagmi/core'
import { type ResolvedRegister } from '@wagmi/core'
import { useContext } from 'react'

import { WagmiContext } from '../context.js'
Expand Down

1 comment on commit 9bbda59

@vercel
Copy link

@vercel vercel bot commented on 9bbda59 Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wagmi-v2 – ./docs

wagmi-v2.vercel.app
wagmi-v2-git-tmm-v2-wagmi-dev.vercel.app
wagmi-v2-wagmi-dev.vercel.app

Please sign in to comment.