From 0f25de169a350ce1c11a3a802176ac095921bf23 Mon Sep 17 00:00:00 2001 From: Huynh Duc Duy Date: Mon, 2 Dec 2024 15:35:17 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(app):=20export=20utility=20typ?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/multicall.ts | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 98b6800..b1709bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starknet_multicall", - "version": "1.0.2", + "version": "1.0.3", "type": "module", "sideEffects": false, "moduleSideEffects": false, diff --git a/src/multicall.ts b/src/multicall.ts index ecccecc..2dc5e8b 100644 --- a/src/multicall.ts +++ b/src/multicall.ts @@ -15,12 +15,18 @@ import { import MulticallABI from '../artifacts/MulticallABI' -export function createMulticallRequest< +export type ContractMethodArgs< ContractAbi extends Abi, Method extends ExtractAbiFunctionNames, - Args extends FunctionArgs extends unknown[] // note: we have to do this because some how FunctionArgs is wrong for single element +> = + FunctionArgs extends unknown[] // note: we have to do this because some how FunctionArgs is wrong for single element ? FunctionArgs - : [FunctionArgs], + : [FunctionArgs] + +export function createMulticallRequest< + ContractAbi extends Abi, + Method extends ExtractAbiFunctionNames, + Args extends ContractMethodArgs, >( address: string, abi: ContractAbi,