Skip to content

Commit

Permalink
✨ feat(app): export utility types
Browse files Browse the repository at this point in the history
  • Loading branch information
huynhducduy committed Dec 2, 2024
1 parent 2951f94 commit 0f25de1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starknet_multicall",
"version": "1.0.2",
"version": "1.0.3",
"type": "module",
"sideEffects": false,
"moduleSideEffects": false,
Expand Down
12 changes: 9 additions & 3 deletions src/multicall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ import {

import MulticallABI from '../artifacts/MulticallABI'

export function createMulticallRequest<
export type ContractMethodArgs<
ContractAbi extends Abi,
Method extends ExtractAbiFunctionNames<ContractAbi>,
Args extends FunctionArgs<ContractAbi, Method> extends unknown[] // note: we have to do this because some how FunctionArgs is wrong for single element
> =
FunctionArgs<ContractAbi, Method> extends unknown[] // note: we have to do this because some how FunctionArgs is wrong for single element
? FunctionArgs<ContractAbi, Method>
: [FunctionArgs<ContractAbi, Method>],
: [FunctionArgs<ContractAbi, Method>]

export function createMulticallRequest<
ContractAbi extends Abi,
Method extends ExtractAbiFunctionNames<ContractAbi>,
Args extends ContractMethodArgs<ContractAbi, Method>,
>(
address: string,
abi: ContractAbi,
Expand Down

0 comments on commit 0f25de1

Please sign in to comment.