interface ContractClient {
    registerApp(
        params: RegisterAppParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    registerNextVersion(
        params: RegisterNextVersionParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string; newAppVersion: number }>;
    enableAppVersion(
        params: EnableAppVersionParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    addDelegatee(
        params: AddDelegateeParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    removeDelegatee(
        params: RemoveDelegateeParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    deleteApp(
        params: DeleteAppParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    undeleteApp(
        params: UndeleteAppParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    getAppById(params: GetAppByIdParams): Promise<null | App>;
    getAppVersion(
        params: GetAppVersionParams,
    ): Promise<null | { appVersion: AppVersion }>;
    getAppsByManagerAddress(
        params: GetAppsByManagerParams,
    ): Promise<{ app: App; versions: AppVersion[] }[]>;
    getAppByDelegateeAddress(
        params: GetAppByDelegateeParams,
    ): Promise<null | App>;
    getDelegatedPkpEthAddresses(
        params: GetDelegatedPkpEthAddressesParams,
    ): Promise<string[]>;
    permitApp(
        params: PermitAppParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    unPermitApp(
        params: UnPermitAppParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    setAbilityPolicyParameters(
        params: SetAbilityPolicyParametersParams,
        overrides?: Overrides,
    ): Promise<{ txHash: string }>;
    getAllRegisteredAgentPkpEthAddresses(
        params: GetAllRegisteredAgentPkpsParams,
    ): Promise<string[]>;
    getPermittedAppVersionForPkp(
        params: GetPermittedAppVersionForPkpParams,
    ): Promise<null | number>;
    getAllPermittedAppIdsForPkp(
        params: GetAllPermittedAppIdsForPkpParams,
    ): Promise<number[]>;
    getAllAbilitiesAndPoliciesForApp(
        params: GetAllAbilitiesAndPoliciesForAppParams,
    ): Promise<PermissionData>;
    validateAbilityExecutionAndGetPolicies(
        params: ValidateAbilityExecutionAndGetPoliciesParams,
    ): Promise<ValidateAbilityExecutionAndGetPoliciesResult>;
}

Methods

  • Registers a new app with its initial appVersion (v1)'s permissions

    Parameters

    Returns Promise<{ txHash: string }>

    • The hash of the transaction that registered the app
  • Register a new version on an existing application

    Parameters

    Returns Promise<{ txHash: string; newAppVersion: number }>

    The transaction hash and the new app version incremented on-chain.

    • If for some reason the new app creation event is not found after a successful transaction, this method will throw an error.
  • Enable or disable a specific app version

    Parameters

    Returns Promise<{ txHash: string }>

    The hash of the transaction that set the app enabled state

  • Add a new delegatee to an app

    Parameters

    Returns Promise<{ txHash: string }>

    The hash of the transaction that added the new delegatee

  • Remove a delegatee from an app

    Parameters

    Returns Promise<{ txHash: string }>

    The hash of the transaction that removed the existing delegatee

  • Delete an application by setting its isDeleted flag to true

    Parameters

    Returns Promise<{ txHash: string }>

    The hash of the transaction that marked the app deleted

  • Undelete an app by setting its isDeleted flag to false

    Parameters

    Returns Promise<{ txHash: string }>

    The hash of the transaction that undeleted the app

  • Get detailed information about an app by its ID

    Parameters

    Returns Promise<null | App>

    Detailed view of the app containing its metadata and relationships, or null if the app is not registered

  • Get detailed information about a specific version of an app

    Parameters

    Returns Promise<null | { appVersion: AppVersion }>

    Object containing basic app information and version-specific information including abilities and policies, or null if the app version is not registered

  • Get delegated agent PKP token IDs for a specific app version with pagination

    Returns the first 100 PKP eth addresses.

    Provide pageOpts.offset to fetch more than the initial 100

    Provide pageOpts.limit to fetch more or less than 100-at-a-time

    Returns Promise<string[]>

    Array of delegated agent PKP token IDs

  • Permits an app version for an Agent Wallet PKP token and optionally sets ability policy parameters

    Parameters

    Returns Promise<{ txHash: string }>

    The transaction hash that permitted the app

  • Revokes permission for a PKP to use a specific app version

    Parameters

    Returns Promise<{ txHash: string }>

    The transaction hash that remoked permission for the app

  • Sets ability policy parameters for a specific app version

    Parameters

    Returns Promise<{ txHash: string }>

    The transaction hash that set the policy parameters

  • Get all PKP tokens that are registered as agents for a specific user address

    Returns Promise<string[]>

    Array of PKP eth addresses that are registered as agents for the user. Empty array if none found.