Class Account<TContract>

Type Parameters

  • TContract extends IAccountCore

Hierarchy

  • Account

Implements

  • DetectableFeature

Constructors

Properties

accountPermissions: undefined | AccountPermissions
approveTargetForSigner: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Approve an address as a call target for a given signer on the account

      Parameters

      • Rest ...args: [signerAddress: string, target: string]

      Returns Promise<TResult>

      Remarks

      Approves an address as a call target for a given signer on the account.

      Example

      const tx = await contract.account.approveTargetForSigner(signer, target);
      const receipt = tx.receipt();

      Twfeature

      AccountPermissions

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [signerAddress: string, target: string]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

contractWrapper: ContractWrapper<IAccountCore>
disapproveTargetForSigner: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Disapprove an address as a call target for a given signer on the account

      Parameters

      • Rest ...args: [signerAddress: string, target: string]

      Returns Promise<TResult>

      Remarks

      Disapprove an address as a call target for a given signer on the account.

      Example

      const tx = await contract.account.disapproveTargetForSigner(signer, target);
      const receipt = tx.receipt();

      Twfeature

      AccountPermissions

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [signerAddress: string, target: string]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

featureName: "Account" = FEATURE_ACCOUNT.name
grantAdminPermissions: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Grant an address admin access to the account.

      Parameters

      • Rest ...args: [signerAddress: string]

      Returns Promise<TResult>

      Remarks

      Grants an address admin access to the account. The admin will have complete authority over the account.

      Example

      const tx = await contract.account.grantAdminAccess(signer);
      const receipt = tx.receipt();

      Twfeature

      AccountPermissions

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [signerAddress: string]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

grantPermissions: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Grant a signer permissions to use the account.

      Parameters

      • Rest ...args: [signerAddress: string, permissions: {
            approvedCallTargets: Object;
            expirationDate?: number | Date;
            nativeTokenLimitPerTransaction?: string | number;
            startDate?: number | Date;
        }]

      Returns Promise<TResult>

      Remarks

      Grants a signer permissions to use the account.

      Example

      const tx = await contract.account.grantPermissions(signer, permissions);
      const receipt = tx.receipt();

      Twfeature

      AccountPermissions

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [signerAddress: string, permissions: {
              approvedCallTargets: Object;
              expirationDate?: number | Date;
              nativeTokenLimitPerTransaction?: string | number;
              startDate?: number | Date;
          }]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

resetAllPermissions: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Set the account's entire snapshot of permissions.

      Parameters

      • Rest ...args: [permissionSnapshot: {
            makeAdmin: boolean;
            permissions: { approvedCallTargets: (string[] | "*") & (string[] | "*" | undefined); startDate?: number | Date | undefined; expirationDate?: number | Date | undefined; nativeTokenLimitPerTransaction?: string | ... 1 more ... | undefined; };
            signer: string;
        }[]]

      Returns Promise<TResult>

      Remarks

      Sets the account's entire snapshot of permissions.

      Example

      const tx = await contract.account.setAccess(permissionSnapshot);
      const receipt = tx.receipt();

      Twfeature

      AccountPermissions

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [permissionSnapshot: {
              makeAdmin: boolean;
              permissions: { approvedCallTargets: (string[] | "*") & (string[] | "*" | undefined); startDate?: number | Date | undefined; expirationDate?: number | Date | undefined; nativeTokenLimitPerTransaction?: string | ... 1 more ... | undefined; };
              signer: string;
          }[]]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

revokeAccess: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Revoke a scoped access address to the account

      Parameters

      • Rest ...args: [signerAddress: string]

      Returns Promise<TResult>

      Remarks

      Revokes an address' access to the account.

      Example

      const tx = await contract.account.revokeAccess(signer);
      const receipt = tx.receipt();

      Twfeature

      AccountPermissions

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [signerAddress: string]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

revokeAdminPermissions: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Revoke an address' admin access to the account.

      Parameters

      • Rest ...args: [signerAddress: string]

      Returns Promise<TResult>

      Remarks

      Revokes an address' admin access to the account.

      Example

      const tx = await contract.account.revokeAdminAccess(signer);
      const receipt = tx.receipt();

      Twfeature

      AccountPermissions

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [signerAddress: string]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

updatePermissions: {
    prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>);
    (...args): Promise<TResult>;
} = ...

Type declaration

    • (...args): Promise<TResult>
    • Update the permissions of a signer for using the account.

      Parameters

      • Rest ...args: [signerAddress: string, permissions: {
            approvedCallTargets: Object;
            expirationDate?: number | Date;
            nativeTokenLimitPerTransaction?: string | number;
            startDate?: number | Date;
        }]

      Returns Promise<TResult>

      Remarks

      Updates the permissions of a signer for using the account.

      Example

      const tx = await contract.account.updateAccess(signer, restrictions);
      const receipt = tx.receipt();

      Twfeature

      AccountPermissions

  • prepare: ((...args) => Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>)
      • (...args): Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
      • Parameters

        • Rest ...args: [signerAddress: string, permissions: {
              approvedCallTargets: Object;
              expirationDate?: number | Date;
              nativeTokenLimitPerTransaction?: string | number;
              startDate?: number | Date;
          }]

        Returns Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>

Methods

  • Get all admins of the account.

    Returns Promise<string[]>

    all admins of the account.

    Example

    const allAdmins = await contract.account.getAllAdmins();
    

    Twfeature

    AccountPermissions

  • Get whether a signer is an admin on the account.

    Parameters

    • signerAddress: string

    Returns Promise<boolean>

    whether a signer is an admin on the account.

    Example

    const isAdmin = await contract.account.isAdmin(signer);
    

    Twfeature

    AccountPermissions

  • Get whether a signer has permissions to use the account.

    Parameters

    • signerAddress: string

    Returns Promise<boolean>

    whether a signer has permissions to use the account.

    Example

    const isAdmin = await contract.account.isSigner(signer);
    

    Twfeature

    AccountPermissions

Generated using TypeDoc