import { Message } from "@bufbuild/protobuf"; import { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { FieldMask, Timestamp } from "@bufbuild/protobuf/wkt"; declare namespace price_alerts_pb_d_exports { export { AlertChannel, AlertChannelSchema, AlertDirection, AlertDirectionSchema, AlertPriceSource, AlertPriceSourceSchema, AlertStatus, AlertStatusSchema, AlertUpdate, AlertUpdateSchema, CancelAlertRequest, CancelAlertRequestSchema, CancelAlertResponse, CancelAlertResponseSchema, CreateAlertRequest, CreateAlertRequestSchema, CreateAlertResponse, CreateAlertResponseSchema, ErrorCode, ErrorCodeSchema, ErrorDetail, ErrorDetailSchema, ListAlertsRequest, ListAlertsRequestSchema, ListAlertsResponse, ListAlertsResponseSchema, PriceAlert, PriceAlertSchema, PriceAlertService, UpdateAlertRequest, UpdateAlertRequestSchema, UpdateAlertResponse, UpdateAlertResponseSchema, UpdateOutcome, UpdateOutcomeSchema, file_alerts_v1_price_alerts }; } /** * Describes the file alerts/v1/price_alerts.proto. */ declare const file_alerts_v1_price_alerts: GenFile; /** * ErrorDetail is attached to Price Alert API errors as an error detail of * type alerts.v1.ErrorDetail. * * @generated from message alerts.v1.ErrorDetail */ type ErrorDetail = Message<"alerts.v1.ErrorDetail"> & { /** * Stable error code. * * @generated from field: alerts.v1.ErrorCode code = 1; */ code: ErrorCode; }; /** * Describes the message alerts.v1.ErrorDetail. * Use `create(ErrorDetailSchema)` to create a new message. */ declare const ErrorDetailSchema: GenMessage; /** * PriceAlert is one price alert of the caller. * * An alert fires only on a crossing it observes: it records the price when it * is created or set again (reference_price_ticks), and an alert whose * condition already holds at that price first waits for the price to move to * the other side of the alert price. A BELOW alert created while the price is * already below the alert price therefore fires only after the price rises * above it and falls back to it. An alert fires at most once; prices that * arrive late, or a feed that stops updating, never fire it. * * @generated from message alerts.v1.PriceAlert */ type PriceAlert = Message<"alerts.v1.PriceAlert"> & { /** * Public alert ID. * * @generated from field: fixed64 alert_id = 1; */ alertId: bigint; /** * Numeric spot market identifier; resolve its symbol with GetSpotConfig. * * @generated from field: uint32 symbol_id = 2; */ symbolId: number; /** * Price crossing the alert waits for. * * @generated from field: alerts.v1.AlertDirection direction = 3; */ direction: AlertDirection; /** * Price the alert watches. * * @generated from field: alerts.v1.AlertPriceSource price_source = 4; */ priceSource: AlertPriceSource; /** * Alert price in quote units scaled by 1e9. * * @generated from field: int64 price_ticks = 5; */ priceTicks: bigint; /** * Price of price_source when the alert was created or last set again, in * quote units scaled by 1e9. * * @generated from field: int64 reference_price_ticks = 6; */ referencePriceTicks: bigint; /** * True once the price has been seen on the far side of the alert price, so * the next crossing fires the alert. False while an alert created past its * alert price waits for the price to move back. * * @generated from field: bool armed = 7; */ armed: boolean; /** * Current state of the alert. * * @generated from field: alerts.v1.AlertStatus status = 8; */ status: AlertStatus; /** * Where the alert is delivered when it fires, in ascending enum order. * * @generated from field: repeated alerts.v1.AlertChannel channels = 9; */ channels: AlertChannel[]; /** * Revision of the alert, starting at 1. It increases with every change the * caller makes; pass it as expected_revision to UpdateAlert. * * @generated from field: uint64 revision = 10; */ revision: bigint; /** * When the alert was created. * * @generated from field: google.protobuf.Timestamp created_at = 11; */ createdAt?: Timestamp | undefined; /** * When the caller last changed the alert. * * @generated from field: google.protobuf.Timestamp updated_at = 12; */ updatedAt?: Timestamp | undefined; /** * When the alert fired. Omitted unless status is TRIGGERED. * * @generated from field: google.protobuf.Timestamp triggered_at = 13; */ triggeredAt?: Timestamp | undefined; /** * Price that fired the alert, in quote units scaled by 1e9. Zero unless * status is TRIGGERED. * * @generated from field: int64 triggered_price_ticks = 14; */ triggeredPriceTicks: bigint; }; /** * Describes the message alerts.v1.PriceAlert. * Use `create(PriceAlertSchema)` to create a new message. */ declare const PriceAlertSchema: GenMessage; /** * CreateAlertRequest creates a price alert for the caller. * * @generated from message alerts.v1.CreateAlertRequest */ type CreateAlertRequest = Message<"alerts.v1.CreateAlertRequest"> & { /** * Numeric spot market identifier; resolve it with GetSpotConfig. * * @generated from field: uint32 symbol_id = 1; */ symbolId: number; /** * Price crossing to wait for. * * @generated from field: alerts.v1.AlertDirection direction = 2; */ direction: AlertDirection; /** * Price to watch. Unspecified means INDEX_PRICE on a market that has an * index price, which is harder to move on a thin market, and LAST_PRICE * otherwise; the returned alert states the price it watches. * * @generated from field: alerts.v1.AlertPriceSource price_source = 3; */ priceSource: AlertPriceSource; /** * Alert price in quote units scaled by 1e9, for example 90000000000000 for * 90,000. * * @generated from field: int64 price_ticks = 4; */ priceTicks: bigint; /** * Where to deliver the alert when it fires: one to two distinct channels. * * @generated from field: repeated alerts.v1.AlertChannel channels = 5; */ channels: AlertChannel[]; /** * Optional client-chosen key, unique per caller, that makes creating * idempotent: the same key and request return the alert the first request * created, in its current state; another request with the same key is * IDEMPOTENCY_CONFLICT. A create key is kept as long as its alert. * * @generated from field: string idempotency_key = 6; */ idempotencyKey: string; }; /** * Describes the message alerts.v1.CreateAlertRequest. * Use `create(CreateAlertRequestSchema)` to create a new message. */ declare const CreateAlertRequestSchema: GenMessage; /** * CreateAlertResponse returns the created alert. * * @generated from message alerts.v1.CreateAlertResponse */ type CreateAlertResponse = Message<"alerts.v1.CreateAlertResponse"> & { /** * The alert. * * @generated from field: alerts.v1.PriceAlert alert = 1; */ alert?: PriceAlert | undefined; }; /** * Describes the message alerts.v1.CreateAlertResponse. * Use `create(CreateAlertResponseSchema)` to create a new message. */ declare const CreateAlertResponseSchema: GenMessage; /** * ListAlertsRequest lists the caller's alerts. * * @generated from message alerts.v1.ListAlertsRequest */ type ListAlertsRequest = Message<"alerts.v1.ListAlertsRequest"> & { /** * Return only alerts in these states. Empty returns every state. * * @generated from field: repeated alerts.v1.AlertStatus statuses = 1; */ statuses: AlertStatus[]; /** * Return only alerts on this market. Zero returns every market. * * @generated from field: uint32 symbol_id = 2; */ symbolId: number; /** * Maximum number of alerts to return: default 50, max 200. * * @generated from field: uint32 limit = 3; */ limit: number; /** * Opaque, keyset-backed and exclusive cursor from a previous response's * next_page_token. It is bound to the caller, statuses and symbol_id; reuse * it only with the same values. * * @generated from field: string page_token = 4; */ pageToken: string; }; /** * Describes the message alerts.v1.ListAlertsRequest. * Use `create(ListAlertsRequestSchema)` to create a new message. */ declare const ListAlertsRequestSchema: GenMessage; /** * ListAlertsResponse returns one page of the caller's alerts. * * @generated from message alerts.v1.ListAlertsResponse */ type ListAlertsResponse = Message<"alerts.v1.ListAlertsResponse"> & { /** * Alerts, newest first. * * @generated from field: repeated alerts.v1.PriceAlert alerts = 1; */ alerts: PriceAlert[]; /** * Cursor for the next page. Empty when no more results exist. * * @generated from field: string next_page_token = 2; */ nextPageToken: string; }; /** * Describes the message alerts.v1.ListAlertsResponse. * Use `create(ListAlertsResponseSchema)` to create a new message. */ declare const ListAlertsResponseSchema: GenMessage; /** * AlertUpdate holds the fields UpdateAlert can change. * * @generated from message alerts.v1.AlertUpdate */ type AlertUpdate = Message<"alerts.v1.AlertUpdate"> & { /** * New price crossing to wait for. * * @generated from field: alerts.v1.AlertDirection direction = 1; */ direction: AlertDirection; /** * New alert price in quote units scaled by 1e9. * * @generated from field: int64 price_ticks = 2; */ priceTicks: bigint; /** * New delivery channels: one to two distinct channels. Replaces the whole * list. * * @generated from field: repeated alerts.v1.AlertChannel channels = 3; */ channels: AlertChannel[]; }; /** * Describes the message alerts.v1.AlertUpdate. * Use `create(AlertUpdateSchema)` to create a new message. */ declare const AlertUpdateSchema: GenMessage; /** * UpdateAlertRequest changes an active or triggered alert of the caller. * * @generated from message alerts.v1.UpdateAlertRequest */ type UpdateAlertRequest = Message<"alerts.v1.UpdateAlertRequest"> & { /** * Public alert ID. * * @generated from field: fixed64 alert_id = 1; */ alertId: bigint; /** * New values of the fields update_mask names. * * @generated from field: alerts.v1.AlertUpdate update = 2; */ update?: AlertUpdate | undefined; /** * Fields of update to apply, by name: direction, price_ticks and channels. * Required. An empty mask changes no field: it sets a TRIGGERED alert again * and changes nothing on an ACTIVE one. * * @generated from field: google.protobuf.FieldMask update_mask = 3; */ updateMask?: FieldMask | undefined; /** * The alert's current revision, from the last read. * * @generated from field: uint64 expected_revision = 4; */ expectedRevision: bigint; /** * Optional client-chosen key, unique per caller, that makes the update * idempotent: the same key and request (alert, update and update_mask; * expected_revision aside) return the alert in its current state and apply * nothing again, even after it fired or changed since; another request with * the same key is IDEMPOTENCY_CONFLICT. A key is kept as long as its alert, * so a repeat is recognized however late it comes. An alert keeps at most * 1,000 keys: an update with a new key beyond that is * ALERT_UPDATE_LIMIT_REACHED. * * @generated from field: string idempotency_key = 5; */ idempotencyKey: string; }; /** * Describes the message alerts.v1.UpdateAlertRequest. * Use `create(UpdateAlertRequestSchema)` to create a new message. */ declare const UpdateAlertRequestSchema: GenMessage; /** * UpdateAlertResponse returns the alert after the update. * * @generated from message alerts.v1.UpdateAlertResponse */ type UpdateAlertResponse = Message<"alerts.v1.UpdateAlertResponse"> & { /** * The alert. For REPLAYED, the alert as it is now. * * @generated from field: alerts.v1.PriceAlert alert = 1; */ alert?: PriceAlert | undefined; /** * What this call did. * * @generated from field: alerts.v1.UpdateOutcome outcome = 2; */ outcome: UpdateOutcome; }; /** * Describes the message alerts.v1.UpdateAlertResponse. * Use `create(UpdateAlertResponseSchema)` to create a new message. */ declare const UpdateAlertResponseSchema: GenMessage; /** * CancelAlertRequest cancels an active alert of the caller. * * @generated from message alerts.v1.CancelAlertRequest */ type CancelAlertRequest = Message<"alerts.v1.CancelAlertRequest"> & { /** * Public alert ID. * * @generated from field: fixed64 alert_id = 1; */ alertId: bigint; }; /** * Describes the message alerts.v1.CancelAlertRequest. * Use `create(CancelAlertRequestSchema)` to create a new message. */ declare const CancelAlertRequestSchema: GenMessage; /** * CancelAlertResponse returns the cancelled alert. * * @generated from message alerts.v1.CancelAlertResponse */ type CancelAlertResponse = Message<"alerts.v1.CancelAlertResponse"> & { /** * The alert. * * @generated from field: alerts.v1.PriceAlert alert = 1; */ alert?: PriceAlert | undefined; }; /** * Describes the message alerts.v1.CancelAlertResponse. * Use `create(CancelAlertResponseSchema)` to create a new message. */ declare const CancelAlertResponseSchema: GenMessage; /** * ErrorCode identifies a Price Alert API error. * * @generated from enum alerts.v1.ErrorCode */ declare enum ErrorCode { /** * No code. * * @generated from enum value: ERROR_UNSPECIFIED = 0; */ ERROR_UNSPECIFIED = 0, /** * No alert of the caller has this ID. Another account's alert is reported * the same way. * * @generated from enum value: ALERT_NOT_FOUND = 1; */ ALERT_NOT_FOUND = 1, /** * The market is not listed. * * @generated from enum value: UNKNOWN_SYMBOL = 2; */ UNKNOWN_SYMBOL = 2, /** * The market has no current price of the requested price source, so the * alert cannot record the price it starts from. Retry shortly. * * @generated from enum value: PRICE_UNAVAILABLE = 3; */ PRICE_UNAVAILABLE = 3, /** * The market has no index price; use LAST_PRICE. * * @generated from enum value: PRICE_SOURCE_UNSUPPORTED = 4; */ PRICE_SOURCE_UNSUPPORTED = 4, /** * The caller already has the maximum number of active alerts. Cancel one * first. * * @generated from enum value: ALERT_LIMIT_REACHED = 5; */ ALERT_LIMIT_REACHED = 5, /** * The alert changed after the caller read it: expected_revision is not its * current revision. Read it again and retry. * * @generated from enum value: REVISION_CONFLICT = 6; */ REVISION_CONFLICT = 6, /** * The alert was cancelled; it can no longer change. * * @generated from enum value: ALERT_CANCELLED = 7; */ ALERT_CANCELLED = 7, /** * The alert already fired, so there is nothing to cancel. Update it to set * it again. * * @generated from enum value: ALERT_TRIGGERED = 8; */ ALERT_TRIGGERED = 8, /** * The idempotency key was already used with a different request. The * original alert, or the original update, stands. * * @generated from enum value: IDEMPOTENCY_CONFLICT = 9; */ IDEMPOTENCY_CONFLICT = 9, /** * A required service is temporarily unavailable; retry the same request. * * @generated from enum value: SERVICE_UNAVAILABLE = 10; */ SERVICE_UNAVAILABLE = 10, /** * The API key is scoped to a subaccount. Price alerts belong to the root * account: use a session or an API key of the root account. * * @generated from enum value: SUBACCOUNT_KEY_REFUSED = 11; */ SUBACCOUNT_KEY_REFUSED = 11, /** * The alert already holds the maximum number of update idempotency keys * (1,000), so an update with a new key is refused. Updates without a key, * and repeats of a stored key, still work; or create a new alert. * * @generated from enum value: ALERT_UPDATE_LIMIT_REACHED = 12; */ ALERT_UPDATE_LIMIT_REACHED = 12 } /** * Describes the enum alerts.v1.ErrorCode. */ declare const ErrorCodeSchema: GenEnum; /** * AlertDirection is the price crossing an alert waits for. Both directions * include the alert price itself, as stop and take-profit triggers do. * * @generated from enum alerts.v1.AlertDirection */ declare enum AlertDirection { /** * Not set. Rejected in requests. * * @generated from enum value: DIRECTION_UNSPECIFIED = 0; */ DIRECTION_UNSPECIFIED = 0, /** * Fires when the price rises to or above the alert price. * * @generated from enum value: ABOVE = 1; */ ABOVE = 1, /** * Fires when the price falls to or below the alert price. * * @generated from enum value: BELOW = 2; */ BELOW = 2 } /** * Describes the enum alerts.v1.AlertDirection. */ declare const AlertDirectionSchema: GenEnum; /** * AlertPriceSource is the price an alert watches. * * @generated from enum alerts.v1.AlertPriceSource */ declare enum AlertPriceSource { /** * Not set. In requests it means INDEX_PRICE on a market that has an index * price, and LAST_PRICE otherwise. Never returned. * * @generated from enum value: PRICE_SOURCE_UNSPECIFIED = 0; */ PRICE_SOURCE_UNSPECIFIED = 0, /** * The market's last traded price. * * @generated from enum value: LAST_PRICE = 1; */ LAST_PRICE = 1, /** * The market's index price: a fair price computed from other venues. * Available only on markets that have one. * * @generated from enum value: INDEX_PRICE = 2; */ INDEX_PRICE = 2 } /** * Describes the enum alerts.v1.AlertPriceSource. */ declare const AlertPriceSourceSchema: GenEnum; /** * AlertStatus is the state of an alert. * * @generated from enum alerts.v1.AlertStatus */ declare enum AlertStatus { /** * Not set. Never returned. * * @generated from enum value: STATUS_UNSPECIFIED = 0; */ STATUS_UNSPECIFIED = 0, /** * Waiting for its price crossing. * * @generated from enum value: ACTIVE = 1; */ ACTIVE = 1, /** * Fired once and stopped. UpdateAlert sets it again. * * @generated from enum value: TRIGGERED = 2; */ TRIGGERED = 2, /** * Cancelled. It never fires again. * * @generated from enum value: CANCELLED = 3; */ CANCELLED = 3 } /** * Describes the enum alerts.v1.AlertStatus. */ declare const AlertStatusSchema: GenEnum; /** * UpdateOutcome is what an UpdateAlert call did, as decided in the * transaction that answered it. * * @generated from enum alerts.v1.UpdateOutcome */ declare enum UpdateOutcome { /** * Not set. Never returned. * * @generated from enum value: UPDATE_OUTCOME_UNSPECIFIED = 0; */ UPDATE_OUTCOME_UNSPECIFIED = 0, /** * This call changed the alert. * * @generated from enum value: APPLIED = 1; */ APPLIED = 1, /** * This call was processed now and changed nothing: the alert already held * the requested values. * * @generated from enum value: UNCHANGED = 2; */ UNCHANGED = 2, /** * idempotency_key was already used for this request: nothing was applied * now, and the alert is returned as it is now, which may have fired or * changed since. * * @generated from enum value: REPLAYED = 3; */ REPLAYED = 3 } /** * Describes the enum alerts.v1.UpdateOutcome. */ declare const UpdateOutcomeSchema: GenEnum; /** * AlertChannel is where a fired alert is delivered. * * @generated from enum alerts.v1.AlertChannel */ declare enum AlertChannel { /** * Not set. Rejected in requests. * * @generated from enum value: CHANNEL_UNSPECIFIED = 0; */ CHANNEL_UNSPECIFIED = 0, /** * The notification inbox on the website and in the app. * * @generated from enum value: IN_APP = 1; */ IN_APP = 1, /** * A direct message from the Polyester Telegram bot to the Telegram account * linked to the caller's account. * * @generated from enum value: TELEGRAM = 2; */ TELEGRAM = 2 } /** * Describes the enum alerts.v1.AlertChannel. */ declare const AlertChannelSchema: GenEnum; /** * PriceAlertService manages the caller's price alerts. An alert belongs to * the caller's root account, the person, not to a trading account: a session * and the root account's API keys see the same alerts, and an API key scoped * to a subaccount is refused (PERMISSION_DENIED, SUBACCOUNT_KEY_REFUSED). No * call changes balances, orders or account settings. * * @generated from service alerts.v1.PriceAlertService */ declare const PriceAlertService: GenService<{ /** * CreateAlert creates an active alert and records the current price of its * price source as its reference price. An alert whose condition already * holds at that price waits for the price to cross back first. * * Errors: * - INVALID_ARGUMENT: malformed request, or UNKNOWN_SYMBOL. * - FAILED_PRECONDITION: PRICE_SOURCE_UNSUPPORTED (INDEX_PRICE requested on * a market without one), or ALERT_LIMIT_REACHED. * - ALREADY_EXISTS: IDEMPOTENCY_CONFLICT; the original alert stands. * - UNAVAILABLE: PRICE_UNAVAILABLE or SERVICE_UNAVAILABLE; retry the same * request. * - PERMISSION_DENIED: SUBACCOUNT_KEY_REFUSED. * - UNAUTHENTICATED: missing or invalid credentials. * * @generated from rpc alerts.v1.PriceAlertService.CreateAlert */ createAlert: { methodKind: "unary"; input: typeof CreateAlertRequestSchema; output: typeof CreateAlertResponseSchema; }; /** * ListAlerts lists the caller's alerts, newest first. * * Errors: * - INVALID_ARGUMENT: malformed request or page token. * - UNAVAILABLE: SERVICE_UNAVAILABLE; retry. * - PERMISSION_DENIED: SUBACCOUNT_KEY_REFUSED. * - UNAUTHENTICATED: missing or invalid credentials. * * @generated from rpc alerts.v1.PriceAlertService.ListAlerts */ listAlerts: { methodKind: "unary"; input: typeof ListAlertsRequestSchema; output: typeof ListAlertsResponseSchema; }; /** * UpdateAlert changes an alert's direction, price or channels. A change of * direction or price records a new reference price, as creating does. * Updating a TRIGGERED alert sets it again: it becomes ACTIVE with a new * reference price, even when no field changes; an empty update_mask does * only that. An update that changes nothing on an ACTIVE alert returns it * unchanged. With an idempotency_key * already used for the same request, it returns the alert as it is now and * changes nothing: a retried or replayed update never sets the alert again. * * Errors: * - INVALID_ARGUMENT: malformed request or update_mask. * - NOT_FOUND: ALERT_NOT_FOUND. * - ALREADY_EXISTS: IDEMPOTENCY_CONFLICT. * - ABORTED: REVISION_CONFLICT. * - FAILED_PRECONDITION: ALERT_CANCELLED, PRICE_SOURCE_UNSUPPORTED, * ALERT_LIMIT_REACHED or ALERT_UPDATE_LIMIT_REACHED. * - UNAVAILABLE: PRICE_UNAVAILABLE or SERVICE_UNAVAILABLE; retry. * - PERMISSION_DENIED: SUBACCOUNT_KEY_REFUSED. * - UNAUTHENTICATED: missing or invalid credentials. * * @generated from rpc alerts.v1.PriceAlertService.UpdateAlert */ updateAlert: { methodKind: "unary"; input: typeof UpdateAlertRequestSchema; output: typeof UpdateAlertResponseSchema; }; /** * CancelAlert cancels an active alert. Cancelling a cancelled alert returns * it unchanged. * * Errors: * - INVALID_ARGUMENT: malformed request. * - NOT_FOUND: ALERT_NOT_FOUND. * - FAILED_PRECONDITION: ALERT_TRIGGERED; the alert already fired. * - UNAVAILABLE: SERVICE_UNAVAILABLE; retry. * - PERMISSION_DENIED: SUBACCOUNT_KEY_REFUSED. * - UNAUTHENTICATED: missing or invalid credentials. * * @generated from rpc alerts.v1.PriceAlertService.CancelAlert */ cancelAlert: { methodKind: "unary"; input: typeof CancelAlertRequestSchema; output: typeof CancelAlertResponseSchema; }; }>; //#endregion export { AlertChannel, AlertChannelSchema, AlertDirection, AlertDirectionSchema, AlertPriceSource, AlertPriceSourceSchema, AlertStatus, AlertStatusSchema, AlertUpdate, AlertUpdateSchema, CancelAlertRequest, CancelAlertRequestSchema, CancelAlertResponse, CancelAlertResponseSchema, CreateAlertRequest, CreateAlertRequestSchema, CreateAlertResponse, CreateAlertResponseSchema, ErrorCode, ErrorCodeSchema, ErrorDetail, ErrorDetailSchema, ListAlertsRequest, ListAlertsRequestSchema, ListAlertsResponse, ListAlertsResponseSchema, PriceAlert, PriceAlertSchema, PriceAlertService, UpdateAlertRequest, UpdateAlertRequestSchema, UpdateAlertResponse, UpdateAlertResponseSchema, UpdateOutcome, UpdateOutcomeSchema, file_alerts_v1_price_alerts, price_alerts_pb_d_exports }; //# sourceMappingURL=price_alerts_pb.d.ts.map