Class AccountFactory<TContract>

Type Parameters

  • TContract extends IAccountFactory

Hierarchy

  • AccountFactory

Implements

  • DetectableFeature

Constructors

Properties

contractWrapper: ContractWrapper<IAccountFactory>
createAccount: {
    prepare: ((...args) => Promise<Transaction<TransactionResultWithAddress>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Create a account

      Parameters

      • Rest ...args: [accountAdmin: string, extraData?: BytesLike]

      Returns Promise<TResult>

      Remarks

      Create a account for an admin. The admin will have complete authority over the account.

      Example

      const tx = await contract.accountFactory.createAccount(admin, extraData);
      const receipt = tx.receipt();
      const accountAddress = tx.address;

      Twfeature

      AccountFactory

  • prepare: ((...args) => Promise<Transaction<TransactionResultWithAddress>>)
events: ContractEvents<IAccountFactory>
featureName: "AccountFactory" = FEATURE_ACCOUNT_FACTORY.name

Methods

  • Get all accounts

    Returns Promise<string[]>

    all accounts created via the account factory.

    Example

    const allAccounts = await contract.accountFactory.getAllAccounts();
    

    Twfeature

    AccountFactory

  • Get all accounts on which the given signer has authority

    Parameters

    • signer: string

      The account address.

    Returns Promise<string[]>

    all accounts on which the given signer has authority.

    Example

    const allAccounts = await contract.accountFactory.getAssociatedAccounts(admin);
    

    Twfeature

    AccountFactory

  • Check if a account has been deployed for the given admin

    Parameters

    • admin: string

      The admin of the account.

    • Optional extraData: BytesLike

      (Optional) Extra data to be passed to the account on creation.

    Returns Promise<boolean>

    whether the account has been deployed for the given admin.

  • Get the deterministic address of the account that will be created

    Parameters

    • admin: string

      The admin of the account.

    • Optional extraData: BytesLike

      (Optional) Extra data to be passed to the account on creation.

    Returns Promise<string>

    the deterministic address of the account that will be created for the given admin.

    Example

    const accountAddress = await contract.accountFactory.predictAccountAddress(admin);
    

    Twfeature

    AccountFactory

Generated using TypeDoc