Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #170 from unicape/1.x
Browse files Browse the repository at this point in the history
chore: Update dependencies
  • Loading branch information
unicape authored Mar 18, 2024
2 parents f5323a9 + 63148f0 commit 83fc8a2
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 77 deletions.
5 changes: 5 additions & 0 deletions .changeset/chatty-spies-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"use-wagmi": patch
---

Update dependencies
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"rimraf": "^4.4.1",
"simple-git-hooks": "^2.9.0",
"typescript": "5.1.6",
"viem": "2.x",
"viem": "2.8.4",
"vitest": "^0.34.5"
},
"packageManager": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
}
},
"dependencies": {
"@wagmi/connectors": "4.1.14",
"@wagmi/core": "2.6.5",
"@wagmi/connectors": "4.1.18",
"@wagmi/core": "2.6.9",
"vue": "3.3.8",
"vue-demi": "^0.14.6"
},
Expand Down
45 changes: 32 additions & 13 deletions packages/vue/src/hooks/usePrepareTransactionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
type Config,
type PrepareTransactionRequestErrorType,
type ResolvedRegister,
type SelectChains,
} from '@wagmi/core'
import {
type PrepareTransactionRequestData,
Expand All @@ -12,7 +13,7 @@ import {
prepareTransactionRequestQueryOptions,
} from '@wagmi/core/query'
import type { PrepareTransactionRequestQueryFnData } from '@wagmi/core/query'
import { type PrepareTransactionRequestParameterType as viem_PrepareTransactionRequestParameterType } from 'viem'
import { type PrepareTransactionRequestRequest as viem_PrepareTransactionRequestRequest } from 'viem'

import { computed } from 'vue-demi'
import {
Expand All @@ -26,45 +27,63 @@ import { useChainId } from './useChainId.js'
import { useConfig } from './useConfig.js'

export type UsePrepareTransactionRequestParameters<
parameterType extends viem_PrepareTransactionRequestParameterType = viem_PrepareTransactionRequestParameterType,
config extends Config = Config,
chainId extends config['chains'][number]['id'] | undefined = undefined,
selectData = PrepareTransactionRequestData<parameterType, config, chainId>,
request extends viem_PrepareTransactionRequestRequest<
SelectChains<config, chainId>[0],
SelectChains<config, chainId>[0]
> = viem_PrepareTransactionRequestRequest<
SelectChains<config, chainId>[0],
SelectChains<config, chainId>[0]
>,
selectData = PrepareTransactionRequestData<config, chainId, request>,
> = MaybeRefDeep<
PrepareTransactionRequestOptions<parameterType, config, chainId> &
PrepareTransactionRequestOptions<config, chainId, request> &
ConfigParameter<config> &
QueryParameter<
PrepareTransactionRequestQueryFnData<parameterType, config, chainId>,
PrepareTransactionRequestQueryFnData<config, chainId, request>,
PrepareTransactionRequestErrorType,
selectData,
PrepareTransactionRequestQueryKey<parameterType, config, chainId>
PrepareTransactionRequestQueryKey<config, chainId, request>
>
>

export type UsePrepareTransactionRequestReturnType<
parameterType extends viem_PrepareTransactionRequestParameterType = viem_PrepareTransactionRequestParameterType,
config extends Config = Config,
chainId extends config['chains'][number]['id'] | undefined = undefined,
selectData = PrepareTransactionRequestData<parameterType, config, chainId>,
request extends viem_PrepareTransactionRequestRequest<
SelectChains<config, chainId>[0],
SelectChains<config, chainId>[0]
> = viem_PrepareTransactionRequestRequest<
SelectChains<config, chainId>[0],
SelectChains<config, chainId>[0]
>,
selectData = PrepareTransactionRequestData<config, chainId, request>,
> = UseQueryReturnType<selectData, PrepareTransactionRequestErrorType>

/** https://wagmi.sh/react/api/hooks/usePrepareTransactionRequest */
export function usePrepareTransactionRequest<
parameterType extends viem_PrepareTransactionRequestParameterType,
config extends Config = ResolvedRegister['config'],
chainId extends config['chains'][number]['id'] | undefined = undefined,
selectData = PrepareTransactionRequestData<parameterType, config, chainId>,
request extends viem_PrepareTransactionRequestRequest<
SelectChains<config, chainId>[0],
SelectChains<config, chainId>[0]
> = viem_PrepareTransactionRequestRequest<
SelectChains<config, chainId>[0],
SelectChains<config, chainId>[0]
>,
selectData = PrepareTransactionRequestData<config, chainId, request>,
>(
parameters: UsePrepareTransactionRequestParameters<
parameterType,
config,
chainId,
request,
selectData
> = {} as any,
): UsePrepareTransactionRequestReturnType<
parameterType,
config,
chainId,
request,
selectData
> {
const config = useConfig(parameters)
Expand All @@ -90,9 +109,9 @@ export function usePrepareTransactionRequest<
return useQuery(
queryOptions as any,
) as UsePrepareTransactionRequestReturnType<
parameterType,
config,
chainId,
request,
selectData
>
}
Loading

0 comments on commit 83fc8a2

Please sign in to comment.