@wagmi/core 2.0.0-alpha.9 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/esm/actions/connect.js +4 -3
- package/dist/esm/actions/connect.js.map +1 -1
- package/dist/esm/actions/disconnect.js +1 -1
- package/dist/esm/actions/disconnect.js.map +1 -1
- package/dist/esm/actions/estimateFeesPerGas.js +3 -0
- package/dist/esm/actions/estimateFeesPerGas.js.map +1 -1
- package/dist/esm/actions/estimateGas.js +2 -2
- package/dist/esm/actions/estimateGas.js.map +1 -1
- package/dist/esm/actions/getAccount.js +1 -1
- package/dist/esm/actions/getAccount.js.map +1 -1
- package/dist/esm/actions/getBalance.js +3 -1
- package/dist/esm/actions/getBalance.js.map +1 -1
- package/dist/esm/actions/getBlock.js +3 -1
- package/dist/esm/actions/getBlock.js.map +1 -1
- package/dist/esm/actions/getBlockNumber.js +3 -1
- package/dist/esm/actions/getBlockNumber.js.map +1 -1
- package/dist/esm/actions/getChainId.js +2 -1
- package/dist/esm/actions/getChainId.js.map +1 -1
- package/dist/esm/actions/getClient.js +3 -0
- package/dist/esm/actions/getClient.js.map +1 -1
- package/dist/esm/actions/getConnections.js +2 -1
- package/dist/esm/actions/getConnections.js.map +1 -1
- package/dist/esm/actions/getConnectorClient.js +7 -3
- package/dist/esm/actions/getConnectorClient.js.map +1 -1
- package/dist/esm/actions/getConnectors.js +1 -1
- package/dist/esm/actions/getConnectors.js.map +1 -1
- package/dist/esm/actions/getEnsAddress.js +3 -1
- package/dist/esm/actions/getEnsAddress.js.map +1 -1
- package/dist/esm/actions/getEnsAvatar.js +3 -1
- package/dist/esm/actions/getEnsAvatar.js.map +1 -1
- package/dist/esm/actions/getEnsName.js +3 -1
- package/dist/esm/actions/getEnsName.js.map +1 -1
- package/dist/esm/actions/getEnsResolver.js +3 -1
- package/dist/esm/actions/getEnsResolver.js.map +1 -1
- package/dist/esm/actions/getPublicClient.js +3 -0
- package/dist/esm/actions/getPublicClient.js.map +1 -1
- package/dist/esm/actions/getToken.js +4 -0
- package/dist/esm/actions/getToken.js.map +1 -1
- package/dist/esm/actions/getTransaction.js +2 -1
- package/dist/esm/actions/getTransaction.js.map +1 -1
- package/dist/esm/actions/getWalletClient.js +4 -0
- package/dist/esm/actions/getWalletClient.js.map +1 -1
- package/dist/esm/actions/multicall.js +2 -0
- package/dist/esm/actions/multicall.js.map +1 -1
- package/dist/esm/actions/readContract.js +2 -1
- package/dist/esm/actions/readContract.js.map +1 -1
- package/dist/esm/actions/reconnect.js +3 -1
- package/dist/esm/actions/reconnect.js.map +1 -1
- package/dist/esm/actions/sendTransaction.js +4 -5
- package/dist/esm/actions/sendTransaction.js.map +1 -1
- package/dist/esm/actions/signMessage.js +4 -2
- package/dist/esm/actions/signMessage.js.map +1 -1
- package/dist/esm/actions/signTypedData.js +2 -2
- package/dist/esm/actions/signTypedData.js.map +1 -1
- package/dist/esm/actions/simulateContract.js +2 -7
- package/dist/esm/actions/simulateContract.js.map +1 -1
- package/dist/esm/actions/switchAccount.js +3 -2
- package/dist/esm/actions/switchAccount.js.map +1 -1
- package/dist/esm/actions/switchChain.js +5 -5
- package/dist/esm/actions/switchChain.js.map +1 -1
- package/dist/esm/actions/waitForTransactionReceipt.js +3 -0
- package/dist/esm/actions/waitForTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/watchAccount.js +1 -1
- package/dist/esm/actions/watchAccount.js.map +1 -1
- package/dist/esm/actions/watchBlockNumber.js +1 -1
- package/dist/esm/actions/watchBlockNumber.js.map +1 -1
- package/dist/esm/actions/watchBlocks.js +1 -1
- package/dist/esm/actions/watchBlocks.js.map +1 -1
- package/dist/esm/actions/watchChainId.js +2 -1
- package/dist/esm/actions/watchChainId.js.map +1 -1
- package/dist/esm/actions/watchClient.js +2 -1
- package/dist/esm/actions/watchClient.js.map +1 -1
- package/dist/esm/actions/watchConnections.js +2 -1
- package/dist/esm/actions/watchConnections.js.map +1 -1
- package/dist/esm/actions/watchConnectors.js +2 -1
- package/dist/esm/actions/watchConnectors.js.map +1 -1
- package/dist/esm/actions/watchContractEvent.js +2 -1
- package/dist/esm/actions/watchContractEvent.js.map +1 -1
- package/dist/esm/actions/watchPendingTransactions.js +2 -1
- package/dist/esm/actions/watchPendingTransactions.js.map +1 -1
- package/dist/esm/actions/watchPublicClient.js +2 -1
- package/dist/esm/actions/watchPublicClient.js.map +1 -1
- package/dist/esm/actions/writeContract.js +4 -7
- package/dist/esm/actions/writeContract.js.map +1 -1
- package/dist/esm/connectors/injected.js +1 -0
- package/dist/esm/connectors/injected.js.map +1 -1
- package/dist/esm/createConfig.js +11 -3
- package/dist/esm/createConfig.js.map +1 -1
- package/dist/esm/createStorage.js +2 -0
- package/dist/esm/createStorage.js.map +1 -1
- package/dist/esm/errors/base.js +1 -1
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/errors/config.js +3 -15
- package/dist/esm/errors/config.js.map +1 -1
- package/dist/esm/errors/connector.js.map +1 -1
- package/dist/esm/exports/index.js +5 -1
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/hydrate.js +34 -0
- package/dist/esm/hydrate.js.map +1 -0
- package/dist/esm/query/disconnect.js +1 -0
- package/dist/esm/query/disconnect.js.map +1 -1
- package/dist/esm/query/estimateFeesPerGas.js +1 -0
- package/dist/esm/query/estimateFeesPerGas.js.map +1 -1
- package/dist/esm/query/estimateGas.js +1 -0
- package/dist/esm/query/estimateGas.js.map +1 -1
- package/dist/esm/query/getBalance.js +1 -0
- package/dist/esm/query/getBalance.js.map +1 -1
- package/dist/esm/query/getBlock.js +1 -0
- package/dist/esm/query/getBlock.js.map +1 -1
- package/dist/esm/query/getBlockNumber.js +1 -0
- package/dist/esm/query/getBlockNumber.js.map +1 -1
- package/dist/esm/query/getConnectorClient.js +1 -0
- package/dist/esm/query/getConnectorClient.js.map +1 -1
- package/dist/esm/query/getEnsAddress.js +1 -0
- package/dist/esm/query/getEnsAddress.js.map +1 -1
- package/dist/esm/query/getEnsAvatar.js +1 -0
- package/dist/esm/query/getEnsAvatar.js.map +1 -1
- package/dist/esm/query/getEnsName.js +1 -0
- package/dist/esm/query/getEnsName.js.map +1 -1
- package/dist/esm/query/getEnsResolver.js +1 -0
- package/dist/esm/query/getEnsResolver.js.map +1 -1
- package/dist/esm/query/getToken.js +1 -0
- package/dist/esm/query/getToken.js.map +1 -1
- package/dist/esm/query/getTransaction.js +1 -0
- package/dist/esm/query/getTransaction.js.map +1 -1
- package/dist/esm/query/getWalletClient.js +1 -0
- package/dist/esm/query/getWalletClient.js.map +1 -1
- package/dist/esm/query/infiniteReadContracts.js +2 -0
- package/dist/esm/query/infiniteReadContracts.js.map +1 -1
- package/dist/esm/query/readContract.js +1 -0
- package/dist/esm/query/readContract.js.map +1 -1
- package/dist/esm/query/readContracts.js +3 -1
- package/dist/esm/query/readContracts.js.map +1 -1
- package/dist/esm/query/reconnect.js +2 -0
- package/dist/esm/query/reconnect.js.map +1 -1
- package/dist/esm/query/sendTransaction.js +1 -0
- package/dist/esm/query/sendTransaction.js.map +1 -1
- package/dist/esm/query/signTypedData.js +1 -0
- package/dist/esm/query/signTypedData.js.map +1 -1
- package/dist/esm/query/simulateContract.js +1 -0
- package/dist/esm/query/simulateContract.js.map +1 -1
- package/dist/esm/query/switchAccount.js +3 -0
- package/dist/esm/query/switchAccount.js.map +1 -1
- package/dist/esm/query/switchChain.js +2 -0
- package/dist/esm/query/switchChain.js.map +1 -1
- package/dist/esm/query/types.js +2 -1
- package/dist/esm/query/types.js.map +1 -1
- package/dist/esm/query/utils.js +1 -0
- package/dist/esm/query/utils.js.map +1 -1
- package/dist/esm/query/waitForTransactionReceipt.js +3 -0
- package/dist/esm/query/waitForTransactionReceipt.js.map +1 -1
- package/dist/esm/query/writeContract.js +3 -0
- package/dist/esm/query/writeContract.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/types/chain.js +3 -1
- package/dist/esm/types/chain.js.map +1 -1
- package/dist/esm/types/properties.js +1 -1
- package/dist/esm/types/properties.js.map +1 -1
- package/dist/esm/types/register.js +1 -1
- package/dist/esm/types/register.js.map +1 -1
- package/dist/esm/utils/cookie.js +37 -0
- package/dist/esm/utils/cookie.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/actions/connect.d.ts +7 -8
- package/dist/types/actions/connect.d.ts.map +1 -1
- package/dist/types/actions/disconnect.d.ts +4 -2
- package/dist/types/actions/disconnect.d.ts.map +1 -1
- package/dist/types/actions/estimateFeesPerGas.d.ts +3 -3
- package/dist/types/actions/estimateFeesPerGas.d.ts.map +1 -1
- package/dist/types/actions/estimateGas.d.ts +4 -2
- package/dist/types/actions/estimateGas.d.ts.map +1 -1
- package/dist/types/actions/getAccount.d.ts +1 -1
- package/dist/types/actions/getAccount.d.ts.map +1 -1
- package/dist/types/actions/getBalance.d.ts +3 -3
- package/dist/types/actions/getBalance.d.ts.map +1 -1
- package/dist/types/actions/getBlock.d.ts +3 -3
- package/dist/types/actions/getBlock.d.ts.map +1 -1
- package/dist/types/actions/getBlockNumber.d.ts +3 -3
- package/dist/types/actions/getBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/getChainId.d.ts +2 -2
- package/dist/types/actions/getChainId.d.ts.map +1 -1
- package/dist/types/actions/getClient.d.ts +3 -3
- package/dist/types/actions/getClient.d.ts.map +1 -1
- package/dist/types/actions/getConnections.d.ts +2 -2
- package/dist/types/actions/getConnections.d.ts.map +1 -1
- package/dist/types/actions/getConnectorClient.d.ts +6 -5
- package/dist/types/actions/getConnectorClient.d.ts.map +1 -1
- package/dist/types/actions/getConnectors.d.ts +1 -1
- package/dist/types/actions/getConnectors.d.ts.map +1 -1
- package/dist/types/actions/getEnsAddress.d.ts +3 -3
- package/dist/types/actions/getEnsAddress.d.ts.map +1 -1
- package/dist/types/actions/getEnsAvatar.d.ts +3 -3
- package/dist/types/actions/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/actions/getEnsName.d.ts +3 -3
- package/dist/types/actions/getEnsName.d.ts.map +1 -1
- package/dist/types/actions/getEnsResolver.d.ts +3 -3
- package/dist/types/actions/getEnsResolver.d.ts.map +1 -1
- package/dist/types/actions/getPublicClient.d.ts +3 -3
- package/dist/types/actions/getPublicClient.d.ts.map +1 -1
- package/dist/types/actions/getToken.d.ts +4 -4
- package/dist/types/actions/getToken.d.ts.map +1 -1
- package/dist/types/actions/getTransaction.d.ts +2 -2
- package/dist/types/actions/getTransaction.d.ts.map +1 -1
- package/dist/types/actions/getWalletClient.d.ts +4 -3
- package/dist/types/actions/getWalletClient.d.ts.map +1 -1
- package/dist/types/actions/multicall.d.ts +2 -2
- package/dist/types/actions/multicall.d.ts.map +1 -1
- package/dist/types/actions/readContract.d.ts +2 -2
- package/dist/types/actions/readContract.d.ts.map +1 -1
- package/dist/types/actions/reconnect.d.ts +4 -3
- package/dist/types/actions/reconnect.d.ts.map +1 -1
- package/dist/types/actions/sendTransaction.d.ts +6 -4
- package/dist/types/actions/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/signMessage.d.ts +6 -4
- package/dist/types/actions/signMessage.d.ts.map +1 -1
- package/dist/types/actions/signTypedData.d.ts +4 -2
- package/dist/types/actions/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/simulateContract.d.ts +4 -2
- package/dist/types/actions/simulateContract.d.ts.map +1 -1
- package/dist/types/actions/switchAccount.d.ts +5 -4
- package/dist/types/actions/switchAccount.d.ts.map +1 -1
- package/dist/types/actions/switchChain.d.ts +7 -6
- package/dist/types/actions/switchChain.d.ts.map +1 -1
- package/dist/types/actions/waitForTransactionReceipt.d.ts +3 -3
- package/dist/types/actions/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/watchAccount.d.ts +1 -1
- package/dist/types/actions/watchAccount.d.ts.map +1 -1
- package/dist/types/actions/watchBlockNumber.d.ts +1 -1
- package/dist/types/actions/watchBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/watchBlocks.d.ts +1 -1
- package/dist/types/actions/watchBlocks.d.ts.map +1 -1
- package/dist/types/actions/watchChainId.d.ts +2 -2
- package/dist/types/actions/watchChainId.d.ts.map +1 -1
- package/dist/types/actions/watchClient.d.ts +2 -2
- package/dist/types/actions/watchClient.d.ts.map +1 -1
- package/dist/types/actions/watchConnections.d.ts +2 -2
- package/dist/types/actions/watchConnections.d.ts.map +1 -1
- package/dist/types/actions/watchConnectors.d.ts +2 -2
- package/dist/types/actions/watchConnectors.d.ts.map +1 -1
- package/dist/types/actions/watchContractEvent.d.ts +2 -2
- package/dist/types/actions/watchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/watchPendingTransactions.d.ts +2 -2
- package/dist/types/actions/watchPendingTransactions.d.ts.map +1 -1
- package/dist/types/actions/watchPublicClient.d.ts +2 -2
- package/dist/types/actions/watchPublicClient.d.ts.map +1 -1
- package/dist/types/actions/writeContract.d.ts +6 -3
- package/dist/types/actions/writeContract.d.ts.map +1 -1
- package/dist/types/connectors/injected.d.ts +1 -1
- package/dist/types/connectors/injected.d.ts.map +1 -1
- package/dist/types/createConfig.d.ts +7 -0
- package/dist/types/createConfig.d.ts.map +1 -1
- package/dist/types/createStorage.d.ts +3 -3
- package/dist/types/createStorage.d.ts.map +1 -1
- package/dist/types/errors/base.d.ts +6 -0
- package/dist/types/errors/base.d.ts.map +1 -1
- package/dist/types/errors/config.d.ts +17 -9
- package/dist/types/errors/config.d.ts.map +1 -1
- package/dist/types/errors/connector.d.ts +6 -0
- package/dist/types/errors/connector.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +4 -2
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/hydrate.d.ts +10 -0
- package/dist/types/hydrate.d.ts.map +1 -0
- package/dist/types/query/disconnect.d.ts +1 -1
- package/dist/types/query/disconnect.d.ts.map +1 -1
- package/dist/types/query/estimateFeesPerGas.d.ts +1 -1
- package/dist/types/query/estimateFeesPerGas.d.ts.map +1 -1
- package/dist/types/query/estimateGas.d.ts +1 -1
- package/dist/types/query/estimateGas.d.ts.map +1 -1
- package/dist/types/query/getBalance.d.ts +1 -1
- package/dist/types/query/getBalance.d.ts.map +1 -1
- package/dist/types/query/getBlock.d.ts +2 -84
- package/dist/types/query/getBlock.d.ts.map +1 -1
- package/dist/types/query/getBlockNumber.d.ts +1 -1
- package/dist/types/query/getBlockNumber.d.ts.map +1 -1
- package/dist/types/query/getConnectorClient.d.ts +2 -2
- package/dist/types/query/getConnectorClient.d.ts.map +1 -1
- package/dist/types/query/getEnsAddress.d.ts +1 -1
- package/dist/types/query/getEnsAddress.d.ts.map +1 -1
- package/dist/types/query/getEnsAvatar.d.ts +1 -1
- package/dist/types/query/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/query/getEnsName.d.ts +1 -1
- package/dist/types/query/getEnsName.d.ts.map +1 -1
- package/dist/types/query/getEnsResolver.d.ts +1 -1
- package/dist/types/query/getEnsResolver.d.ts.map +1 -1
- package/dist/types/query/getToken.d.ts +1 -1
- package/dist/types/query/getToken.d.ts.map +1 -1
- package/dist/types/query/getTransaction.d.ts +2 -84
- package/dist/types/query/getTransaction.d.ts.map +1 -1
- package/dist/types/query/getWalletClient.d.ts +7 -212
- package/dist/types/query/getWalletClient.d.ts.map +1 -1
- package/dist/types/query/infiniteReadContracts.d.ts +2 -2
- package/dist/types/query/infiniteReadContracts.d.ts.map +1 -1
- package/dist/types/query/readContract.d.ts +1 -1
- package/dist/types/query/readContract.d.ts.map +1 -1
- package/dist/types/query/readContracts.d.ts +6 -6
- package/dist/types/query/readContracts.d.ts.map +1 -1
- package/dist/types/query/reconnect.d.ts +2 -2
- package/dist/types/query/reconnect.d.ts.map +1 -1
- package/dist/types/query/sendTransaction.d.ts +1 -1
- package/dist/types/query/sendTransaction.d.ts.map +1 -1
- package/dist/types/query/signTypedData.d.ts +1 -1
- package/dist/types/query/signTypedData.d.ts.map +1 -1
- package/dist/types/query/simulateContract.d.ts +1 -1
- package/dist/types/query/simulateContract.d.ts.map +1 -1
- package/dist/types/query/switchAccount.d.ts +2 -2
- package/dist/types/query/switchAccount.d.ts.map +1 -1
- package/dist/types/query/switchChain.d.ts +2 -2
- package/dist/types/query/switchChain.d.ts.map +1 -1
- package/dist/types/query/types.d.ts +2 -2
- package/dist/types/query/types.d.ts.map +1 -1
- package/dist/types/query/utils.d.ts +1 -1
- package/dist/types/query/utils.d.ts.map +1 -1
- package/dist/types/query/waitForTransactionReceipt.d.ts +4 -86
- package/dist/types/query/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/query/writeContract.d.ts +4 -45
- package/dist/types/query/writeContract.d.ts.map +1 -1
- package/dist/types/types/chain.d.ts +3 -3
- package/dist/types/types/chain.d.ts.map +1 -1
- package/dist/types/types/properties.d.ts +1 -1
- package/dist/types/types/properties.d.ts.map +1 -1
- package/dist/types/types/register.d.ts +1 -1
- package/dist/types/types/register.d.ts.map +1 -1
- package/dist/types/types/utils.d.ts +1 -1
- package/dist/types/types/utils.d.ts.map +1 -1
- package/dist/types/utils/cookie.d.ts +9 -0
- package/dist/types/utils/cookie.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/actions/connect.ts +18 -12
- package/src/actions/disconnect.ts +10 -2
- package/src/actions/estimateFeesPerGas.ts +3 -3
- package/src/actions/estimateGas.ts +14 -3
- package/src/actions/getAccount.ts +1 -1
- package/src/actions/getBalance.ts +3 -3
- package/src/actions/getBlock.ts +3 -3
- package/src/actions/getBlockNumber.ts +3 -3
- package/src/actions/getChainId.ts +2 -2
- package/src/actions/getClient.ts +3 -3
- package/src/actions/getConnections.ts +2 -2
- package/src/actions/getConnectorClient.ts +16 -7
- package/src/actions/getConnectors.ts +1 -1
- package/src/actions/getEnsAddress.ts +3 -3
- package/src/actions/getEnsAvatar.ts +3 -3
- package/src/actions/getEnsName.ts +3 -3
- package/src/actions/getEnsResolver.ts +3 -3
- package/src/actions/getPublicClient.ts +3 -3
- package/src/actions/getToken.ts +4 -4
- package/src/actions/getTransaction.ts +2 -2
- package/src/actions/getWalletClient.ts +12 -3
- package/src/actions/multicall.ts +2 -2
- package/src/actions/readContract.ts +2 -2
- package/src/actions/reconnect.ts +5 -4
- package/src/actions/sendTransaction.ts +16 -8
- package/src/actions/signMessage.ts +16 -5
- package/src/actions/signTypedData.ts +14 -3
- package/src/actions/simulateContract.ts +14 -7
- package/src/actions/switchAccount.ts +11 -4
- package/src/actions/switchChain.ts +24 -13
- package/src/actions/waitForTransactionReceipt.ts +3 -3
- package/src/actions/watchAccount.ts +1 -1
- package/src/actions/watchBlockNumber.ts +1 -1
- package/src/actions/watchBlocks.ts +1 -1
- package/src/actions/watchChainId.ts +2 -2
- package/src/actions/watchClient.ts +2 -2
- package/src/actions/watchConnections.ts +2 -2
- package/src/actions/watchConnectors.ts +2 -2
- package/src/actions/watchContractEvent.ts +2 -2
- package/src/actions/watchPendingTransactions.ts +2 -2
- package/src/actions/watchPublicClient.ts +2 -2
- package/src/actions/writeContract.ts +20 -10
- package/src/connectors/injected.ts +1 -1
- package/src/createConfig.ts +23 -3
- package/src/createStorage.ts +4 -2
- package/src/errors/base.ts +4 -1
- package/src/errors/config.ts +20 -18
- package/src/errors/connector.ts +6 -0
- package/src/exports/index.ts +19 -2
- package/src/hydrate.ts +42 -0
- package/src/query/disconnect.ts +1 -1
- package/src/query/estimateFeesPerGas.ts +1 -1
- package/src/query/estimateGas.ts +1 -1
- package/src/query/getBalance.ts +1 -1
- package/src/query/getBlock.ts +1 -1
- package/src/query/getBlockNumber.ts +1 -1
- package/src/query/getConnectorClient.ts +1 -1
- package/src/query/getEnsAddress.ts +1 -1
- package/src/query/getEnsAvatar.ts +1 -1
- package/src/query/getEnsName.ts +1 -1
- package/src/query/getEnsResolver.ts +1 -1
- package/src/query/getToken.ts +1 -1
- package/src/query/getTransaction.ts +1 -1
- package/src/query/getWalletClient.ts +1 -1
- package/src/query/infiniteReadContracts.ts +2 -2
- package/src/query/readContract.ts +1 -1
- package/src/query/readContracts.ts +4 -4
- package/src/query/reconnect.ts +2 -2
- package/src/query/sendTransaction.ts +1 -1
- package/src/query/signTypedData.ts +1 -1
- package/src/query/simulateContract.ts +1 -1
- package/src/query/switchAccount.ts +3 -3
- package/src/query/switchChain.ts +2 -2
- package/src/query/types.ts +7 -7
- package/src/query/utils.ts +1 -1
- package/src/query/waitForTransactionReceipt.ts +3 -3
- package/src/query/writeContract.ts +7 -3
- package/src/types/chain.ts +5 -4
- package/src/types/properties.ts +1 -1
- package/src/types/register.ts +1 -1
- package/src/types/utils.ts +2 -0
- package/src/utils/cookie.ts +34 -0
- package/src/version.ts +1 -1
- package/dist/esm/utils/assertActiveChain.js +0 -14
- package/dist/esm/utils/assertActiveChain.js.map +0 -1
- package/dist/types/utils/assertActiveChain.d.ts +0 -8
- package/dist/types/utils/assertActiveChain.d.ts.map +0 -1
- package/src/utils/assertActiveChain.ts +0 -26
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type Account,
|
|
3
3
|
type Address,
|
|
4
|
+
type BaseErrorType,
|
|
4
5
|
type Client,
|
|
5
6
|
createClient,
|
|
6
7
|
custom,
|
|
@@ -8,15 +9,18 @@ import {
|
|
|
8
9
|
|
|
9
10
|
import { parseAccount } from 'viem/utils'
|
|
10
11
|
import type { Config, Connection } from '../createConfig.js'
|
|
12
|
+
import type { ErrorType } from '../errors/base.js'
|
|
11
13
|
import {
|
|
12
|
-
|
|
14
|
+
ConnectorAccountNotFoundError,
|
|
15
|
+
type ConnectorAccountNotFoundErrorType,
|
|
13
16
|
ConnectorNotConnectedError,
|
|
17
|
+
type ConnectorNotConnectedErrorType,
|
|
14
18
|
} from '../errors/config.js'
|
|
15
19
|
import type {
|
|
16
20
|
ChainIdParameter,
|
|
17
21
|
ConnectorParameter,
|
|
18
22
|
} from '../types/properties.js'
|
|
19
|
-
import type
|
|
23
|
+
import { type Evaluate } from '../types/utils.js'
|
|
20
24
|
|
|
21
25
|
export type GetConnectorClientParameters<
|
|
22
26
|
config extends Config = Config,
|
|
@@ -40,11 +44,13 @@ export type GetConnectorClientReturnType<
|
|
|
40
44
|
>
|
|
41
45
|
|
|
42
46
|
export type GetConnectorClientErrorType =
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
47
|
+
| ConnectorAccountNotFoundErrorType
|
|
48
|
+
| ConnectorNotConnectedErrorType
|
|
49
|
+
// base
|
|
50
|
+
| BaseErrorType
|
|
51
|
+
| ErrorType
|
|
46
52
|
|
|
47
|
-
/** https://
|
|
53
|
+
/** https://beta.wagmi.sh/core/api/actions/getConnectorClient */
|
|
48
54
|
export async function getConnectorClient<
|
|
49
55
|
config extends Config,
|
|
50
56
|
chainId extends config['chains'][number]['id'],
|
|
@@ -85,7 +91,10 @@ export async function getConnectorClient<
|
|
|
85
91
|
|
|
86
92
|
// if account was provided, check that it exists on the connector
|
|
87
93
|
if (parameters.account && !connection.accounts.includes(account.address))
|
|
88
|
-
throw new
|
|
94
|
+
throw new ConnectorAccountNotFoundError({
|
|
95
|
+
address: account.address,
|
|
96
|
+
connector,
|
|
97
|
+
})
|
|
89
98
|
|
|
90
99
|
return createClient({
|
|
91
100
|
account,
|
|
@@ -5,7 +5,7 @@ export type GetConnectorsReturnType = readonly Connector[]
|
|
|
5
5
|
|
|
6
6
|
let previousConnectors: readonly Connector[] = []
|
|
7
7
|
|
|
8
|
-
/** https://
|
|
8
|
+
/** https://beta.wagmi.sh/core/api/actions/getConnectors */
|
|
9
9
|
export function getConnectors(config: Config): GetConnectorsReturnType {
|
|
10
10
|
const connectors = config.connectors
|
|
11
11
|
if (deepEqual(previousConnectors, connectors)) return previousConnectors
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from 'viem/actions'
|
|
7
7
|
|
|
8
8
|
import { type Config } from '../createConfig.js'
|
|
9
|
-
import type
|
|
10
|
-
import type
|
|
9
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
10
|
+
import { type Evaluate } from '../types/utils.js'
|
|
11
11
|
|
|
12
12
|
export type GetEnsAddressParameters<config extends Config = Config> = Evaluate<
|
|
13
13
|
viem_GetEnsAddressParameters & ChainIdParameter<config>
|
|
@@ -17,7 +17,7 @@ export type GetEnsAddressReturnType = viem_GetEnsAddressReturnType
|
|
|
17
17
|
|
|
18
18
|
export type GetEnsAddressErrorType = viem_GetEnsAddressErrorType
|
|
19
19
|
|
|
20
|
-
/** https://
|
|
20
|
+
/** https://beta.wagmi.sh/core/api/actions/getEnsAddress */
|
|
21
21
|
export function getEnsAddress<config extends Config>(
|
|
22
22
|
config: config,
|
|
23
23
|
parameters: GetEnsAddressParameters<config>,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from 'viem/actions'
|
|
7
7
|
|
|
8
8
|
import { type Config } from '../createConfig.js'
|
|
9
|
-
import type
|
|
10
|
-
import type
|
|
9
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
10
|
+
import { type Evaluate } from '../types/utils.js'
|
|
11
11
|
|
|
12
12
|
export type GetEnsAvatarParameters<config extends Config = Config> = Evaluate<
|
|
13
13
|
viem_GetEnsAvatarParameters & ChainIdParameter<config>
|
|
@@ -17,7 +17,7 @@ export type GetEnsAvatarReturnType = viem_GetEnsAvatarReturnType
|
|
|
17
17
|
|
|
18
18
|
export type GetEnsAvatarErrorType = viem_GetEnsAvatarErrorType
|
|
19
19
|
|
|
20
|
-
/** https://
|
|
20
|
+
/** https://beta.wagmi.sh/core/api/actions/getEnsAvatar */
|
|
21
21
|
export function getEnsAvatar<config extends Config>(
|
|
22
22
|
config: config,
|
|
23
23
|
parameters: GetEnsAvatarParameters<config>,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from 'viem/actions'
|
|
7
7
|
|
|
8
8
|
import { type Config } from '../createConfig.js'
|
|
9
|
-
import type
|
|
10
|
-
import type
|
|
9
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
10
|
+
import { type Evaluate } from '../types/utils.js'
|
|
11
11
|
|
|
12
12
|
export type GetEnsNameParameters<config extends Config = Config> = Evaluate<
|
|
13
13
|
viem_GetEnsNameParameters & ChainIdParameter<config>
|
|
@@ -17,7 +17,7 @@ export type GetEnsNameReturnType = viem_GetEnsNameReturnType
|
|
|
17
17
|
|
|
18
18
|
export type GetEnsNameErrorType = viem_GetEnsNameErrorType
|
|
19
19
|
|
|
20
|
-
/** https://
|
|
20
|
+
/** https://beta.wagmi.sh/core/api/actions/getEnsName */
|
|
21
21
|
export function getEnsName<config extends Config>(
|
|
22
22
|
config: config,
|
|
23
23
|
parameters: GetEnsNameParameters<config>,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from 'viem/actions'
|
|
7
7
|
|
|
8
8
|
import { type Config } from '../createConfig.js'
|
|
9
|
-
import type
|
|
10
|
-
import type
|
|
9
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
10
|
+
import { type Evaluate } from '../types/utils.js'
|
|
11
11
|
|
|
12
12
|
export type GetEnsResolverParameters<config extends Config = Config> = Evaluate<
|
|
13
13
|
viem_GetEnsResolverParameters & ChainIdParameter<config>
|
|
@@ -17,7 +17,7 @@ export type GetEnsResolverReturnType = viem_GetEnsResolverReturnType
|
|
|
17
17
|
|
|
18
18
|
export type GetEnsResolverErrorType = viem_GetEnsResolverErrorType
|
|
19
19
|
|
|
20
|
-
/** https://
|
|
20
|
+
/** https://beta.wagmi.sh/core/api/actions/getEnsResolver */
|
|
21
21
|
export function getEnsResolver<config extends Config>(
|
|
22
22
|
config: config,
|
|
23
23
|
parameters: GetEnsResolverParameters<config>,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type PublicClient, publicActions } from 'viem'
|
|
2
2
|
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
5
|
-
import type
|
|
3
|
+
import { type Config } from '../createConfig.js'
|
|
4
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
5
|
+
import { type Evaluate } from '../types/utils.js'
|
|
6
6
|
|
|
7
7
|
export type GetPublicClientParameters<
|
|
8
8
|
config extends Config = Config,
|
package/src/actions/getToken.ts
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
trim,
|
|
7
7
|
} from 'viem'
|
|
8
8
|
|
|
9
|
-
import type
|
|
10
|
-
import type
|
|
11
|
-
import type
|
|
12
|
-
import type
|
|
9
|
+
import { type Config } from '../createConfig.js'
|
|
10
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
11
|
+
import { type Unit } from '../types/unit.js'
|
|
12
|
+
import { type Evaluate } from '../types/utils.js'
|
|
13
13
|
import { getUnit } from '../utils/getUnit.js'
|
|
14
14
|
import { type ReadContractsErrorType, readContracts } from './readContracts.js'
|
|
15
15
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { type Config } from '../createConfig.js'
|
|
10
10
|
import type { SelectChains } from '../types/chain.js'
|
|
11
|
-
import type
|
|
11
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
12
12
|
import { type Evaluate } from '../types/utils.js'
|
|
13
13
|
|
|
14
14
|
export type GetTransactionParameters<
|
|
@@ -29,7 +29,7 @@ export type GetTransactionReturnType<
|
|
|
29
29
|
|
|
30
30
|
export type GetTransactionErrorType = viem_GetTransactionErrorType
|
|
31
31
|
|
|
32
|
-
/** https://
|
|
32
|
+
/** https://beta.wagmi.sh/core/api/actions/getTransaction */
|
|
33
33
|
export function getTransaction<
|
|
34
34
|
config extends Config,
|
|
35
35
|
chainId extends config['chains'][number]['id'],
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Account, type WalletClient, walletActions } from 'viem'
|
|
2
2
|
|
|
3
|
-
import type
|
|
4
|
-
import type {
|
|
3
|
+
import { type Config } from '../createConfig.js'
|
|
4
|
+
import type { BaseErrorType, ErrorType } from '../errors/base.js'
|
|
5
|
+
import { type Evaluate } from '../types/utils.js'
|
|
5
6
|
import {
|
|
6
7
|
type GetConnectorClientErrorType,
|
|
7
8
|
type GetConnectorClientParameters,
|
|
@@ -24,7 +25,12 @@ export type GetWalletClientReturnType<
|
|
|
24
25
|
>
|
|
25
26
|
>
|
|
26
27
|
|
|
27
|
-
export type GetWalletClientErrorType =
|
|
28
|
+
export type GetWalletClientErrorType =
|
|
29
|
+
// getConnectorClient()
|
|
30
|
+
| GetConnectorClientErrorType
|
|
31
|
+
// base
|
|
32
|
+
| BaseErrorType
|
|
33
|
+
| ErrorType
|
|
28
34
|
|
|
29
35
|
export async function getWalletClient<
|
|
30
36
|
config extends Config,
|
|
@@ -34,6 +40,9 @@ export async function getWalletClient<
|
|
|
34
40
|
parameters: GetWalletClientParameters<config, chainId> = {},
|
|
35
41
|
): Promise<GetWalletClientReturnType<config, chainId>> {
|
|
36
42
|
const client = await getConnectorClient(config, parameters)
|
|
43
|
+
client.extend(walletActions)
|
|
44
|
+
|
|
45
|
+
// @ts-ignore
|
|
37
46
|
return client.extend(walletActions) as unknown as GetWalletClientReturnType<
|
|
38
47
|
config,
|
|
39
48
|
chainId
|
package/src/actions/multicall.ts
CHANGED
|
@@ -6,8 +6,8 @@ import type {
|
|
|
6
6
|
} from 'viem'
|
|
7
7
|
import { multicall as viem_multicall } from 'viem/actions'
|
|
8
8
|
|
|
9
|
-
import type
|
|
10
|
-
import type
|
|
9
|
+
import { type Config } from '../createConfig.js'
|
|
10
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
11
11
|
|
|
12
12
|
export type MulticallParameters<
|
|
13
13
|
contracts extends readonly unknown[] = readonly ContractFunctionParameters[],
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from 'viem/actions'
|
|
9
9
|
|
|
10
10
|
import { type Config } from '../createConfig.js'
|
|
11
|
-
import type
|
|
11
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
12
12
|
|
|
13
13
|
export type ReadContractParameters<
|
|
14
14
|
abi extends Abi | readonly unknown[] = Abi,
|
|
@@ -40,7 +40,7 @@ export type ReadContractReturnType<
|
|
|
40
40
|
|
|
41
41
|
export type ReadContractErrorType = viem_ReadContractErrorType
|
|
42
42
|
|
|
43
|
-
/** https://
|
|
43
|
+
/** https://beta.wagmi.sh/core/api/actions/readContract */
|
|
44
44
|
export function readContract<
|
|
45
45
|
config extends Config,
|
|
46
46
|
const abi extends Abi | readonly unknown[],
|
package/src/actions/reconnect.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Address } from 'viem'
|
|
2
2
|
|
|
3
3
|
import { type CreateConnectorFn } from '../connectors/createConnector.js'
|
|
4
4
|
import type { Config, Connection, Connector } from '../createConfig.js'
|
|
5
|
-
import type {
|
|
5
|
+
import type { ErrorType } from '../errors/base.js'
|
|
6
|
+
import { type Evaluate } from '../types/utils.js'
|
|
6
7
|
|
|
7
8
|
export type ReconnectParameters = {
|
|
8
9
|
/** Connectors to attempt reconnect with */
|
|
@@ -11,11 +12,11 @@ export type ReconnectParameters = {
|
|
|
11
12
|
|
|
12
13
|
export type ReconnectReturnType = Evaluate<Connection>[]
|
|
13
14
|
|
|
14
|
-
export type ReconnectErrorType =
|
|
15
|
+
export type ReconnectErrorType = ErrorType
|
|
15
16
|
|
|
16
17
|
let isReconnecting = false
|
|
17
18
|
|
|
18
|
-
/** https://
|
|
19
|
+
/** https://beta.wagmi.sh/core/api/actions/reconnect */
|
|
19
20
|
export async function reconnect(
|
|
20
21
|
config: Config,
|
|
21
22
|
parameters: ReconnectParameters = {},
|
|
@@ -8,15 +8,18 @@ import type {
|
|
|
8
8
|
} from 'viem'
|
|
9
9
|
import { sendTransaction as viem_sendTransaction } from 'viem/actions'
|
|
10
10
|
|
|
11
|
-
import type
|
|
11
|
+
import { type Config } from '../createConfig.js'
|
|
12
|
+
import type { BaseErrorType, ErrorType } from '../errors/base.js'
|
|
12
13
|
import type { SelectChains } from '../types/chain.js'
|
|
13
14
|
import type {
|
|
14
15
|
ChainIdParameter,
|
|
15
16
|
ConnectorParameter,
|
|
16
17
|
} from '../types/properties.js'
|
|
17
|
-
import type
|
|
18
|
-
import {
|
|
19
|
-
|
|
18
|
+
import { type Evaluate } from '../types/utils.js'
|
|
19
|
+
import {
|
|
20
|
+
type GetConnectorClientErrorType,
|
|
21
|
+
getConnectorClient,
|
|
22
|
+
} from './getConnectorClient.js'
|
|
20
23
|
|
|
21
24
|
export type SendTransactionParameters<
|
|
22
25
|
config extends Config = Config,
|
|
@@ -38,9 +41,16 @@ export type SendTransactionParameters<
|
|
|
38
41
|
|
|
39
42
|
export type SendTransactionReturnType = viem_SendTransactionReturnType
|
|
40
43
|
|
|
41
|
-
export type SendTransactionErrorType =
|
|
44
|
+
export type SendTransactionErrorType =
|
|
45
|
+
// getConnectorClient()
|
|
46
|
+
| GetConnectorClientErrorType
|
|
47
|
+
// base
|
|
48
|
+
| BaseErrorType
|
|
49
|
+
| ErrorType
|
|
50
|
+
// viem
|
|
51
|
+
| viem_SendTransactionErrorType
|
|
42
52
|
|
|
43
|
-
/** https://
|
|
53
|
+
/** https://beta.wagmi.sh/core/api/actions/sendTransaction */
|
|
44
54
|
export async function sendTransaction<
|
|
45
55
|
config extends Config,
|
|
46
56
|
chainId extends config['chains'][number]['id'],
|
|
@@ -55,8 +65,6 @@ export async function sendTransaction<
|
|
|
55
65
|
chainId,
|
|
56
66
|
connector,
|
|
57
67
|
})
|
|
58
|
-
if (chainId)
|
|
59
|
-
assertActiveChain(config, { activeChainId: client.chain.id, chainId })
|
|
60
68
|
|
|
61
69
|
const hash = await viem_sendTransaction(client, {
|
|
62
70
|
...(rest as any),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Account } from 'viem'
|
|
2
2
|
import {
|
|
3
3
|
type SignMessageErrorType as viem_SignMessageErrorType,
|
|
4
4
|
type SignMessageParameters as viem_SignMessageParameters,
|
|
@@ -7,9 +7,13 @@ import {
|
|
|
7
7
|
} from 'viem/actions'
|
|
8
8
|
|
|
9
9
|
import { type Config } from '../createConfig.js'
|
|
10
|
+
import type { BaseErrorType, ErrorType } from '../errors/base.js'
|
|
10
11
|
import type { ConnectorParameter } from '../types/properties.js'
|
|
11
|
-
import type
|
|
12
|
-
import {
|
|
12
|
+
import { type Evaluate } from '../types/utils.js'
|
|
13
|
+
import {
|
|
14
|
+
type GetConnectorClientErrorType,
|
|
15
|
+
getConnectorClient,
|
|
16
|
+
} from './getConnectorClient.js'
|
|
13
17
|
|
|
14
18
|
export type SignMessageParameters = Evaluate<
|
|
15
19
|
viem_SignMessageParameters<Account> & ConnectorParameter
|
|
@@ -17,9 +21,16 @@ export type SignMessageParameters = Evaluate<
|
|
|
17
21
|
|
|
18
22
|
export type SignMessageReturnType = viem_SignMessageReturnType
|
|
19
23
|
|
|
20
|
-
export type SignMessageErrorType =
|
|
24
|
+
export type SignMessageErrorType =
|
|
25
|
+
// getConnectorClient()
|
|
26
|
+
| GetConnectorClientErrorType
|
|
27
|
+
// base
|
|
28
|
+
| BaseErrorType
|
|
29
|
+
| ErrorType
|
|
30
|
+
// viem
|
|
31
|
+
| viem_SignMessageErrorType
|
|
21
32
|
|
|
22
|
-
/** https://
|
|
33
|
+
/** https://beta.wagmi.sh/core/api/actions/signMessage */
|
|
23
34
|
export async function signMessage(
|
|
24
35
|
config: Config,
|
|
25
36
|
parameters: SignMessageParameters,
|
|
@@ -7,9 +7,13 @@ import {
|
|
|
7
7
|
} from 'viem/actions'
|
|
8
8
|
|
|
9
9
|
import { type Config } from '../createConfig.js'
|
|
10
|
+
import type { BaseErrorType, ErrorType } from '../errors/base.js'
|
|
10
11
|
import type { ConnectorParameter } from '../types/properties.js'
|
|
11
12
|
import type { UnionEvaluate } from '../types/utils.js'
|
|
12
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
type GetConnectorClientErrorType,
|
|
15
|
+
getConnectorClient,
|
|
16
|
+
} from './getConnectorClient.js'
|
|
13
17
|
|
|
14
18
|
export type SignTypedDataParameters<
|
|
15
19
|
typedData extends TypedData | Record<string, unknown> = TypedData,
|
|
@@ -23,9 +27,16 @@ export type SignTypedDataParameters<
|
|
|
23
27
|
|
|
24
28
|
export type SignTypedDataReturnType = viem_SignTypedDataReturnType
|
|
25
29
|
|
|
26
|
-
export type SignTypedDataErrorType =
|
|
30
|
+
export type SignTypedDataErrorType =
|
|
31
|
+
// getConnectorClient()
|
|
32
|
+
| GetConnectorClientErrorType
|
|
33
|
+
// base
|
|
34
|
+
| BaseErrorType
|
|
35
|
+
| ErrorType
|
|
36
|
+
// viem
|
|
37
|
+
| viem_SignMessageErrorType
|
|
27
38
|
|
|
28
|
-
/** https://
|
|
39
|
+
/** https://beta.wagmi.sh/core/api/actions/signTypedData */
|
|
29
40
|
export async function signTypedData<
|
|
30
41
|
const typedData extends TypedData | Record<string, unknown>,
|
|
31
42
|
primaryType extends keyof typedData | 'EIP712Domain',
|
|
@@ -14,14 +14,17 @@ import {
|
|
|
14
14
|
} from 'viem/actions'
|
|
15
15
|
|
|
16
16
|
import { type Config } from '../createConfig.js'
|
|
17
|
+
import type { BaseErrorType, ErrorType } from '../errors/base.js'
|
|
17
18
|
import type { SelectChains } from '../types/chain.js'
|
|
18
19
|
import type {
|
|
19
20
|
ChainIdParameter,
|
|
20
21
|
ConnectorParameter,
|
|
21
22
|
} from '../types/properties.js'
|
|
22
23
|
import type { PartialBy, UnionEvaluate, UnionOmit } from '../types/utils.js'
|
|
23
|
-
import {
|
|
24
|
-
|
|
24
|
+
import {
|
|
25
|
+
type GetConnectorClientErrorType,
|
|
26
|
+
getConnectorClient,
|
|
27
|
+
} from './getConnectorClient.js'
|
|
25
28
|
|
|
26
29
|
export type SimulateContractParameters<
|
|
27
30
|
abi extends Abi | readonly unknown[] = Abi,
|
|
@@ -102,9 +105,16 @@ export type SimulateContractReturnType<
|
|
|
102
105
|
: never
|
|
103
106
|
}[number]
|
|
104
107
|
|
|
105
|
-
export type SimulateContractErrorType =
|
|
108
|
+
export type SimulateContractErrorType =
|
|
109
|
+
// getConnectorClient()
|
|
110
|
+
| GetConnectorClientErrorType
|
|
111
|
+
// base
|
|
112
|
+
| BaseErrorType
|
|
113
|
+
| ErrorType
|
|
114
|
+
// viem
|
|
115
|
+
| viem_SimulateContractErrorType
|
|
106
116
|
|
|
107
|
-
/** https://
|
|
117
|
+
/** https://beta.wagmi.sh/core/api/actions/simulateContract */
|
|
108
118
|
export async function simulateContract<
|
|
109
119
|
config extends Config,
|
|
110
120
|
const abi extends Abi | readonly unknown[],
|
|
@@ -131,7 +141,6 @@ export async function simulateContract<
|
|
|
131
141
|
parameters as SimulateContractParameters
|
|
132
142
|
|
|
133
143
|
let account: Address | Account
|
|
134
|
-
let activeChainId: number | undefined
|
|
135
144
|
if (parameters.account) account = parameters.account
|
|
136
145
|
else {
|
|
137
146
|
const connectorClient = await getConnectorClient(config, {
|
|
@@ -139,9 +148,7 @@ export async function simulateContract<
|
|
|
139
148
|
connector,
|
|
140
149
|
})
|
|
141
150
|
account = connectorClient.account
|
|
142
|
-
activeChainId = connectorClient.chain.id
|
|
143
151
|
}
|
|
144
|
-
if (chainId) assertActiveChain(config, { activeChainId, chainId })
|
|
145
152
|
|
|
146
153
|
const client = config.getClient({ chainId })
|
|
147
154
|
const { result, request } = await viem_simulateContract(client, {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Address } from 'viem'
|
|
2
2
|
|
|
3
3
|
import { type Config, type Connector } from '../createConfig.js'
|
|
4
|
-
import {
|
|
4
|
+
import type { BaseError, ErrorType } from '../errors/base.js'
|
|
5
|
+
import {
|
|
6
|
+
ConnectorNotConnectedError,
|
|
7
|
+
type ConnectorNotConnectedErrorType,
|
|
8
|
+
} from '../errors/config.js'
|
|
5
9
|
|
|
6
10
|
export type SwitchAccountParameters = {
|
|
7
11
|
connector: Connector
|
|
@@ -14,9 +18,12 @@ export type SwitchAccountReturnType<config extends Config = Config> = {
|
|
|
14
18
|
| (number extends config['chains'][number]['id'] ? number : number & {})
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
export type SwitchAccountErrorType =
|
|
21
|
+
export type SwitchAccountErrorType =
|
|
22
|
+
| ConnectorNotConnectedErrorType
|
|
23
|
+
| BaseError
|
|
24
|
+
| ErrorType
|
|
18
25
|
|
|
19
|
-
/** https://
|
|
26
|
+
/** https://beta.wagmi.sh/core/api/actions/switchAccount */
|
|
20
27
|
export async function switchAccount<config extends Config>(
|
|
21
28
|
config: config,
|
|
22
29
|
parameters: SwitchAccountParameters,
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type SwitchChainErrorType as viem_SwitchChainErrorType,
|
|
3
|
+
type UserRejectedRequestErrorType,
|
|
4
4
|
} from 'viem'
|
|
5
5
|
|
|
6
6
|
import { type Config } from '../createConfig.js'
|
|
7
|
-
import type {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import type { BaseErrorType, ErrorType } from '../errors/base.js'
|
|
8
|
+
import {
|
|
9
|
+
ChainNotConfiguredError,
|
|
10
|
+
type ChainNotConfiguredErrorType,
|
|
11
|
+
} from '../errors/config.js'
|
|
12
|
+
import {
|
|
13
|
+
type ProviderNotFoundErrorType,
|
|
14
|
+
SwitchChainNotSupportedError,
|
|
15
|
+
type SwitchChainNotSupportedErrorType,
|
|
16
|
+
} from '../errors/connector.js'
|
|
11
17
|
import type { ConnectorParameter } from '../types/properties.js'
|
|
12
|
-
import type
|
|
18
|
+
import { type Evaluate } from '../types/utils.js'
|
|
13
19
|
|
|
14
20
|
export type SwitchChainParameters<
|
|
15
21
|
config extends Config = Config,
|
|
@@ -29,13 +35,18 @@ export type SwitchChainReturnType<
|
|
|
29
35
|
>
|
|
30
36
|
|
|
31
37
|
export type SwitchChainErrorType =
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
35
|
-
|
|
|
36
|
-
|
|
|
38
|
+
| SwitchChainNotSupportedErrorType
|
|
39
|
+
| ChainNotConfiguredErrorType
|
|
40
|
+
// connector.switchChain()
|
|
41
|
+
| ProviderNotFoundErrorType
|
|
42
|
+
| UserRejectedRequestErrorType
|
|
43
|
+
// base
|
|
44
|
+
| BaseErrorType
|
|
45
|
+
| ErrorType
|
|
46
|
+
// viem
|
|
47
|
+
| viem_SwitchChainErrorType
|
|
37
48
|
|
|
38
|
-
/** https://
|
|
49
|
+
/** https://beta.wagmi.sh/core/api/actions/switchChain */
|
|
39
50
|
export async function switchChain<
|
|
40
51
|
config extends Config,
|
|
41
52
|
chainId extends config['chains'][number]['id'],
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
waitForTransactionReceipt as viem_waitForTransactionReceipt,
|
|
10
10
|
} from 'viem/actions'
|
|
11
11
|
|
|
12
|
-
import type
|
|
12
|
+
import { type Config } from '../createConfig.js'
|
|
13
13
|
import type { SelectChains } from '../types/chain.js'
|
|
14
|
-
import type
|
|
15
|
-
import type
|
|
14
|
+
import { type ChainIdParameter } from '../types/properties.js'
|
|
15
|
+
import { type Evaluate } from '../types/utils.js'
|
|
16
16
|
|
|
17
17
|
export type WaitForTransactionReceiptParameters<
|
|
18
18
|
config extends Config = Config,
|
|
@@ -11,7 +11,7 @@ export type WatchAccountParameters = {
|
|
|
11
11
|
|
|
12
12
|
export type WatchAccountReturnType = () => void
|
|
13
13
|
|
|
14
|
-
/** https://
|
|
14
|
+
/** https://beta.wagmi.sh/core/api/actions/watchAccount */
|
|
15
15
|
export function watchAccount(
|
|
16
16
|
config: Config,
|
|
17
17
|
parameters: WatchAccountParameters,
|
|
@@ -35,7 +35,7 @@ export type WatchBlockNumberParameters<
|
|
|
35
35
|
export type WatchBlockNumberReturnType = viem_WatchBlockNumberReturnType
|
|
36
36
|
|
|
37
37
|
// TODO: wrap in viem's `observe` to avoid duplicate invocations.
|
|
38
|
-
/** https://
|
|
38
|
+
/** https://beta.wagmi.sh/core/api/actions/watchBlockNumber */
|
|
39
39
|
export function watchBlockNumber<
|
|
40
40
|
config extends Config,
|
|
41
41
|
chainId extends config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
@@ -40,7 +40,7 @@ export type WatchBlocksParameters<
|
|
|
40
40
|
export type WatchBlocksReturnType = viem_WatchBlocksReturnType
|
|
41
41
|
|
|
42
42
|
// TODO: wrap in viem's `observe` to avoid duplicate invocations.
|
|
43
|
-
/** https://
|
|
43
|
+
/** https://beta.wagmi.sh/core/actions/watchBlocks */
|
|
44
44
|
export function watchBlocks<
|
|
45
45
|
config extends Config,
|
|
46
46
|
chainId extends config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Config } from '../createConfig.js'
|
|
2
2
|
import type { GetChainIdReturnType } from './getChainId.js'
|
|
3
3
|
|
|
4
4
|
export type WatchChainIdParameters<config extends Config = Config> = {
|
|
@@ -10,7 +10,7 @@ export type WatchChainIdParameters<config extends Config = Config> = {
|
|
|
10
10
|
|
|
11
11
|
export type WatchChainIdReturnType = () => void
|
|
12
12
|
|
|
13
|
-
/** https://
|
|
13
|
+
/** https://beta.wagmi.sh/core/api/actions/watchChainId */
|
|
14
14
|
export function watchChainId<config extends Config>(
|
|
15
15
|
config: config,
|
|
16
16
|
parameters: WatchChainIdParameters<config>,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Config } from '../createConfig.js'
|
|
2
2
|
import { type GetClientReturnType, getClient } from './getClient.js'
|
|
3
3
|
|
|
4
4
|
export type WatchClientParameters<
|
|
@@ -13,7 +13,7 @@ export type WatchClientParameters<
|
|
|
13
13
|
|
|
14
14
|
export type WatchClientReturnType = () => void
|
|
15
15
|
|
|
16
|
-
/** https://
|
|
16
|
+
/** https://beta.wagmi.sh/core/api/actions/watchClient */
|
|
17
17
|
export function watchClient<
|
|
18
18
|
config extends Config,
|
|
19
19
|
chainId extends config['chains'][number]['id'],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Config } from '../createConfig.js'
|
|
2
2
|
import { deepEqual } from '../utils/deepEqual.js'
|
|
3
3
|
import {
|
|
4
4
|
type GetConnectionsReturnType,
|
|
@@ -14,7 +14,7 @@ export type WatchConnectionsParameters = {
|
|
|
14
14
|
|
|
15
15
|
export type WatchConnectionsReturnType = () => void
|
|
16
16
|
|
|
17
|
-
/** https://
|
|
17
|
+
/** https://beta.wagmi.sh/core/api/actions/watchConnections */
|
|
18
18
|
export function watchConnections(
|
|
19
19
|
config: Config,
|
|
20
20
|
parameters: WatchConnectionsParameters,
|