UNPKG

@okutrade/account-api

Version:

TypeScript client for OKU Account API using Connect-ES

182 lines (181 loc) 5.28 kB
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; import type { Address } from "./common_pb.js"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file gfxcafe/oku/account/v1/login.proto. */ export declare const file_gfxcafe_oku_account_v1_login: GenFile; /** * ChallengeRequest for generating a login challenge * * @generated from message gfxcafe.oku.account.v1.ChallengeRequest */ export type ChallengeRequest = Message<"gfxcafe.oku.account.v1.ChallengeRequest"> & { /** * Ethereum address * * @generated from field: gfxcafe.oku.account.v1.Address address = 1; */ address?: Address; /** * Chain ID * * @generated from field: int32 chain_id = 2; */ chainId: number; /** * URI for the challenge * * @generated from field: string uri = 3; */ uri: string; }; /** * Describes the message gfxcafe.oku.account.v1.ChallengeRequest. * Use `create(ChallengeRequestSchema)` to create a new message. */ export declare const ChallengeRequestSchema: GenMessage<ChallengeRequest>; /** * ChallengeResponse with challenge to sign * * @generated from message gfxcafe.oku.account.v1.ChallengeResponse */ export type ChallengeResponse = Message<"gfxcafe.oku.account.v1.ChallengeResponse"> & { /** * Challenge message to sign * * @generated from field: string challenge = 1; */ challenge: string; /** * Optional server signature * * @generated from field: bytes signature = 2; */ signature: Uint8Array; }; /** * Describes the message gfxcafe.oku.account.v1.ChallengeResponse. * Use `create(ChallengeResponseSchema)` to create a new message. */ export declare const ChallengeResponseSchema: GenMessage<ChallengeResponse>; /** * SolutionRequest with signed challenge * * @generated from message gfxcafe.oku.account.v1.SolutionRequest */ export type SolutionRequest = Message<"gfxcafe.oku.account.v1.SolutionRequest"> & { /** * The challenge that was signed * * @generated from field: string challenge = 1; */ challenge: string; /** * The signature solution * * @generated from field: bytes solution = 2; */ solution: Uint8Array; }; /** * Describes the message gfxcafe.oku.account.v1.SolutionRequest. * Use `create(SolutionRequestSchema)` to create a new message. */ export declare const SolutionRequestSchema: GenMessage<SolutionRequest>; /** * SolutionResponse with auth token * * @generated from message gfxcafe.oku.account.v1.SolutionResponse */ export type SolutionResponse = Message<"gfxcafe.oku.account.v1.SolutionResponse"> & { /** * Access token * * @generated from field: string token = 1; */ token: string; /** * Token type (e.g., "Bearer") * * @generated from field: string token_type = 2; */ tokenType: string; }; /** * Describes the message gfxcafe.oku.account.v1.SolutionResponse. * Use `create(SolutionResponseSchema)` to create a new message. */ export declare const SolutionResponseSchema: GenMessage<SolutionResponse>; /** * LinkRequest to link wallet to account * * @generated from message gfxcafe.oku.account.v1.LinkRequest */ export type LinkRequest = Message<"gfxcafe.oku.account.v1.LinkRequest"> & { /** * Access token from wallet authentication * * @generated from field: string token = 1; */ token: string; /** * Token type * * @generated from field: string token_type = 2; */ tokenType: string; }; /** * Describes the message gfxcafe.oku.account.v1.LinkRequest. * Use `create(LinkRequestSchema)` to create a new message. */ export declare const LinkRequestSchema: GenMessage<LinkRequest>; /** * LinkResponse (empty) * * @generated from message gfxcafe.oku.account.v1.LinkResponse */ export type LinkResponse = Message<"gfxcafe.oku.account.v1.LinkResponse"> & {}; /** * Describes the message gfxcafe.oku.account.v1.LinkResponse. * Use `create(LinkResponseSchema)` to create a new message. */ export declare const LinkResponseSchema: GenMessage<LinkResponse>; /** * LoginService provides wallet-based authentication * * @generated from service gfxcafe.oku.account.v1.LoginService */ export declare const LoginService: GenService<{ /** * Generate a login challenge for wallet signing (/login/challenge) * * @generated from rpc gfxcafe.oku.account.v1.LoginService.Challenge */ challenge: { methodKind: "unary"; input: typeof ChallengeRequestSchema; output: typeof ChallengeResponseSchema; }; /** * Verify the signed challenge and return auth token (/login/solution) * * @generated from rpc gfxcafe.oku.account.v1.LoginService.Solution */ solution: { methodKind: "unary"; input: typeof SolutionRequestSchema; output: typeof SolutionResponseSchema; }; /** * Link an Ethereum address to an existing user account (/login/link) * * @generated from rpc gfxcafe.oku.account.v1.LoginService.Link */ link: { methodKind: "unary"; input: typeof LinkRequestSchema; output: typeof LinkResponseSchema; }; }>;