@@ -44,7 +44,18 @@ export abstract class AccountInterface extends ProviderInterface {
4444 * @param calls the invocation object containing:
4545 * - contractAddress - the address of the contract
4646 * - entrypoint - the entrypoint of the contract
47- * - calldata - (defaults to []) the calldata
47+ * - calldata? - (defaults to []) the calldata
48+ *
49+ * @param estimateFeeDetails -
50+ * - blockIdentifier?
51+ * - nonce? = 0
52+ * - skipValidate? - default true
53+ * - tip? - prioritize order of transactions in the mempool.
54+ * - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction)
55+ * - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
56+ * - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
57+ * - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
58+ * - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
4859 *
4960 * @returns response from estimate_fee
5061 */
@@ -58,7 +69,20 @@ export abstract class AccountInterface extends ProviderInterface {
5869 *
5970 * @param contractPayload the payload object containing:
6071 * - contract - the compiled contract to be declared
61- * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.
72+ * - casm? - compiled cairo assembly. Cairo1(casm or compiledClassHash are required)
73+ * - classHash? - the class hash of the compiled contract. Precalculate for faster execution.
74+ * - compiledClassHash?: class hash of the cairo assembly. Cairo1(casm or compiledClassHash are required)
75+ *
76+ * @param estimateFeeDetails -
77+ * - blockIdentifier?
78+ * - nonce? = 0
79+ * - skipValidate? - default true
80+ * - tip? - prioritize order of transactions in the mempool.
81+ * - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction)
82+ * - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
83+ * - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
84+ * - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
85+ * - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
6286 *
6387 * @returns response from estimate_fee
6488 */
@@ -71,11 +95,21 @@ export abstract class AccountInterface extends ProviderInterface {
7195 * Estimate Fee for executing a DEPLOY_ACCOUNT transaction on starknet
7296 *
7397 * @param contractPayload -
74- * - contract - the compiled contract to be deployed
75- * - classHash - the class hash of the compiled contract. This can be obtained by using starknet-cli.
98+ * - classHash - the class hash of the compiled contract.
99+ * - constructorCalldata? - constructor data;
100+ * - contractAddress? - future account contract address. Precalculate for faster execution.
101+ * - addressSalt? - salt used for calculation of the contractAddress. Required if contractAddress is provided.
102+ *
76103 * @param estimateFeeDetails -
77- * - optional blockIdentifier
78- * - constant nonce = 0
104+ * - blockIdentifier?
105+ * - nonce? = 0
106+ * - skipValidate? - default true
107+ * - tip? - prioritize order of transactions in the mempool.
108+ * - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
109+ * - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
110+ * - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
111+ * - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
112+ *
79113 * @returns response from estimate_fee
80114 */
81115 public abstract estimateAccountDeployFee (
@@ -87,20 +121,26 @@ export abstract class AccountInterface extends ProviderInterface {
87121 * Estimate Fee for executing a UDC DEPLOY transaction on starknet
88122 * This is different from the normal DEPLOY transaction as it goes through the Universal Deployer Contract (UDC)
89123
90- * @param deployContractPayload containing
124+ * @param deployContractPayload array or singular
91125 * - classHash: computed class hash of compiled contract
92126 * - salt: address salt
93127 * - unique: bool if true ensure unique salt
94- * - calldata : constructor calldata
128+ * - constructorCalldata : constructor calldata
95129 *
96- * @param transactionsDetail Invocation Details containing:
97- * - optional nonce
98- * - optional version
99- * - optional maxFee
130+ * @param estimateFeeDetails -
131+ * - blockIdentifier?
132+ * - nonce?
133+ * - skipValidate? - default true
134+ * - tip? - prioritize order of transactions in the mempool.
135+ * - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction)
136+ * - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
137+ * - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
138+ * - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
139+ * - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
100140 */
101141 public abstract estimateDeployFee (
102142 deployContractPayload : UniversalDeployerContractPayload | UniversalDeployerContractPayload [ ] ,
103- transactionsDetail ?: InvocationsDetails
143+ estimateFeeDetails ?: EstimateFeeDetails
104144 ) : Promise < EstimateFeeResponse > ;
105145
106146 /**
@@ -111,13 +151,50 @@ export abstract class AccountInterface extends ProviderInterface {
111151 * - type - the type of transaction : 'DECLARE' | (multi)'DEPLOY' | (multi)'INVOKE_FUNCTION' | 'DEPLOY_ACCOUNT'
112152 * - payload - the payload of the transaction
113153 *
154+ * @param estimateFeeDetails -
155+ * - blockIdentifier?
156+ * - nonce?
157+ * - skipValidate? - default true
158+ * - tip? - prioritize order of transactions in the mempool.
159+ * - accountDeploymentData? - deploy an account contract (substitution for deploy account transaction)
160+ * - paymasterData? - entity other than the transaction sender to pay the transaction fees(EIP-4337)
161+ * - nonceDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
162+ * - feeDataAvailabilityMode? - allows users to choose their preferred data availability mode (Volition)
163+ * - version? - specify ETransactionVersion - V3 Transactions fee is in fri, oldV transactions fee is in wei
164+ *
114165 * @returns response from estimate_fee
115166 */
116167 public abstract estimateFeeBulk (
117168 invocations : Invocations ,
118169 details ?: EstimateFeeDetails
119170 ) : Promise < EstimateFeeResponseBulk > ;
120171
172+ /**
173+ * Gets Suggested Max Fee based on the transaction type
174+ *
175+ * @param {EstimateFeeAction } estimateFeeAction
176+ * @param {EstimateFeeDetails } details
177+ * @returns EstimateFee (...response, resourceBounds, suggestedMaxFee)
178+ */
179+ public abstract getSuggestedFee (
180+ estimateFeeAction : EstimateFeeAction ,
181+ details : EstimateFeeDetails
182+ ) : Promise < EstimateFee > ;
183+
184+ /**
185+ * Simulates an array of transaction and returns an array of transaction trace and estimated fee.
186+ *
187+ * @param invocations Invocations containing:
188+ * - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION
189+ * @param details SimulateTransactionDetails
190+ *
191+ * @returns response from simulate_transaction
192+ */
193+ public abstract simulateTransaction (
194+ invocations : Invocations ,
195+ details ?: SimulateTransactionDetails
196+ ) : Promise < SimulateTransactionResponse > ;
197+
121198 /**
122199 * Invoke execute function in account contract
123200 *
@@ -138,16 +215,14 @@ export abstract class AccountInterface extends ProviderInterface {
138215
139216 /**
140217 * Declares a given compiled contract (json) to starknet
141- *
218+ *
142219 * @param contractPayload transaction payload to be deployed containing:
143- - contract: compiled contract code
144- - (optional) classHash: computed class hash of compiled contract. Pre-compute it for faster execution.
145- - (required for Cairo1 without compiledClassHash) casm: CompiledContract | string;
146- - (optional for Cairo1 with casm) compiledClassHash: compiled class hash from casm. Pre-compute it for faster execution.
147- * @param transactionsDetail Invocation Details containing:
148- - optional nonce
149- - optional version
150- - optional maxFee
220+ * - contract: compiled contract code
221+ * - (optional) classHash: computed class hash of compiled contract. Pre-compute it for faster execution.
222+ * - (required for Cairo1 without compiledClassHash) casm: CompiledContract | string;
223+ * - (optional for Cairo1 with casm) compiledClassHash: compiled class hash from casm. Pre-compute it for faster execution.
224+ * @param transactionsDetail - InvocationsDetails
225+ *
151226 * @returns a confirmation of sending a transaction on the starknet contract
152227 */
153228 public abstract declare (
@@ -164,17 +239,15 @@ export abstract class AccountInterface extends ProviderInterface {
164239 * - [constructorCalldata] contract constructor calldata
165240 * - [salt=pseudorandom] deploy address salt
166241 * - [unique=true] ensure unique salt
167- * @param details -
168- * - [nonce=getNonce]
169- * - [version=transactionVersion]
170- * - [maxFee=getSuggestedFee]
242+ * @param details - InvocationsDetails
243+ *
171244 * @returns
172245 * - contract_address[]
173246 * - transaction_hash
174247 */
175248 public abstract deploy (
176249 payload : UniversalDeployerContractPayload | UniversalDeployerContractPayload [ ] ,
177- details ?: InvocationsDetails | undefined
250+ details ?: InvocationsDetails
178251 ) : Promise < MultiDeployContractResponse > ;
179252
180253 /**
@@ -186,10 +259,8 @@ export abstract class AccountInterface extends ProviderInterface {
186259 * - [constructorCalldata] contract constructor calldata
187260 * - [salt=pseudorandom] deploy address salt
188261 * - [unique=true] ensure unique salt
189- * @param details -
190- * - [nonce=getNonce]
191- * - [version=transactionVersion]
192- * - [maxFee=getSuggestedFee]
262+ * @param details - InvocationsDetails
263+ *
193264 * @returns
194265 * - contract_address
195266 * - transaction_hash
@@ -203,7 +274,7 @@ export abstract class AccountInterface extends ProviderInterface {
203274 */
204275 public abstract deployContract (
205276 payload : UniversalDeployerContractPayload | UniversalDeployerContractPayload [ ] ,
206- details ?: InvocationsDetails | undefined
277+ details ?: InvocationsDetails
207278 ) : Promise < DeployContractUDCResponse > ;
208279
209280 /**
@@ -219,10 +290,8 @@ export abstract class AccountInterface extends ProviderInterface {
219290 * - [constructorCalldata] contract constructor calldata
220291 * - [salt=pseudorandom] deploy address salt
221292 * - [unique=true] ensure unique salt
222- * @param details
223- * - [nonce=getNonce]
224- * - [version=transactionVersion]
225- * - [maxFee=getSuggestedFee]
293+ * @param details - InvocationsDetails
294+ *
226295 * @returns
227296 * - declare
228297 * - transaction_hash
@@ -239,21 +308,19 @@ export abstract class AccountInterface extends ProviderInterface {
239308 */
240309 public abstract declareAndDeploy (
241310 payload : DeclareAndDeployContractPayload ,
242- details ?: InvocationsDetails | undefined
311+ details ?: InvocationsDetails
243312 ) : Promise < DeclareDeployUDCResponse > ;
244313
245314 /**
246315 * Deploy the account on Starknet
247- *
316+ *
248317 * @param contractPayload transaction payload to be deployed containing:
249- - classHash: computed class hash of compiled contract
250- - optional constructor calldata
251- - optional address salt
252- - optional contractAddress
253- * @param transactionsDetail Invocation Details containing:
254- - constant nonce = 0
255- - optional version
256- - optional maxFee
318+ * - classHash: computed class hash of compiled contract
319+ * - optional constructor calldata
320+ * - optional address salt
321+ * - optional contractAddress
322+ * @param transactionsDetail - InvocationsDetails
323+ *
257324 * @returns a confirmation of sending a transaction on the starknet contract
258325 */
259326 public abstract deployAccount (
@@ -309,30 +376,4 @@ export abstract class AccountInterface extends ProviderInterface {
309376 * @returns nonce of the account
310377 */
311378 public abstract getNonce ( blockIdentifier ?: BlockIdentifier ) : Promise < Nonce > ;
312-
313- /**
314- * Gets Suggested Max Fee based on the transaction type
315- *
316- * @param {EstimateFeeAction } estimateFeeAction
317- * @param {EstimateFeeDetails } details
318- * @returns suggestedMaxFee
319- */
320- public abstract getSuggestedFee (
321- estimateFeeAction : EstimateFeeAction ,
322- details : EstimateFeeDetails
323- ) : Promise < EstimateFee > ;
324-
325- /**
326- * Simulates an array of transaction and returns an array of transaction trace and estimated fee.
327- *
328- * @param invocations Invocations containing:
329- * - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION
330- * @param details SimulateTransactionDetails
331- *
332- * @returns response from simulate_transaction
333- */
334- public abstract simulateTransaction (
335- invocations : Invocations ,
336- details ?: SimulateTransactionDetails
337- ) : Promise < SimulateTransactionResponse > ;
338379}
0 commit comments