diff --git a/src/account/default.ts b/src/account/default.ts index a8bce285e..2dad91b9f 100644 --- a/src/account/default.ts +++ b/src/account/default.ts @@ -241,21 +241,28 @@ export class Account extends Provider implements AccountInterface { constructorCalldata = [], isDevnet = false, }: UniversalDeployerContractPayload, + additionalCalls: AllowArray = [], // support multicall transactionsDetail: InvocationsDetails = {} ): Promise { const compiledConstructorCallData = compileCalldata(constructorCalldata); + + const callsArray = Array.isArray(additionalCalls) ? additionalCalls : [additionalCalls]; + return this.execute( - { - contractAddress: isDevnet ? UDC.ADDRESS_DEVNET : UDC.ADDRESS, - entrypoint: UDC.ENTRYPOINT, - calldata: [ - classHash, - salt, - toCairoBool(unique), - compiledConstructorCallData.length, - ...compiledConstructorCallData, - ], - }, + [ + { + contractAddress: isDevnet ? UDC.ADDRESS_DEVNET : UDC.ADDRESS, + entrypoint: UDC.ENTRYPOINT, + calldata: [ + classHash, + salt, + toCairoBool(unique), + compiledConstructorCallData.length, + ...compiledConstructorCallData, + ], + }, + ...callsArray, + ], undefined, transactionsDetail ); diff --git a/src/account/interface.ts b/src/account/interface.ts index 6c2d19dbc..d439e350e 100644 --- a/src/account/interface.ts +++ b/src/account/interface.ts @@ -128,6 +128,7 @@ export abstract class AccountInterface extends ProviderInterface { * - salt: address salt * - unique: bool if true ensure unique salt * - calldata: constructor calldata + * @param additionalCalls - optional additional calls array to support multicall * @param transactionsDetail Invocation Details containing: * - optional nonce * - optional version @@ -135,6 +136,7 @@ export abstract class AccountInterface extends ProviderInterface { */ public abstract deploy( deployContractPayload: UniversalDeployerContractPayload, + additionalCalls?: AllowArray, transactionsDetail?: InvocationsDetails ): Promise;