@wagmi/core 2.11.7 → 2.12.0
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/dist/esm/actions/codegen/createWriteContract.js.map +1 -1
- package/dist/esm/actions/watchAsset.js +11 -0
- package/dist/esm/actions/watchAsset.js.map +1 -0
- package/dist/esm/connectors/injected.js +7 -0
- package/dist/esm/connectors/injected.js.map +1 -1
- package/dist/esm/connectors/mock.js +8 -0
- package/dist/esm/connectors/mock.js.map +1 -1
- package/dist/esm/exports/actions.js +1 -0
- package/dist/esm/exports/actions.js.map +1 -1
- package/dist/esm/exports/index.js +1 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/query.js +1 -0
- package/dist/esm/exports/query.js.map +1 -1
- package/dist/esm/query/estimateGas.js.map +1 -1
- package/dist/esm/query/watchAsset.js +10 -0
- package/dist/esm/query/watchAsset.js.map +1 -0
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/codegen/createReadContract.d.ts +2 -2
- package/dist/types/actions/codegen/createReadContract.d.ts.map +1 -1
- package/dist/types/actions/codegen/createSimulateContract.d.ts +2 -2
- package/dist/types/actions/codegen/createSimulateContract.d.ts.map +1 -1
- package/dist/types/actions/codegen/createWatchContractEvent.d.ts +2 -2
- package/dist/types/actions/codegen/createWatchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/codegen/createWriteContract.d.ts +4 -4
- package/dist/types/actions/codegen/createWriteContract.d.ts.map +1 -1
- package/dist/types/actions/connect.d.ts +2 -2
- package/dist/types/actions/connect.d.ts.map +1 -1
- package/dist/types/actions/deployContract.d.ts +2 -2
- package/dist/types/actions/deployContract.d.ts.map +1 -1
- package/dist/types/actions/estimateFeesPerGas.d.ts +5 -5
- package/dist/types/actions/estimateFeesPerGas.d.ts.map +1 -1
- package/dist/types/actions/estimateGas.d.ts +2 -2
- package/dist/types/actions/estimateGas.d.ts.map +1 -1
- package/dist/types/actions/estimateMaxPriorityFeePerGas.d.ts +2 -2
- package/dist/types/actions/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/types/actions/getBalance.d.ts +2 -2
- 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 +2 -2
- package/dist/types/actions/getBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/getBlockTransactionCount.d.ts +2 -2
- package/dist/types/actions/getBlockTransactionCount.d.ts.map +1 -1
- package/dist/types/actions/getBytecode.d.ts +2 -2
- package/dist/types/actions/getBytecode.d.ts.map +1 -1
- package/dist/types/actions/getClient.d.ts +2 -2
- 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 +3 -3
- package/dist/types/actions/getConnectorClient.d.ts.map +1 -1
- package/dist/types/actions/getEnsAddress.d.ts +2 -2
- package/dist/types/actions/getEnsAddress.d.ts.map +1 -1
- package/dist/types/actions/getEnsAvatar.d.ts +2 -2
- package/dist/types/actions/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/actions/getEnsName.d.ts +2 -2
- package/dist/types/actions/getEnsName.d.ts.map +1 -1
- package/dist/types/actions/getEnsResolver.d.ts +2 -2
- package/dist/types/actions/getEnsResolver.d.ts.map +1 -1
- package/dist/types/actions/getEnsText.d.ts +2 -2
- package/dist/types/actions/getEnsText.d.ts.map +1 -1
- package/dist/types/actions/getFeeHistory.d.ts +2 -2
- package/dist/types/actions/getFeeHistory.d.ts.map +1 -1
- package/dist/types/actions/getGasPrice.d.ts +2 -2
- package/dist/types/actions/getGasPrice.d.ts.map +1 -1
- package/dist/types/actions/getProof.d.ts +2 -2
- package/dist/types/actions/getProof.d.ts.map +1 -1
- package/dist/types/actions/getPublicClient.d.ts +2 -2
- package/dist/types/actions/getPublicClient.d.ts.map +1 -1
- package/dist/types/actions/getStorageAt.d.ts +2 -2
- package/dist/types/actions/getStorageAt.d.ts.map +1 -1
- package/dist/types/actions/getToken.d.ts +2 -2
- package/dist/types/actions/getToken.d.ts.map +1 -1
- package/dist/types/actions/getTransaction.d.ts +3 -3
- package/dist/types/actions/getTransaction.d.ts.map +1 -1
- package/dist/types/actions/getTransactionCount.d.ts +2 -2
- package/dist/types/actions/getTransactionCount.d.ts.map +1 -1
- package/dist/types/actions/getTransactionReceipt.d.ts +3 -3
- package/dist/types/actions/getTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/getWalletClient.d.ts +2 -2
- package/dist/types/actions/getWalletClient.d.ts.map +1 -1
- package/dist/types/actions/prepareTransactionRequest.d.ts +3 -3
- package/dist/types/actions/prepareTransactionRequest.d.ts.map +1 -1
- package/dist/types/actions/reconnect.d.ts +2 -2
- package/dist/types/actions/reconnect.d.ts.map +1 -1
- package/dist/types/actions/sendTransaction.d.ts +2 -2
- package/dist/types/actions/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/signMessage.d.ts +2 -2
- package/dist/types/actions/signMessage.d.ts.map +1 -1
- package/dist/types/actions/signTypedData.d.ts +2 -2
- package/dist/types/actions/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/simulateContract.d.ts +3 -3
- package/dist/types/actions/simulateContract.d.ts.map +1 -1
- package/dist/types/actions/switchChain.d.ts +3 -3
- package/dist/types/actions/switchChain.d.ts.map +1 -1
- package/dist/types/actions/verifyMessage.d.ts +2 -2
- package/dist/types/actions/verifyMessage.d.ts.map +1 -1
- package/dist/types/actions/verifyTypedData.d.ts +2 -2
- package/dist/types/actions/verifyTypedData.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/watchAsset.d.ts +12 -0
- package/dist/types/actions/watchAsset.d.ts.map +1 -0
- package/dist/types/actions/watchBlockNumber.d.ts +2 -2
- package/dist/types/actions/watchBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/watchBlocks.d.ts +2 -2
- package/dist/types/actions/watchBlocks.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/writeContract.d.ts +3 -3
- package/dist/types/actions/writeContract.d.ts.map +1 -1
- package/dist/types/connectors/createConnector.d.ts +5 -5
- package/dist/types/connectors/createConnector.d.ts.map +1 -1
- package/dist/types/connectors/injected.d.ts +3 -3
- package/dist/types/connectors/injected.d.ts.map +1 -1
- package/dist/types/connectors/mock.d.ts +1 -0
- package/dist/types/connectors/mock.d.ts.map +1 -1
- package/dist/types/createConfig.d.ts +3 -3
- 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 +2 -2
- package/dist/types/errors/base.d.ts.map +1 -1
- package/dist/types/experimental/actions/sendCalls.d.ts +2 -2
- package/dist/types/experimental/actions/sendCalls.d.ts.map +1 -1
- package/dist/types/experimental/actions/writeContracts.d.ts +2 -2
- package/dist/types/experimental/actions/writeContracts.d.ts.map +1 -1
- package/dist/types/experimental/query/getCallsStatus.d.ts +2 -2
- package/dist/types/experimental/query/getCallsStatus.d.ts.map +1 -1
- package/dist/types/experimental/query/getCapabilities.d.ts +2 -2
- package/dist/types/experimental/query/getCapabilities.d.ts.map +1 -1
- package/dist/types/experimental/query/sendCalls.d.ts +4 -4
- package/dist/types/experimental/query/sendCalls.d.ts.map +1 -1
- package/dist/types/experimental/query/showCallsStatus.d.ts +4 -4
- package/dist/types/experimental/query/showCallsStatus.d.ts.map +1 -1
- package/dist/types/experimental/query/writeContracts.d.ts +4 -4
- package/dist/types/experimental/query/writeContracts.d.ts.map +1 -1
- package/dist/types/exports/actions.d.ts +1 -0
- package/dist/types/exports/actions.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +1 -0
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/internal.d.ts +1 -1
- package/dist/types/exports/internal.d.ts.map +1 -1
- package/dist/types/exports/query.d.ts +1 -0
- package/dist/types/exports/query.d.ts.map +1 -1
- package/dist/types/query/call.d.ts +2 -2
- package/dist/types/query/call.d.ts.map +1 -1
- package/dist/types/query/deployContract.d.ts +4 -4
- package/dist/types/query/deployContract.d.ts.map +1 -1
- package/dist/types/query/estimateFeesPerGas.d.ts +2 -2
- package/dist/types/query/estimateFeesPerGas.d.ts.map +1 -1
- package/dist/types/query/estimateGas.d.ts +2 -2
- package/dist/types/query/estimateGas.d.ts.map +1 -1
- package/dist/types/query/estimateMaxPriorityFeePerGas.d.ts +2 -2
- package/dist/types/query/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/types/query/getBalance.d.ts +3 -3
- package/dist/types/query/getBalance.d.ts.map +1 -1
- package/dist/types/query/getBlock.d.ts +2 -2
- package/dist/types/query/getBlock.d.ts.map +1 -1
- package/dist/types/query/getBlockNumber.d.ts +2 -2
- package/dist/types/query/getBlockNumber.d.ts.map +1 -1
- package/dist/types/query/getBlockTransactionCount.d.ts +2 -2
- package/dist/types/query/getBlockTransactionCount.d.ts.map +1 -1
- package/dist/types/query/getBytecode.d.ts +2 -2
- package/dist/types/query/getBytecode.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 +2 -2
- package/dist/types/query/getEnsAddress.d.ts.map +1 -1
- package/dist/types/query/getEnsAvatar.d.ts +2 -2
- package/dist/types/query/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/query/getEnsName.d.ts +2 -2
- package/dist/types/query/getEnsName.d.ts.map +1 -1
- package/dist/types/query/getEnsResolver.d.ts +2 -2
- package/dist/types/query/getEnsResolver.d.ts.map +1 -1
- package/dist/types/query/getEnsText.d.ts +2 -2
- package/dist/types/query/getEnsText.d.ts.map +1 -1
- package/dist/types/query/getFeeHistory.d.ts +2 -2
- package/dist/types/query/getFeeHistory.d.ts.map +1 -1
- package/dist/types/query/getGasPrice.d.ts +2 -2
- package/dist/types/query/getGasPrice.d.ts.map +1 -1
- package/dist/types/query/getProof.d.ts +2 -2
- package/dist/types/query/getProof.d.ts.map +1 -1
- package/dist/types/query/getStorageAt.d.ts +2 -2
- package/dist/types/query/getStorageAt.d.ts.map +1 -1
- package/dist/types/query/getToken.d.ts +2 -2
- package/dist/types/query/getToken.d.ts.map +1 -1
- package/dist/types/query/getTransaction.d.ts +2 -2
- package/dist/types/query/getTransaction.d.ts.map +1 -1
- package/dist/types/query/getTransactionConfirmations.d.ts +2 -2
- package/dist/types/query/getTransactionConfirmations.d.ts.map +1 -1
- package/dist/types/query/getTransactionCount.d.ts +3 -3
- package/dist/types/query/getTransactionCount.d.ts.map +1 -1
- package/dist/types/query/getTransactionReceipt.d.ts +2 -2
- package/dist/types/query/getTransactionReceipt.d.ts.map +1 -1
- package/dist/types/query/getWalletClient.d.ts +2 -2
- 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/prepareTransactionRequest.d.ts +2 -2
- package/dist/types/query/prepareTransactionRequest.d.ts.map +1 -1
- package/dist/types/query/readContract.d.ts +6 -6
- package/dist/types/query/readContract.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 +4 -4
- package/dist/types/query/sendTransaction.d.ts.map +1 -1
- package/dist/types/query/signMessage.d.ts +2 -2
- package/dist/types/query/signMessage.d.ts.map +1 -1
- package/dist/types/query/signTypedData.d.ts +2 -2
- package/dist/types/query/signTypedData.d.ts.map +1 -1
- package/dist/types/query/simulateContract.d.ts +2 -2
- package/dist/types/query/simulateContract.d.ts.map +1 -1
- package/dist/types/query/switchAccount.d.ts +3 -3
- package/dist/types/query/switchAccount.d.ts.map +1 -1
- package/dist/types/query/switchChain.d.ts +6 -6
- package/dist/types/query/switchChain.d.ts.map +1 -1
- package/dist/types/query/types.d.ts +5 -5
- package/dist/types/query/types.d.ts.map +1 -1
- package/dist/types/query/verifyMessage.d.ts +2 -2
- package/dist/types/query/verifyMessage.d.ts.map +1 -1
- package/dist/types/query/waitForTransactionReceipt.d.ts +2 -2
- package/dist/types/query/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/query/watchAsset.d.ts +22 -0
- package/dist/types/query/watchAsset.d.ts.map +1 -0
- package/dist/types/query/writeContract.d.ts +3 -3
- package/dist/types/query/writeContract.d.ts.map +1 -1
- package/dist/types/types/utils.d.ts +9 -9
- package/dist/types/types/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/actions/codegen/createReadContract.ts +3 -3
- package/src/actions/codegen/createSimulateContract.ts +3 -3
- package/src/actions/codegen/createWatchContractEvent.ts +3 -3
- package/src/actions/codegen/createWriteContract.ts +8 -4
- package/src/actions/connect.ts +2 -2
- package/src/actions/deployContract.ts +2 -2
- package/src/actions/estimateFeesPerGas.ts +5 -5
- package/src/actions/estimateGas.ts +2 -2
- package/src/actions/estimateMaxPriorityFeePerGas.ts +2 -2
- package/src/actions/getBalance.ts +2 -2
- package/src/actions/getBlock.ts +3 -3
- package/src/actions/getBlockNumber.ts +2 -2
- package/src/actions/getBlockTransactionCount.ts +2 -2
- package/src/actions/getBytecode.ts +2 -2
- package/src/actions/getClient.ts +2 -2
- package/src/actions/getConnections.ts +2 -2
- package/src/actions/getConnectorClient.ts +3 -3
- package/src/actions/getEnsAddress.ts +2 -2
- package/src/actions/getEnsAvatar.ts +2 -2
- package/src/actions/getEnsName.ts +2 -2
- package/src/actions/getEnsResolver.ts +2 -2
- package/src/actions/getEnsText.ts +2 -2
- package/src/actions/getFeeHistory.ts +2 -2
- package/src/actions/getGasPrice.ts +2 -2
- package/src/actions/getProof.ts +2 -2
- package/src/actions/getPublicClient.ts +2 -2
- package/src/actions/getStorageAt.ts +2 -2
- package/src/actions/getToken.ts +2 -2
- package/src/actions/getTransaction.ts +3 -3
- package/src/actions/getTransactionCount.ts +2 -2
- package/src/actions/getTransactionReceipt.ts +3 -3
- package/src/actions/getWalletClient.ts +2 -2
- package/src/actions/prepareTransactionRequest.ts +6 -6
- package/src/actions/reconnect.ts +2 -2
- package/src/actions/sendTransaction.ts +2 -2
- package/src/actions/signMessage.ts +2 -2
- package/src/actions/signTypedData.ts +2 -2
- package/src/actions/simulateContract.ts +6 -6
- package/src/actions/switchChain.ts +3 -3
- package/src/actions/verifyMessage.ts +2 -2
- package/src/actions/verifyTypedData.ts +2 -2
- package/src/actions/waitForTransactionReceipt.ts +3 -3
- package/src/actions/watchAsset.ts +44 -0
- package/src/actions/watchBlockNumber.ts +2 -2
- package/src/actions/watchBlocks.ts +2 -2
- package/src/actions/watchContractEvent.ts +2 -2
- package/src/actions/watchPendingTransactions.ts +2 -2
- package/src/actions/writeContract.ts +4 -4
- package/src/connectors/createConnector.ts +5 -5
- package/src/connectors/injected.ts +11 -4
- package/src/connectors/mock.ts +12 -0
- package/src/createConfig.ts +3 -3
- package/src/createStorage.ts +3 -3
- package/src/errors/base.ts +2 -2
- package/src/experimental/actions/sendCalls.ts +2 -2
- package/src/experimental/actions/writeContracts.ts +2 -2
- package/src/experimental/query/getCallsStatus.ts +2 -2
- package/src/experimental/query/getCapabilities.ts +2 -2
- package/src/experimental/query/sendCalls.ts +6 -6
- package/src/experimental/query/showCallsStatus.ts +6 -6
- package/src/experimental/query/writeContracts.ts +6 -6
- package/src/exports/actions.ts +6 -0
- package/src/exports/index.ts +7 -0
- package/src/exports/internal.ts +5 -5
- package/src/exports/query.ts +8 -0
- package/src/query/call.ts +2 -2
- package/src/query/deployContract.ts +6 -6
- package/src/query/estimateFeesPerGas.ts +2 -2
- package/src/query/estimateGas.ts +3 -2
- package/src/query/estimateMaxPriorityFeePerGas.ts +2 -2
- package/src/query/getBalance.ts +3 -3
- package/src/query/getBlock.ts +2 -2
- package/src/query/getBlockNumber.ts +2 -2
- package/src/query/getBlockTransactionCount.ts +2 -2
- package/src/query/getBytecode.ts +2 -2
- package/src/query/getConnectorClient.ts +2 -2
- package/src/query/getEnsAddress.ts +2 -2
- package/src/query/getEnsAvatar.ts +2 -2
- package/src/query/getEnsName.ts +2 -2
- package/src/query/getEnsResolver.ts +2 -2
- package/src/query/getEnsText.ts +2 -2
- package/src/query/getFeeHistory.ts +2 -2
- package/src/query/getGasPrice.ts +2 -2
- package/src/query/getProof.ts +2 -2
- package/src/query/getStorageAt.ts +2 -2
- package/src/query/getToken.ts +2 -2
- package/src/query/getTransaction.ts +2 -2
- package/src/query/getTransactionConfirmations.ts +2 -2
- package/src/query/getTransactionCount.ts +3 -3
- package/src/query/getTransactionReceipt.ts +2 -2
- package/src/query/getWalletClient.ts +2 -2
- package/src/query/infiniteReadContracts.ts +2 -2
- package/src/query/prepareTransactionRequest.ts +2 -2
- package/src/query/readContract.ts +2 -2
- package/src/query/reconnect.ts +2 -2
- package/src/query/sendTransaction.ts +6 -6
- package/src/query/signMessage.ts +2 -2
- package/src/query/signTypedData.ts +2 -2
- package/src/query/simulateContract.ts +2 -2
- package/src/query/switchAccount.ts +3 -3
- package/src/query/switchChain.ts +7 -7
- package/src/query/types.ts +7 -7
- package/src/query/verifyMessage.ts +2 -2
- package/src/query/waitForTransactionReceipt.ts +2 -2
- package/src/query/watchAsset.ts +42 -0
- package/src/query/writeContract.ts +2 -2
- package/src/types/utils.ts +12 -10
- package/src/version.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchAsset.d.ts","sourceRoot":"","sources":["../../../src/query/watchAsset.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAE1B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAErD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM;;;;;;;iBA8Bm7H,CAAC;;;;;EAnB3+H;AAED,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAA;AAEjD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAE/D,MAAM,MAAM,gBAAgB,CAAC,OAAO,GAAG,OAAO,IAAI,MAAM,CACtD,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,CACR,CAAA;AAED,MAAM,MAAM,qBAAqB,CAAC,OAAO,GAAG,OAAO,IAAI,WAAW,CAChE,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,OAAO,CACR,CAAA"}
|
|
@@ -2,16 +2,16 @@ import type { MutateOptions } from '@tanstack/query-core';
|
|
|
2
2
|
import type { Abi, ContractFunctionArgs, ContractFunctionName } from 'viem';
|
|
3
3
|
import { type WriteContractErrorType, type WriteContractParameters, type WriteContractReturnType } from '../actions/writeContract.js';
|
|
4
4
|
import type { Config } from '../createConfig.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { Compute } from '../types/utils.js';
|
|
6
6
|
export declare function writeContractMutationOptions<config extends Config>(config: config): {
|
|
7
|
-
readonly mutationFn: (variables: import("../types/utils.js").
|
|
7
|
+
readonly mutationFn: (variables: import("../types/utils.js").UnionCompute<(import("../types/chain.js").SelectChains<config, config["chains"][number]["id"]> extends infer T extends readonly import("viem").Chain[] ? { [key in keyof T]: import("viem").WriteContractParameters<Abi, string, readonly unknown[], import("../types/chain.js").SelectChains<config, config["chains"][number]["id"]>[key], import("viem").Account, import("../types/chain.js").SelectChains<config, config["chains"][number]["id"]>[key], string>; } : never)[number] & {
|
|
8
8
|
chainId?: config["chains"][number]["id"] | (config["chains"][number]["id"] extends infer T_1 ? T_1 extends config["chains"][number]["id"] ? T_1 extends config["chains"][number]["id"] ? T_1 : undefined : never : never) | undefined;
|
|
9
9
|
} & import("../types/properties.js").ConnectorParameter & {
|
|
10
10
|
__mode?: "prepared";
|
|
11
11
|
}>) => Promise<`0x${string}`>;
|
|
12
12
|
readonly mutationKey: readonly ["writeContract"];
|
|
13
13
|
};
|
|
14
|
-
export type WriteContractData =
|
|
14
|
+
export type WriteContractData = Compute<WriteContractReturnType>;
|
|
15
15
|
export type WriteContractVariables<abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, config extends Config, chainId extends config['chains'][number]['id'], allFunctionNames = ContractFunctionName<abi, 'nonpayable' | 'payable'>> = WriteContractParameters<abi, functionName, args, config, chainId, allFunctionNames>;
|
|
16
16
|
export type WriteContractMutate<config extends Config, context = unknown> = <const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, chainId extends config['chains'][number]['id']>(variables: WriteContractVariables<abi, functionName, args, config, chainId>, options?: MutateOptions<WriteContractData, WriteContractErrorType, WriteContractVariables<abi, functionName, args, config, chainId, functionName>, context> | undefined) => void;
|
|
17
17
|
export type WriteContractMutateAsync<config extends Config, context = unknown> = <const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, chainId extends config['chains'][number]['id']>(variables: WriteContractVariables<abi, functionName, args, config, chainId>, options?: MutateOptions<WriteContractData, WriteContractErrorType, WriteContractVariables<abi, functionName, args, config, chainId, functionName>, context> | undefined) => Promise<WriteContractData>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeContract.d.ts","sourceRoot":"","sources":["../../../src/query/writeContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAA;AAE3E,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAE7B,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"writeContract.d.ts","sourceRoot":"","sources":["../../../src/query/writeContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAA;AAE3E,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAE7B,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD,wBAAgB,4BAA4B,CAAC,MAAM,SAAS,MAAM,EAChE,MAAM,EAAE,MAAM;;;;;;;EAkBf;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAEhE,MAAM,MAAM,sBAAsB,CAChC,GAAG,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EACpC,YAAY,SAAS,oBAAoB,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,CAAC,E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AoB,CAC/B,GAAG,EACH,YAAY,GAAG,SAAS,EACxB,YAAY,CACb,EACD,OAAO,SAAS,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAE9C,SAAS,EAAE,sBAAsB,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAC3E,OAAO,CAAC,EACJ,aAAa,CACX,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,CACpB,GAAG,EACH,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,OAAO,EAEP,YAAY,CACb,EACD,OAAO,CACR,GACD,SAAS,KACV,OAAO,CAAC,iBAAiB,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Combines members of an intersection into a readable type. */
|
|
2
|
-
export type
|
|
2
|
+
export type Compute<type> = {
|
|
3
3
|
[key in keyof type]: type[key];
|
|
4
4
|
} & unknown;
|
|
5
5
|
/**
|
|
@@ -23,28 +23,28 @@ export type IsNever<type> = [type] extends [never] ? true : false;
|
|
|
23
23
|
*/
|
|
24
24
|
export type IsUnknown<type> = unknown extends type ? true : false;
|
|
25
25
|
/** Merges two object types into new type */
|
|
26
|
-
export type Merge<obj1, obj2> =
|
|
26
|
+
export type Merge<obj1, obj2> = Compute<LooseOmit<obj1, keyof obj2 extends infer key extends string ? key : never> & obj2>;
|
|
27
27
|
/** Removes `readonly` from all properties of an object. */
|
|
28
28
|
export type Mutable<type extends object> = {
|
|
29
29
|
-readonly [key in keyof type]: type[key];
|
|
30
30
|
};
|
|
31
31
|
/** Strict version of built-in Omit type */
|
|
32
|
-
export type
|
|
32
|
+
export type StrictOmit<type, keys extends keyof type> = Pick<type, Exclude<keyof type, keys>>;
|
|
33
33
|
/** Makes objects destructurable. */
|
|
34
|
-
export type OneOf<union extends object, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends infer Item ?
|
|
34
|
+
export type OneOf<union extends object, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends infer Item ? Compute<Item & {
|
|
35
35
|
[K in Exclude<keys, keyof Item>]?: undefined;
|
|
36
36
|
}> : never;
|
|
37
37
|
type KeyofUnion<type> = type extends type ? keyof type : never;
|
|
38
38
|
/** Makes {@link key} optional in {@link type} while preserving type inference. */
|
|
39
|
-
export type PartialBy<type, key extends keyof type> = ExactPartial<Pick<type, key>> &
|
|
39
|
+
export type PartialBy<type, key extends keyof type> = ExactPartial<Pick<type, key>> & StrictOmit<type, key>;
|
|
40
40
|
export type RemoveUndefined<type> = {
|
|
41
41
|
[key in keyof type]: NonNullable<type[key]>;
|
|
42
42
|
};
|
|
43
|
-
/** Loose version of {@link
|
|
43
|
+
/** Loose version of {@link StrictOmit} */
|
|
44
44
|
export type LooseOmit<type, keys extends string> = Pick<type, Exclude<keyof type, keys>>;
|
|
45
|
-
export type
|
|
45
|
+
export type UnionCompute<type> = type extends object ? Compute<type> : type;
|
|
46
46
|
export type UnionLooseOmit<type, keys extends string> = type extends any ? LooseOmit<type, keys> : never;
|
|
47
|
-
export type
|
|
48
|
-
export type
|
|
47
|
+
export type UnionStrictOmit<type, keys extends keyof type> = type extends any ? StrictOmit<type, keys> : never;
|
|
48
|
+
export type UnionExactPartial<type> = type extends object ? ExactPartial<type> : type;
|
|
49
49
|
export {};
|
|
50
50
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/utils.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/utils.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,MAAM,MAAM,OAAO,CAAC,IAAI,IAAI;KAAG,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;CAAE,GAAG,OAAO,CAAA;AAExE;;;;GAIG;AACH,MA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AAE,IAAI,CAAC,GACtB,KAAK,CAAA;AAET,MAAM,MAAM,iBAAiB,CAAC,IAAI,IAAI,IAAI,SAAS,MAAM,GACrD,YAAY,CAAC,IAAI,CAAC,GAClB,IAAI,CAAA"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "2.
|
|
1
|
+
export declare const version = "2.12.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wagmi/core",
|
|
3
3
|
"description": "VanillaJS library for Ethereum",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.12.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
95
|
"eventemitter3": "5.0.1",
|
|
96
|
-
"mipd": "0.0.
|
|
96
|
+
"mipd": "0.0.7",
|
|
97
97
|
"zustand": "4.4.1"
|
|
98
98
|
},
|
|
99
99
|
"contributors": [
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
} from 'viem'
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../../createConfig.js'
|
|
9
|
-
import type {
|
|
9
|
+
import type { UnionCompute, UnionStrictOmit } from '../../types/utils.js'
|
|
10
10
|
import { getAccount } from '../getAccount.js'
|
|
11
11
|
import { getChainId } from '../getChainId.js'
|
|
12
12
|
import {
|
|
@@ -50,8 +50,8 @@ export type CreateReadContractReturnType<
|
|
|
50
50
|
args extends ContractFunctionArgs<abi, stateMutability, name>,
|
|
51
51
|
>(
|
|
52
52
|
config: config,
|
|
53
|
-
parameters:
|
|
54
|
-
|
|
53
|
+
parameters: UnionCompute<
|
|
54
|
+
UnionStrictOmit<
|
|
55
55
|
ReadContractParameters<abi, name, args, config>,
|
|
56
56
|
omittedProperties
|
|
57
57
|
>
|
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
ChainIdParameter,
|
|
15
15
|
ConnectorParameter,
|
|
16
16
|
} from '../../types/properties.js'
|
|
17
|
-
import type {
|
|
17
|
+
import type { UnionCompute, UnionStrictOmit } from '../../types/utils.js'
|
|
18
18
|
import { getAccount } from '../getAccount.js'
|
|
19
19
|
import { getChainId } from '../getChainId.js'
|
|
20
20
|
import {
|
|
@@ -55,8 +55,8 @@ export type CreateSimulateContractReturnType<
|
|
|
55
55
|
>(
|
|
56
56
|
config: config,
|
|
57
57
|
parameters: {
|
|
58
|
-
[key in keyof chains]:
|
|
59
|
-
|
|
58
|
+
[key in keyof chains]: UnionCompute<
|
|
59
|
+
UnionStrictOmit<
|
|
60
60
|
viem_SimulateContractParameters<
|
|
61
61
|
abi,
|
|
62
62
|
name,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Abi, Address, ContractEventName } from 'viem'
|
|
2
2
|
|
|
3
3
|
import type { Config } from '../../createConfig.js'
|
|
4
|
-
import type {
|
|
4
|
+
import type { UnionCompute, UnionStrictOmit } from '../../types/utils.js'
|
|
5
5
|
import { getAccount } from '../getAccount.js'
|
|
6
6
|
import { getChainId } from '../getChainId.js'
|
|
7
7
|
import {
|
|
@@ -40,8 +40,8 @@ export type CreateWatchContractEventReturnType<
|
|
|
40
40
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
41
41
|
>(
|
|
42
42
|
config: config,
|
|
43
|
-
parameters:
|
|
44
|
-
|
|
43
|
+
parameters: UnionCompute<
|
|
44
|
+
UnionStrictOmit<
|
|
45
45
|
WatchContractEventParameters<abi, name, strict, config, chainId>,
|
|
46
46
|
omittedProperties
|
|
47
47
|
>
|
|
@@ -14,7 +14,11 @@ import type {
|
|
|
14
14
|
ChainIdParameter,
|
|
15
15
|
ConnectorParameter,
|
|
16
16
|
} from '../../types/properties.js'
|
|
17
|
-
import type {
|
|
17
|
+
import type {
|
|
18
|
+
Compute,
|
|
19
|
+
UnionCompute,
|
|
20
|
+
UnionStrictOmit,
|
|
21
|
+
} from '../../types/utils.js'
|
|
18
22
|
import { getAccount } from '../getAccount.js'
|
|
19
23
|
import { getChainId } from '../getChainId.js'
|
|
20
24
|
import {
|
|
@@ -59,9 +63,9 @@ export type CreateWriteContractReturnType<
|
|
|
59
63
|
| (functionName extends undefined ? never : 'functionName'),
|
|
60
64
|
>(
|
|
61
65
|
config: config,
|
|
62
|
-
parameters:
|
|
66
|
+
parameters: UnionCompute<
|
|
63
67
|
{
|
|
64
|
-
[key in keyof chains]:
|
|
68
|
+
[key in keyof chains]: UnionStrictOmit<
|
|
65
69
|
viem_WriteContractParameters<
|
|
66
70
|
abi,
|
|
67
71
|
name,
|
|
@@ -81,7 +85,7 @@ export type CreateWriteContractReturnType<
|
|
|
81
85
|
| (chainId extends keyof address ? chainId : never)
|
|
82
86
|
| undefined
|
|
83
87
|
}
|
|
84
|
-
:
|
|
88
|
+
: Compute<ChainIdParameter<config, chainId>>) &
|
|
85
89
|
ConnectorParameter & { __mode?: 'prepared' }
|
|
86
90
|
>,
|
|
87
91
|
) => Promise<WriteContractReturnType>
|
package/src/actions/connect.ts
CHANGED
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
type ConnectorAlreadyConnectedErrorType,
|
|
13
13
|
} from '../errors/config.js'
|
|
14
14
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
15
|
-
import type {
|
|
15
|
+
import type { Compute } from '../types/utils.js'
|
|
16
16
|
|
|
17
|
-
export type ConnectParameters<config extends Config = Config> =
|
|
17
|
+
export type ConnectParameters<config extends Config = Config> = Compute<
|
|
18
18
|
ChainIdParameter<config> & {
|
|
19
19
|
connector: Connector | CreateConnectorFn
|
|
20
20
|
}
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
ChainIdParameter,
|
|
13
13
|
ConnectorParameter,
|
|
14
14
|
} from '../types/properties.js'
|
|
15
|
-
import type {
|
|
15
|
+
import type { Compute } from '../types/utils.js'
|
|
16
16
|
import { getAction } from '../utils/getAction.js'
|
|
17
17
|
import {
|
|
18
18
|
type GetConnectorClientErrorType,
|
|
@@ -28,7 +28,7 @@ export type DeployContractParameters<
|
|
|
28
28
|
allArgs = ContractConstructorArgs<abi>,
|
|
29
29
|
chains extends readonly Chain[] = SelectChains<config, chainId>,
|
|
30
30
|
> = {
|
|
31
|
-
[key in keyof chains]:
|
|
31
|
+
[key in keyof chains]: Compute<
|
|
32
32
|
Omit<
|
|
33
33
|
viem_DeployContractParameters<
|
|
34
34
|
abi,
|
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
import type { Config } from '../createConfig.js'
|
|
16
16
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
17
17
|
import type { Unit } from '../types/unit.js'
|
|
18
|
-
import type {
|
|
19
|
-
import type {
|
|
18
|
+
import type { Compute } from '../types/utils.js'
|
|
19
|
+
import type { UnionCompute, UnionLooseOmit } from '../types/utils.js'
|
|
20
20
|
import { getAction } from '../utils/getAction.js'
|
|
21
21
|
import { getUnit } from '../utils/getUnit.js'
|
|
22
22
|
|
|
23
23
|
export type EstimateFeesPerGasParameters<
|
|
24
24
|
type extends FeeValuesType = FeeValuesType,
|
|
25
25
|
config extends Config = Config,
|
|
26
|
-
> =
|
|
26
|
+
> = UnionCompute<
|
|
27
27
|
UnionLooseOmit<
|
|
28
28
|
viem_EstimateFeesPerGasParameters<Chain, Chain, type>,
|
|
29
29
|
'chain'
|
|
@@ -36,10 +36,10 @@ export type EstimateFeesPerGasParameters<
|
|
|
36
36
|
|
|
37
37
|
export type EstimateFeesPerGasReturnType<
|
|
38
38
|
type extends FeeValuesType = FeeValuesType,
|
|
39
|
-
> =
|
|
39
|
+
> = Compute<
|
|
40
40
|
viem_EstimateFeesPerGasReturnType<type> & {
|
|
41
41
|
/** @deprecated */
|
|
42
|
-
formatted:
|
|
42
|
+
formatted: UnionCompute<
|
|
43
43
|
| (type extends 'legacy' ? FeeValuesLegacy<string> : never)
|
|
44
44
|
| (type extends 'eip1559' ? FeeValuesEIP1559<string> : never)
|
|
45
45
|
>
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
ChainIdParameter,
|
|
14
14
|
ConnectorParameter,
|
|
15
15
|
} from '../types/properties.js'
|
|
16
|
-
import type {
|
|
16
|
+
import type { UnionCompute, UnionLooseOmit } from '../types/utils.js'
|
|
17
17
|
import { getAction } from '../utils/getAction.js'
|
|
18
18
|
import {
|
|
19
19
|
type GetConnectorClientErrorType,
|
|
@@ -28,7 +28,7 @@ export type EstimateGasParameters<
|
|
|
28
28
|
///
|
|
29
29
|
chains extends readonly Chain[] = SelectChains<config, chainId>,
|
|
30
30
|
> = {
|
|
31
|
-
[key in keyof chains]:
|
|
31
|
+
[key in keyof chains]: UnionCompute<
|
|
32
32
|
UnionLooseOmit<viem_EstimateGasParameters<chains[key]>, 'chain'> &
|
|
33
33
|
ChainIdParameter<config, chainId> &
|
|
34
34
|
ConnectorParameter
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, UnionLooseOmit } from '../types/utils.js'
|
|
12
12
|
import { getAction } from '../utils/getAction.js'
|
|
13
13
|
|
|
14
14
|
export type EstimateMaxPriorityFeePerGasParameters<
|
|
15
15
|
config extends Config = Config,
|
|
16
16
|
chainId extends
|
|
17
17
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
18
|
-
> =
|
|
18
|
+
> = Compute<
|
|
19
19
|
UnionLooseOmit<
|
|
20
20
|
viem_EstimateMaxPriorityFeePerGasParameters<Chain, Chain> &
|
|
21
21
|
ChainIdParameter<config, chainId>,
|
|
@@ -15,12 +15,12 @@ import {
|
|
|
15
15
|
import type { Config } from '../createConfig.js'
|
|
16
16
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
17
17
|
import type { Unit } from '../types/unit.js'
|
|
18
|
-
import type {
|
|
18
|
+
import type { Compute } from '../types/utils.js'
|
|
19
19
|
import { getAction } from '../utils/getAction.js'
|
|
20
20
|
import { getUnit } from '../utils/getUnit.js'
|
|
21
21
|
import { readContracts } from './readContracts.js'
|
|
22
22
|
|
|
23
|
-
export type GetBalanceParameters<config extends Config = Config> =
|
|
23
|
+
export type GetBalanceParameters<config extends Config = Config> = Compute<
|
|
24
24
|
ChainIdParameter<config> &
|
|
25
25
|
viem_GetBalanceParameters & {
|
|
26
26
|
/** @deprecated */
|
package/src/actions/getBlock.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { SelectChains } from '../types/chain.js'
|
|
11
11
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
12
|
-
import type {
|
|
12
|
+
import type { Compute, IsNarrowable } from '../types/utils.js'
|
|
13
13
|
import { getAction } from '../utils/getAction.js'
|
|
14
14
|
|
|
15
15
|
export type GetBlockParameters<
|
|
@@ -18,7 +18,7 @@ export type GetBlockParameters<
|
|
|
18
18
|
config extends Config = Config,
|
|
19
19
|
chainId extends
|
|
20
20
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
21
|
-
> =
|
|
21
|
+
> = Compute<
|
|
22
22
|
viem_GetBlockParameters<includeTransactions, blockTag> &
|
|
23
23
|
ChainIdParameter<config, chainId>
|
|
24
24
|
>
|
|
@@ -31,7 +31,7 @@ export type GetBlockReturnType<
|
|
|
31
31
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
32
32
|
///
|
|
33
33
|
chains extends readonly Chain[] = SelectChains<config, chainId>,
|
|
34
|
-
> =
|
|
34
|
+
> = Compute<
|
|
35
35
|
{
|
|
36
36
|
[key in keyof chains]: viem_GetBlockReturnType<
|
|
37
37
|
IsNarrowable<chains[key], Chain> extends true ? chains[key] : undefined,
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
13
|
export type GetBlockNumberParameters<
|
|
14
14
|
config extends Config = Config,
|
|
15
15
|
chainId extends
|
|
16
16
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
17
|
-
> =
|
|
17
|
+
> = Compute<viem_GetBlockNumberParameters & ChainIdParameter<config, chainId>>
|
|
18
18
|
|
|
19
19
|
export type GetBlockNumberReturnType = viem_GetBlockNumberReturnType
|
|
20
20
|
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { UnionCompute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
13
|
export type GetBlockTransactionCountParameters<
|
|
14
14
|
config extends Config = Config,
|
|
15
15
|
chainId extends
|
|
16
16
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
17
|
-
> =
|
|
17
|
+
> = UnionCompute<
|
|
18
18
|
viem_GetBlockTransactionCountParameters & ChainIdParameter<config, chainId>
|
|
19
19
|
>
|
|
20
20
|
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
|
-
export type GetBytecodeParameters<config extends Config = Config> =
|
|
13
|
+
export type GetBytecodeParameters<config extends Config = Config> = Compute<
|
|
14
14
|
viem_GetBytecodeParameters & ChainIdParameter<config>
|
|
15
15
|
>
|
|
16
16
|
|
package/src/actions/getClient.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Client } from 'viem'
|
|
|
2
2
|
|
|
3
3
|
import type { Config } from '../createConfig.js'
|
|
4
4
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
5
|
-
import type {
|
|
5
|
+
import type { Compute, IsNarrowable } from '../types/utils.js'
|
|
6
6
|
|
|
7
7
|
export type GetClientParameters<
|
|
8
8
|
config extends Config = Config,
|
|
@@ -29,7 +29,7 @@ export type GetClientReturnType<
|
|
|
29
29
|
: config['chains'][number]['id']
|
|
30
30
|
: config['chains'][number]['id'] | undefined,
|
|
31
31
|
> = resolvedChainId extends config['chains'][number]['id']
|
|
32
|
-
?
|
|
32
|
+
? Compute<
|
|
33
33
|
Client<
|
|
34
34
|
config['_internal']['transports'][resolvedChainId],
|
|
35
35
|
Extract<config['chains'][number], { id: resolvedChainId }>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Config, Connection } from '../createConfig.js'
|
|
2
|
-
import type {
|
|
2
|
+
import type { Compute } from '../types/utils.js'
|
|
3
3
|
import { deepEqual } from '../utils/deepEqual.js'
|
|
4
4
|
|
|
5
|
-
export type GetConnectionsReturnType =
|
|
5
|
+
export type GetConnectionsReturnType = Compute<Connection>[]
|
|
6
6
|
|
|
7
7
|
let previousConnections: Connection[] = []
|
|
8
8
|
|
|
@@ -22,13 +22,13 @@ import type {
|
|
|
22
22
|
ChainIdParameter,
|
|
23
23
|
ConnectorParameter,
|
|
24
24
|
} from '../types/properties.js'
|
|
25
|
-
import type {
|
|
25
|
+
import type { Compute } from '../types/utils.js'
|
|
26
26
|
|
|
27
27
|
export type GetConnectorClientParameters<
|
|
28
28
|
config extends Config = Config,
|
|
29
29
|
chainId extends
|
|
30
30
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
31
|
-
> =
|
|
31
|
+
> = Compute<
|
|
32
32
|
ChainIdParameter<config, chainId> &
|
|
33
33
|
ConnectorParameter & {
|
|
34
34
|
account?: Address | Account | undefined
|
|
@@ -39,7 +39,7 @@ export type GetConnectorClientReturnType<
|
|
|
39
39
|
config extends Config = Config,
|
|
40
40
|
chainId extends
|
|
41
41
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
42
|
-
> =
|
|
42
|
+
> = Compute<
|
|
43
43
|
Client<
|
|
44
44
|
config['_internal']['transports'][chainId],
|
|
45
45
|
Extract<config['chains'][number], { id: chainId }>,
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
|
-
export type GetEnsAddressParameters<config extends Config = Config> =
|
|
13
|
+
export type GetEnsAddressParameters<config extends Config = Config> = Compute<
|
|
14
14
|
viem_GetEnsAddressParameters & ChainIdParameter<config>
|
|
15
15
|
>
|
|
16
16
|
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
|
-
export type GetEnsAvatarParameters<config extends Config = Config> =
|
|
13
|
+
export type GetEnsAvatarParameters<config extends Config = Config> = Compute<
|
|
14
14
|
viem_GetEnsAvatarParameters & ChainIdParameter<config>
|
|
15
15
|
>
|
|
16
16
|
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
|
-
export type GetEnsNameParameters<config extends Config = Config> =
|
|
13
|
+
export type GetEnsNameParameters<config extends Config = Config> = Compute<
|
|
14
14
|
viem_GetEnsNameParameters & ChainIdParameter<config>
|
|
15
15
|
>
|
|
16
16
|
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
|
-
export type GetEnsResolverParameters<config extends Config = Config> =
|
|
13
|
+
export type GetEnsResolverParameters<config extends Config = Config> = Compute<
|
|
14
14
|
viem_GetEnsResolverParameters & ChainIdParameter<config>
|
|
15
15
|
>
|
|
16
16
|
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
|
-
export type GetEnsTextParameters<config extends Config = Config> =
|
|
13
|
+
export type GetEnsTextParameters<config extends Config = Config> = Compute<
|
|
14
14
|
viem_GetEnsTextParameters & ChainIdParameter<config>
|
|
15
15
|
>
|
|
16
16
|
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
13
|
export type GetFeeHistoryParameters<
|
|
14
14
|
config extends Config = Config,
|
|
15
15
|
chainId extends
|
|
16
16
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
17
|
-
> =
|
|
17
|
+
> = Compute<viem_GetFeeHistoryParameters & ChainIdParameter<config, chainId>>
|
|
18
18
|
|
|
19
19
|
export type GetFeeHistoryReturnType = viem_GetFeeHistoryReturnType
|
|
20
20
|
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import type { Config } from '../createConfig.js'
|
|
8
8
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
9
|
-
import type {
|
|
9
|
+
import type { Compute } from '../types/utils.js'
|
|
10
10
|
import { getAction } from '../utils/getAction.js'
|
|
11
11
|
|
|
12
12
|
export type GetGasPriceParameters<
|
|
13
13
|
config extends Config = Config,
|
|
14
14
|
chainId extends
|
|
15
15
|
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
16
|
-
> =
|
|
16
|
+
> = Compute<ChainIdParameter<config, chainId>>
|
|
17
17
|
|
|
18
18
|
export type GetGasPriceReturnType = viem_GetGasPriceReturnType
|
|
19
19
|
|
package/src/actions/getProof.ts
CHANGED
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
|
-
export type GetProofParameters<config extends Config = Config> =
|
|
13
|
+
export type GetProofParameters<config extends Config = Config> = Compute<
|
|
14
14
|
viem_GetProofParameters & ChainIdParameter<config>
|
|
15
15
|
>
|
|
16
16
|
|
|
@@ -2,7 +2,7 @@ import { type Client, type PublicClient, publicActions } from 'viem'
|
|
|
2
2
|
|
|
3
3
|
import type { Config } from '../createConfig.js'
|
|
4
4
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
5
|
-
import type {
|
|
5
|
+
import type { Compute, IsNarrowable } from '../types/utils.js'
|
|
6
6
|
import { getClient } from './getClient.js'
|
|
7
7
|
|
|
8
8
|
export type GetPublicClientParameters<
|
|
@@ -29,7 +29,7 @@ export type GetPublicClientReturnType<
|
|
|
29
29
|
: config['chains'][number]['id']
|
|
30
30
|
: config['chains'][number]['id'] | undefined,
|
|
31
31
|
> = resolvedChainId extends config['chains'][number]['id']
|
|
32
|
-
?
|
|
32
|
+
? Compute<
|
|
33
33
|
PublicClient<
|
|
34
34
|
config['_internal']['transports'][resolvedChainId],
|
|
35
35
|
Extract<config['chains'][number], { id: resolvedChainId }>
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import type { Config } from '../createConfig.js'
|
|
9
9
|
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import { getAction } from '../utils/getAction.js'
|
|
12
12
|
|
|
13
|
-
export type GetStorageAtParameters<config extends Config = Config> =
|
|
13
|
+
export type GetStorageAtParameters<config extends Config = Config> = Compute<
|
|
14
14
|
viem_GetStorageAtParameters & ChainIdParameter<config>
|
|
15
15
|
>
|
|
16
16
|
|