import { fetch } from "./universal"; import { TurnkeyCredentialRequestOptions } from "./webauthn"; import type { TurnkeyClient } from "."; export type { TurnkeyCredentialRequestOptions }; export { fetch }; type TBasicType = string; type TQueryShape = Record>; type THeadersShape = Record | undefined; type TBodyShape = Record; type TSubstitutionShape = Record; /** * Represents a signed request ready to be POSTed to Turnkey * @deprecated use {@link TSignedRequest} instead */ export type SignedRequest = { body: string; stamp: string; url: string; }; /** * @deprecated */ export declare function signedRequest(input: { uri: string; query?: Q; body?: B; substitution?: S; options?: TurnkeyCredentialRequestOptions | undefined; }): Promise; export declare function request(input: { uri: string; method: "POST"; headers?: H; query?: Q; body?: B; substitution?: S; }): Promise; /** * Seals and stamps the request body with your Turnkey API credentials. * * You can either: * - Before calling `sealAndStampRequestBody(...)`, initialize with your Turnkey API credentials via `init(...)` * - Or, provide `apiPublicKey` and `apiPrivateKey` here as arguments */ export declare function sealAndStampRequestBody(input: { body: Record; apiPublicKey?: string; apiPrivateKey?: string; }): Promise<{ sealedBody: string; xStamp: string; }>; export declare function isHttpClient(client: any): client is TurnkeyClient; export type THttpConfig = { baseUrl: string; }; /** * Represents a signed request ready to be POSTed to Turnkey */ export type TSignedRequest = { body: string; stamp: TStamp; url: string; }; /** * Represents a stamp header name/value pair */ export type TStamp = { stampHeaderName: string; stampHeaderValue: string; }; export type GrpcStatus = { message: string; code: number; details: unknown[] | null; }; /** * Interface to implement if you want to provide your own stampers to your {@link TurnkeyClient}. * Currently Turnkey provides 2 stampers: * - applications signing requests with Passkeys or webauthn devices should use `@turnkey/webauthn-stamper` * - applications signing requests with API keys should use `@turnkey/api-key-stamper` */ export interface TStamper { stamp: (input: string) => Promise; } export declare class TurnkeyRequestError extends Error { details: any[] | null; code: number; constructor(input: GrpcStatus); } //# sourceMappingURL=base.d.ts.map