Comparing version 2.0.9 to 2.0.10
@@ -35,2 +35,15 @@ import { writeFileSync } from 'fs'; | ||
export type {{CONTRACT_NAME}}ContractQueries = keyof {{CONTRACT_NAME}}Contract['calls'] | ||
export type {{CONTRACT_NAME}}CallReturn<M extends {{CONTRACT_NAME}}ContractQueries> = { | ||
contractName: '{{CONTRACT_NAME}}' | ||
method: M | ||
args: ExtractArgs<{{CONTRACT_NAME}}Contract['calls'][M]> | ||
address: Address | undefined | ||
deployAddress: Address | undefined | ||
defaultValue: Awaited<ReturnType<{{CONTRACT_NAME}}Contract['calls'][M]>> | undefined | ||
getAbi: () => typeof abi | ||
with: (options: { | ||
contractAddress?: Address | ||
defaultValue?: Awaited<ReturnType<{{CONTRACT_NAME}}Contract['calls'][M]>> | ||
}) => {{CONTRACT_NAME}}CallReturn<M> | ||
} | ||
export function {{CONTRACT_NAME}}Call<M extends {{CONTRACT_NAME}}ContractQueries>( | ||
@@ -45,3 +58,3 @@ method: M, | ||
}, | ||
) { | ||
): {{CONTRACT_NAME}}CallReturn<M> { | ||
const address = | ||
@@ -59,8 +72,11 @@ typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress | ||
getAbi: () => abi, | ||
with: (options: { contractAddress?: Address; defaultValue?: Awaited<ReturnType<{{CONTRACT_NAME}}Contract['calls'][M]>> }) => { | ||
call.address = options.contractAddress | ||
call.defaultValue = options.defaultValue | ||
return call | ||
} | ||
} | ||
with: (options: { | ||
contractAddress?: Address | ||
defaultValue?: Awaited<ReturnType<{{CONTRACT_NAME}}Contract['calls'][M]>> | ||
}) => { | ||
call.address = options.contractAddress | ||
call.defaultValue = options.defaultValue | ||
return call as {{CONTRACT_NAME}}CallReturn<M> | ||
}, | ||
} as {{CONTRACT_NAME}}CallReturn<M> | ||
@@ -67,0 +83,0 @@ return call |
{ | ||
"name": "dappql", | ||
"version": "2.0.9", | ||
"version": "2.0.10", | ||
"description": "wagmi extension to easily query smart-contracts", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
14119
331