Skip to content

Commit

Permalink
docs: util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jul 24, 2023
1 parent 847b071 commit 39608d3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions yarn-project/end-to-end/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,32 @@ export async function deployContract(
return { address: receipt.contractAddress!, partialContractAddress: deployMethod.partialContractAddress! };
}

/**
* Represents a function that creates an AccountImplementation object asynchronously.
*
* @param address - The Aztec address associated with the account.
* @param useProperKey - A flag indicating whether the proper key should be used during account creation.
* @param partialAddress - The partial contract address associated with the account.
* @param encryptionPrivateKey - The encryption private key used during account creation.
* @returns A Promise that resolves to an AccountImplementation object.
*/
export type CreateAccountImplFn = (
address: AztecAddress,
useProperKey: boolean,
partialAddress: PartialContractAddress,
encryptionPrivateKey: Buffer,
) => Promise<AccountImplementation>;

/**
* Creates a new account.
* @param aztecRpcServer - The AztecRPC server to interact with.
* @param abi - The ABI (Application Binary Interface) of the account contract.
* @param args - The arguments to pass to the account contract's constructor.
* @param encryptionPrivateKey - The encryption private key used by the account.
* @param useProperKey - A flag indicating whether the proper key should be used during account creation.
* @param createAccountImpl - A function that creates an AccountImplementation object.
* @returns A Promise that resolves to an object containing the created wallet, account address, and partial address.
*/
export async function createNewAccount(
aztecRpcServer: AztecRPC,
abi: ContractAbi,
Expand Down

0 comments on commit 39608d3

Please sign in to comment.