Skip to content

Commit 78bb79f

Browse files
committed
fix: also in sdk
1 parent 8910037 commit 78bb79f

File tree

1 file changed

+7
-4
lines changed
  • packages/sdk/src/deployments/lib/contracts

1 file changed

+7
-4
lines changed

packages/sdk/src/deployments/lib/contracts/tx-log.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import type {
1111
import type { Provider } from '@ethersproject/providers'
1212
import type { ContractParam } from '../types/contract'
1313

14+
class WrappedContract {
15+
// The meta-class properties
16+
[key: string]: ContractFunction | any
17+
}
18+
1419
/**
1520
* Modifies a contract connect function to return a contract wrapped with {@link wrapCalls}
1621
*
@@ -45,7 +50,7 @@ export function getWrappedConnect(
4550
* @returns the wrapped contract
4651
*/
4752
export function wrapCalls(contract: Contract, contractName: string): Contract {
48-
const wrappedContract = lodash.cloneDeep(contract)
53+
const wrappedContract = lodash.cloneDeep(contract) as WrappedContract
4954

5055
for (const fn of Object.keys(contract.functions)) {
5156
const call: ContractFunction<ContractTransaction> = contract.functions[fn]
@@ -60,13 +65,11 @@ export function wrapCalls(contract: Contract, contractName: string): Contract {
6065
return tx
6166
}
6267

63-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
64-
// @ts-ignore
6568
wrappedContract[fn] = override
6669
wrappedContract.functions[fn] = override
6770
}
6871

69-
return wrappedContract
72+
return wrappedContract as Contract
7073
}
7174

7275
function logContractCall(

0 commit comments

Comments
 (0)