import { U128 } from "../../polyester/type/v1/u128_pb.js"; import { Message } from "@bufbuild/protobuf"; import { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { Timestamp } from "@bufbuild/protobuf/wkt"; declare namespace swap_pb_d_exports { export { CreateSwapRequest, CreateSwapRequestSchema, CreateSwapResponse, CreateSwapResponseSchema, ErrorCode, ErrorCodeSchema, ErrorDetail, ErrorDetailSchema, GetSwapRequest, GetSwapRequestSchema, GetSwapResponse, GetSwapResponseSchema, QuoteSwapRequest, QuoteSwapRequestSchema, QuoteSwapResponse, QuoteSwapResponseSchema, Side, SideSchema, Swap, SwapOrder, SwapOrderSchema, SwapOrderStatus, SwapOrderStatusSchema, SwapQuote, SwapQuoteLeg, SwapQuoteLegSchema, SwapQuoteSchema, SwapReason, SwapReasonSchema, SwapSchema, SwapService, SwapStatus, SwapStatusSchema, SwapTerms, SwapTermsSchema, file_swap_v1_swap }; } /** * Describes the file swap/v1/swap.proto. */ declare const file_swap_v1_swap: GenFile; /** * SwapTerms are the economic terms of one Swap: spend amount_e18 of the * source asset from the account's Trading balance and receive the destination * asset there. The same terms are quoted and created. A Swap executes as spot * orders at the account's own spot taker fee; no other fee is charged. * * @generated from message swap.v1.SwapTerms */ type SwapTerms = Message<"swap.v1.SwapTerms"> & { /** * Optional sub-account public ID whose Trading balance funds the Swap. When * omitted, the caller's root account funds it, or the sub-account an API key * is bound to. * * @generated from field: fixed64 subaccount_id = 1; */ subaccountId: bigint; /** * Asset spent: a unified asset ID, as used for balances and internal * transfers. * * @generated from field: uint32 source_asset_id = 2; */ sourceAssetId: number; /** * Asset received: a unified asset ID. * * @generated from field: uint32 destination_asset_id = 3; */ destinationAssetId: number; /** * How much to Swap. Exactly one; further ways to size a Swap may be added * to this choice. * * @generated from oneof swap.v1.SwapTerms.amount */ amount: { /** * Positive source amount to spend, in 18-decimal units (0.5 is * 500000000000000000). Only whole order steps of the market are traded; * the rest stays on the account. * * @generated from field: polyester.type.v1.U128 amount_e18 = 4; */ value: U128; case: "amountE18"; } | { case: undefined; value?: undefined; }; }; /** * Describes the message swap.v1.SwapTerms. * Use `create(SwapTermsSchema)` to create a new message. */ declare const SwapTermsSchema: GenMessage; /** * SwapQuoteLeg is one spot market a quote trades on. * * @generated from message swap.v1.SwapQuoteLeg */ type SwapQuoteLeg = Message<"swap.v1.SwapQuoteLeg"> & { /** * Stable numeric pair ID from GetSpotConfig. * * @generated from field: uint32 symbol_id = 1; */ symbolId: number; /** * Side of the order on the market. * * @generated from field: swap.v1.Side side = 2; */ side: Side; /** * Estimated average fill price, quote asset per base asset, as a decimal * string; for display. * * @generated from field: string average_price = 3; */ averagePrice: string; /** * Distance of average_price from the best price of the book, in basis points, * rounded up: the cost of the order's size against current depth. * * @generated from field: uint32 price_impact_bps = 4; */ priceImpactBps: number; /** * The account's spot taker fee rate on the market, in percent (for example * "0.1" for 0.1%), as a decimal string. * * @generated from field: string taker_fee_rate_percent = 5; */ takerFeeRatePercent: string; /** * Estimated fee, in 18-decimal units of the asset the leg receives * (fee_asset_id). * * @generated from field: polyester.type.v1.U128 fee_e18 = 6; */ feeE18?: U128 | undefined; /** * Asset the fee is charged in: the asset the leg receives. * * @generated from field: uint32 fee_asset_id = 7; */ feeAssetId: number; }; /** * Describes the message swap.v1.SwapQuoteLeg. * Use `create(SwapQuoteLegSchema)` to create a new message. */ declare const SwapQuoteLegSchema: GenMessage; /** * SwapQuote is an estimate from current order-book depth. Nothing is * reserved: the prices are indicative, and only min_amount_out binds once the * Swap is created. * * @generated from message swap.v1.SwapQuote */ type SwapQuote = Message<"swap.v1.SwapQuote"> & { /** * The quoted terms. * * @generated from field: swap.v1.SwapTerms terms = 1; */ terms?: SwapTerms | undefined; /** * Markets the Swap would trade on, in order. A direct Swap has one. * * @generated from field: repeated swap.v1.SwapQuoteLeg legs = 2; */ legs: SwapQuoteLeg[]; /** * Estimated destination amount after fees, in 18-decimal units, at current * order-book depth. A buy spends the whole source amount at the prices * available up to its price limit; what the book cannot fill within the * limit stays in the account. * * @generated from field: polyester.type.v1.U128 expected_amount_out_e18 = 3; */ expectedAmountOutE18?: U128 | undefined; /** * Minimum destination amount after fees at the requested slippage, in * 18-decimal units. Create the Swap with this value (or another accepted * minimum) as min_amount_out_e18: whatever is executed then nets at least the * same rate, and what cannot be stays on the account. * * @generated from field: polyester.type.v1.U128 min_amount_out_e18 = 4; */ minAmountOutE18?: U128 | undefined; /** * When the quote was priced. * * @generated from field: google.protobuf.Timestamp quoted_at = 5; */ quotedAt?: Timestamp | undefined; /** * Last moment the quote may be accepted, 30 seconds after quoted_at. Pass it * as quote_expires_at when creating the Swap. * * @generated from field: google.protobuf.Timestamp expires_at = 6; */ expiresAt?: Timestamp | undefined; }; /** * Describes the message swap.v1.SwapQuote. * Use `create(SwapQuoteSchema)` to create a new message. */ declare const SwapQuoteSchema: GenMessage; /** * SwapOrder is one spot order of a Swap: an immediate-or-cancel limit order * at the Swap's protection price. * * @generated from message swap.v1.SwapOrder */ type SwapOrder = Message<"swap.v1.SwapOrder"> & { /** * Spot order ID, once the market accepted the order; 0 before. * * @generated from field: fixed64 order_id = 1; */ orderId: bigint; /** * Stable numeric pair ID from GetSpotConfig. * * @generated from field: uint32 symbol_id = 2; */ symbolId: number; /** * Side of the order. * * @generated from field: swap.v1.Side side = 3; */ side: Side; /** * Zero-based position of the order's market in the Swap's route. * * @generated from field: uint32 leg = 4; */ leg: number; /** * State of the order. * * @generated from field: swap.v1.SwapOrderStatus status = 5; */ status: SwapOrderStatus; /** * Limit price in quote-asset price ticks (1e-9 quote units per base unit): * the worst price at which the order nets the Swap's minimum rate after fees. * * @generated from field: int64 limit_price_ticks = 6; */ limitPriceTicks: bigint; /** * Amount the order spent in settled fills, fees in the spent asset included, * in 18-decimal units. * * @generated from field: polyester.type.v1.U128 spent_e18 = 7; */ spentE18?: U128 | undefined; /** * Amount the order received in settled fills after fees, in 18-decimal * units. * * @generated from field: polyester.type.v1.U128 received_e18 = 8; */ receivedE18?: U128 | undefined; /** * Fee charged on settled fills, in 18-decimal units of the asset the order * receives. * * @generated from field: polyester.type.v1.U128 fee_e18 = 9; */ feeE18?: U128 | undefined; }; /** * Describes the message swap.v1.SwapOrder. * Use `create(SwapOrderSchema)` to create a new message. */ declare const SwapOrderSchema: GenMessage; /** * Swap is one signed-in Swap and its outcome. Amounts count settled fills * only. * * @generated from message swap.v1.Swap */ type Swap = Message<"swap.v1.Swap"> & { /** * Swap ID. * * @generated from field: fixed64 swap_id = 1; */ swapId: bigint; /** * Idempotency key the Swap was created with. * * @generated from field: string idempotency_key = 2; */ idempotencyKey: string; /** * Sub-account public ID funding the Swap; 0 for the root account. * * @generated from field: fixed64 subaccount_id = 3; */ subaccountId: bigint; /** * Asset spent. * * @generated from field: uint32 source_asset_id = 4; */ sourceAssetId: number; /** * Asset received. * * @generated from field: uint32 destination_asset_id = 5; */ destinationAssetId: number; /** * Source amount requested, in 18-decimal units. * * @generated from field: polyester.type.v1.U128 amount_e18 = 6; */ amountE18?: U128 | undefined; /** * Minimum destination amount after fees for the whole amount, in 18-decimal * units. Each traded part nets at least this rate. * * @generated from field: polyester.type.v1.U128 min_amount_out_e18 = 7; */ minAmountOutE18?: U128 | undefined; /** * Current status. * * @generated from field: swap.v1.SwapStatus status = 8; */ status: SwapStatus; /** * Why the Swap did not trade its whole amount; set with PARTIALLY_COMPLETED * and FAILED. * * @generated from field: swap.v1.SwapReason reason = 9; */ reason: SwapReason; /** * True once the status is final: COMPLETED, PARTIALLY_COMPLETED or FAILED. * * @generated from field: bool is_terminal = 10; */ isTerminal: boolean; /** * Source amount spent in settled fills, in 18-decimal units. * * @generated from field: polyester.type.v1.U128 executed_amount_e18 = 11; */ executedAmountE18?: U128 | undefined; /** * Source amount not spent, in 18-decimal units; it never left the * account. Final once is_terminal is true. * * @generated from field: polyester.type.v1.U128 unspent_amount_e18 = 12; */ unspentAmountE18?: U128 | undefined; /** * Destination amount received after fees, in 18-decimal units. * * @generated from field: polyester.type.v1.U128 received_amount_e18 = 13; */ receivedAmountE18?: U128 | undefined; /** * Total fee charged, in 18-decimal units of the destination asset. * * @generated from field: polyester.type.v1.U128 fee_e18 = 14; */ feeE18?: U128 | undefined; /** * The Swap's spot orders, in placement order. * * @generated from field: repeated swap.v1.SwapOrder orders = 15; */ orders: SwapOrder[]; /** * When the Swap was created. * * @generated from field: google.protobuf.Timestamp created_at = 16; */ createdAt?: Timestamp | undefined; }; /** * Describes the message swap.v1.Swap. * Use `create(SwapSchema)` to create a new message. */ declare const SwapSchema: GenMessage; /** * QuoteSwapRequest asks for a quote of terms. * * @generated from message swap.v1.QuoteSwapRequest */ type QuoteSwapRequest = Message<"swap.v1.QuoteSwapRequest"> & { /** * Terms to quote. * * @generated from field: swap.v1.SwapTerms terms = 1; */ terms?: SwapTerms | undefined; /** * Accepted shortfall from the expected output, in basis points (1 bp = * 0.01%), from 1 to 1000; sets the quote's min_amount_out. * * @generated from field: uint32 max_slippage_bps = 2; */ maxSlippageBps: number; }; /** * Describes the message swap.v1.QuoteSwapRequest. * Use `create(QuoteSwapRequestSchema)` to create a new message. */ declare const QuoteSwapRequestSchema: GenMessage; /** * QuoteSwapResponse is the quote. * * @generated from message swap.v1.QuoteSwapResponse */ type QuoteSwapResponse = Message<"swap.v1.QuoteSwapResponse"> & { /** * The quote. * * @generated from field: swap.v1.SwapQuote quote = 1; */ quote?: SwapQuote | undefined; }; /** * Describes the message swap.v1.QuoteSwapResponse. * Use `create(QuoteSwapResponseSchema)` to create a new message. */ declare const QuoteSwapResponseSchema: GenMessage; /** * CreateSwapRequest creates and executes a Swap. * * @generated from message swap.v1.CreateSwapRequest */ type CreateSwapRequest = Message<"swap.v1.CreateSwapRequest"> & { /** * Client-chosen key, unique per caller, that makes creation idempotent: the * same key and request return the same Swap; another request with the same * key is IDEMPOTENCY_CONFLICT. * * @generated from field: string idempotency_key = 1; */ idempotencyKey: string; /** * Terms to execute. * * @generated from field: swap.v1.SwapTerms terms = 2; */ terms?: SwapTerms | undefined; /** * Positive minimum destination amount after fees for the whole amount, in * 18-decimal units, usually the quote's min_amount_out_e18. Execution never * nets a lower rate; what cannot be traded at it stays on the account. * * @generated from field: polyester.type.v1.U128 min_amount_out_e18 = 3; */ minAmountOutE18?: U128 | undefined; /** * The accepted quote's expires_at. The Swap is refused with QUOTE_EXPIRED * once it has passed. * * @generated from field: google.protobuf.Timestamp quote_expires_at = 4; */ quoteExpiresAt?: Timestamp | undefined; }; /** * Describes the message swap.v1.CreateSwapRequest. * Use `create(CreateSwapRequestSchema)` to create a new message. */ declare const CreateSwapRequestSchema: GenMessage; /** * CreateSwapResponse is the created (or existing) Swap. * * @generated from message swap.v1.CreateSwapResponse */ type CreateSwapResponse = Message<"swap.v1.CreateSwapResponse"> & { /** * The Swap. * * @generated from field: swap.v1.Swap swap = 1; */ swap?: Swap | undefined; }; /** * Describes the message swap.v1.CreateSwapResponse. * Use `create(CreateSwapResponseSchema)` to create a new message. */ declare const CreateSwapResponseSchema: GenMessage; /** * GetSwapRequest selects one Swap of the caller. * * @generated from message swap.v1.GetSwapRequest */ type GetSwapRequest = Message<"swap.v1.GetSwapRequest"> & { /** * Exactly one selector. * * @generated from oneof swap.v1.GetSwapRequest.selector */ selector: { /** * Swap ID. * * @generated from field: fixed64 swap_id = 1; */ value: bigint; case: "swapId"; } | { /** * Idempotency key the Swap was created with. * * @generated from field: string idempotency_key = 2; */ value: string; case: "idempotencyKey"; } | { case: undefined; value?: undefined; }; }; /** * Describes the message swap.v1.GetSwapRequest. * Use `create(GetSwapRequestSchema)` to create a new message. */ declare const GetSwapRequestSchema: GenMessage; /** * GetSwapResponse is the selected Swap. * * @generated from message swap.v1.GetSwapResponse */ type GetSwapResponse = Message<"swap.v1.GetSwapResponse"> & { /** * The Swap. * * @generated from field: swap.v1.Swap swap = 1; */ swap?: Swap | undefined; }; /** * Describes the message swap.v1.GetSwapResponse. * Use `create(GetSwapResponseSchema)` to create a new message. */ declare const GetSwapResponseSchema: GenMessage; /** * ErrorDetail is attached to Swap errors as an error detail of type * swap.v1.ErrorDetail. * * @generated from message swap.v1.ErrorDetail */ type ErrorDetail = Message<"swap.v1.ErrorDetail"> & { /** * Stable error code. * * @generated from field: swap.v1.ErrorCode code = 1; */ code: ErrorCode; /** * IDEMPOTENCY_CONFLICT only: the Swap bound to the idempotency key. * * @generated from field: fixed64 swap_id = 2; */ swapId: bigint; /** * AMOUNT_OUT_OF_RANGE only: the smallest amount that currently quotes, in * 18-decimal units of the source asset. Guidance, not a guarantee. * * @generated from field: polyester.type.v1.U128 min_amount_e18 = 3; */ minAmountE18?: U128 | undefined; /** * AMOUNT_OUT_OF_RANGE only: the largest amount current depth absorbs in one * order within the market's maximum order quantity, in 18-decimal units of * the source asset. A buy above it would buy more than the maximum order * quantity, so it is refused rather than partly executed. * * @generated from field: polyester.type.v1.U128 max_amount_e18 = 4; */ maxAmountE18?: U128 | undefined; }; /** * Describes the message swap.v1.ErrorDetail. * Use `create(ErrorDetailSchema)` to create a new message. */ declare const ErrorDetailSchema: GenMessage; /** * Side is a spot order side. * * @generated from enum swap.v1.Side */ declare enum Side { /** * No side. * * @generated from enum value: SIDE_UNSPECIFIED = 0; */ SIDE_UNSPECIFIED = 0, /** * Buy the market's base asset with its quote asset. * * @generated from enum value: BUY = 1; */ BUY = 1, /** * Sell the market's base asset for its quote asset. * * @generated from enum value: SELL = 2; */ SELL = 2 } /** * Describes the enum swap.v1.Side. */ declare const SideSchema: GenEnum; /** * SwapStatus is the state of a Swap. * * @generated from enum swap.v1.SwapStatus */ declare enum SwapStatus { /** * No status. * * @generated from enum value: STATUS_UNSPECIFIED = 0; */ STATUS_UNSPECIFIED = 0, /** * The Swap is accepted and its orders are being placed, filled or settled. * * @generated from enum value: EXECUTING = 1; */ EXECUTING = 1, /** * The whole amount was traded and settled (a remainder smaller than one * order step stays on the account, unspent). * * @generated from enum value: COMPLETED = 2; */ COMPLETED = 2, /** * Part of the amount was traded and settled; the rest stays on the account, * unspent. reason says why. * * @generated from enum value: PARTIALLY_COMPLETED = 3; */ PARTIALLY_COMPLETED = 3, /** * Nothing was traded and the whole amount stays on the account, or, with * reason MINIMUM_NOT_MET, a fill netted less than the accepted minimum rate; * reason says why, and the amounts show what was traded. * * @generated from enum value: FAILED = 4; */ FAILED = 4, /** * An order's outcome is being established. Balances already reflect any * settled fill; the Swap stays here until the outcome is confirmed. * * @generated from enum value: RECONCILING = 5; */ RECONCILING = 5 } /** * Describes the enum swap.v1.SwapStatus. */ declare const SwapStatusSchema: GenEnum; /** * SwapReason says why a Swap did not trade its whole amount. * * @generated from enum swap.v1.SwapReason */ declare enum SwapReason { /** * No reason. * * @generated from enum value: REASON_UNSPECIFIED = 0; */ REASON_UNSPECIFIED = 0, /** * The Trading balance did not cover the amount when the order was placed. * * @generated from enum value: INSUFFICIENT_BALANCE = 1; */ INSUFFICIENT_BALANCE = 1, /** * The order books could not fill the rest at a price that meets * min_amount_out. * * @generated from enum value: PRICE_PROTECTION = 2; */ PRICE_PROTECTION = 2, /** * The market was closed, halted, restricted or without liquidity. * * @generated from enum value: MARKET_UNAVAILABLE = 3; */ MARKET_UNAVAILABLE = 3, /** * The order was outside the market's size limits. * * @generated from enum value: ORDER_SIZE_OUT_OF_RANGE = 4; */ ORDER_SIZE_OUT_OF_RANGE = 4, /** * The account's order rate limit was reached. * * @generated from enum value: RATE_LIMITED = 5; */ RATE_LIMITED = 5, /** * The order was refused, for example by the sub-account's trading policy. * * @generated from enum value: ORDER_REJECTED = 6; */ ORDER_REJECTED = 6, /** * The execution window ended before the order could be placed. * * @generated from enum value: EXPIRED = 7; */ EXPIRED = 7, /** * A fill netted less than the accepted minimum rate. The Swap failed closed: * the amounts show exactly what was traded and received. * * @generated from enum value: MINIMUM_NOT_MET = 8; */ MINIMUM_NOT_MET = 8, /** * The order bought the market's maximum order quantity and stopped there; * the rest of the amount stays on the account, unspent. The market's depth * or maximum changed after the quote, which never quotes past it. * * @generated from enum value: MAX_ORDER_QUANTITY = 9; */ MAX_ORDER_QUANTITY = 9 } /** * Describes the enum swap.v1.SwapReason. */ declare const SwapReasonSchema: GenEnum; /** * SwapOrderStatus is the state of a Swap's spot order. * * @generated from enum swap.v1.SwapOrderStatus */ declare enum SwapOrderStatus { /** * No order status. * * @generated from enum value: ORDER_STATUS_UNSPECIFIED = 0; */ ORDER_STATUS_UNSPECIFIED = 0, /** * The order is being placed. * * @generated from enum value: PLACING = 1; */ PLACING = 1, /** * The order was accepted by the market. * * @generated from enum value: PLACED = 2; */ PLACED = 2, /** * The order was refused before it reached the market. * * @generated from enum value: REFUSED = 3; */ REFUSED = 3, /** * The order was not placed before the execution window ended. * * @generated from enum value: NOT_PLACED = 4; */ NOT_PLACED = 4, /** * The order's outcome is being established. * * @generated from enum value: UNCONFIRMED = 5; */ UNCONFIRMED = 5 } /** * Describes the enum swap.v1.SwapOrderStatus. */ declare const SwapOrderStatusSchema: GenEnum; /** * ErrorCode identifies a Swap API error. * * @generated from enum swap.v1.ErrorCode */ declare enum ErrorCode { /** * No code. * * @generated from enum value: ERROR_UNSPECIFIED = 0; */ ERROR_UNSPECIFIED = 0, /** * No spot market trades the source asset directly against the destination * asset. * * @generated from enum value: ROUTE_UNSUPPORTED = 1; */ ROUTE_UNSUPPORTED = 1, /** * The amount is outside the market's current limits. The error carries the * limits (min_amount_e18, max_amount_e18) when known. * * @generated from enum value: AMOUNT_OUT_OF_RANGE = 2; */ AMOUNT_OUT_OF_RANGE = 2, /** * No price is currently available for the route; retry later. * * @generated from enum value: QUOTE_UNAVAILABLE = 3; */ QUOTE_UNAVAILABLE = 3, /** * Current order-book depth cannot deliver min_amount_out_e18 (or the * requested slippage): request a new quote. * * @generated from enum value: PROTECTION_UNACHIEVABLE = 4; */ PROTECTION_UNACHIEVABLE = 4, /** * quote_expires_at has passed: request a new quote. * * @generated from enum value: QUOTE_EXPIRED = 5; */ QUOTE_EXPIRED = 5, /** * The idempotency key was already used with a different request. The error * carries the original swap_id. * * @generated from enum value: IDEMPOTENCY_CONFLICT = 6; */ IDEMPOTENCY_CONFLICT = 6, /** * No Swap of the caller matches the selector. * * @generated from enum value: SWAP_NOT_FOUND = 7; */ SWAP_NOT_FOUND = 7, /** * subaccount_id is not a valid sub-account ID. * * @generated from enum value: INVALID_SUBACCOUNT_ID = 8; */ INVALID_SUBACCOUNT_ID = 8, /** * The sub-account does not exist. * * @generated from enum value: SUBACCOUNT_NOT_FOUND = 9; */ SUBACCOUNT_NOT_FOUND = 9, /** * The sub-account is not active. * * @generated from enum value: SUBACCOUNT_INACTIVE = 10; */ SUBACCOUNT_INACTIVE = 10, /** * The caller may not Swap on the account: the role, the API key's policy or * the sub-account's policy does not grant SWAP, or a root-scoped API key * selected a sub-account. * * @generated from enum value: SWAP_NOT_PERMITTED = 11; */ SWAP_NOT_PERMITTED = 11, /** * A required service is temporarily unavailable; retry the same request. * * @generated from enum value: SERVICE_UNAVAILABLE = 12; */ SERVICE_UNAVAILABLE = 12, /** * The market trades the two assets but cannot execute a Swap in this * direction: a buy there would pay its fee in the asset it spends. * * @generated from enum value: DIRECTION_UNSUPPORTED = 13; */ DIRECTION_UNSUPPORTED = 13 } /** * Describes the enum swap.v1.ErrorCode. */ declare const ErrorCodeSchema: GenEnum; /** * SwapService converts one asset of an account's Trading balance into another * through Polyester's spot order books. A Swap executes as immediate-or-cancel * spot orders on the account, at the account's spot taker fee and with no * other fee, protected by the end-to-end min_amount_out the caller accepts: * any part that trades nets at least that rate, and anything that cannot stays * on the account. Quotes are estimates and reserve nothing. * * Requests are authenticated with a session token or a signed API key. The * caller needs the SWAP permission on the account: the trading roles grant it * on sub-accounts, and API keys and sub-account policies must include the SWAP * action. A Swap's orders also remain subject to the sub-account's spot * trading policy. * * Follow a Swap with GetSwap until is_terminal is true; a direct Swap usually * completes within seconds. * * @generated from service swap.v1.SwapService */ declare const SwapService: GenService<{ /** * QuoteSwap prices terms against current order-book depth and the account's * taker fee. Nothing is reserved. * * Errors: * - INVALID_ARGUMENT: malformed request, AMOUNT_OUT_OF_RANGE or * INVALID_SUBACCOUNT_ID. * - FAILED_PRECONDITION: ROUTE_UNSUPPORTED, DIRECTION_UNSUPPORTED, * PROTECTION_UNACHIEVABLE or SUBACCOUNT_INACTIVE. * - NOT_FOUND: SUBACCOUNT_NOT_FOUND. * - PERMISSION_DENIED: SWAP_NOT_PERMITTED. * - UNAVAILABLE: QUOTE_UNAVAILABLE or SERVICE_UNAVAILABLE; retry later. * - UNAUTHENTICATED: missing or invalid credentials. * * @generated from rpc swap.v1.SwapService.QuoteSwap */ quoteSwap: { methodKind: "unary"; input: typeof QuoteSwapRequestSchema; output: typeof QuoteSwapResponseSchema; }; /** * CreateSwap creates the Swap for idempotency_key and executes it at once. * It re-prices the terms against current depth first: the Swap is created * only while the quote is unexpired and min_amount_out_e18 is achievable. * It is idempotent per caller and key: a repeated or concurrent request with * the same body returns the same Swap, so every unknown outcome is resolved * by repeating the request unchanged. * * Errors: * - INVALID_ARGUMENT: malformed request, AMOUNT_OUT_OF_RANGE or * INVALID_SUBACCOUNT_ID. * - FAILED_PRECONDITION: ROUTE_UNSUPPORTED, DIRECTION_UNSUPPORTED, * PROTECTION_UNACHIEVABLE, QUOTE_EXPIRED or SUBACCOUNT_INACTIVE; nothing is * created. * - ALREADY_EXISTS: IDEMPOTENCY_CONFLICT; the original Swap stands. * - NOT_FOUND: SUBACCOUNT_NOT_FOUND. * - PERMISSION_DENIED: SWAP_NOT_PERMITTED. * - UNAVAILABLE, DEADLINE_EXCEEDED: QUOTE_UNAVAILABLE, SERVICE_UNAVAILABLE * or an unknown outcome; retry the same request. * - UNAUTHENTICATED: missing or invalid credentials. * * @generated from rpc swap.v1.SwapService.CreateSwap */ createSwap: { methodKind: "unary"; input: typeof CreateSwapRequestSchema; output: typeof CreateSwapResponseSchema; }; /** * GetSwap returns one of the caller's Swaps by swap_id or idempotency key. * * Errors: * - INVALID_ARGUMENT: malformed selector. * - NOT_FOUND: SWAP_NOT_FOUND. * - PERMISSION_DENIED: SWAP_NOT_PERMITTED. * - UNAVAILABLE: SERVICE_UNAVAILABLE; retry later. * - UNAUTHENTICATED: missing or invalid credentials. * * @generated from rpc swap.v1.SwapService.GetSwap */ getSwap: { methodKind: "unary"; input: typeof GetSwapRequestSchema; output: typeof GetSwapResponseSchema; }; }>; //#endregion export { CreateSwapRequest, CreateSwapRequestSchema, CreateSwapResponse, CreateSwapResponseSchema, ErrorCode, ErrorCodeSchema, ErrorDetail, ErrorDetailSchema, GetSwapRequest, GetSwapRequestSchema, GetSwapResponse, GetSwapResponseSchema, QuoteSwapRequest, QuoteSwapRequestSchema, QuoteSwapResponse, QuoteSwapResponseSchema, Side, SideSchema, Swap, SwapOrder, SwapOrderSchema, SwapOrderStatus, SwapOrderStatusSchema, SwapQuote, SwapQuoteLeg, SwapQuoteLegSchema, SwapQuoteSchema, SwapReason, SwapReasonSchema, SwapSchema, SwapService, SwapStatus, SwapStatusSchema, SwapTerms, SwapTermsSchema, file_swap_v1_swap, swap_pb_d_exports }; //# sourceMappingURL=swap_pb.d.ts.map