@tinkoff/invest-js
Version:
T-Invest OpenAPI Client
1,129 lines • 48.1 kB
JavaScript
"use strict";
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.6.1
// protoc v3.19.1
// source: common.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.ErrorDetail = exports.BrandData = exports.ResponseMetadata = exports.PageResponse = exports.Page = exports.Ping = exports.PingDelaySettings = exports.PingRequest = exports.Quotation = exports.MoneyValue = exports.ResultSubscriptionStatus = exports.PriceType = exports.SecurityTradingStatus = exports.InstrumentStatus = exports.InstrumentType = void 0;
exports.instrumentTypeFromJSON = instrumentTypeFromJSON;
exports.instrumentTypeToJSON = instrumentTypeToJSON;
exports.instrumentStatusFromJSON = instrumentStatusFromJSON;
exports.instrumentStatusToJSON = instrumentStatusToJSON;
exports.securityTradingStatusFromJSON = securityTradingStatusFromJSON;
exports.securityTradingStatusToJSON = securityTradingStatusToJSON;
exports.priceTypeFromJSON = priceTypeFromJSON;
exports.priceTypeToJSON = priceTypeToJSON;
exports.resultSubscriptionStatusFromJSON = resultSubscriptionStatusFromJSON;
exports.resultSubscriptionStatusToJSON = resultSubscriptionStatusToJSON;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const timestamp_1 = require("./google/protobuf/timestamp");
/** Тип инструмента. */
var InstrumentType;
(function (InstrumentType) {
InstrumentType[InstrumentType["INSTRUMENT_TYPE_UNSPECIFIED"] = 0] = "INSTRUMENT_TYPE_UNSPECIFIED";
/** INSTRUMENT_TYPE_BOND - Облигация. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_BOND"] = 1] = "INSTRUMENT_TYPE_BOND";
/** INSTRUMENT_TYPE_SHARE - Акция. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_SHARE"] = 2] = "INSTRUMENT_TYPE_SHARE";
/** INSTRUMENT_TYPE_CURRENCY - Валюта. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_CURRENCY"] = 3] = "INSTRUMENT_TYPE_CURRENCY";
/** INSTRUMENT_TYPE_ETF - Exchange-traded fund. Фонд. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_ETF"] = 4] = "INSTRUMENT_TYPE_ETF";
/** INSTRUMENT_TYPE_FUTURES - Фьючерс. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_FUTURES"] = 5] = "INSTRUMENT_TYPE_FUTURES";
/** INSTRUMENT_TYPE_SP - Структурная нота. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_SP"] = 6] = "INSTRUMENT_TYPE_SP";
/** INSTRUMENT_TYPE_OPTION - Опцион. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_OPTION"] = 7] = "INSTRUMENT_TYPE_OPTION";
/** INSTRUMENT_TYPE_CLEARING_CERTIFICATE - Clearing certificate. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_CLEARING_CERTIFICATE"] = 8] = "INSTRUMENT_TYPE_CLEARING_CERTIFICATE";
/** INSTRUMENT_TYPE_INDEX - Индекс. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_INDEX"] = 9] = "INSTRUMENT_TYPE_INDEX";
/** INSTRUMENT_TYPE_COMMODITY - Товар. */
InstrumentType[InstrumentType["INSTRUMENT_TYPE_COMMODITY"] = 10] = "INSTRUMENT_TYPE_COMMODITY";
InstrumentType[InstrumentType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(InstrumentType || (exports.InstrumentType = InstrumentType = {}));
function instrumentTypeFromJSON(object) {
switch (object) {
case 0:
case "INSTRUMENT_TYPE_UNSPECIFIED":
return InstrumentType.INSTRUMENT_TYPE_UNSPECIFIED;
case 1:
case "INSTRUMENT_TYPE_BOND":
return InstrumentType.INSTRUMENT_TYPE_BOND;
case 2:
case "INSTRUMENT_TYPE_SHARE":
return InstrumentType.INSTRUMENT_TYPE_SHARE;
case 3:
case "INSTRUMENT_TYPE_CURRENCY":
return InstrumentType.INSTRUMENT_TYPE_CURRENCY;
case 4:
case "INSTRUMENT_TYPE_ETF":
return InstrumentType.INSTRUMENT_TYPE_ETF;
case 5:
case "INSTRUMENT_TYPE_FUTURES":
return InstrumentType.INSTRUMENT_TYPE_FUTURES;
case 6:
case "INSTRUMENT_TYPE_SP":
return InstrumentType.INSTRUMENT_TYPE_SP;
case 7:
case "INSTRUMENT_TYPE_OPTION":
return InstrumentType.INSTRUMENT_TYPE_OPTION;
case 8:
case "INSTRUMENT_TYPE_CLEARING_CERTIFICATE":
return InstrumentType.INSTRUMENT_TYPE_CLEARING_CERTIFICATE;
case 9:
case "INSTRUMENT_TYPE_INDEX":
return InstrumentType.INSTRUMENT_TYPE_INDEX;
case 10:
case "INSTRUMENT_TYPE_COMMODITY":
return InstrumentType.INSTRUMENT_TYPE_COMMODITY;
case -1:
case "UNRECOGNIZED":
default:
return InstrumentType.UNRECOGNIZED;
}
}
function instrumentTypeToJSON(object) {
switch (object) {
case InstrumentType.INSTRUMENT_TYPE_UNSPECIFIED:
return "INSTRUMENT_TYPE_UNSPECIFIED";
case InstrumentType.INSTRUMENT_TYPE_BOND:
return "INSTRUMENT_TYPE_BOND";
case InstrumentType.INSTRUMENT_TYPE_SHARE:
return "INSTRUMENT_TYPE_SHARE";
case InstrumentType.INSTRUMENT_TYPE_CURRENCY:
return "INSTRUMENT_TYPE_CURRENCY";
case InstrumentType.INSTRUMENT_TYPE_ETF:
return "INSTRUMENT_TYPE_ETF";
case InstrumentType.INSTRUMENT_TYPE_FUTURES:
return "INSTRUMENT_TYPE_FUTURES";
case InstrumentType.INSTRUMENT_TYPE_SP:
return "INSTRUMENT_TYPE_SP";
case InstrumentType.INSTRUMENT_TYPE_OPTION:
return "INSTRUMENT_TYPE_OPTION";
case InstrumentType.INSTRUMENT_TYPE_CLEARING_CERTIFICATE:
return "INSTRUMENT_TYPE_CLEARING_CERTIFICATE";
case InstrumentType.INSTRUMENT_TYPE_INDEX:
return "INSTRUMENT_TYPE_INDEX";
case InstrumentType.INSTRUMENT_TYPE_COMMODITY:
return "INSTRUMENT_TYPE_COMMODITY";
case InstrumentType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
/** Статус запрашиваемых инструментов. */
var InstrumentStatus;
(function (InstrumentStatus) {
/** INSTRUMENT_STATUS_UNSPECIFIED - Значение не определено. */
InstrumentStatus[InstrumentStatus["INSTRUMENT_STATUS_UNSPECIFIED"] = 0] = "INSTRUMENT_STATUS_UNSPECIFIED";
/** INSTRUMENT_STATUS_BASE - Базовый список инструментов (по умолчанию). Инструменты, доступные для торговли через T-Invest API. Cейчас списки бумаг, которые доступны из API и других интерфейсах совпадают — кроме внебиржевых бумаг. Но в будущем возможны ситуации, когда списки инструментов будут отличаться. */
InstrumentStatus[InstrumentStatus["INSTRUMENT_STATUS_BASE"] = 1] = "INSTRUMENT_STATUS_BASE";
/** INSTRUMENT_STATUS_ALL - Список всех инструментов. */
InstrumentStatus[InstrumentStatus["INSTRUMENT_STATUS_ALL"] = 2] = "INSTRUMENT_STATUS_ALL";
InstrumentStatus[InstrumentStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(InstrumentStatus || (exports.InstrumentStatus = InstrumentStatus = {}));
function instrumentStatusFromJSON(object) {
switch (object) {
case 0:
case "INSTRUMENT_STATUS_UNSPECIFIED":
return InstrumentStatus.INSTRUMENT_STATUS_UNSPECIFIED;
case 1:
case "INSTRUMENT_STATUS_BASE":
return InstrumentStatus.INSTRUMENT_STATUS_BASE;
case 2:
case "INSTRUMENT_STATUS_ALL":
return InstrumentStatus.INSTRUMENT_STATUS_ALL;
case -1:
case "UNRECOGNIZED":
default:
return InstrumentStatus.UNRECOGNIZED;
}
}
function instrumentStatusToJSON(object) {
switch (object) {
case InstrumentStatus.INSTRUMENT_STATUS_UNSPECIFIED:
return "INSTRUMENT_STATUS_UNSPECIFIED";
case InstrumentStatus.INSTRUMENT_STATUS_BASE:
return "INSTRUMENT_STATUS_BASE";
case InstrumentStatus.INSTRUMENT_STATUS_ALL:
return "INSTRUMENT_STATUS_ALL";
case InstrumentStatus.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
/** Режим торгов инструмента */
var SecurityTradingStatus;
(function (SecurityTradingStatus) {
/** SECURITY_TRADING_STATUS_UNSPECIFIED - Торговый статус не определён. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_UNSPECIFIED"] = 0] = "SECURITY_TRADING_STATUS_UNSPECIFIED";
/** SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING - Недоступен для торгов. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING"] = 1] = "SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING";
/** SECURITY_TRADING_STATUS_OPENING_PERIOD - Период открытия торгов. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_OPENING_PERIOD"] = 2] = "SECURITY_TRADING_STATUS_OPENING_PERIOD";
/** SECURITY_TRADING_STATUS_CLOSING_PERIOD - Период закрытия торгов. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_CLOSING_PERIOD"] = 3] = "SECURITY_TRADING_STATUS_CLOSING_PERIOD";
/** SECURITY_TRADING_STATUS_BREAK_IN_TRADING - Перерыв в торговле. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_BREAK_IN_TRADING"] = 4] = "SECURITY_TRADING_STATUS_BREAK_IN_TRADING";
/** SECURITY_TRADING_STATUS_NORMAL_TRADING - Нормальная торговля. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_NORMAL_TRADING"] = 5] = "SECURITY_TRADING_STATUS_NORMAL_TRADING";
/** SECURITY_TRADING_STATUS_CLOSING_AUCTION - Аукцион закрытия. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_CLOSING_AUCTION"] = 6] = "SECURITY_TRADING_STATUS_CLOSING_AUCTION";
/** SECURITY_TRADING_STATUS_DARK_POOL_AUCTION - Аукцион крупных пакетов. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_DARK_POOL_AUCTION"] = 7] = "SECURITY_TRADING_STATUS_DARK_POOL_AUCTION";
/** SECURITY_TRADING_STATUS_DISCRETE_AUCTION - Дискретный аукцион. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_DISCRETE_AUCTION"] = 8] = "SECURITY_TRADING_STATUS_DISCRETE_AUCTION";
/** SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD - Аукцион открытия. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD"] = 9] = "SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD";
/** SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE - Период торгов по цене аукциона закрытия. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE"] = 10] = "SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE";
/** SECURITY_TRADING_STATUS_SESSION_ASSIGNED - Сессия назначена. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_SESSION_ASSIGNED"] = 11] = "SECURITY_TRADING_STATUS_SESSION_ASSIGNED";
/** SECURITY_TRADING_STATUS_SESSION_CLOSE - Сессия закрыта. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_SESSION_CLOSE"] = 12] = "SECURITY_TRADING_STATUS_SESSION_CLOSE";
/** SECURITY_TRADING_STATUS_SESSION_OPEN - Сессия открыта. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_SESSION_OPEN"] = 13] = "SECURITY_TRADING_STATUS_SESSION_OPEN";
/** SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING - Доступна торговля в режиме внутренней ликвидности брокера. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING"] = 14] = "SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING";
/** SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING - Перерыв торговли в режиме внутренней ликвидности брокера. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING"] = 15] = "SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING";
/** SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING - Недоступна торговля в режиме внутренней ликвидности брокера. */
SecurityTradingStatus[SecurityTradingStatus["SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING"] = 16] = "SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING";
SecurityTradingStatus[SecurityTradingStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(SecurityTradingStatus || (exports.SecurityTradingStatus = SecurityTradingStatus = {}));
function securityTradingStatusFromJSON(object) {
switch (object) {
case 0:
case "SECURITY_TRADING_STATUS_UNSPECIFIED":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_UNSPECIFIED;
case 1:
case "SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING;
case 2:
case "SECURITY_TRADING_STATUS_OPENING_PERIOD":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_OPENING_PERIOD;
case 3:
case "SECURITY_TRADING_STATUS_CLOSING_PERIOD":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_CLOSING_PERIOD;
case 4:
case "SECURITY_TRADING_STATUS_BREAK_IN_TRADING":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_BREAK_IN_TRADING;
case 5:
case "SECURITY_TRADING_STATUS_NORMAL_TRADING":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_NORMAL_TRADING;
case 6:
case "SECURITY_TRADING_STATUS_CLOSING_AUCTION":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_CLOSING_AUCTION;
case 7:
case "SECURITY_TRADING_STATUS_DARK_POOL_AUCTION":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_DARK_POOL_AUCTION;
case 8:
case "SECURITY_TRADING_STATUS_DISCRETE_AUCTION":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_DISCRETE_AUCTION;
case 9:
case "SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD;
case 10:
case "SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE;
case 11:
case "SECURITY_TRADING_STATUS_SESSION_ASSIGNED":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_SESSION_ASSIGNED;
case 12:
case "SECURITY_TRADING_STATUS_SESSION_CLOSE":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_SESSION_CLOSE;
case 13:
case "SECURITY_TRADING_STATUS_SESSION_OPEN":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_SESSION_OPEN;
case 14:
case "SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING;
case 15:
case "SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING;
case 16:
case "SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING":
return SecurityTradingStatus.SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING;
case -1:
case "UNRECOGNIZED":
default:
return SecurityTradingStatus.UNRECOGNIZED;
}
}
function securityTradingStatusToJSON(object) {
switch (object) {
case SecurityTradingStatus.SECURITY_TRADING_STATUS_UNSPECIFIED:
return "SECURITY_TRADING_STATUS_UNSPECIFIED";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING:
return "SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR_TRADING";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_OPENING_PERIOD:
return "SECURITY_TRADING_STATUS_OPENING_PERIOD";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_CLOSING_PERIOD:
return "SECURITY_TRADING_STATUS_CLOSING_PERIOD";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_BREAK_IN_TRADING:
return "SECURITY_TRADING_STATUS_BREAK_IN_TRADING";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_NORMAL_TRADING:
return "SECURITY_TRADING_STATUS_NORMAL_TRADING";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_CLOSING_AUCTION:
return "SECURITY_TRADING_STATUS_CLOSING_AUCTION";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_DARK_POOL_AUCTION:
return "SECURITY_TRADING_STATUS_DARK_POOL_AUCTION";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_DISCRETE_AUCTION:
return "SECURITY_TRADING_STATUS_DISCRETE_AUCTION";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD:
return "SECURITY_TRADING_STATUS_OPENING_AUCTION_PERIOD";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE:
return "SECURITY_TRADING_STATUS_TRADING_AT_CLOSING_AUCTION_PRICE";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_SESSION_ASSIGNED:
return "SECURITY_TRADING_STATUS_SESSION_ASSIGNED";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_SESSION_CLOSE:
return "SECURITY_TRADING_STATUS_SESSION_CLOSE";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_SESSION_OPEN:
return "SECURITY_TRADING_STATUS_SESSION_OPEN";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING:
return "SECURITY_TRADING_STATUS_DEALER_NORMAL_TRADING";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING:
return "SECURITY_TRADING_STATUS_DEALER_BREAK_IN_TRADING";
case SecurityTradingStatus.SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING:
return "SECURITY_TRADING_STATUS_DEALER_NOT_AVAILABLE_FOR_TRADING";
case SecurityTradingStatus.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
/** Тип цены. */
var PriceType;
(function (PriceType) {
/** PRICE_TYPE_UNSPECIFIED - Значение не определено. */
PriceType[PriceType["PRICE_TYPE_UNSPECIFIED"] = 0] = "PRICE_TYPE_UNSPECIFIED";
/** PRICE_TYPE_POINT - Цена в пунктах (только для фьючерсов и облигаций). */
PriceType[PriceType["PRICE_TYPE_POINT"] = 1] = "PRICE_TYPE_POINT";
/** PRICE_TYPE_CURRENCY - Цена в валюте расчётов по инструменту. */
PriceType[PriceType["PRICE_TYPE_CURRENCY"] = 2] = "PRICE_TYPE_CURRENCY";
PriceType[PriceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(PriceType || (exports.PriceType = PriceType = {}));
function priceTypeFromJSON(object) {
switch (object) {
case 0:
case "PRICE_TYPE_UNSPECIFIED":
return PriceType.PRICE_TYPE_UNSPECIFIED;
case 1:
case "PRICE_TYPE_POINT":
return PriceType.PRICE_TYPE_POINT;
case 2:
case "PRICE_TYPE_CURRENCY":
return PriceType.PRICE_TYPE_CURRENCY;
case -1:
case "UNRECOGNIZED":
default:
return PriceType.UNRECOGNIZED;
}
}
function priceTypeToJSON(object) {
switch (object) {
case PriceType.PRICE_TYPE_UNSPECIFIED:
return "PRICE_TYPE_UNSPECIFIED";
case PriceType.PRICE_TYPE_POINT:
return "PRICE_TYPE_POINT";
case PriceType.PRICE_TYPE_CURRENCY:
return "PRICE_TYPE_CURRENCY";
case PriceType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
var ResultSubscriptionStatus;
(function (ResultSubscriptionStatus) {
/** RESULT_SUBSCRIPTION_STATUS_UNSPECIFIED - Статус подписки не определен. */
ResultSubscriptionStatus[ResultSubscriptionStatus["RESULT_SUBSCRIPTION_STATUS_UNSPECIFIED"] = 0] = "RESULT_SUBSCRIPTION_STATUS_UNSPECIFIED";
/** RESULT_SUBSCRIPTION_STATUS_OK - Подписка успешно установлена. */
ResultSubscriptionStatus[ResultSubscriptionStatus["RESULT_SUBSCRIPTION_STATUS_OK"] = 1] = "RESULT_SUBSCRIPTION_STATUS_OK";
/** RESULT_SUBSCRIPTION_STATUS_ERROR - Ошибка подписки */
ResultSubscriptionStatus[ResultSubscriptionStatus["RESULT_SUBSCRIPTION_STATUS_ERROR"] = 13] = "RESULT_SUBSCRIPTION_STATUS_ERROR";
ResultSubscriptionStatus[ResultSubscriptionStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(ResultSubscriptionStatus || (exports.ResultSubscriptionStatus = ResultSubscriptionStatus = {}));
function resultSubscriptionStatusFromJSON(object) {
switch (object) {
case 0:
case "RESULT_SUBSCRIPTION_STATUS_UNSPECIFIED":
return ResultSubscriptionStatus.RESULT_SUBSCRIPTION_STATUS_UNSPECIFIED;
case 1:
case "RESULT_SUBSCRIPTION_STATUS_OK":
return ResultSubscriptionStatus.RESULT_SUBSCRIPTION_STATUS_OK;
case 13:
case "RESULT_SUBSCRIPTION_STATUS_ERROR":
return ResultSubscriptionStatus.RESULT_SUBSCRIPTION_STATUS_ERROR;
case -1:
case "UNRECOGNIZED":
default:
return ResultSubscriptionStatus.UNRECOGNIZED;
}
}
function resultSubscriptionStatusToJSON(object) {
switch (object) {
case ResultSubscriptionStatus.RESULT_SUBSCRIPTION_STATUS_UNSPECIFIED:
return "RESULT_SUBSCRIPTION_STATUS_UNSPECIFIED";
case ResultSubscriptionStatus.RESULT_SUBSCRIPTION_STATUS_OK:
return "RESULT_SUBSCRIPTION_STATUS_OK";
case ResultSubscriptionStatus.RESULT_SUBSCRIPTION_STATUS_ERROR:
return "RESULT_SUBSCRIPTION_STATUS_ERROR";
case ResultSubscriptionStatus.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
function createBaseMoneyValue() {
return { currency: "", units: 0, nano: 0 };
}
exports.MoneyValue = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.currency !== "") {
writer.uint32(10).string(message.currency);
}
if (message.units !== 0) {
writer.uint32(16).int64(message.units);
}
if (message.nano !== 0) {
writer.uint32(24).int32(message.nano);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMoneyValue();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.currency = reader.string();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.units = longToNumber(reader.int64());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.nano = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
units: isSet(object.units) ? globalThis.Number(object.units) : 0,
nano: isSet(object.nano) ? globalThis.Number(object.nano) : 0,
};
},
toJSON(message) {
const obj = {};
if (message.currency !== "") {
obj.currency = message.currency;
}
if (message.units !== 0) {
obj.units = Math.round(message.units);
}
if (message.nano !== 0) {
obj.nano = Math.round(message.nano);
}
return obj;
},
create(base) {
return exports.MoneyValue.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseMoneyValue();
message.currency = (_a = object.currency) !== null && _a !== void 0 ? _a : "";
message.units = (_b = object.units) !== null && _b !== void 0 ? _b : 0;
message.nano = (_c = object.nano) !== null && _c !== void 0 ? _c : 0;
return message;
},
};
function createBaseQuotation() {
return { units: 0, nano: 0 };
}
exports.Quotation = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.units !== 0) {
writer.uint32(8).int64(message.units);
}
if (message.nano !== 0) {
writer.uint32(16).int32(message.nano);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQuotation();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.units = longToNumber(reader.int64());
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.nano = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
units: isSet(object.units) ? globalThis.Number(object.units) : 0,
nano: isSet(object.nano) ? globalThis.Number(object.nano) : 0,
};
},
toJSON(message) {
const obj = {};
if (message.units !== 0) {
obj.units = Math.round(message.units);
}
if (message.nano !== 0) {
obj.nano = Math.round(message.nano);
}
return obj;
},
create(base) {
return exports.Quotation.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseQuotation();
message.units = (_a = object.units) !== null && _a !== void 0 ? _a : 0;
message.nano = (_b = object.nano) !== null && _b !== void 0 ? _b : 0;
return message;
},
};
function createBasePingRequest() {
return { time: undefined };
}
exports.PingRequest = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.time !== undefined) {
timestamp_1.Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePingRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.time = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined };
},
toJSON(message) {
const obj = {};
if (message.time !== undefined) {
obj.time = message.time.toISOString();
}
return obj;
},
create(base) {
return exports.PingRequest.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBasePingRequest();
message.time = (_a = object.time) !== null && _a !== void 0 ? _a : undefined;
return message;
},
};
function createBasePingDelaySettings() {
return { pingDelayMs: undefined };
}
exports.PingDelaySettings = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.pingDelayMs !== undefined) {
writer.uint32(120).int32(message.pingDelayMs);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePingDelaySettings();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 15: {
if (tag !== 120) {
break;
}
message.pingDelayMs = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { pingDelayMs: isSet(object.pingDelayMs) ? globalThis.Number(object.pingDelayMs) : undefined };
},
toJSON(message) {
const obj = {};
if (message.pingDelayMs !== undefined) {
obj.pingDelayMs = Math.round(message.pingDelayMs);
}
return obj;
},
create(base) {
return exports.PingDelaySettings.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a;
const message = createBasePingDelaySettings();
message.pingDelayMs = (_a = object.pingDelayMs) !== null && _a !== void 0 ? _a : undefined;
return message;
},
};
function createBasePing() {
return { time: undefined, streamId: "", pingRequestTime: undefined };
}
exports.Ping = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.time !== undefined) {
timestamp_1.Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).join();
}
if (message.streamId !== "") {
writer.uint32(18).string(message.streamId);
}
if (message.pingRequestTime !== undefined) {
timestamp_1.Timestamp.encode(toTimestamp(message.pingRequestTime), writer.uint32(34).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePing();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.time = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.streamId = reader.string();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.pingRequestTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
streamId: isSet(object.streamId) ? globalThis.String(object.streamId) : "",
pingRequestTime: isSet(object.pingRequestTime) ? fromJsonTimestamp(object.pingRequestTime) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.time !== undefined) {
obj.time = message.time.toISOString();
}
if (message.streamId !== "") {
obj.streamId = message.streamId;
}
if (message.pingRequestTime !== undefined) {
obj.pingRequestTime = message.pingRequestTime.toISOString();
}
return obj;
},
create(base) {
return exports.Ping.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c;
const message = createBasePing();
message.time = (_a = object.time) !== null && _a !== void 0 ? _a : undefined;
message.streamId = (_b = object.streamId) !== null && _b !== void 0 ? _b : "";
message.pingRequestTime = (_c = object.pingRequestTime) !== null && _c !== void 0 ? _c : undefined;
return message;
},
};
function createBasePage() {
return { limit: 0, pageNumber: 0 };
}
exports.Page = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.limit !== 0) {
writer.uint32(8).int32(message.limit);
}
if (message.pageNumber !== 0) {
writer.uint32(16).int32(message.pageNumber);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePage();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.limit = reader.int32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.pageNumber = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
pageNumber: isSet(object.pageNumber) ? globalThis.Number(object.pageNumber) : 0,
};
},
toJSON(message) {
const obj = {};
if (message.limit !== 0) {
obj.limit = Math.round(message.limit);
}
if (message.pageNumber !== 0) {
obj.pageNumber = Math.round(message.pageNumber);
}
return obj;
},
create(base) {
return exports.Page.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBasePage();
message.limit = (_a = object.limit) !== null && _a !== void 0 ? _a : 0;
message.pageNumber = (_b = object.pageNumber) !== null && _b !== void 0 ? _b : 0;
return message;
},
};
function createBasePageResponse() {
return { limit: 0, pageNumber: 0, totalCount: 0 };
}
exports.PageResponse = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.limit !== 0) {
writer.uint32(8).int32(message.limit);
}
if (message.pageNumber !== 0) {
writer.uint32(16).int32(message.pageNumber);
}
if (message.totalCount !== 0) {
writer.uint32(24).int32(message.totalCount);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBasePageResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.limit = reader.int32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.pageNumber = reader.int32();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.totalCount = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
pageNumber: isSet(object.pageNumber) ? globalThis.Number(object.pageNumber) : 0,
totalCount: isSet(object.totalCount) ? globalThis.Number(object.totalCount) : 0,
};
},
toJSON(message) {
const obj = {};
if (message.limit !== 0) {
obj.limit = Math.round(message.limit);
}
if (message.pageNumber !== 0) {
obj.pageNumber = Math.round(message.pageNumber);
}
if (message.totalCount !== 0) {
obj.totalCount = Math.round(message.totalCount);
}
return obj;
},
create(base) {
return exports.PageResponse.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c;
const message = createBasePageResponse();
message.limit = (_a = object.limit) !== null && _a !== void 0 ? _a : 0;
message.pageNumber = (_b = object.pageNumber) !== null && _b !== void 0 ? _b : 0;
message.totalCount = (_c = object.totalCount) !== null && _c !== void 0 ? _c : 0;
return message;
},
};
function createBaseResponseMetadata() {
return { trackingId: "", serverTime: undefined };
}
exports.ResponseMetadata = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.trackingId !== "") {
writer.uint32(338).string(message.trackingId);
}
if (message.serverTime !== undefined) {
timestamp_1.Timestamp.encode(toTimestamp(message.serverTime), writer.uint32(346).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseResponseMetadata();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 42: {
if (tag !== 338) {
break;
}
message.trackingId = reader.string();
continue;
}
case 43: {
if (tag !== 346) {
break;
}
message.serverTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
trackingId: isSet(object.trackingId) ? globalThis.String(object.trackingId) : "",
serverTime: isSet(object.serverTime) ? fromJsonTimestamp(object.serverTime) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.trackingId !== "") {
obj.trackingId = message.trackingId;
}
if (message.serverTime !== undefined) {
obj.serverTime = message.serverTime.toISOString();
}
return obj;
},
create(base) {
return exports.ResponseMetadata.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseResponseMetadata();
message.trackingId = (_a = object.trackingId) !== null && _a !== void 0 ? _a : "";
message.serverTime = (_b = object.serverTime) !== null && _b !== void 0 ? _b : undefined;
return message;
},
};
function createBaseBrandData() {
return { logoName: "", logoBaseColor: "", textColor: "" };
}
exports.BrandData = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.logoName !== "") {
writer.uint32(10).string(message.logoName);
}
if (message.logoBaseColor !== "") {
writer.uint32(18).string(message.logoBaseColor);
}
if (message.textColor !== "") {
writer.uint32(26).string(message.textColor);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseBrandData();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.logoName = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.logoBaseColor = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.textColor = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
logoName: isSet(object.logoName) ? globalThis.String(object.logoName) : "",
logoBaseColor: isSet(object.logoBaseColor) ? globalThis.String(object.logoBaseColor) : "",
textColor: isSet(object.textColor) ? globalThis.String(object.textColor) : "",
};
},
toJSON(message) {
const obj = {};
if (message.logoName !== "") {
obj.logoName = message.logoName;
}
if (message.logoBaseColor !== "") {
obj.logoBaseColor = message.logoBaseColor;
}
if (message.textColor !== "") {
obj.textColor = message.textColor;
}
return obj;
},
create(base) {
return exports.BrandData.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseBrandData();
message.logoName = (_a = object.logoName) !== null && _a !== void 0 ? _a : "";
message.logoBaseColor = (_b = object.logoBaseColor) !== null && _b !== void 0 ? _b : "";
message.textColor = (_c = object.textColor) !== null && _c !== void 0 ? _c : "";
return message;
},
};
function createBaseErrorDetail() {
return { code: "", message: "" };
}
exports.ErrorDetail = {
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.code !== "") {
writer.uint32(10).string(message.code);
}
if (message.message !== "") {
writer.uint32(26).string(message.message);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseErrorDetail();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.code = reader.string();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.message = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
code: isSet(object.code) ? globalThis.String(object.code) : "",
message: isSet(object.message) ? globalThis.String(object.message) : "",
};
},
toJSON(message) {
const obj = {};
if (message.code !== "") {
obj.code = message.code;
}
if (message.message !== "") {
obj.message = message.message;
}
return obj;
},
create(base) {
return exports.ErrorDetail.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseErrorDetail();
message.code = (_a = object.code) !== null && _a !== void 0 ? _a : "";
message.message = (_b = object.message) !== null && _b !== void 0 ? _b : "";
return message;
},
};
function toTimestamp(date) {
const seconds = Math.trunc(date.getTime() / 1000);
const nanos = (date.getTime() % 1000) * 1000000;
return { seconds, nanos };
}
function fromTimestamp(t) {
let millis = (t.seconds || 0) * 1000;
millis += (t.nanos || 0) / 1000000;
return new globalThis.Date(millis);
}
function fromJsonTimestamp(o) {
if (o instanceof globalThis.Date) {
return o;
}
else if (typeof o === "string") {
return new globalThis.Date(o);
}
else {
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
}
}
function longToNumber(int64) {
const num = globalThis.Number(int64.toString());
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
}
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
}
return num;
}
function isSet(value) {
return value !== null && value !== undefined;
}
//# sourceMappingURL=common.js.map