@okutrade/account-api
Version:
TypeScript client for OKU Account API using Connect-ES
219 lines (196 loc) • 7.14 kB
text/typescript
// @generated by protoc-gen-es v2.2.2 with parameter "target=ts,import_extension=.js"
// @generated from file gfxcafe/oku/account/v1/login.proto (package gfxcafe.oku.account.v1, syntax proto3)
/* eslint-disable */
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1";
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
import { file_buf_validate_validate } from "../../../../buf/validate/validate_pb.js";
import type { Address } from "./common_pb.js";
import { file_gfxcafe_oku_account_v1_common } from "./common_pb.js";
import type { Message } from "@bufbuild/protobuf";
/**
* Describes the file gfxcafe/oku/account/v1/login.proto.
*/
export const file_gfxcafe_oku_account_v1_login: GenFile = /*@__PURE__*/
fileDesc("CiJnZnhjYWZlL29rdS9hY2NvdW50L3YxL2xvZ2luLnByb3RvEhZnZnhjYWZlLm9rdS5hY2NvdW50LnYxIoABChBDaGFsbGVuZ2VSZXF1ZXN0EjgKB2FkZHJlc3MYASABKAsyHy5nZnhjYWZlLm9rdS5hY2NvdW50LnYxLkFkZHJlc3NCBrpIA8gBARIYCghjaGFpbl9pZBgCIAEoBUIGukgDyAEBEhgKA3VyaRgDIAEoCUILukgIyAEBcgOIAQEiOQoRQ2hhbGxlbmdlUmVzcG9uc2USEQoJY2hhbGxlbmdlGAEgASgJEhEKCXNpZ25hdHVyZRgCIAEoDCJGCg9Tb2x1dGlvblJlcXVlc3QSGQoJY2hhbGxlbmdlGAEgASgJQga6SAPIAQESGAoIc29sdXRpb24YAiABKAxCBrpIA8gBASI1ChBTb2x1dGlvblJlc3BvbnNlEg0KBXRva2VuGAEgASgJEhIKCnRva2VuX3R5cGUYAiABKAkiQAoLTGlua1JlcXVlc3QSFQoFdG9rZW4YASABKAlCBrpIA8gBARIaCgp0b2tlbl90eXBlGAIgASgJQga6SAPIAQEiDgoMTGlua1Jlc3BvbnNlMqICCgxMb2dpblNlcnZpY2USYAoJQ2hhbGxlbmdlEiguZ2Z4Y2FmZS5va3UuYWNjb3VudC52MS5DaGFsbGVuZ2VSZXF1ZXN0GikuZ2Z4Y2FmZS5va3UuYWNjb3VudC52MS5DaGFsbGVuZ2VSZXNwb25zZRJdCghTb2x1dGlvbhInLmdmeGNhZmUub2t1LmFjY291bnQudjEuU29sdXRpb25SZXF1ZXN0GiguZ2Z4Y2FmZS5va3UuYWNjb3VudC52MS5Tb2x1dGlvblJlc3BvbnNlElEKBExpbmsSIy5nZnhjYWZlLm9rdS5hY2NvdW50LnYxLkxpbmtSZXF1ZXN0GiQuZ2Z4Y2FmZS5va3UuYWNjb3VudC52MS5MaW5rUmVzcG9uc2VCN1o1Z2Z4LmNhZmUvb2t1L2FjY291bnQvZ2VuL2dvL2dmeGNhZmUvb2t1L2FjY291bnQvdjE7djFiBnByb3RvMw", [file_buf_validate_validate, file_gfxcafe_oku_account_v1_common]);
/**
* 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 const ChallengeRequestSchema: GenMessage<ChallengeRequest> = /*@__PURE__*/
messageDesc(file_gfxcafe_oku_account_v1_login, 0);
/**
* 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 const ChallengeResponseSchema: GenMessage<ChallengeResponse> = /*@__PURE__*/
messageDesc(file_gfxcafe_oku_account_v1_login, 1);
/**
* 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 const SolutionRequestSchema: GenMessage<SolutionRequest> = /*@__PURE__*/
messageDesc(file_gfxcafe_oku_account_v1_login, 2);
/**
* 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 const SolutionResponseSchema: GenMessage<SolutionResponse> = /*@__PURE__*/
messageDesc(file_gfxcafe_oku_account_v1_login, 3);
/**
* 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 const LinkRequestSchema: GenMessage<LinkRequest> = /*@__PURE__*/
messageDesc(file_gfxcafe_oku_account_v1_login, 4);
/**
* 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 const LinkResponseSchema: GenMessage<LinkResponse> = /*@__PURE__*/
messageDesc(file_gfxcafe_oku_account_v1_login, 5);
/**
* LoginService provides wallet-based authentication
*
* @generated from service gfxcafe.oku.account.v1.LoginService
*/
export 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;
},
}> = /*@__PURE__*/
serviceDesc(file_gfxcafe_oku_account_v1_login, 0);