Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Aug 29, 2023
1 parent 0768d50 commit 776ff25
Show file tree
Hide file tree
Showing 35 changed files with 332 additions and 112 deletions.
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["orta.vscode-twoslash-queries", "rome.rome", "Vue.volar"]
"recommendations": [
"orta.vscode-twoslash-queries",
"biomejs.biome",
"Vue.volar"
]
}
15 changes: 8 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{
"editor.defaultFormatter": "rome.rome",
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.importModuleSpecifier": "shortest",
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.organizeImports.rome": true
"quickfix.biome": true,
"source.organizeImports.biome": true
},
"[json]": {
"editor.defaultFormatter": "rome.rome"
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "rome.rome"
"editor.defaultFormatter": "biomejs.biome"
},
"[javascriptreact]": {
"editor.defaultFormatter": "rome.rome"
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "rome.rome"
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "rome.rome"
"editor.defaultFormatter": "biomejs.biome"
},
"[vue]": {
"editor.defaultFormatter": "Vue.volar"
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function getSidebar() {
link: '/react/connectors',
items: [
{
text: 'coinbaseWallet 🚧',
text: 'coinbaseWallet',
link: '/react/connectors/coinbaseWallet',
},
{ text: 'injected', link: '/react/connectors/injected' },
Expand Down Expand Up @@ -340,7 +340,7 @@ export function getSidebar() {
link: '/core/connectors',
items: [
{
text: 'coinbaseWallet 🚧',
text: 'coinbaseWallet',
link: '/core/connectors/coinbaseWallet',
},
{ text: 'injected', link: '/core/connectors/injected' },
Expand Down
6 changes: 6 additions & 0 deletions docs/core/connectors/coinbaseWallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script setup>
const packageName = '@wagmi/core'
const connectorsPackageName = '@wagmi/connectors'
</script>

<!-- @include: @shared/connectors/coinbaseWallet.md -->
6 changes: 6 additions & 0 deletions docs/react/connectors/coinbaseWallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script setup>
const packageName = 'wagmi'
const connectorsPackageName = 'wagmi/connectors'
</script>

<!-- @include: @shared/connectors/coinbaseWallet.md -->
196 changes: 196 additions & 0 deletions docs/shared/connectors/coinbaseWallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
<!-- <script setup>
const packageName = 'wagmi'
const connectorsPackageName = 'wagmi/connectors'
</script> -->

# coinbaseWallet

Connector for the [Coinbase Wallet SDK](https://github.com/coinbase/coinbase-wallet-sdk).

## Import

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
```

## Usage

```ts-vue
import { createConfig, http } from '{{packageName}}'
import { mainnet, sepolia } from '{{packageName}}/chains'
import { coinbaseWallet } from '{{connectorsPackageName}}'
export const config = createConfig({
chains: [mainnet, sepolia],
connectors: [
coinbaseWallet({
appName: 'My Wagmi App',
}),
],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
```

## Parameters

```ts-vue
import { type CoinbaseWalletParameters } from '{{connectorsPackageName}}'
```

### appName

`string`

Application name.

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App', // [!code focus]
})
```

### appLogoUrl

`string | null | undefined`

Application logo image URL; favicon is used if unspecified.

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App',
appLogoUrl: 'https://example.com/myLogoUrl.png', // [!code focus]
})
```

### chainId

`number | undefined`

Fallback Ethereum Chain ID. Defaults to `1` (Mainnet).

```ts-vue
import { mainnet } from '{{packageName}}/chains'
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App',
chainId: mainnet.id, // [!code focus]
})
```

### darkMode

`boolean | undefined`

Use dark theme.

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App',
darkMode: true, // [!code focus]
})
```

### diagnosticLogger

`DiagnosticLogger | undefined`

A diagnostic tool for debugging; for most, leave it unspecified.

### enableMobileWalletLink

`boolean | undefined`

Whether to connect mobile web app via WalletLink, defaults to `false`.

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App',
enableMobileWalletLink: true, // [!code focus]
})
```

### headlessMode

`boolean | undefined`

Whether or not onboarding overlay popup should be displayed.

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App',
headlessMode: false, // [!code focus]
})
```

### jsonRpcUrl

`string | undefined`

Fallback Ethereum JSON RPC URL.

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App',
jsonRpcUrl: 'https://cloudflare-eth.com', // [!code focus]
})
```

### linkApiUrl

`string | undefined`

Coinbase Wallet link server URL; for most, leave it unspecified.

### overrideIsCoinbaseBrowser / overrideIsCoinbaseWallet / overrideIsMetaMask

`boolean | undefined`

Whether wallet link provider should override the `isCoinbaseBrowser`, `isCoinbaseWallet`, and/or `isMetaMask` property.

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App',
isCoinbaseBrowser: true, // [!code focus]
isCoinbaseWallet: true, // [!code focus]
isMetaMask: true, // [!code focus]
})
```

### reloadOnDisconnect

`boolean | undefined`

Whether or not to reload dapp automatically after disconnect, defaults to `false`.

```ts-vue
import { coinbaseWallet } from '{{connectorsPackageName}}'
const connector = coinbaseWallet({
appName: 'My Wagmi App',
reloadOnDisconnect: true, // [!code focus]
})
```

### uiConstructor

`((options: Readonly<WalletUIOptions>) => WalletUI) | undefined`

An implementation of WalletUI; for most, leave it unspecified.
2 changes: 1 addition & 1 deletion docs/snippets/core/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { injected } from '@wagmi/connectors'
import { createConfig, http } from '@wagmi/core'
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'

export const config = createConfig({
Expand Down
2 changes: 1 addition & 1 deletion docs/snippets/core/testing/clients.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createTestClient, http } from 'viem'
import { http, createTestClient } from 'viem'

import { mainnetFork, optimismFork } from './chains'

Expand Down
2 changes: 1 addition & 1 deletion docs/snippets/core/testing/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createConfig, http } from '@wagmi/core'
import { http, createConfig } from '@wagmi/core'
import { accounts, testConnector } from '@wagmi/test'

import { mainnetFork, optimismFork } from './chains'
Expand Down
2 changes: 1 addition & 1 deletion docs/snippets/react/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createConfig, http } from 'wagmi'
import { http, createConfig } from 'wagmi'
import { mainnet, sepolia } from 'wagmi/chains'
import { injected } from 'wagmi/connectors'

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"dev:vite-core": "pnpm --filter vite-core dev",
"dev:vite-react": "pnpm --filter vite-react dev",
"docs:dev": "rimraf node_modules/.cache/twoslash && pnpm --filter docs dev",
"format": "rome format . --write",
"lint": "rome check .",
"format": "biome format . --write",
"lint": "biome check .",
"lint:fix": "pnpm lint --apply",
"lint:unused": "pnpm clean && knip",
"postinstall": "pnpm preconstruct",
Expand All @@ -29,6 +29,7 @@
"version:update": "pnpm bun scripts/updateVersion.ts"
},
"devDependencies": {
"@biomejs/biome": "1.0.0",
"@changesets/changelog-github": "0.4.6",
"@changesets/cli": "^2.26.0",
"@types/fs-extra": "^11.0.1",
Expand All @@ -45,7 +46,6 @@
"msw": "^1.2.1",
"publint": "^0.2.0",
"rimraf": "^4.4.1",
"rome": "^12.1.3",
"simple-git-hooks": "^2.8.1",
"typescript": "5.0.4",
"viem": "0.0.0-w-20230829165118",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/readContracts.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { abi, address, chain } from '@wagmi/test'
import { type MulticallResponse, http } from 'viem'
import { http, type MulticallResponse } from 'viem'
import { expect, expectTypeOf, test, vi } from 'vitest'

import { createConfig } from '../config.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/simulateContract.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { abi, config } from '@wagmi/test'
import { type Address, http } from 'viem'
import { http, type Address } from 'viem'
import { celo, mainnet } from 'viem/chains'
import { expectTypeOf, test } from 'vitest'

Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/actions/switchAccount.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Address } from 'viem'

import { type Config, type Connector } from '../config.js'
import { ConnectorNotFoundError } from '../errors/config.js'
import type { Address } from 'viem'

export type SwitchAccountParameters = {
connector: Connector
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/writeContract.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { abi, config } from '@wagmi/test'
import { type Address, http } from 'viem'
import { http, type Address } from 'viem'
import { celo, mainnet } from 'viem/chains'
import { expectTypeOf, test } from 'vitest'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { accounts, testConnector } from '@wagmi/test'
import { createClient, http } from 'viem'
import { http, createClient } from 'viem'
import { mainnet, sepolia } from 'viem/chains'
import { expectTypeOf, test } from 'vitest'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/query/signTypedData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'

import type { TypedData } from 'viem'
import {
type SignTypedDataError,
type SignTypedDataParameters,
Expand All @@ -8,7 +9,6 @@ import {
} from '../actions/signTypedData.js'
import { type Config } from '../config.js'
import type { Evaluate } from '../types/utils.js'
import type { TypedData } from 'viem'

export function signTypedDataMutationOptions<config extends Config>(
config: config,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/query/simulateContract.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { abi } from '@wagmi/test'
import { type Address, http } from 'viem'
import { http, type Address } from 'viem'
import { celo, mainnet } from 'viem/chains'
import { expectTypeOf, test } from 'vitest'

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/storage.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createStorage } from './storage.js'
import { expectTypeOf, test } from 'vitest'
import { createStorage } from './storage.js'

import type { Connection } from './config.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/hooks/useAccountEffect.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { connect, createConfig, disconnect, http } from '@wagmi/core'
import { http, connect, createConfig, disconnect } from '@wagmi/core'
import { accounts, chain, config, testConnector } from '@wagmi/test'
import { createWrapper, renderHook, waitFor } from '@wagmi/test/react'
import { expect, test, vi } from 'vitest'
Expand Down
Loading

1 comment on commit 776ff25

@vercel
Copy link

@vercel vercel bot commented on 776ff25 Aug 29, 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-git-alpha-wagmi-dev.vercel.app
wagmi-v2.vercel.app
wagmi-v2-wagmi-dev.vercel.app
alpha.wagmi.sh

Please sign in to comment.