@okutrade/account-api
Version:
TypeScript client for OKU Account API using Connect-ES
482 lines (481 loc) • 12.9 kB
TypeScript
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1";
import type { Address } from "./common_pb.js";
import type { JsonObject, Message } from "@bufbuild/protobuf";
/**
* Describes the file gfxcafe/oku/account/v1/orders.proto.
*/
export declare const file_gfxcafe_oku_account_v1_orders: GenFile;
/**
* CanoeMarketMarketIdRequest for generating execution information
*
* @generated from message gfxcafe.oku.account.v1.CanoeMarketMarketIdRequest
*/
export type CanoeMarketMarketIdRequest = Message<"gfxcafe.oku.account.v1.CanoeMarketMarketIdRequest"> & {
/**
* Market ID (e.g., "airswap", "enso", "kyberswap")
*
* @generated from field: string market_id = 1;
*/
marketId: string;
/**
* Request parameters as JSON
*
* @generated from field: google.protobuf.Struct params = 2;
*/
params?: JsonObject;
};
/**
* Describes the message gfxcafe.oku.account.v1.CanoeMarketMarketIdRequest.
* Use `create(CanoeMarketMarketIdRequestSchema)` to create a new message.
*/
export declare const CanoeMarketMarketIdRequestSchema: GenMessage<CanoeMarketMarketIdRequest>;
/**
* CanoeMarketMarketIdResponse with execution information
*
* @generated from message gfxcafe.oku.account.v1.CanoeMarketMarketIdResponse
*/
export type CanoeMarketMarketIdResponse = Message<"gfxcafe.oku.account.v1.CanoeMarketMarketIdResponse"> & {
/**
* Approval payloads
*
* @generated from field: repeated gfxcafe.oku.account.v1.ApprovalPayload approvals = 1;
*/
approvals: ApprovalPayload[];
/**
* Transaction payloads
*
* @generated from field: repeated gfxcafe.oku.account.v1.TransactionPayload transactions = 2;
*/
transactions: TransactionPayload[];
/**
* Trade transaction
*
* @generated from field: gfxcafe.oku.account.v1.TransactionPayload trade = 3;
*/
trade?: TransactionPayload;
/**
* Analysis results
*
* @generated from field: google.protobuf.Struct analysis = 4;
*/
analysis?: JsonObject;
/**
* Extra data
*
* @generated from field: google.protobuf.Struct extra = 5;
*/
extra?: JsonObject;
};
/**
* Describes the message gfxcafe.oku.account.v1.CanoeMarketMarketIdResponse.
* Use `create(CanoeMarketMarketIdResponseSchema)` to create a new message.
*/
export declare const CanoeMarketMarketIdResponseSchema: GenMessage<CanoeMarketMarketIdResponse>;
/**
* CanoeQuoteMarketMarketIdRequest for getting a price quote
*
* @generated from message gfxcafe.oku.account.v1.CanoeQuoteMarketMarketIdRequest
*/
export type CanoeQuoteMarketMarketIdRequest = Message<"gfxcafe.oku.account.v1.CanoeQuoteMarketMarketIdRequest"> & {
/**
* Market ID (e.g., "airswap", "enso", "kyberswap")
*
* @generated from field: string market_id = 1;
*/
marketId: string;
/**
* Quote parameters as JSON
*
* @generated from field: google.protobuf.Struct quote_params = 2;
*/
quoteParams?: JsonObject;
};
/**
* Describes the message gfxcafe.oku.account.v1.CanoeQuoteMarketMarketIdRequest.
* Use `create(CanoeQuoteMarketMarketIdRequestSchema)` to create a new message.
*/
export declare const CanoeQuoteMarketMarketIdRequestSchema: GenMessage<CanoeQuoteMarketMarketIdRequest>;
/**
* CanoeQuoteMarketMarketIdResponse with price quote data
*
* @generated from message gfxcafe.oku.account.v1.CanoeQuoteMarketMarketIdResponse
*/
export type CanoeQuoteMarketMarketIdResponse = Message<"gfxcafe.oku.account.v1.CanoeQuoteMarketMarketIdResponse"> & {
/**
* Input amount
*
* @generated from field: string in_amount = 1;
*/
inAmount: string;
/**
* Output amount
*
* @generated from field: string out_amount = 2;
*/
outAmount: string;
/**
* Slippage
*
* @generated from field: double slippage = 3;
*/
slippage: number;
/**
* Estimated gas
*
* @generated from field: string estimated_gas = 4;
*/
estimatedGas: string;
/**
* Chain ID
*
* @generated from field: int32 chain_id = 5;
*/
chainId: number;
/**
* Market ID
*
* @generated from field: string market = 6;
*/
market: string;
/**
* Is exact input
*
* @generated from field: bool is_exact_in = 7;
*/
isExactIn: boolean;
/**
* Input token metadata
*
* @generated from field: gfxcafe.oku.account.v1.TokenMetadata in_token = 8;
*/
inToken?: TokenMetadata;
/**
* Output token metadata
*
* @generated from field: gfxcafe.oku.account.v1.TokenMetadata out_token = 9;
*/
outToken?: TokenMetadata;
/**
* Amount ratio
*
* @generated from field: double amount_ratio = 10;
*/
amountRatio: number;
/**
* Gas value in USD
*
* @generated from field: double gas_usd_value = 11;
*/
gasUsdValue: number;
/**
* Token input USD value
*
* @generated from field: double token_in_usd_value = 12;
*/
tokenInUsdValue: number;
/**
* Total input USD value
*
* @generated from field: double in_usd_value = 13;
*/
inUsdValue: number;
/**
* Token output USD value
*
* @generated from field: double token_out_usd_value = 14;
*/
tokenOutUsdValue: number;
/**
* Total output USD value
*
* @generated from field: double out_usd_value = 15;
*/
outUsdValue: number;
/**
* Fees information
*
* @generated from field: gfxcafe.oku.account.v1.Fees fees = 16;
*/
fees?: Fees;
/**
* Trade path
*
* @generated from field: repeated gfxcafe.oku.account.v1.TradePath path = 17;
*/
path: TradePath[];
/**
* Candidate trade transaction
*
* @generated from field: gfxcafe.oku.account.v1.TransactionPayload candidate_trade = 18;
*/
candidateTrade?: TransactionPayload;
/**
* Coupon data
*
* @generated from field: google.protobuf.Struct coupon = 19;
*/
coupon?: JsonObject;
/**
* Signing request
*
* @generated from field: google.protobuf.Struct signing_request = 20;
*/
signingRequest?: JsonObject;
/**
* Extra data
*
* @generated from field: google.protobuf.Struct extra = 21;
*/
extra?: JsonObject;
/**
* Analysis results
*
* @generated from field: google.protobuf.Struct analysis = 22;
*/
analysis?: JsonObject;
/**
* Simulation result
*
* @generated from field: string simulation = 23;
*/
simulation: string;
/**
* Simulation error
*
* @generated from field: string simulation_error = 24;
*/
simulationError: string;
/**
* Simulated amount out
*
* @generated from field: string simulated_amount_out = 25;
*/
simulatedAmountOut: string;
/**
* Timestamp
*
* @generated from field: int32 timestamp = 26;
*/
timestamp: number;
};
/**
* Describes the message gfxcafe.oku.account.v1.CanoeQuoteMarketMarketIdResponse.
* Use `create(CanoeQuoteMarketMarketIdResponseSchema)` to create a new message.
*/
export declare const CanoeQuoteMarketMarketIdResponseSchema: GenMessage<CanoeQuoteMarketMarketIdResponse>;
/**
* TokenMetadata describes a token
*
* @generated from message gfxcafe.oku.account.v1.TokenMetadata
*/
export type TokenMetadata = Message<"gfxcafe.oku.account.v1.TokenMetadata"> & {
/**
* Chain ID
*
* @generated from field: int32 chain_id = 1;
*/
chainId: number;
/**
* Token address
*
* @generated from field: gfxcafe.oku.account.v1.Address address = 2;
*/
address?: Address;
/**
* Token decimals
*
* @generated from field: int32 decimals = 3;
*/
decimals: number;
/**
* Token name
*
* @generated from field: string name = 4;
*/
name: string;
/**
* Token symbol
*
* @generated from field: string symbol = 5;
*/
symbol: string;
};
/**
* Describes the message gfxcafe.oku.account.v1.TokenMetadata.
* Use `create(TokenMetadataSchema)` to create a new message.
*/
export declare const TokenMetadataSchema: GenMessage<TokenMetadata>;
/**
* TransactionPayload for trade execution
*
* @generated from message gfxcafe.oku.account.v1.TransactionPayload
*/
export type TransactionPayload = Message<"gfxcafe.oku.account.v1.TransactionPayload"> & {
/**
* Chain ID
*
* @generated from field: int32 chain_id = 1;
*/
chainId: number;
/**
* Access list
*
* @generated from field: google.protobuf.Struct access_list = 2;
*/
accessList?: JsonObject;
/**
* Value in wei
*
* @generated from field: string value = 3;
*/
value: string;
/**
* To address
*
* @generated from field: string to = 4;
*/
to: string;
/**
* Transaction data
*
* @generated from field: string data = 5;
*/
data: string;
};
/**
* Describes the message gfxcafe.oku.account.v1.TransactionPayload.
* Use `create(TransactionPayloadSchema)` to create a new message.
*/
export declare const TransactionPayloadSchema: GenMessage<TransactionPayload>;
/**
* ApprovalPayload for token approvals
*
* @generated from message gfxcafe.oku.account.v1.ApprovalPayload
*/
export type ApprovalPayload = Message<"gfxcafe.oku.account.v1.ApprovalPayload"> & {
/**
* Chain ID
*
* @generated from field: int32 chain_id = 1;
*/
chainId: number;
/**
* Approvee address
*
* @generated from field: gfxcafe.oku.account.v1.Address approvee = 2;
*/
approvee?: Address;
/**
* Token address
*
* @generated from field: gfxcafe.oku.account.v1.Address address = 3;
*/
address?: Address;
/**
* Approval amount
*
* @generated from field: string amount = 4;
*/
amount: string;
};
/**
* Describes the message gfxcafe.oku.account.v1.ApprovalPayload.
* Use `create(ApprovalPayloadSchema)` to create a new message.
*/
export declare const ApprovalPayloadSchema: GenMessage<ApprovalPayload>;
/**
* Fees information
*
* @generated from message gfxcafe.oku.account.v1.Fees
*/
export type Fees = Message<"gfxcafe.oku.account.v1.Fees"> & {
/**
* Fees in input amount
*
* @generated from field: string fees_in_amount = 1;
*/
feesInAmount: string;
/**
* Fees in output amount
*
* @generated from field: string fees_out_amount = 2;
*/
feesOutAmount: string;
/**
* Gas fees
*
* @generated from field: string gas = 3;
*/
gas: string;
};
/**
* Describes the message gfxcafe.oku.account.v1.Fees.
* Use `create(FeesSchema)` to create a new message.
*/
export declare const FeesSchema: GenMessage<Fees>;
/**
* TradePath describes a swap path
*
* @generated from message gfxcafe.oku.account.v1.TradePath
*/
export type TradePath = Message<"gfxcafe.oku.account.v1.TradePath"> & {
/**
* DEX code
*
* @generated from field: string dex_code = 1;
*/
dexCode: string;
/**
* Swap token
*
* @generated from field: string swap_token = 2;
*/
swapToken: string;
/**
* Input amount
*
* @generated from field: string in_amount = 3;
*/
inAmount: string;
/**
* Output amount
*
* @generated from field: string out_amount = 4;
*/
outAmount: string;
};
/**
* Describes the message gfxcafe.oku.account.v1.TradePath.
* Use `create(TradePathSchema)` to create a new message.
*/
export declare const TradePathSchema: GenMessage<TradePath>;
/**
* OrdersService provides trading and quote functionality
*
* Note: /orders/simple_swap/* endpoints are handled by SimpleSwapService
* Note: /orders/history/* endpoints are handled by OrderHistoryService
*
* @generated from service gfxcafe.oku.account.v1.OrdersService
*/
export declare const OrdersService: GenService<{
/**
* Generate execution information for a market order (/canoe_market/{marketId})
*
* @generated from rpc gfxcafe.oku.account.v1.OrdersService.CanoeMarketMarketId
*/
canoeMarketMarketId: {
methodKind: "unary";
input: typeof CanoeMarketMarketIdRequestSchema;
output: typeof CanoeMarketMarketIdResponseSchema;
};
/**
* Get a price quote for a market order (/canoe_quote/market/{marketId})
*
* @generated from rpc gfxcafe.oku.account.v1.OrdersService.CanoeQuoteMarketMarketId
*/
canoeQuoteMarketMarketId: {
methodKind: "unary";
input: typeof CanoeQuoteMarketMarketIdRequestSchema;
output: typeof CanoeQuoteMarketMarketIdResponseSchema;
};
}>;