Skip to content

Commit f2fc6bb

Browse files
committed
Update type definitions in types.ts to include additional configuration options for web3modal
1 parent ef4d330 commit f2fc6bb

File tree

12 files changed

+46
-315
lines changed

12 files changed

+46
-315
lines changed

.prettierrc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@
77
"singleQuote": true,
88
"endOfLine": "auto",
99
"plugins": [
10-
"@trivago/prettier-plugin-sort-imports",
10+
"prettier-plugin-organize-imports",
1111
"prettier-plugin-organize-attributes",
1212
"prettier-plugin-tailwindcss"
1313
],
14-
"importOrder": [
15-
"^./App.vue$",
16-
"<THIRD_PARTY_MODULES>",
17-
"^@/(.*)$",
18-
"^[./]"
19-
],
20-
"importOrderSeparation": true,
21-
"importOrderSortSpecifiers": true,
2214
"attributeGroups": [
2315
"^ref",
2416
"^v-if",

examples/vue-cli-service/.prettierrc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,5 @@
55
"printWidth": 120,
66
"semi": false,
77
"singleQuote": true,
8-
"endOfLine": "auto",
9-
"plugins": [
10-
"@trivago/prettier-plugin-sort-imports",
11-
"prettier-plugin-tailwindcss"
12-
],
13-
"importOrder": [
14-
"<THIRD_PARTY_MODULES>",
15-
"^[./]"
16-
],
17-
"importOrderSeparation": true,
18-
"importOrderSortSpecifiers": true
8+
"endOfLine": "auto"
199
}

examples/vue-cli-service/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717
"devDependencies": {
1818
"@babel/core": "^7.12.16",
1919
"@babel/eslint-parser": "^7.12.16",
20-
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
2120
"@vue/cli-plugin-babel": "~5.0.0",
2221
"@vue/cli-plugin-eslint": "~5.0.0",
2322
"@vue/cli-service": "~5.0.0",
2423
"eslint": "^7.32.0",
2524
"eslint-plugin-vue": "^8.0.3",
26-
"prettier": "3.0.3",
27-
"prettier-plugin-tailwindcss": "^0.5.5"
25+
"prettier": "3.0.3"
2826
},
2927
"eslintConfig": {
3028
"root": true,

examples/vue-cli-service/yarn.lock

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
dependencies:
3737
"@babel/highlight" "^7.10.4"
3838

39-
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.22.13":
39+
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.22.13":
4040
version "7.22.13"
4141
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e"
4242
integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==
@@ -79,16 +79,7 @@
7979
eslint-visitor-keys "^2.1.0"
8080
semver "^6.3.1"
8181

82-
83-
version "7.17.7"
84-
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad"
85-
integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==
86-
dependencies:
87-
"@babel/types" "^7.17.0"
88-
jsesc "^2.5.1"
89-
source-map "^0.5.0"
90-
91-
"@babel/generator@^7.17.3", "@babel/generator@^7.23.0":
82+
"@babel/generator@^7.23.0":
9283
version "7.23.0"
9384
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420"
9485
integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==
@@ -158,20 +149,20 @@
158149
lodash.debounce "^4.0.8"
159150
resolve "^1.14.2"
160151

161-
"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.22.20", "@babel/helper-environment-visitor@^7.22.5":
152+
"@babel/helper-environment-visitor@^7.22.20", "@babel/helper-environment-visitor@^7.22.5":
162153
version "7.22.20"
163154
resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167"
164155
integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==
165156

166-
"@babel/helper-function-name@^7.16.7", "@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0":
157+
"@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0":
167158
version "7.23.0"
168159
resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759"
169160
integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==
170161
dependencies:
171162
"@babel/template" "^7.22.15"
172163
"@babel/types" "^7.23.0"
173164

174-
"@babel/helper-hoist-variables@^7.16.7", "@babel/helper-hoist-variables@^7.22.5":
165+
"@babel/helper-hoist-variables@^7.22.5":
175166
version "7.22.5"
176167
resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb"
177168
integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==
@@ -247,7 +238,7 @@
247238
dependencies:
248239
"@babel/types" "^7.22.5"
249240

250-
"@babel/helper-split-export-declaration@^7.16.7", "@babel/helper-split-export-declaration@^7.22.6":
241+
"@babel/helper-split-export-declaration@^7.22.6":
251242
version "7.22.6"
252243
resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c"
253244
integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==
@@ -259,7 +250,7 @@
259250
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f"
260251
integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==
261252

262-
"@babel/helper-validator-identifier@^7.16.7", "@babel/helper-validator-identifier@^7.22.20":
253+
"@babel/helper-validator-identifier@^7.22.20":
263254
version "7.22.20"
264255
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0"
265256
integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==
@@ -296,7 +287,7 @@
296287
chalk "^2.4.2"
297288
js-tokens "^4.0.0"
298289

299-
"@babel/parser@^7.17.3", "@babel/parser@^7.20.15", "@babel/parser@^7.20.5", "@babel/parser@^7.21.3", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0":
290+
"@babel/parser@^7.20.15", "@babel/parser@^7.21.3", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0":
300291
version "7.23.0"
301292
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719"
302293
integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==
@@ -998,22 +989,6 @@
998989
"@babel/parser" "^7.22.15"
999990
"@babel/types" "^7.22.15"
1000991

1001-
1002-
version "7.17.3"
1003-
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57"
1004-
integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==
1005-
dependencies:
1006-
"@babel/code-frame" "^7.16.7"
1007-
"@babel/generator" "^7.17.3"
1008-
"@babel/helper-environment-visitor" "^7.16.7"
1009-
"@babel/helper-function-name" "^7.16.7"
1010-
"@babel/helper-hoist-variables" "^7.16.7"
1011-
"@babel/helper-split-export-declaration" "^7.16.7"
1012-
"@babel/parser" "^7.17.3"
1013-
"@babel/types" "^7.17.0"
1014-
debug "^4.1.0"
1015-
globals "^11.1.0"
1016-
1017992
"@babel/traverse@^7.22.5", "@babel/traverse@^7.23.0":
1018993
version "7.23.0"
1019994
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.0.tgz#18196ddfbcf4ccea324b7f6d3ada00d8c5a99c53"
@@ -1030,15 +1005,7 @@
10301005
debug "^4.1.0"
10311006
globals "^11.1.0"
10321007

1033-
1034-
version "7.17.0"
1035-
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b"
1036-
integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==
1037-
dependencies:
1038-
"@babel/helper-validator-identifier" "^7.16.7"
1039-
to-fast-properties "^2.0.0"
1040-
1041-
"@babel/types@^7.17.0", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.4.4":
1008+
"@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.4.4":
10421009
version "7.23.0"
10431010
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb"
10441011
integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==
@@ -1607,18 +1574,6 @@
16071574
"@tanstack/query-core" "4.35.7"
16081575
use-sync-external-store "^1.2.0"
16091576

1610-
"@trivago/prettier-plugin-sort-imports@^4.2.0":
1611-
version "4.2.0"
1612-
resolved "https://registry.yarnpkg.com/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.2.0.tgz#b240366f9e2bda8e14edb18b14ea084e0ec25968"
1613-
integrity sha512-YBepjbt+ZNBVmN3ev1amQH3lWCmHyt5qTbLCp/syXJRu/Kw2koXh44qayB1gMRxcL/gV8egmjN5xWSrYyfUtyw==
1614-
dependencies:
1615-
"@babel/generator" "7.17.7"
1616-
"@babel/parser" "^7.20.5"
1617-
"@babel/traverse" "7.17.3"
1618-
"@babel/types" "7.17.0"
1619-
javascript-natural-sort "0.7.1"
1620-
lodash "^4.17.21"
1621-
16221577
"@trysound/[email protected]":
16231578
version "0.2.0"
16241579
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad"
@@ -5083,11 +5038,6 @@ isomorphic-ws@^4.0.1:
50835038
resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc"
50845039
integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==
50855040

5086-
5087-
version "0.7.1"
5088-
resolved "https://registry.yarnpkg.com/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz#f9e2303d4507f6d74355a73664d1440fb5a0ef59"
5089-
integrity sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==
5090-
50915041
javascript-stringify@^2.0.1:
50925042
version "2.1.0"
50935043
resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-2.1.0.tgz#27c76539be14d8bd128219a2d731b09337904e79"
@@ -6378,11 +6328,6 @@ prelude-ls@^1.2.1:
63786328
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
63796329
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
63806330

6381-
prettier-plugin-tailwindcss@^0.5.5:
6382-
version "0.5.5"
6383-
resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.5.tgz#2860de31772235231339ca5e8c745969532fab95"
6384-
integrity sha512-voy0CjWv/CM8yeaduv5ZwovovpTGMR5LbzlhGF+LtEvMJt9wBeVTVnW781hL38R/RcDXCJwN2rolsgr94B/n0Q==
6385-
63866331
63876332
version "3.0.3"
63886333
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
@@ -6999,11 +6944,6 @@ source-map-support@~0.5.20:
69996944
buffer-from "^1.0.0"
70006945
source-map "^0.6.0"
70016946

7002-
source-map@^0.5.0:
7003-
version "0.5.7"
7004-
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
7005-
integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==
7006-
70076947
source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
70086948
version "0.6.1"
70096949
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"

lib/actions/index.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
export { watchAsset } from './asset'
2-
32
export { fetchBalance, useFetchBalance } from './balance'
4-
53
export { fetchBlockNumber } from './block'
6-
7-
export { readContract, writeContract, estimateWriteContractGas } from './contract'
8-
4+
export { estimateWriteContractGas, readContract, writeContract } from './contract'
95
export { parseEvents, watchContractEvent } from './event'
10-
116
export { fetchGasPrice } from './gas'
12-
137
export { signMessage } from './message'
14-
158
export { multicall } from './multicall'
16-
179
export { fetchToken } from './token'
18-
1910
export {
2011
fetchTransaction,
2112
fetchTransactionReceipt,

lib/actions/multicall.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type MulticallResult, multicall as masterMulticall } from '@wagmi/core'
1+
import { multicall as masterMulticall, type MulticallResult } from '@wagmi/core'
22
import { type MulticallParameters } from 'viem/actions'
33
import { type ContractFunctionConfig } from 'viem/types/contract'
44

lib/index.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
import * as Chains from '@wagmi/core/chains'
22

3+
export { account, accountDetails, connect, disconnect, shortAddressFilter } from './account'
34
export * from './actions'
4-
5-
export * from './utils/abi'
6-
7-
export { connect, disconnect, accountDetails, shortAddressFilter, account } from './account'
8-
9-
export { selectChain, switchChain, getAvailableChains, chain } from './chain'
10-
5+
export { chain, getAvailableChains, selectChain, switchChain } from './chain'
116
export { Events } from './enums'
12-
13-
export { $on, $off } from './event'
14-
7+
export { $off, $on } from './event'
158
export { createWeb3Auth } from './plugin'
16-
17-
export type { Chain, Options, MulticallArgs, MulticallContract } from './types'
18-
9+
export type { Chain, MulticallArgs, MulticallContract, Options } from './types'
10+
export * from './utils/abi'
1911
export { init } from './wc'
20-
2112
export { Chains }

lib/types.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
Unit,
77
WaitForTransactionArgs
88
} from '@wagmi/core'
9-
import type { ThemeCtrlState } from '@web3modal/core'
9+
import type { ConfigCtrlState, ThemeCtrlState } from '@web3modal/core'
1010
import type { EthereumClient } from '@web3modal/ethereum'
1111
import type { WatchAssetParams } from 'viem/types/eip1193'
1212

@@ -39,7 +39,20 @@ export type Options = {
3939
* if true, the w3m provider will be disabled and a custom rpc based on the rpc from the chain configuration will be activated
4040
*/
4141
enableCustomProvider?: boolean
42-
web3modalOptions?: ThemeCtrlState
42+
web3modalOptions?: Pick<
43+
ConfigCtrlState,
44+
| 'mobileWallets'
45+
| 'desktopWallets'
46+
| 'walletImages'
47+
| 'chainImages'
48+
| 'tokenImages'
49+
| 'tokenContracts'
50+
| 'explorerRecommendedWalletIds'
51+
| 'explorerExcludedWalletIds'
52+
| 'termsOfServiceUrl'
53+
| 'privacyPolicyUrl'
54+
> &
55+
ThemeCtrlState
4356
}
4457

4558
export type { Chain }

lib/wc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type GetNetworkResult, configureChains, createConfig, watchAccount, watchNetwork } from '@wagmi/core'
1+
import { configureChains, createConfig, watchAccount, watchNetwork, type GetNetworkResult } from '@wagmi/core'
22
import { EthereumClient, w3mConnectors, w3mProvider } from '@web3modal/ethereum'
33
import { reactive, toRaw, watch } from 'vue'
44
import { publicProvider } from 'wagmi/providers/public'

lib/web3Modal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ModalCtrlState, ThemeCtrlState } from '@web3modal/core/dist/_types/src/types/controllerTypes'
22
import { type EthereumClient } from '@web3modal/ethereum'
33
import { Web3Modal } from '@web3modal/html'
4-
import { type Ref, ref } from 'vue'
4+
import { ref, type Ref } from 'vue'
55

66
import { Events } from './enums'
77
import { $emit } from './event'
@@ -22,7 +22,7 @@ export function initWeb3Modal(ethereumClient: EthereumClient) {
2222
web3Modal.value = new Web3Modal(
2323
{
2424
projectId: optionsState.projectId,
25-
...(optionsState?.web3modalOptions || [])
25+
...(optionsState?.web3modalOptions || {})
2626
},
2727
ethereumClient
2828
)

0 commit comments

Comments
 (0)