Skip to content

Commit

Permalink
make account optional for restoreFootprint
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaineHeffron committed May 29, 2024
1 parent c0e15ed commit 541e663
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/contract/assembled_transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,6 @@ export class AssembledTransaction<T> {
* - A `signTransaction` function must be provided during the Client initialization.
* - The provided `restorePreamble` should include a minimum resource fee and valid
* transaction data.
* - The `account` parameter should be an instance of a valid blockchain account.
*
* @throws {Error} - Throws an error if no `signTransaction` function is provided during
* Client initialization.
Expand All @@ -838,11 +837,12 @@ export class AssembledTransaction<T> {
/**
* The account that is executing the footprint restore operation.
*/
account: Account
account?: Account
): Promise<Api.GetTransactionResponse> {
if(!this.options.signTransaction){
throw new Error("For automatic restore to work you must provide a signTransaction function when initializing your Client");
}
account = account ?? await getAccount(this.options, this.server);
// first try restoring the contract
const restoreTx = await AssembledTransaction.buildFootprintRestoreTransaction(
{ ...this.options },
Expand Down

0 comments on commit 541e663

Please sign in to comment.