Documentation
    Preparing search index...

    Class EnokiClient

    A low-level client for interacting with the Enoki API.

    Index
    • Parameters

      • input: CreateSponsoredTransactionApiInput

      Returns Promise<CreateSponsoredTransactionApiResponse>

    • Parameters

      • input: CreateSubnameApiInput

      Returns Promise<CreateSubnameApiResponse>

    • Parameters

      • input: CreateZkLoginNonceApiInput

      Returns Promise<CreateZkLoginNonceApiResponse>

    • Parameters

      • input: CreateZkLoginZkpApiInput

      Returns Promise<CreateZkLoginZkpApiResponse>

    • Parameters

      • input: DeleteSubnameApiInput

      Returns void

    • Parameters

      • input: ExecuteSponsoredTransactionApiInput

      Returns Promise<ExecuteSponsoredTransactionApiResponse>

    • Parameters

      • Optional_input: GetAppApiInput

      Returns Promise<GetAppApiResponse>

    • Enoki's sponsor address. Works with a public key. Cached for a minute, or until a stale error.

      Parameters

      • __namedParameters: { network: EnokiDomainNetwork }

      Returns Promise<string>

    • Parameters

      • input: GetSubnamesApiInput

      Returns Promise<GetSubnamesApiResponse>

    • Parameters

      • input: GetZkLoginApiInput

      Returns Promise<GetZkLoginApiResponse>

    • Parameters

      • input: GetZkLoginAddressesApiInput

      Returns Promise<GetZkLoginAddressesApiResponse>

    • Sets Enoki's sponsor as gas owner with an empty gas payment, without building. Works with a public key. Throws if the transaction has a different gas owner or a gas payment.

      Parameters

      • __namedParameters: { network: EnokiDomainNetwork; transaction: Transaction }

      Returns Promise<Transaction>

    • Sponsors and executes a transaction in one request. Build it with the sponsor address from getApp as gas owner and an empty gas payment, and have the sender sign it. Requires a private API key.

      On invalid_gas_owner or invalid_gas_price, rebuild with the value in the error's data, sign again and retry. already_sponsored means Enoki has already sponsored this transaction.

      Parameters

      • input: SponsorAndExecuteTransactionApiInput

      Returns Promise<SponsorAndExecuteTransactionApiResponse>