diff --git a/.gitignore b/.gitignore index 9c9e6a9f..888c0be6 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,3 @@ packages/ibkr/ref/source/cppclient/ packages/ibkr/ref/samples/Java/ packages/ibkr/ref/samples/Cpp/ packages/ibkr/ref/CMakeLists.txt -packages/ibkr/src/protobuf/ diff --git a/README.md b/README.md index 20da37cd..9737831e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ Your one-person Wall Street. Alice is an AI trading agent that gives you your ow Open Alice Preview

+> [!CAUTION] +> **Open Alice is experimental software in active development.** Many features and interfaces are incomplete and subject to breaking changes. Do not use this software for live trading with real funds unless you fully understand and accept the risks involved. The authors provide no guarantees of correctness, reliability, or profitability, and accept no liability for financial losses. + ## Features - **Multi-provider AI** — switch between Claude Code CLI, Vercel AI SDK, and Agent SDK at runtime, no restart needed diff --git a/packages/ibkr/src/protobuf/AccountDataEnd.ts b/packages/ibkr/src/protobuf/AccountDataEnd.ts new file mode 100644 index 00000000..b2246df6 --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountDataEnd.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountDataEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountDataEnd { + accountName?: string | undefined; +} + +function createBaseAccountDataEnd(): AccountDataEnd { + return { accountName: undefined }; +} + +export const AccountDataEnd: MessageFns = { + encode(message: AccountDataEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.accountName !== undefined) { + writer.uint32(10).string(message.accountName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountDataEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountDataEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.accountName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountDataEnd { + return { accountName: isSet(object.accountName) ? globalThis.String(object.accountName) : undefined }; + }, + + toJSON(message: AccountDataEnd): unknown { + const obj: any = {}; + if (message.accountName !== undefined) { + obj.accountName = message.accountName; + } + return obj; + }, + + create(base?: DeepPartial): AccountDataEnd { + return AccountDataEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountDataEnd { + const message = createBaseAccountDataEnd(); + message.accountName = object.accountName ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountDataRequest.ts b/packages/ibkr/src/protobuf/AccountDataRequest.ts new file mode 100644 index 00000000..b5f30b13 --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountDataRequest.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountDataRequest { + subscribe?: boolean | undefined; + acctCode?: string | undefined; +} + +function createBaseAccountDataRequest(): AccountDataRequest { + return { subscribe: undefined, acctCode: undefined }; +} + +export const AccountDataRequest: MessageFns = { + encode(message: AccountDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.subscribe !== undefined) { + writer.uint32(8).bool(message.subscribe); + } + if (message.acctCode !== undefined) { + writer.uint32(18).string(message.acctCode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.subscribe = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.acctCode = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountDataRequest { + return { + subscribe: isSet(object.subscribe) ? globalThis.Boolean(object.subscribe) : undefined, + acctCode: isSet(object.acctCode) ? globalThis.String(object.acctCode) : undefined, + }; + }, + + toJSON(message: AccountDataRequest): unknown { + const obj: any = {}; + if (message.subscribe !== undefined) { + obj.subscribe = message.subscribe; + } + if (message.acctCode !== undefined) { + obj.acctCode = message.acctCode; + } + return obj; + }, + + create(base?: DeepPartial): AccountDataRequest { + return AccountDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountDataRequest { + const message = createBaseAccountDataRequest(); + message.subscribe = object.subscribe ?? undefined; + message.acctCode = object.acctCode ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountSummary.ts b/packages/ibkr/src/protobuf/AccountSummary.ts new file mode 100644 index 00000000..d6938037 --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountSummary.ts @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountSummary.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountSummary { + reqId?: number | undefined; + account?: string | undefined; + tag?: string | undefined; + value?: string | undefined; + currency?: string | undefined; +} + +function createBaseAccountSummary(): AccountSummary { + return { reqId: undefined, account: undefined, tag: undefined, value: undefined, currency: undefined }; +} + +export const AccountSummary: MessageFns = { + encode(message: AccountSummary, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.account !== undefined) { + writer.uint32(18).string(message.account); + } + if (message.tag !== undefined) { + writer.uint32(26).string(message.tag); + } + if (message.value !== undefined) { + writer.uint32(34).string(message.value); + } + if (message.currency !== undefined) { + writer.uint32(42).string(message.currency); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountSummary { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountSummary(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.account = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.tag = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.value = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.currency = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountSummary { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + tag: isSet(object.tag) ? globalThis.String(object.tag) : undefined, + value: isSet(object.value) ? globalThis.String(object.value) : undefined, + currency: isSet(object.currency) ? globalThis.String(object.currency) : undefined, + }; + }, + + toJSON(message: AccountSummary): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.tag !== undefined) { + obj.tag = message.tag; + } + if (message.value !== undefined) { + obj.value = message.value; + } + if (message.currency !== undefined) { + obj.currency = message.currency; + } + return obj; + }, + + create(base?: DeepPartial): AccountSummary { + return AccountSummary.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountSummary { + const message = createBaseAccountSummary(); + message.reqId = object.reqId ?? undefined; + message.account = object.account ?? undefined; + message.tag = object.tag ?? undefined; + message.value = object.value ?? undefined; + message.currency = object.currency ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountSummaryEnd.ts b/packages/ibkr/src/protobuf/AccountSummaryEnd.ts new file mode 100644 index 00000000..71be69d1 --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountSummaryEnd.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountSummaryEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountSummaryEnd { + reqId?: number | undefined; +} + +function createBaseAccountSummaryEnd(): AccountSummaryEnd { + return { reqId: undefined }; +} + +export const AccountSummaryEnd: MessageFns = { + encode(message: AccountSummaryEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountSummaryEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountSummaryEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountSummaryEnd { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: AccountSummaryEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): AccountSummaryEnd { + return AccountSummaryEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountSummaryEnd { + const message = createBaseAccountSummaryEnd(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountSummaryRequest.ts b/packages/ibkr/src/protobuf/AccountSummaryRequest.ts new file mode 100644 index 00000000..21669fda --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountSummaryRequest.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountSummaryRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountSummaryRequest { + reqId?: number | undefined; + group?: string | undefined; + tags?: string | undefined; +} + +function createBaseAccountSummaryRequest(): AccountSummaryRequest { + return { reqId: undefined, group: undefined, tags: undefined }; +} + +export const AccountSummaryRequest: MessageFns = { + encode(message: AccountSummaryRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.group !== undefined) { + writer.uint32(18).string(message.group); + } + if (message.tags !== undefined) { + writer.uint32(26).string(message.tags); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountSummaryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountSummaryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.group = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.tags = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountSummaryRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + group: isSet(object.group) ? globalThis.String(object.group) : undefined, + tags: isSet(object.tags) ? globalThis.String(object.tags) : undefined, + }; + }, + + toJSON(message: AccountSummaryRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.group !== undefined) { + obj.group = message.group; + } + if (message.tags !== undefined) { + obj.tags = message.tags; + } + return obj; + }, + + create(base?: DeepPartial): AccountSummaryRequest { + return AccountSummaryRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountSummaryRequest { + const message = createBaseAccountSummaryRequest(); + message.reqId = object.reqId ?? undefined; + message.group = object.group ?? undefined; + message.tags = object.tags ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountUpdateMulti.ts b/packages/ibkr/src/protobuf/AccountUpdateMulti.ts new file mode 100644 index 00000000..99c418e8 --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountUpdateMulti.ts @@ -0,0 +1,187 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountUpdateMulti.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountUpdateMulti { + reqId?: number | undefined; + account?: string | undefined; + modelCode?: string | undefined; + key?: string | undefined; + value?: string | undefined; + currency?: string | undefined; +} + +function createBaseAccountUpdateMulti(): AccountUpdateMulti { + return { + reqId: undefined, + account: undefined, + modelCode: undefined, + key: undefined, + value: undefined, + currency: undefined, + }; +} + +export const AccountUpdateMulti: MessageFns = { + encode(message: AccountUpdateMulti, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.account !== undefined) { + writer.uint32(18).string(message.account); + } + if (message.modelCode !== undefined) { + writer.uint32(26).string(message.modelCode); + } + if (message.key !== undefined) { + writer.uint32(34).string(message.key); + } + if (message.value !== undefined) { + writer.uint32(42).string(message.value); + } + if (message.currency !== undefined) { + writer.uint32(50).string(message.currency); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountUpdateMulti { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUpdateMulti(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.account = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.modelCode = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.key = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.value = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.currency = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountUpdateMulti { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + modelCode: isSet(object.modelCode) ? globalThis.String(object.modelCode) : undefined, + key: isSet(object.key) ? globalThis.String(object.key) : undefined, + value: isSet(object.value) ? globalThis.String(object.value) : undefined, + currency: isSet(object.currency) ? globalThis.String(object.currency) : undefined, + }; + }, + + toJSON(message: AccountUpdateMulti): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.modelCode !== undefined) { + obj.modelCode = message.modelCode; + } + if (message.key !== undefined) { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + if (message.currency !== undefined) { + obj.currency = message.currency; + } + return obj; + }, + + create(base?: DeepPartial): AccountUpdateMulti { + return AccountUpdateMulti.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountUpdateMulti { + const message = createBaseAccountUpdateMulti(); + message.reqId = object.reqId ?? undefined; + message.account = object.account ?? undefined; + message.modelCode = object.modelCode ?? undefined; + message.key = object.key ?? undefined; + message.value = object.value ?? undefined; + message.currency = object.currency ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountUpdateMultiEnd.ts b/packages/ibkr/src/protobuf/AccountUpdateMultiEnd.ts new file mode 100644 index 00000000..13b388e7 --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountUpdateMultiEnd.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountUpdateMultiEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountUpdateMultiEnd { + reqId?: number | undefined; +} + +function createBaseAccountUpdateMultiEnd(): AccountUpdateMultiEnd { + return { reqId: undefined }; +} + +export const AccountUpdateMultiEnd: MessageFns = { + encode(message: AccountUpdateMultiEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountUpdateMultiEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUpdateMultiEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountUpdateMultiEnd { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: AccountUpdateMultiEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): AccountUpdateMultiEnd { + return AccountUpdateMultiEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountUpdateMultiEnd { + const message = createBaseAccountUpdateMultiEnd(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountUpdateTime.ts b/packages/ibkr/src/protobuf/AccountUpdateTime.ts new file mode 100644 index 00000000..309b7f07 --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountUpdateTime.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountUpdateTime.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountUpdateTime { + timeStamp?: string | undefined; +} + +function createBaseAccountUpdateTime(): AccountUpdateTime { + return { timeStamp: undefined }; +} + +export const AccountUpdateTime: MessageFns = { + encode(message: AccountUpdateTime, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.timeStamp !== undefined) { + writer.uint32(10).string(message.timeStamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountUpdateTime { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUpdateTime(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.timeStamp = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountUpdateTime { + return { timeStamp: isSet(object.timeStamp) ? globalThis.String(object.timeStamp) : undefined }; + }, + + toJSON(message: AccountUpdateTime): unknown { + const obj: any = {}; + if (message.timeStamp !== undefined) { + obj.timeStamp = message.timeStamp; + } + return obj; + }, + + create(base?: DeepPartial): AccountUpdateTime { + return AccountUpdateTime.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountUpdateTime { + const message = createBaseAccountUpdateTime(); + message.timeStamp = object.timeStamp ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountUpdatesMultiRequest.ts b/packages/ibkr/src/protobuf/AccountUpdatesMultiRequest.ts new file mode 100644 index 00000000..ef6f3c88 --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountUpdatesMultiRequest.ts @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountUpdatesMultiRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountUpdatesMultiRequest { + reqId?: number | undefined; + account?: string | undefined; + modelCode?: string | undefined; + ledgerAndNLV?: boolean | undefined; +} + +function createBaseAccountUpdatesMultiRequest(): AccountUpdatesMultiRequest { + return { reqId: undefined, account: undefined, modelCode: undefined, ledgerAndNLV: undefined }; +} + +export const AccountUpdatesMultiRequest: MessageFns = { + encode(message: AccountUpdatesMultiRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.account !== undefined) { + writer.uint32(18).string(message.account); + } + if (message.modelCode !== undefined) { + writer.uint32(26).string(message.modelCode); + } + if (message.ledgerAndNLV !== undefined) { + writer.uint32(32).bool(message.ledgerAndNLV); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountUpdatesMultiRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountUpdatesMultiRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.account = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.modelCode = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.ledgerAndNLV = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountUpdatesMultiRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + modelCode: isSet(object.modelCode) ? globalThis.String(object.modelCode) : undefined, + ledgerAndNLV: isSet(object.ledgerAndNLV) ? globalThis.Boolean(object.ledgerAndNLV) : undefined, + }; + }, + + toJSON(message: AccountUpdatesMultiRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.modelCode !== undefined) { + obj.modelCode = message.modelCode; + } + if (message.ledgerAndNLV !== undefined) { + obj.ledgerAndNLV = message.ledgerAndNLV; + } + return obj; + }, + + create(base?: DeepPartial): AccountUpdatesMultiRequest { + return AccountUpdatesMultiRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountUpdatesMultiRequest { + const message = createBaseAccountUpdatesMultiRequest(); + message.reqId = object.reqId ?? undefined; + message.account = object.account ?? undefined; + message.modelCode = object.modelCode ?? undefined; + message.ledgerAndNLV = object.ledgerAndNLV ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AccountValue.ts b/packages/ibkr/src/protobuf/AccountValue.ts new file mode 100644 index 00000000..c5e65abb --- /dev/null +++ b/packages/ibkr/src/protobuf/AccountValue.ts @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AccountValue.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AccountValue { + key?: string | undefined; + value?: string | undefined; + currency?: string | undefined; + accountName?: string | undefined; +} + +function createBaseAccountValue(): AccountValue { + return { key: undefined, value: undefined, currency: undefined, accountName: undefined }; +} + +export const AccountValue: MessageFns = { + encode(message: AccountValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== undefined) { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + writer.uint32(18).string(message.value); + } + if (message.currency !== undefined) { + writer.uint32(26).string(message.currency); + } + if (message.accountName !== undefined) { + writer.uint32(34).string(message.accountName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AccountValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.currency = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.accountName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AccountValue { + return { + key: isSet(object.key) ? globalThis.String(object.key) : undefined, + value: isSet(object.value) ? globalThis.String(object.value) : undefined, + currency: isSet(object.currency) ? globalThis.String(object.currency) : undefined, + accountName: isSet(object.accountName) ? globalThis.String(object.accountName) : undefined, + }; + }, + + toJSON(message: AccountValue): unknown { + const obj: any = {}; + if (message.key !== undefined) { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + if (message.currency !== undefined) { + obj.currency = message.currency; + } + if (message.accountName !== undefined) { + obj.accountName = message.accountName; + } + return obj; + }, + + create(base?: DeepPartial): AccountValue { + return AccountValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AccountValue { + const message = createBaseAccountValue(); + message.key = object.key ?? undefined; + message.value = object.value ?? undefined; + message.currency = object.currency ?? undefined; + message.accountName = object.accountName ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AllOpenOrdersRequest.ts b/packages/ibkr/src/protobuf/AllOpenOrdersRequest.ts new file mode 100644 index 00000000..abf7833b --- /dev/null +++ b/packages/ibkr/src/protobuf/AllOpenOrdersRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AllOpenOrdersRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface AllOpenOrdersRequest { +} + +function createBaseAllOpenOrdersRequest(): AllOpenOrdersRequest { + return {}; +} + +export const AllOpenOrdersRequest: MessageFns = { + encode(_: AllOpenOrdersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AllOpenOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllOpenOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): AllOpenOrdersRequest { + return {}; + }, + + toJSON(_: AllOpenOrdersRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): AllOpenOrdersRequest { + return AllOpenOrdersRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): AllOpenOrdersRequest { + const message = createBaseAllOpenOrdersRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ApiConfig.ts b/packages/ibkr/src/protobuf/ApiConfig.ts new file mode 100644 index 00000000..b4b28262 --- /dev/null +++ b/packages/ibkr/src/protobuf/ApiConfig.ts @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ApiConfig.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { ApiPrecautionsConfig } from "./ApiPrecautionsConfig"; +import { ApiSettingsConfig } from "./ApiSettingsConfig"; + +export const protobufPackage = "protobuf"; + +export interface ApiConfig { + precautions?: ApiPrecautionsConfig | undefined; + settings?: ApiSettingsConfig | undefined; +} + +function createBaseApiConfig(): ApiConfig { + return { precautions: undefined, settings: undefined }; +} + +export const ApiConfig: MessageFns = { + encode(message: ApiConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.precautions !== undefined) { + ApiPrecautionsConfig.encode(message.precautions, writer.uint32(10).fork()).join(); + } + if (message.settings !== undefined) { + ApiSettingsConfig.encode(message.settings, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ApiConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseApiConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.precautions = ApiPrecautionsConfig.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.settings = ApiSettingsConfig.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ApiConfig { + return { + precautions: isSet(object.precautions) ? ApiPrecautionsConfig.fromJSON(object.precautions) : undefined, + settings: isSet(object.settings) ? ApiSettingsConfig.fromJSON(object.settings) : undefined, + }; + }, + + toJSON(message: ApiConfig): unknown { + const obj: any = {}; + if (message.precautions !== undefined) { + obj.precautions = ApiPrecautionsConfig.toJSON(message.precautions); + } + if (message.settings !== undefined) { + obj.settings = ApiSettingsConfig.toJSON(message.settings); + } + return obj; + }, + + create(base?: DeepPartial): ApiConfig { + return ApiConfig.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ApiConfig { + const message = createBaseApiConfig(); + message.precautions = (object.precautions !== undefined && object.precautions !== null) + ? ApiPrecautionsConfig.fromPartial(object.precautions) + : undefined; + message.settings = (object.settings !== undefined && object.settings !== null) + ? ApiSettingsConfig.fromPartial(object.settings) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ApiPrecautionsConfig.ts b/packages/ibkr/src/protobuf/ApiPrecautionsConfig.ts new file mode 100644 index 00000000..84bf96be --- /dev/null +++ b/packages/ibkr/src/protobuf/ApiPrecautionsConfig.ts @@ -0,0 +1,277 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ApiPrecautionsConfig.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ApiPrecautionsConfig { + bypassOrderPrecautions?: boolean | undefined; + bypassBondWarning?: boolean | undefined; + bypassNegativeYieldConfirmation?: boolean | undefined; + bypassCalledBondWarning?: boolean | undefined; + bypassSameActionPairTradeWarning?: boolean | undefined; + bypassFlaggedAccountsWarning?: boolean | undefined; + bypassPriceBasedVolatilityWarning?: boolean | undefined; + bypassRedirectOrderWarning?: boolean | undefined; + bypassNoOverfillProtection?: boolean | undefined; + bypassRouteMarketableToBBO?: boolean | undefined; +} + +function createBaseApiPrecautionsConfig(): ApiPrecautionsConfig { + return { + bypassOrderPrecautions: undefined, + bypassBondWarning: undefined, + bypassNegativeYieldConfirmation: undefined, + bypassCalledBondWarning: undefined, + bypassSameActionPairTradeWarning: undefined, + bypassFlaggedAccountsWarning: undefined, + bypassPriceBasedVolatilityWarning: undefined, + bypassRedirectOrderWarning: undefined, + bypassNoOverfillProtection: undefined, + bypassRouteMarketableToBBO: undefined, + }; +} + +export const ApiPrecautionsConfig: MessageFns = { + encode(message: ApiPrecautionsConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bypassOrderPrecautions !== undefined) { + writer.uint32(8).bool(message.bypassOrderPrecautions); + } + if (message.bypassBondWarning !== undefined) { + writer.uint32(16).bool(message.bypassBondWarning); + } + if (message.bypassNegativeYieldConfirmation !== undefined) { + writer.uint32(24).bool(message.bypassNegativeYieldConfirmation); + } + if (message.bypassCalledBondWarning !== undefined) { + writer.uint32(32).bool(message.bypassCalledBondWarning); + } + if (message.bypassSameActionPairTradeWarning !== undefined) { + writer.uint32(40).bool(message.bypassSameActionPairTradeWarning); + } + if (message.bypassFlaggedAccountsWarning !== undefined) { + writer.uint32(48).bool(message.bypassFlaggedAccountsWarning); + } + if (message.bypassPriceBasedVolatilityWarning !== undefined) { + writer.uint32(56).bool(message.bypassPriceBasedVolatilityWarning); + } + if (message.bypassRedirectOrderWarning !== undefined) { + writer.uint32(64).bool(message.bypassRedirectOrderWarning); + } + if (message.bypassNoOverfillProtection !== undefined) { + writer.uint32(72).bool(message.bypassNoOverfillProtection); + } + if (message.bypassRouteMarketableToBBO !== undefined) { + writer.uint32(80).bool(message.bypassRouteMarketableToBBO); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ApiPrecautionsConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseApiPrecautionsConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.bypassOrderPrecautions = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.bypassBondWarning = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.bypassNegativeYieldConfirmation = reader.bool(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.bypassCalledBondWarning = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.bypassSameActionPairTradeWarning = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.bypassFlaggedAccountsWarning = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.bypassPriceBasedVolatilityWarning = reader.bool(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.bypassRedirectOrderWarning = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.bypassNoOverfillProtection = reader.bool(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.bypassRouteMarketableToBBO = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ApiPrecautionsConfig { + return { + bypassOrderPrecautions: isSet(object.bypassOrderPrecautions) + ? globalThis.Boolean(object.bypassOrderPrecautions) + : undefined, + bypassBondWarning: isSet(object.bypassBondWarning) ? globalThis.Boolean(object.bypassBondWarning) : undefined, + bypassNegativeYieldConfirmation: isSet(object.bypassNegativeYieldConfirmation) + ? globalThis.Boolean(object.bypassNegativeYieldConfirmation) + : undefined, + bypassCalledBondWarning: isSet(object.bypassCalledBondWarning) + ? globalThis.Boolean(object.bypassCalledBondWarning) + : undefined, + bypassSameActionPairTradeWarning: isSet(object.bypassSameActionPairTradeWarning) + ? globalThis.Boolean(object.bypassSameActionPairTradeWarning) + : undefined, + bypassFlaggedAccountsWarning: isSet(object.bypassFlaggedAccountsWarning) + ? globalThis.Boolean(object.bypassFlaggedAccountsWarning) + : undefined, + bypassPriceBasedVolatilityWarning: isSet(object.bypassPriceBasedVolatilityWarning) + ? globalThis.Boolean(object.bypassPriceBasedVolatilityWarning) + : undefined, + bypassRedirectOrderWarning: isSet(object.bypassRedirectOrderWarning) + ? globalThis.Boolean(object.bypassRedirectOrderWarning) + : undefined, + bypassNoOverfillProtection: isSet(object.bypassNoOverfillProtection) + ? globalThis.Boolean(object.bypassNoOverfillProtection) + : undefined, + bypassRouteMarketableToBBO: isSet(object.bypassRouteMarketableToBBO) + ? globalThis.Boolean(object.bypassRouteMarketableToBBO) + : undefined, + }; + }, + + toJSON(message: ApiPrecautionsConfig): unknown { + const obj: any = {}; + if (message.bypassOrderPrecautions !== undefined) { + obj.bypassOrderPrecautions = message.bypassOrderPrecautions; + } + if (message.bypassBondWarning !== undefined) { + obj.bypassBondWarning = message.bypassBondWarning; + } + if (message.bypassNegativeYieldConfirmation !== undefined) { + obj.bypassNegativeYieldConfirmation = message.bypassNegativeYieldConfirmation; + } + if (message.bypassCalledBondWarning !== undefined) { + obj.bypassCalledBondWarning = message.bypassCalledBondWarning; + } + if (message.bypassSameActionPairTradeWarning !== undefined) { + obj.bypassSameActionPairTradeWarning = message.bypassSameActionPairTradeWarning; + } + if (message.bypassFlaggedAccountsWarning !== undefined) { + obj.bypassFlaggedAccountsWarning = message.bypassFlaggedAccountsWarning; + } + if (message.bypassPriceBasedVolatilityWarning !== undefined) { + obj.bypassPriceBasedVolatilityWarning = message.bypassPriceBasedVolatilityWarning; + } + if (message.bypassRedirectOrderWarning !== undefined) { + obj.bypassRedirectOrderWarning = message.bypassRedirectOrderWarning; + } + if (message.bypassNoOverfillProtection !== undefined) { + obj.bypassNoOverfillProtection = message.bypassNoOverfillProtection; + } + if (message.bypassRouteMarketableToBBO !== undefined) { + obj.bypassRouteMarketableToBBO = message.bypassRouteMarketableToBBO; + } + return obj; + }, + + create(base?: DeepPartial): ApiPrecautionsConfig { + return ApiPrecautionsConfig.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ApiPrecautionsConfig { + const message = createBaseApiPrecautionsConfig(); + message.bypassOrderPrecautions = object.bypassOrderPrecautions ?? undefined; + message.bypassBondWarning = object.bypassBondWarning ?? undefined; + message.bypassNegativeYieldConfirmation = object.bypassNegativeYieldConfirmation ?? undefined; + message.bypassCalledBondWarning = object.bypassCalledBondWarning ?? undefined; + message.bypassSameActionPairTradeWarning = object.bypassSameActionPairTradeWarning ?? undefined; + message.bypassFlaggedAccountsWarning = object.bypassFlaggedAccountsWarning ?? undefined; + message.bypassPriceBasedVolatilityWarning = object.bypassPriceBasedVolatilityWarning ?? undefined; + message.bypassRedirectOrderWarning = object.bypassRedirectOrderWarning ?? undefined; + message.bypassNoOverfillProtection = object.bypassNoOverfillProtection ?? undefined; + message.bypassRouteMarketableToBBO = object.bypassRouteMarketableToBBO ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ApiSettingsConfig.ts b/packages/ibkr/src/protobuf/ApiSettingsConfig.ts new file mode 100644 index 00000000..530c9de0 --- /dev/null +++ b/packages/ibkr/src/protobuf/ApiSettingsConfig.ts @@ -0,0 +1,787 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ApiSettingsConfig.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ApiSettingsConfig { + readOnlyApi?: boolean | undefined; + totalQuantityForMutualFunds?: boolean | undefined; + downloadOpenOrdersOnConnection?: boolean | undefined; + includeVirtualFxPositions?: boolean | undefined; + prepareDailyPnL?: boolean | undefined; + sendStatusUpdatesForVolatilityOrders?: boolean | undefined; + encodeApiMessages?: string | undefined; + socketPort?: number | undefined; + useNegativeAutoRange?: boolean | undefined; + createApiMessageLogFile?: boolean | undefined; + includeMarketDataInLogFile?: boolean | undefined; + exposeTradingScheduleToApi?: boolean | undefined; + splitInsuredDepositFromCashBalance?: boolean | undefined; + sendZeroPositionsForTodayOnly?: boolean | undefined; + letApiAccountRequestsSwitchSubscription?: boolean | undefined; + useAccountGroupsWithAllocationMethods?: boolean | undefined; + loggingLevel?: string | undefined; + masterClientId?: number | undefined; + bulkDataTimeout?: number | undefined; + componentExchSeparator?: string | undefined; + showForexDataIn110Pips?: boolean | undefined; + allowForexTradingIn110Pips?: boolean | undefined; + roundAccountValuesToNearestWholeNumber?: boolean | undefined; + sendMarketDataInLotsForUsStocks?: boolean | undefined; + showAdvancedOrderRejectInUi?: boolean | undefined; + rejectMessagesAboveMaxRate?: boolean | undefined; + maintainConnectionOnIncorrectFields?: boolean | undefined; + compatibilityModeNasdaqStocks?: boolean | undefined; + sendInstrumentTimezone?: string | undefined; + sendForexDataInCompatibilityMode?: boolean | undefined; + maintainAndResubmitOrdersOnReconnect?: boolean | undefined; + historicalDataMaxSize?: number | undefined; + autoReportNettingEventContractTrades?: boolean | undefined; + optionExerciseRequestType?: string | undefined; + allowLocalhostOnly?: boolean | undefined; + trustedIPs: string[]; +} + +function createBaseApiSettingsConfig(): ApiSettingsConfig { + return { + readOnlyApi: undefined, + totalQuantityForMutualFunds: undefined, + downloadOpenOrdersOnConnection: undefined, + includeVirtualFxPositions: undefined, + prepareDailyPnL: undefined, + sendStatusUpdatesForVolatilityOrders: undefined, + encodeApiMessages: undefined, + socketPort: undefined, + useNegativeAutoRange: undefined, + createApiMessageLogFile: undefined, + includeMarketDataInLogFile: undefined, + exposeTradingScheduleToApi: undefined, + splitInsuredDepositFromCashBalance: undefined, + sendZeroPositionsForTodayOnly: undefined, + letApiAccountRequestsSwitchSubscription: undefined, + useAccountGroupsWithAllocationMethods: undefined, + loggingLevel: undefined, + masterClientId: undefined, + bulkDataTimeout: undefined, + componentExchSeparator: undefined, + showForexDataIn110Pips: undefined, + allowForexTradingIn110Pips: undefined, + roundAccountValuesToNearestWholeNumber: undefined, + sendMarketDataInLotsForUsStocks: undefined, + showAdvancedOrderRejectInUi: undefined, + rejectMessagesAboveMaxRate: undefined, + maintainConnectionOnIncorrectFields: undefined, + compatibilityModeNasdaqStocks: undefined, + sendInstrumentTimezone: undefined, + sendForexDataInCompatibilityMode: undefined, + maintainAndResubmitOrdersOnReconnect: undefined, + historicalDataMaxSize: undefined, + autoReportNettingEventContractTrades: undefined, + optionExerciseRequestType: undefined, + allowLocalhostOnly: undefined, + trustedIPs: [], + }; +} + +export const ApiSettingsConfig: MessageFns = { + encode(message: ApiSettingsConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.readOnlyApi !== undefined) { + writer.uint32(8).bool(message.readOnlyApi); + } + if (message.totalQuantityForMutualFunds !== undefined) { + writer.uint32(16).bool(message.totalQuantityForMutualFunds); + } + if (message.downloadOpenOrdersOnConnection !== undefined) { + writer.uint32(24).bool(message.downloadOpenOrdersOnConnection); + } + if (message.includeVirtualFxPositions !== undefined) { + writer.uint32(32).bool(message.includeVirtualFxPositions); + } + if (message.prepareDailyPnL !== undefined) { + writer.uint32(40).bool(message.prepareDailyPnL); + } + if (message.sendStatusUpdatesForVolatilityOrders !== undefined) { + writer.uint32(48).bool(message.sendStatusUpdatesForVolatilityOrders); + } + if (message.encodeApiMessages !== undefined) { + writer.uint32(58).string(message.encodeApiMessages); + } + if (message.socketPort !== undefined) { + writer.uint32(64).int32(message.socketPort); + } + if (message.useNegativeAutoRange !== undefined) { + writer.uint32(72).bool(message.useNegativeAutoRange); + } + if (message.createApiMessageLogFile !== undefined) { + writer.uint32(80).bool(message.createApiMessageLogFile); + } + if (message.includeMarketDataInLogFile !== undefined) { + writer.uint32(88).bool(message.includeMarketDataInLogFile); + } + if (message.exposeTradingScheduleToApi !== undefined) { + writer.uint32(96).bool(message.exposeTradingScheduleToApi); + } + if (message.splitInsuredDepositFromCashBalance !== undefined) { + writer.uint32(104).bool(message.splitInsuredDepositFromCashBalance); + } + if (message.sendZeroPositionsForTodayOnly !== undefined) { + writer.uint32(112).bool(message.sendZeroPositionsForTodayOnly); + } + if (message.letApiAccountRequestsSwitchSubscription !== undefined) { + writer.uint32(120).bool(message.letApiAccountRequestsSwitchSubscription); + } + if (message.useAccountGroupsWithAllocationMethods !== undefined) { + writer.uint32(128).bool(message.useAccountGroupsWithAllocationMethods); + } + if (message.loggingLevel !== undefined) { + writer.uint32(138).string(message.loggingLevel); + } + if (message.masterClientId !== undefined) { + writer.uint32(144).int32(message.masterClientId); + } + if (message.bulkDataTimeout !== undefined) { + writer.uint32(152).int32(message.bulkDataTimeout); + } + if (message.componentExchSeparator !== undefined) { + writer.uint32(162).string(message.componentExchSeparator); + } + if (message.showForexDataIn110Pips !== undefined) { + writer.uint32(168).bool(message.showForexDataIn110Pips); + } + if (message.allowForexTradingIn110Pips !== undefined) { + writer.uint32(176).bool(message.allowForexTradingIn110Pips); + } + if (message.roundAccountValuesToNearestWholeNumber !== undefined) { + writer.uint32(184).bool(message.roundAccountValuesToNearestWholeNumber); + } + if (message.sendMarketDataInLotsForUsStocks !== undefined) { + writer.uint32(192).bool(message.sendMarketDataInLotsForUsStocks); + } + if (message.showAdvancedOrderRejectInUi !== undefined) { + writer.uint32(200).bool(message.showAdvancedOrderRejectInUi); + } + if (message.rejectMessagesAboveMaxRate !== undefined) { + writer.uint32(208).bool(message.rejectMessagesAboveMaxRate); + } + if (message.maintainConnectionOnIncorrectFields !== undefined) { + writer.uint32(216).bool(message.maintainConnectionOnIncorrectFields); + } + if (message.compatibilityModeNasdaqStocks !== undefined) { + writer.uint32(224).bool(message.compatibilityModeNasdaqStocks); + } + if (message.sendInstrumentTimezone !== undefined) { + writer.uint32(234).string(message.sendInstrumentTimezone); + } + if (message.sendForexDataInCompatibilityMode !== undefined) { + writer.uint32(240).bool(message.sendForexDataInCompatibilityMode); + } + if (message.maintainAndResubmitOrdersOnReconnect !== undefined) { + writer.uint32(248).bool(message.maintainAndResubmitOrdersOnReconnect); + } + if (message.historicalDataMaxSize !== undefined) { + writer.uint32(256).int32(message.historicalDataMaxSize); + } + if (message.autoReportNettingEventContractTrades !== undefined) { + writer.uint32(264).bool(message.autoReportNettingEventContractTrades); + } + if (message.optionExerciseRequestType !== undefined) { + writer.uint32(274).string(message.optionExerciseRequestType); + } + if (message.allowLocalhostOnly !== undefined) { + writer.uint32(280).bool(message.allowLocalhostOnly); + } + for (const v of message.trustedIPs) { + writer.uint32(290).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ApiSettingsConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseApiSettingsConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.readOnlyApi = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.totalQuantityForMutualFunds = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.downloadOpenOrdersOnConnection = reader.bool(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.includeVirtualFxPositions = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.prepareDailyPnL = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.sendStatusUpdatesForVolatilityOrders = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.encodeApiMessages = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.socketPort = reader.int32(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.useNegativeAutoRange = reader.bool(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.createApiMessageLogFile = reader.bool(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.includeMarketDataInLogFile = reader.bool(); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.exposeTradingScheduleToApi = reader.bool(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.splitInsuredDepositFromCashBalance = reader.bool(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.sendZeroPositionsForTodayOnly = reader.bool(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.letApiAccountRequestsSwitchSubscription = reader.bool(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.useAccountGroupsWithAllocationMethods = reader.bool(); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + + message.loggingLevel = reader.string(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.masterClientId = reader.int32(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.bulkDataTimeout = reader.int32(); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + + message.componentExchSeparator = reader.string(); + continue; + } + case 21: { + if (tag !== 168) { + break; + } + + message.showForexDataIn110Pips = reader.bool(); + continue; + } + case 22: { + if (tag !== 176) { + break; + } + + message.allowForexTradingIn110Pips = reader.bool(); + continue; + } + case 23: { + if (tag !== 184) { + break; + } + + message.roundAccountValuesToNearestWholeNumber = reader.bool(); + continue; + } + case 24: { + if (tag !== 192) { + break; + } + + message.sendMarketDataInLotsForUsStocks = reader.bool(); + continue; + } + case 25: { + if (tag !== 200) { + break; + } + + message.showAdvancedOrderRejectInUi = reader.bool(); + continue; + } + case 26: { + if (tag !== 208) { + break; + } + + message.rejectMessagesAboveMaxRate = reader.bool(); + continue; + } + case 27: { + if (tag !== 216) { + break; + } + + message.maintainConnectionOnIncorrectFields = reader.bool(); + continue; + } + case 28: { + if (tag !== 224) { + break; + } + + message.compatibilityModeNasdaqStocks = reader.bool(); + continue; + } + case 29: { + if (tag !== 234) { + break; + } + + message.sendInstrumentTimezone = reader.string(); + continue; + } + case 30: { + if (tag !== 240) { + break; + } + + message.sendForexDataInCompatibilityMode = reader.bool(); + continue; + } + case 31: { + if (tag !== 248) { + break; + } + + message.maintainAndResubmitOrdersOnReconnect = reader.bool(); + continue; + } + case 32: { + if (tag !== 256) { + break; + } + + message.historicalDataMaxSize = reader.int32(); + continue; + } + case 33: { + if (tag !== 264) { + break; + } + + message.autoReportNettingEventContractTrades = reader.bool(); + continue; + } + case 34: { + if (tag !== 274) { + break; + } + + message.optionExerciseRequestType = reader.string(); + continue; + } + case 35: { + if (tag !== 280) { + break; + } + + message.allowLocalhostOnly = reader.bool(); + continue; + } + case 36: { + if (tag !== 290) { + break; + } + + message.trustedIPs.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ApiSettingsConfig { + return { + readOnlyApi: isSet(object.readOnlyApi) ? globalThis.Boolean(object.readOnlyApi) : undefined, + totalQuantityForMutualFunds: isSet(object.totalQuantityForMutualFunds) + ? globalThis.Boolean(object.totalQuantityForMutualFunds) + : undefined, + downloadOpenOrdersOnConnection: isSet(object.downloadOpenOrdersOnConnection) + ? globalThis.Boolean(object.downloadOpenOrdersOnConnection) + : undefined, + includeVirtualFxPositions: isSet(object.includeVirtualFxPositions) + ? globalThis.Boolean(object.includeVirtualFxPositions) + : undefined, + prepareDailyPnL: isSet(object.prepareDailyPnL) ? globalThis.Boolean(object.prepareDailyPnL) : undefined, + sendStatusUpdatesForVolatilityOrders: isSet(object.sendStatusUpdatesForVolatilityOrders) + ? globalThis.Boolean(object.sendStatusUpdatesForVolatilityOrders) + : undefined, + encodeApiMessages: isSet(object.encodeApiMessages) ? globalThis.String(object.encodeApiMessages) : undefined, + socketPort: isSet(object.socketPort) ? globalThis.Number(object.socketPort) : undefined, + useNegativeAutoRange: isSet(object.useNegativeAutoRange) + ? globalThis.Boolean(object.useNegativeAutoRange) + : undefined, + createApiMessageLogFile: isSet(object.createApiMessageLogFile) + ? globalThis.Boolean(object.createApiMessageLogFile) + : undefined, + includeMarketDataInLogFile: isSet(object.includeMarketDataInLogFile) + ? globalThis.Boolean(object.includeMarketDataInLogFile) + : undefined, + exposeTradingScheduleToApi: isSet(object.exposeTradingScheduleToApi) + ? globalThis.Boolean(object.exposeTradingScheduleToApi) + : undefined, + splitInsuredDepositFromCashBalance: isSet(object.splitInsuredDepositFromCashBalance) + ? globalThis.Boolean(object.splitInsuredDepositFromCashBalance) + : undefined, + sendZeroPositionsForTodayOnly: isSet(object.sendZeroPositionsForTodayOnly) + ? globalThis.Boolean(object.sendZeroPositionsForTodayOnly) + : undefined, + letApiAccountRequestsSwitchSubscription: isSet(object.letApiAccountRequestsSwitchSubscription) + ? globalThis.Boolean(object.letApiAccountRequestsSwitchSubscription) + : undefined, + useAccountGroupsWithAllocationMethods: isSet(object.useAccountGroupsWithAllocationMethods) + ? globalThis.Boolean(object.useAccountGroupsWithAllocationMethods) + : undefined, + loggingLevel: isSet(object.loggingLevel) ? globalThis.String(object.loggingLevel) : undefined, + masterClientId: isSet(object.masterClientId) ? globalThis.Number(object.masterClientId) : undefined, + bulkDataTimeout: isSet(object.bulkDataTimeout) ? globalThis.Number(object.bulkDataTimeout) : undefined, + componentExchSeparator: isSet(object.componentExchSeparator) + ? globalThis.String(object.componentExchSeparator) + : undefined, + showForexDataIn110Pips: isSet(object.showForexDataIn110Pips) + ? globalThis.Boolean(object.showForexDataIn110Pips) + : isSet(object.showForexDataIn1_10Pips) + ? globalThis.Boolean(object.showForexDataIn1_10Pips) + : undefined, + allowForexTradingIn110Pips: isSet(object.allowForexTradingIn110Pips) + ? globalThis.Boolean(object.allowForexTradingIn110Pips) + : isSet(object.allowForexTradingIn1_10Pips) + ? globalThis.Boolean(object.allowForexTradingIn1_10Pips) + : undefined, + roundAccountValuesToNearestWholeNumber: isSet(object.roundAccountValuesToNearestWholeNumber) + ? globalThis.Boolean(object.roundAccountValuesToNearestWholeNumber) + : undefined, + sendMarketDataInLotsForUsStocks: isSet(object.sendMarketDataInLotsForUsStocks) + ? globalThis.Boolean(object.sendMarketDataInLotsForUsStocks) + : undefined, + showAdvancedOrderRejectInUi: isSet(object.showAdvancedOrderRejectInUi) + ? globalThis.Boolean(object.showAdvancedOrderRejectInUi) + : undefined, + rejectMessagesAboveMaxRate: isSet(object.rejectMessagesAboveMaxRate) + ? globalThis.Boolean(object.rejectMessagesAboveMaxRate) + : undefined, + maintainConnectionOnIncorrectFields: isSet(object.maintainConnectionOnIncorrectFields) + ? globalThis.Boolean(object.maintainConnectionOnIncorrectFields) + : undefined, + compatibilityModeNasdaqStocks: isSet(object.compatibilityModeNasdaqStocks) + ? globalThis.Boolean(object.compatibilityModeNasdaqStocks) + : undefined, + sendInstrumentTimezone: isSet(object.sendInstrumentTimezone) + ? globalThis.String(object.sendInstrumentTimezone) + : undefined, + sendForexDataInCompatibilityMode: isSet(object.sendForexDataInCompatibilityMode) + ? globalThis.Boolean(object.sendForexDataInCompatibilityMode) + : undefined, + maintainAndResubmitOrdersOnReconnect: isSet(object.maintainAndResubmitOrdersOnReconnect) + ? globalThis.Boolean(object.maintainAndResubmitOrdersOnReconnect) + : undefined, + historicalDataMaxSize: isSet(object.historicalDataMaxSize) + ? globalThis.Number(object.historicalDataMaxSize) + : undefined, + autoReportNettingEventContractTrades: isSet(object.autoReportNettingEventContractTrades) + ? globalThis.Boolean(object.autoReportNettingEventContractTrades) + : undefined, + optionExerciseRequestType: isSet(object.optionExerciseRequestType) + ? globalThis.String(object.optionExerciseRequestType) + : undefined, + allowLocalhostOnly: isSet(object.allowLocalhostOnly) ? globalThis.Boolean(object.allowLocalhostOnly) : undefined, + trustedIPs: globalThis.Array.isArray(object?.trustedIPs) + ? object.trustedIPs.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: ApiSettingsConfig): unknown { + const obj: any = {}; + if (message.readOnlyApi !== undefined) { + obj.readOnlyApi = message.readOnlyApi; + } + if (message.totalQuantityForMutualFunds !== undefined) { + obj.totalQuantityForMutualFunds = message.totalQuantityForMutualFunds; + } + if (message.downloadOpenOrdersOnConnection !== undefined) { + obj.downloadOpenOrdersOnConnection = message.downloadOpenOrdersOnConnection; + } + if (message.includeVirtualFxPositions !== undefined) { + obj.includeVirtualFxPositions = message.includeVirtualFxPositions; + } + if (message.prepareDailyPnL !== undefined) { + obj.prepareDailyPnL = message.prepareDailyPnL; + } + if (message.sendStatusUpdatesForVolatilityOrders !== undefined) { + obj.sendStatusUpdatesForVolatilityOrders = message.sendStatusUpdatesForVolatilityOrders; + } + if (message.encodeApiMessages !== undefined) { + obj.encodeApiMessages = message.encodeApiMessages; + } + if (message.socketPort !== undefined) { + obj.socketPort = Math.round(message.socketPort); + } + if (message.useNegativeAutoRange !== undefined) { + obj.useNegativeAutoRange = message.useNegativeAutoRange; + } + if (message.createApiMessageLogFile !== undefined) { + obj.createApiMessageLogFile = message.createApiMessageLogFile; + } + if (message.includeMarketDataInLogFile !== undefined) { + obj.includeMarketDataInLogFile = message.includeMarketDataInLogFile; + } + if (message.exposeTradingScheduleToApi !== undefined) { + obj.exposeTradingScheduleToApi = message.exposeTradingScheduleToApi; + } + if (message.splitInsuredDepositFromCashBalance !== undefined) { + obj.splitInsuredDepositFromCashBalance = message.splitInsuredDepositFromCashBalance; + } + if (message.sendZeroPositionsForTodayOnly !== undefined) { + obj.sendZeroPositionsForTodayOnly = message.sendZeroPositionsForTodayOnly; + } + if (message.letApiAccountRequestsSwitchSubscription !== undefined) { + obj.letApiAccountRequestsSwitchSubscription = message.letApiAccountRequestsSwitchSubscription; + } + if (message.useAccountGroupsWithAllocationMethods !== undefined) { + obj.useAccountGroupsWithAllocationMethods = message.useAccountGroupsWithAllocationMethods; + } + if (message.loggingLevel !== undefined) { + obj.loggingLevel = message.loggingLevel; + } + if (message.masterClientId !== undefined) { + obj.masterClientId = Math.round(message.masterClientId); + } + if (message.bulkDataTimeout !== undefined) { + obj.bulkDataTimeout = Math.round(message.bulkDataTimeout); + } + if (message.componentExchSeparator !== undefined) { + obj.componentExchSeparator = message.componentExchSeparator; + } + if (message.showForexDataIn110Pips !== undefined) { + obj.showForexDataIn110Pips = message.showForexDataIn110Pips; + } + if (message.allowForexTradingIn110Pips !== undefined) { + obj.allowForexTradingIn110Pips = message.allowForexTradingIn110Pips; + } + if (message.roundAccountValuesToNearestWholeNumber !== undefined) { + obj.roundAccountValuesToNearestWholeNumber = message.roundAccountValuesToNearestWholeNumber; + } + if (message.sendMarketDataInLotsForUsStocks !== undefined) { + obj.sendMarketDataInLotsForUsStocks = message.sendMarketDataInLotsForUsStocks; + } + if (message.showAdvancedOrderRejectInUi !== undefined) { + obj.showAdvancedOrderRejectInUi = message.showAdvancedOrderRejectInUi; + } + if (message.rejectMessagesAboveMaxRate !== undefined) { + obj.rejectMessagesAboveMaxRate = message.rejectMessagesAboveMaxRate; + } + if (message.maintainConnectionOnIncorrectFields !== undefined) { + obj.maintainConnectionOnIncorrectFields = message.maintainConnectionOnIncorrectFields; + } + if (message.compatibilityModeNasdaqStocks !== undefined) { + obj.compatibilityModeNasdaqStocks = message.compatibilityModeNasdaqStocks; + } + if (message.sendInstrumentTimezone !== undefined) { + obj.sendInstrumentTimezone = message.sendInstrumentTimezone; + } + if (message.sendForexDataInCompatibilityMode !== undefined) { + obj.sendForexDataInCompatibilityMode = message.sendForexDataInCompatibilityMode; + } + if (message.maintainAndResubmitOrdersOnReconnect !== undefined) { + obj.maintainAndResubmitOrdersOnReconnect = message.maintainAndResubmitOrdersOnReconnect; + } + if (message.historicalDataMaxSize !== undefined) { + obj.historicalDataMaxSize = Math.round(message.historicalDataMaxSize); + } + if (message.autoReportNettingEventContractTrades !== undefined) { + obj.autoReportNettingEventContractTrades = message.autoReportNettingEventContractTrades; + } + if (message.optionExerciseRequestType !== undefined) { + obj.optionExerciseRequestType = message.optionExerciseRequestType; + } + if (message.allowLocalhostOnly !== undefined) { + obj.allowLocalhostOnly = message.allowLocalhostOnly; + } + if (message.trustedIPs?.length) { + obj.trustedIPs = message.trustedIPs; + } + return obj; + }, + + create(base?: DeepPartial): ApiSettingsConfig { + return ApiSettingsConfig.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ApiSettingsConfig { + const message = createBaseApiSettingsConfig(); + message.readOnlyApi = object.readOnlyApi ?? undefined; + message.totalQuantityForMutualFunds = object.totalQuantityForMutualFunds ?? undefined; + message.downloadOpenOrdersOnConnection = object.downloadOpenOrdersOnConnection ?? undefined; + message.includeVirtualFxPositions = object.includeVirtualFxPositions ?? undefined; + message.prepareDailyPnL = object.prepareDailyPnL ?? undefined; + message.sendStatusUpdatesForVolatilityOrders = object.sendStatusUpdatesForVolatilityOrders ?? undefined; + message.encodeApiMessages = object.encodeApiMessages ?? undefined; + message.socketPort = object.socketPort ?? undefined; + message.useNegativeAutoRange = object.useNegativeAutoRange ?? undefined; + message.createApiMessageLogFile = object.createApiMessageLogFile ?? undefined; + message.includeMarketDataInLogFile = object.includeMarketDataInLogFile ?? undefined; + message.exposeTradingScheduleToApi = object.exposeTradingScheduleToApi ?? undefined; + message.splitInsuredDepositFromCashBalance = object.splitInsuredDepositFromCashBalance ?? undefined; + message.sendZeroPositionsForTodayOnly = object.sendZeroPositionsForTodayOnly ?? undefined; + message.letApiAccountRequestsSwitchSubscription = object.letApiAccountRequestsSwitchSubscription ?? undefined; + message.useAccountGroupsWithAllocationMethods = object.useAccountGroupsWithAllocationMethods ?? undefined; + message.loggingLevel = object.loggingLevel ?? undefined; + message.masterClientId = object.masterClientId ?? undefined; + message.bulkDataTimeout = object.bulkDataTimeout ?? undefined; + message.componentExchSeparator = object.componentExchSeparator ?? undefined; + message.showForexDataIn110Pips = object.showForexDataIn110Pips ?? undefined; + message.allowForexTradingIn110Pips = object.allowForexTradingIn110Pips ?? undefined; + message.roundAccountValuesToNearestWholeNumber = object.roundAccountValuesToNearestWholeNumber ?? undefined; + message.sendMarketDataInLotsForUsStocks = object.sendMarketDataInLotsForUsStocks ?? undefined; + message.showAdvancedOrderRejectInUi = object.showAdvancedOrderRejectInUi ?? undefined; + message.rejectMessagesAboveMaxRate = object.rejectMessagesAboveMaxRate ?? undefined; + message.maintainConnectionOnIncorrectFields = object.maintainConnectionOnIncorrectFields ?? undefined; + message.compatibilityModeNasdaqStocks = object.compatibilityModeNasdaqStocks ?? undefined; + message.sendInstrumentTimezone = object.sendInstrumentTimezone ?? undefined; + message.sendForexDataInCompatibilityMode = object.sendForexDataInCompatibilityMode ?? undefined; + message.maintainAndResubmitOrdersOnReconnect = object.maintainAndResubmitOrdersOnReconnect ?? undefined; + message.historicalDataMaxSize = object.historicalDataMaxSize ?? undefined; + message.autoReportNettingEventContractTrades = object.autoReportNettingEventContractTrades ?? undefined; + message.optionExerciseRequestType = object.optionExerciseRequestType ?? undefined; + message.allowLocalhostOnly = object.allowLocalhostOnly ?? undefined; + message.trustedIPs = object.trustedIPs?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AttachedOrders.ts b/packages/ibkr/src/protobuf/AttachedOrders.ts new file mode 100644 index 00000000..4353a381 --- /dev/null +++ b/packages/ibkr/src/protobuf/AttachedOrders.ts @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AttachedOrders.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AttachedOrders { + slOrderId?: number | undefined; + slOrderType?: string | undefined; + ptOrderId?: number | undefined; + ptOrderType?: string | undefined; +} + +function createBaseAttachedOrders(): AttachedOrders { + return { slOrderId: undefined, slOrderType: undefined, ptOrderId: undefined, ptOrderType: undefined }; +} + +export const AttachedOrders: MessageFns = { + encode(message: AttachedOrders, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.slOrderId !== undefined) { + writer.uint32(8).int32(message.slOrderId); + } + if (message.slOrderType !== undefined) { + writer.uint32(18).string(message.slOrderType); + } + if (message.ptOrderId !== undefined) { + writer.uint32(24).int32(message.ptOrderId); + } + if (message.ptOrderType !== undefined) { + writer.uint32(34).string(message.ptOrderType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AttachedOrders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttachedOrders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.slOrderId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.slOrderType = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.ptOrderId = reader.int32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.ptOrderType = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttachedOrders { + return { + slOrderId: isSet(object.slOrderId) ? globalThis.Number(object.slOrderId) : undefined, + slOrderType: isSet(object.slOrderType) ? globalThis.String(object.slOrderType) : undefined, + ptOrderId: isSet(object.ptOrderId) ? globalThis.Number(object.ptOrderId) : undefined, + ptOrderType: isSet(object.ptOrderType) ? globalThis.String(object.ptOrderType) : undefined, + }; + }, + + toJSON(message: AttachedOrders): unknown { + const obj: any = {}; + if (message.slOrderId !== undefined) { + obj.slOrderId = Math.round(message.slOrderId); + } + if (message.slOrderType !== undefined) { + obj.slOrderType = message.slOrderType; + } + if (message.ptOrderId !== undefined) { + obj.ptOrderId = Math.round(message.ptOrderId); + } + if (message.ptOrderType !== undefined) { + obj.ptOrderType = message.ptOrderType; + } + return obj; + }, + + create(base?: DeepPartial): AttachedOrders { + return AttachedOrders.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AttachedOrders { + const message = createBaseAttachedOrders(); + message.slOrderId = object.slOrderId ?? undefined; + message.slOrderType = object.slOrderType ?? undefined; + message.ptOrderId = object.ptOrderId ?? undefined; + message.ptOrderType = object.ptOrderType ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/AutoOpenOrdersRequest.ts b/packages/ibkr/src/protobuf/AutoOpenOrdersRequest.ts new file mode 100644 index 00000000..af8edb57 --- /dev/null +++ b/packages/ibkr/src/protobuf/AutoOpenOrdersRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: AutoOpenOrdersRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface AutoOpenOrdersRequest { + autoBind?: boolean | undefined; +} + +function createBaseAutoOpenOrdersRequest(): AutoOpenOrdersRequest { + return { autoBind: undefined }; +} + +export const AutoOpenOrdersRequest: MessageFns = { + encode(message: AutoOpenOrdersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.autoBind !== undefined) { + writer.uint32(8).bool(message.autoBind); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AutoOpenOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAutoOpenOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.autoBind = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AutoOpenOrdersRequest { + return { autoBind: isSet(object.autoBind) ? globalThis.Boolean(object.autoBind) : undefined }; + }, + + toJSON(message: AutoOpenOrdersRequest): unknown { + const obj: any = {}; + if (message.autoBind !== undefined) { + obj.autoBind = message.autoBind; + } + return obj; + }, + + create(base?: DeepPartial): AutoOpenOrdersRequest { + return AutoOpenOrdersRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AutoOpenOrdersRequest { + const message = createBaseAutoOpenOrdersRequest(); + message.autoBind = object.autoBind ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CalculateImpliedVolatilityRequest.ts b/packages/ibkr/src/protobuf/CalculateImpliedVolatilityRequest.ts new file mode 100644 index 00000000..9553a09d --- /dev/null +++ b/packages/ibkr/src/protobuf/CalculateImpliedVolatilityRequest.ts @@ -0,0 +1,301 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CalculateImpliedVolatilityRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface CalculateImpliedVolatilityRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + optionPrice?: number | undefined; + underPrice?: number | undefined; + impliedVolatilityOptions: { [key: string]: string }; +} + +export interface CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry { + key: string; + value: string; +} + +function createBaseCalculateImpliedVolatilityRequest(): CalculateImpliedVolatilityRequest { + return { + reqId: undefined, + contract: undefined, + optionPrice: undefined, + underPrice: undefined, + impliedVolatilityOptions: {}, + }; +} + +export const CalculateImpliedVolatilityRequest: MessageFns = { + encode(message: CalculateImpliedVolatilityRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.optionPrice !== undefined) { + writer.uint32(25).double(message.optionPrice); + } + if (message.underPrice !== undefined) { + writer.uint32(33).double(message.underPrice); + } + globalThis.Object.entries(message.impliedVolatilityOptions).forEach(([key, value]: [string, string]) => { + CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry.encode( + { key: key as any, value }, + writer.uint32(42).fork(), + ).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CalculateImpliedVolatilityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCalculateImpliedVolatilityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.optionPrice = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.underPrice = reader.double(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + const entry5 = CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry.decode( + reader, + reader.uint32(), + ); + if (entry5.value !== undefined) { + message.impliedVolatilityOptions[entry5.key] = entry5.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CalculateImpliedVolatilityRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + optionPrice: isSet(object.optionPrice) ? globalThis.Number(object.optionPrice) : undefined, + underPrice: isSet(object.underPrice) ? globalThis.Number(object.underPrice) : undefined, + impliedVolatilityOptions: isObject(object.impliedVolatilityOptions) + ? (globalThis.Object.entries(object.impliedVolatilityOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: CalculateImpliedVolatilityRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.optionPrice !== undefined) { + obj.optionPrice = message.optionPrice; + } + if (message.underPrice !== undefined) { + obj.underPrice = message.underPrice; + } + if (message.impliedVolatilityOptions) { + const entries = globalThis.Object.entries(message.impliedVolatilityOptions) as [string, string][]; + if (entries.length > 0) { + obj.impliedVolatilityOptions = {}; + entries.forEach(([k, v]) => { + obj.impliedVolatilityOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): CalculateImpliedVolatilityRequest { + return CalculateImpliedVolatilityRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CalculateImpliedVolatilityRequest { + const message = createBaseCalculateImpliedVolatilityRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.optionPrice = object.optionPrice ?? undefined; + message.underPrice = object.underPrice ?? undefined; + message.impliedVolatilityOptions = + (globalThis.Object.entries(object.impliedVolatilityOptions ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseCalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry(): CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry { + return { key: "", value: "" }; +} + +export const CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry: MessageFns< + CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry +> = { + encode( + message: CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create( + base?: DeepPartial, + ): CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry { + return CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): CalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry { + const message = createBaseCalculateImpliedVolatilityRequest_ImpliedVolatilityOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CalculateOptionPriceRequest.ts b/packages/ibkr/src/protobuf/CalculateOptionPriceRequest.ts new file mode 100644 index 00000000..c4b76465 --- /dev/null +++ b/packages/ibkr/src/protobuf/CalculateOptionPriceRequest.ts @@ -0,0 +1,290 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CalculateOptionPriceRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface CalculateOptionPriceRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + volatility?: number | undefined; + underPrice?: number | undefined; + optionPriceOptions: { [key: string]: string }; +} + +export interface CalculateOptionPriceRequest_OptionPriceOptionsEntry { + key: string; + value: string; +} + +function createBaseCalculateOptionPriceRequest(): CalculateOptionPriceRequest { + return { + reqId: undefined, + contract: undefined, + volatility: undefined, + underPrice: undefined, + optionPriceOptions: {}, + }; +} + +export const CalculateOptionPriceRequest: MessageFns = { + encode(message: CalculateOptionPriceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.volatility !== undefined) { + writer.uint32(25).double(message.volatility); + } + if (message.underPrice !== undefined) { + writer.uint32(33).double(message.underPrice); + } + globalThis.Object.entries(message.optionPriceOptions).forEach(([key, value]: [string, string]) => { + CalculateOptionPriceRequest_OptionPriceOptionsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()) + .join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CalculateOptionPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCalculateOptionPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.volatility = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.underPrice = reader.double(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + const entry5 = CalculateOptionPriceRequest_OptionPriceOptionsEntry.decode(reader, reader.uint32()); + if (entry5.value !== undefined) { + message.optionPriceOptions[entry5.key] = entry5.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CalculateOptionPriceRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + volatility: isSet(object.volatility) ? globalThis.Number(object.volatility) : undefined, + underPrice: isSet(object.underPrice) ? globalThis.Number(object.underPrice) : undefined, + optionPriceOptions: isObject(object.optionPriceOptions) + ? (globalThis.Object.entries(object.optionPriceOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: CalculateOptionPriceRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.volatility !== undefined) { + obj.volatility = message.volatility; + } + if (message.underPrice !== undefined) { + obj.underPrice = message.underPrice; + } + if (message.optionPriceOptions) { + const entries = globalThis.Object.entries(message.optionPriceOptions) as [string, string][]; + if (entries.length > 0) { + obj.optionPriceOptions = {}; + entries.forEach(([k, v]) => { + obj.optionPriceOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): CalculateOptionPriceRequest { + return CalculateOptionPriceRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CalculateOptionPriceRequest { + const message = createBaseCalculateOptionPriceRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.volatility = object.volatility ?? undefined; + message.underPrice = object.underPrice ?? undefined; + message.optionPriceOptions = (globalThis.Object.entries(object.optionPriceOptions ?? {}) as [string, string][]) + .reduce((acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseCalculateOptionPriceRequest_OptionPriceOptionsEntry(): CalculateOptionPriceRequest_OptionPriceOptionsEntry { + return { key: "", value: "" }; +} + +export const CalculateOptionPriceRequest_OptionPriceOptionsEntry: MessageFns< + CalculateOptionPriceRequest_OptionPriceOptionsEntry +> = { + encode( + message: CalculateOptionPriceRequest_OptionPriceOptionsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CalculateOptionPriceRequest_OptionPriceOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCalculateOptionPriceRequest_OptionPriceOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CalculateOptionPriceRequest_OptionPriceOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: CalculateOptionPriceRequest_OptionPriceOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create( + base?: DeepPartial, + ): CalculateOptionPriceRequest_OptionPriceOptionsEntry { + return CalculateOptionPriceRequest_OptionPriceOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): CalculateOptionPriceRequest_OptionPriceOptionsEntry { + const message = createBaseCalculateOptionPriceRequest_OptionPriceOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelAccountSummary.ts b/packages/ibkr/src/protobuf/CancelAccountSummary.ts new file mode 100644 index 00000000..74fc640a --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelAccountSummary.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelAccountSummary.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelAccountSummary { + reqId?: number | undefined; +} + +function createBaseCancelAccountSummary(): CancelAccountSummary { + return { reqId: undefined }; +} + +export const CancelAccountSummary: MessageFns = { + encode(message: CancelAccountSummary, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelAccountSummary { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelAccountSummary(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelAccountSummary { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelAccountSummary): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelAccountSummary { + return CancelAccountSummary.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelAccountSummary { + const message = createBaseCancelAccountSummary(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelAccountUpdatesMulti.ts b/packages/ibkr/src/protobuf/CancelAccountUpdatesMulti.ts new file mode 100644 index 00000000..589a77e4 --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelAccountUpdatesMulti.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelAccountUpdatesMulti.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelAccountUpdatesMulti { + reqId?: number | undefined; +} + +function createBaseCancelAccountUpdatesMulti(): CancelAccountUpdatesMulti { + return { reqId: undefined }; +} + +export const CancelAccountUpdatesMulti: MessageFns = { + encode(message: CancelAccountUpdatesMulti, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelAccountUpdatesMulti { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelAccountUpdatesMulti(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelAccountUpdatesMulti { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelAccountUpdatesMulti): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelAccountUpdatesMulti { + return CancelAccountUpdatesMulti.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelAccountUpdatesMulti { + const message = createBaseCancelAccountUpdatesMulti(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelCalculateImpliedVolatility.ts b/packages/ibkr/src/protobuf/CancelCalculateImpliedVolatility.ts new file mode 100644 index 00000000..b391010e --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelCalculateImpliedVolatility.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelCalculateImpliedVolatility.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelCalculateImpliedVolatility { + reqId?: number | undefined; +} + +function createBaseCancelCalculateImpliedVolatility(): CancelCalculateImpliedVolatility { + return { reqId: undefined }; +} + +export const CancelCalculateImpliedVolatility: MessageFns = { + encode(message: CancelCalculateImpliedVolatility, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelCalculateImpliedVolatility { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelCalculateImpliedVolatility(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelCalculateImpliedVolatility { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelCalculateImpliedVolatility): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelCalculateImpliedVolatility { + return CancelCalculateImpliedVolatility.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelCalculateImpliedVolatility { + const message = createBaseCancelCalculateImpliedVolatility(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelCalculateOptionPrice.ts b/packages/ibkr/src/protobuf/CancelCalculateOptionPrice.ts new file mode 100644 index 00000000..ccde8f0a --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelCalculateOptionPrice.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelCalculateOptionPrice.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelCalculateOptionPrice { + reqId?: number | undefined; +} + +function createBaseCancelCalculateOptionPrice(): CancelCalculateOptionPrice { + return { reqId: undefined }; +} + +export const CancelCalculateOptionPrice: MessageFns = { + encode(message: CancelCalculateOptionPrice, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelCalculateOptionPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelCalculateOptionPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelCalculateOptionPrice { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelCalculateOptionPrice): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelCalculateOptionPrice { + return CancelCalculateOptionPrice.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelCalculateOptionPrice { + const message = createBaseCancelCalculateOptionPrice(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelContractData.ts b/packages/ibkr/src/protobuf/CancelContractData.ts new file mode 100644 index 00000000..95e70f9d --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelContractData.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelContractData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelContractData { + reqId?: number | undefined; +} + +function createBaseCancelContractData(): CancelContractData { + return { reqId: undefined }; +} + +export const CancelContractData: MessageFns = { + encode(message: CancelContractData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelContractData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelContractData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelContractData { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelContractData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelContractData { + return CancelContractData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelContractData { + const message = createBaseCancelContractData(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelFundamentalsData.ts b/packages/ibkr/src/protobuf/CancelFundamentalsData.ts new file mode 100644 index 00000000..3737528e --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelFundamentalsData.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelFundamentalsData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelFundamentalsData { + reqId?: number | undefined; +} + +function createBaseCancelFundamentalsData(): CancelFundamentalsData { + return { reqId: undefined }; +} + +export const CancelFundamentalsData: MessageFns = { + encode(message: CancelFundamentalsData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelFundamentalsData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelFundamentalsData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelFundamentalsData { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelFundamentalsData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelFundamentalsData { + return CancelFundamentalsData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelFundamentalsData { + const message = createBaseCancelFundamentalsData(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelHeadTimestamp.ts b/packages/ibkr/src/protobuf/CancelHeadTimestamp.ts new file mode 100644 index 00000000..abc2d3df --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelHeadTimestamp.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelHeadTimestamp.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelHeadTimestamp { + reqId?: number | undefined; +} + +function createBaseCancelHeadTimestamp(): CancelHeadTimestamp { + return { reqId: undefined }; +} + +export const CancelHeadTimestamp: MessageFns = { + encode(message: CancelHeadTimestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelHeadTimestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelHeadTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelHeadTimestamp { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelHeadTimestamp): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelHeadTimestamp { + return CancelHeadTimestamp.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelHeadTimestamp { + const message = createBaseCancelHeadTimestamp(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelHistogramData.ts b/packages/ibkr/src/protobuf/CancelHistogramData.ts new file mode 100644 index 00000000..4759f862 --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelHistogramData.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelHistogramData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelHistogramData { + reqId?: number | undefined; +} + +function createBaseCancelHistogramData(): CancelHistogramData { + return { reqId: undefined }; +} + +export const CancelHistogramData: MessageFns = { + encode(message: CancelHistogramData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelHistogramData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelHistogramData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelHistogramData { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelHistogramData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelHistogramData { + return CancelHistogramData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelHistogramData { + const message = createBaseCancelHistogramData(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelHistoricalData.ts b/packages/ibkr/src/protobuf/CancelHistoricalData.ts new file mode 100644 index 00000000..ef645e3f --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelHistoricalData.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelHistoricalData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelHistoricalData { + reqId?: number | undefined; +} + +function createBaseCancelHistoricalData(): CancelHistoricalData { + return { reqId: undefined }; +} + +export const CancelHistoricalData: MessageFns = { + encode(message: CancelHistoricalData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelHistoricalData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelHistoricalData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelHistoricalData { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelHistoricalData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelHistoricalData { + return CancelHistoricalData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelHistoricalData { + const message = createBaseCancelHistoricalData(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelHistoricalTicks.ts b/packages/ibkr/src/protobuf/CancelHistoricalTicks.ts new file mode 100644 index 00000000..2d7dac1f --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelHistoricalTicks.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelHistoricalTicks.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelHistoricalTicks { + reqId?: number | undefined; +} + +function createBaseCancelHistoricalTicks(): CancelHistoricalTicks { + return { reqId: undefined }; +} + +export const CancelHistoricalTicks: MessageFns = { + encode(message: CancelHistoricalTicks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelHistoricalTicks { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelHistoricalTicks(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelHistoricalTicks { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelHistoricalTicks): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelHistoricalTicks { + return CancelHistoricalTicks.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelHistoricalTicks { + const message = createBaseCancelHistoricalTicks(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelMarketData.ts b/packages/ibkr/src/protobuf/CancelMarketData.ts new file mode 100644 index 00000000..1cb1de23 --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelMarketData.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelMarketData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelMarketData { + reqId?: number | undefined; +} + +function createBaseCancelMarketData(): CancelMarketData { + return { reqId: undefined }; +} + +export const CancelMarketData: MessageFns = { + encode(message: CancelMarketData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelMarketData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelMarketData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelMarketData { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelMarketData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelMarketData { + return CancelMarketData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelMarketData { + const message = createBaseCancelMarketData(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelMarketDepth.ts b/packages/ibkr/src/protobuf/CancelMarketDepth.ts new file mode 100644 index 00000000..5ebc1b4d --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelMarketDepth.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelMarketDepth.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelMarketDepth { + reqId?: number | undefined; + isSmartDepth?: boolean | undefined; +} + +function createBaseCancelMarketDepth(): CancelMarketDepth { + return { reqId: undefined, isSmartDepth: undefined }; +} + +export const CancelMarketDepth: MessageFns = { + encode(message: CancelMarketDepth, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.isSmartDepth !== undefined) { + writer.uint32(16).bool(message.isSmartDepth); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelMarketDepth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelMarketDepth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.isSmartDepth = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelMarketDepth { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + isSmartDepth: isSet(object.isSmartDepth) ? globalThis.Boolean(object.isSmartDepth) : undefined, + }; + }, + + toJSON(message: CancelMarketDepth): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.isSmartDepth !== undefined) { + obj.isSmartDepth = message.isSmartDepth; + } + return obj; + }, + + create(base?: DeepPartial): CancelMarketDepth { + return CancelMarketDepth.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelMarketDepth { + const message = createBaseCancelMarketDepth(); + message.reqId = object.reqId ?? undefined; + message.isSmartDepth = object.isSmartDepth ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelNewsBulletins.ts b/packages/ibkr/src/protobuf/CancelNewsBulletins.ts new file mode 100644 index 00000000..e5f2af9c --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelNewsBulletins.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelNewsBulletins.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface CancelNewsBulletins { +} + +function createBaseCancelNewsBulletins(): CancelNewsBulletins { + return {}; +} + +export const CancelNewsBulletins: MessageFns = { + encode(_: CancelNewsBulletins, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelNewsBulletins { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelNewsBulletins(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): CancelNewsBulletins { + return {}; + }, + + toJSON(_: CancelNewsBulletins): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): CancelNewsBulletins { + return CancelNewsBulletins.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): CancelNewsBulletins { + const message = createBaseCancelNewsBulletins(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelOrderRequest.ts b/packages/ibkr/src/protobuf/CancelOrderRequest.ts new file mode 100644 index 00000000..7faa7b6c --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelOrderRequest.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelOrderRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { OrderCancel } from "./OrderCancel"; + +export const protobufPackage = "protobuf"; + +export interface CancelOrderRequest { + orderId?: number | undefined; + orderCancel?: OrderCancel | undefined; +} + +function createBaseCancelOrderRequest(): CancelOrderRequest { + return { orderId: undefined, orderCancel: undefined }; +} + +export const CancelOrderRequest: MessageFns = { + encode(message: CancelOrderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.orderId !== undefined) { + writer.uint32(8).int32(message.orderId); + } + if (message.orderCancel !== undefined) { + OrderCancel.encode(message.orderCancel, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelOrderRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelOrderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.orderId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.orderCancel = OrderCancel.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelOrderRequest { + return { + orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined, + orderCancel: isSet(object.orderCancel) ? OrderCancel.fromJSON(object.orderCancel) : undefined, + }; + }, + + toJSON(message: CancelOrderRequest): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + if (message.orderCancel !== undefined) { + obj.orderCancel = OrderCancel.toJSON(message.orderCancel); + } + return obj; + }, + + create(base?: DeepPartial): CancelOrderRequest { + return CancelOrderRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelOrderRequest { + const message = createBaseCancelOrderRequest(); + message.orderId = object.orderId ?? undefined; + message.orderCancel = (object.orderCancel !== undefined && object.orderCancel !== null) + ? OrderCancel.fromPartial(object.orderCancel) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelPnL.ts b/packages/ibkr/src/protobuf/CancelPnL.ts new file mode 100644 index 00000000..7a82b358 --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelPnL.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelPnL.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelPnL { + reqId?: number | undefined; +} + +function createBaseCancelPnL(): CancelPnL { + return { reqId: undefined }; +} + +export const CancelPnL: MessageFns = { + encode(message: CancelPnL, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelPnL { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelPnL(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelPnL { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelPnL): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelPnL { + return CancelPnL.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelPnL { + const message = createBaseCancelPnL(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelPnLSingle.ts b/packages/ibkr/src/protobuf/CancelPnLSingle.ts new file mode 100644 index 00000000..c091da1d --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelPnLSingle.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelPnLSingle.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelPnLSingle { + reqId?: number | undefined; +} + +function createBaseCancelPnLSingle(): CancelPnLSingle { + return { reqId: undefined }; +} + +export const CancelPnLSingle: MessageFns = { + encode(message: CancelPnLSingle, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelPnLSingle { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelPnLSingle(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelPnLSingle { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelPnLSingle): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelPnLSingle { + return CancelPnLSingle.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelPnLSingle { + const message = createBaseCancelPnLSingle(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelPositions.ts b/packages/ibkr/src/protobuf/CancelPositions.ts new file mode 100644 index 00000000..8d9e177f --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelPositions.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelPositions.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface CancelPositions { +} + +function createBaseCancelPositions(): CancelPositions { + return {}; +} + +export const CancelPositions: MessageFns = { + encode(_: CancelPositions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelPositions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelPositions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): CancelPositions { + return {}; + }, + + toJSON(_: CancelPositions): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): CancelPositions { + return CancelPositions.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): CancelPositions { + const message = createBaseCancelPositions(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelPositionsMulti.ts b/packages/ibkr/src/protobuf/CancelPositionsMulti.ts new file mode 100644 index 00000000..d798f38e --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelPositionsMulti.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelPositionsMulti.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelPositionsMulti { + reqId?: number | undefined; +} + +function createBaseCancelPositionsMulti(): CancelPositionsMulti { + return { reqId: undefined }; +} + +export const CancelPositionsMulti: MessageFns = { + encode(message: CancelPositionsMulti, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelPositionsMulti { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelPositionsMulti(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelPositionsMulti { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelPositionsMulti): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelPositionsMulti { + return CancelPositionsMulti.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelPositionsMulti { + const message = createBaseCancelPositionsMulti(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelRealTimeBars.ts b/packages/ibkr/src/protobuf/CancelRealTimeBars.ts new file mode 100644 index 00000000..ec0c6739 --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelRealTimeBars.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelRealTimeBars.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelRealTimeBars { + reqId?: number | undefined; +} + +function createBaseCancelRealTimeBars(): CancelRealTimeBars { + return { reqId: undefined }; +} + +export const CancelRealTimeBars: MessageFns = { + encode(message: CancelRealTimeBars, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelRealTimeBars { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelRealTimeBars(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelRealTimeBars { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelRealTimeBars): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelRealTimeBars { + return CancelRealTimeBars.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelRealTimeBars { + const message = createBaseCancelRealTimeBars(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelScannerSubscription.ts b/packages/ibkr/src/protobuf/CancelScannerSubscription.ts new file mode 100644 index 00000000..b5d390db --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelScannerSubscription.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelScannerSubscription.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelScannerSubscription { + reqId?: number | undefined; +} + +function createBaseCancelScannerSubscription(): CancelScannerSubscription { + return { reqId: undefined }; +} + +export const CancelScannerSubscription: MessageFns = { + encode(message: CancelScannerSubscription, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelScannerSubscription { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelScannerSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelScannerSubscription { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelScannerSubscription): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelScannerSubscription { + return CancelScannerSubscription.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelScannerSubscription { + const message = createBaseCancelScannerSubscription(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelTickByTick.ts b/packages/ibkr/src/protobuf/CancelTickByTick.ts new file mode 100644 index 00000000..70a24789 --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelTickByTick.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelTickByTick.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelTickByTick { + reqId?: number | undefined; +} + +function createBaseCancelTickByTick(): CancelTickByTick { + return { reqId: undefined }; +} + +export const CancelTickByTick: MessageFns = { + encode(message: CancelTickByTick, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelTickByTick { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelTickByTick(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelTickByTick { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelTickByTick): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelTickByTick { + return CancelTickByTick.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelTickByTick { + const message = createBaseCancelTickByTick(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelWshEventData.ts b/packages/ibkr/src/protobuf/CancelWshEventData.ts new file mode 100644 index 00000000..befb8a1e --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelWshEventData.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelWshEventData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelWshEventData { + reqId?: number | undefined; +} + +function createBaseCancelWshEventData(): CancelWshEventData { + return { reqId: undefined }; +} + +export const CancelWshEventData: MessageFns = { + encode(message: CancelWshEventData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelWshEventData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelWshEventData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelWshEventData { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelWshEventData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelWshEventData { + return CancelWshEventData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelWshEventData { + const message = createBaseCancelWshEventData(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CancelWshMetaData.ts b/packages/ibkr/src/protobuf/CancelWshMetaData.ts new file mode 100644 index 00000000..266aa0ad --- /dev/null +++ b/packages/ibkr/src/protobuf/CancelWshMetaData.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CancelWshMetaData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CancelWshMetaData { + reqId?: number | undefined; +} + +function createBaseCancelWshMetaData(): CancelWshMetaData { + return { reqId: undefined }; +} + +export const CancelWshMetaData: MessageFns = { + encode(message: CancelWshMetaData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CancelWshMetaData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelWshMetaData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CancelWshMetaData { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: CancelWshMetaData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): CancelWshMetaData { + return CancelWshMetaData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CancelWshMetaData { + const message = createBaseCancelWshMetaData(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ComboLeg.ts b/packages/ibkr/src/protobuf/ComboLeg.ts new file mode 100644 index 00000000..4fd56508 --- /dev/null +++ b/packages/ibkr/src/protobuf/ComboLeg.ts @@ -0,0 +1,241 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ComboLeg.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ComboLeg { + conId?: number | undefined; + ratio?: number | undefined; + action?: string | undefined; + exchange?: string | undefined; + openClose?: number | undefined; + shortSalesSlot?: number | undefined; + designatedLocation?: string | undefined; + exemptCode?: number | undefined; + perLegPrice?: number | undefined; +} + +function createBaseComboLeg(): ComboLeg { + return { + conId: undefined, + ratio: undefined, + action: undefined, + exchange: undefined, + openClose: undefined, + shortSalesSlot: undefined, + designatedLocation: undefined, + exemptCode: undefined, + perLegPrice: undefined, + }; +} + +export const ComboLeg: MessageFns = { + encode(message: ComboLeg, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.conId !== undefined) { + writer.uint32(8).int32(message.conId); + } + if (message.ratio !== undefined) { + writer.uint32(16).int32(message.ratio); + } + if (message.action !== undefined) { + writer.uint32(26).string(message.action); + } + if (message.exchange !== undefined) { + writer.uint32(34).string(message.exchange); + } + if (message.openClose !== undefined) { + writer.uint32(40).int32(message.openClose); + } + if (message.shortSalesSlot !== undefined) { + writer.uint32(48).int32(message.shortSalesSlot); + } + if (message.designatedLocation !== undefined) { + writer.uint32(58).string(message.designatedLocation); + } + if (message.exemptCode !== undefined) { + writer.uint32(64).int32(message.exemptCode); + } + if (message.perLegPrice !== undefined) { + writer.uint32(73).double(message.perLegPrice); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ComboLeg { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseComboLeg(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.conId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.ratio = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.action = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.openClose = reader.int32(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.shortSalesSlot = reader.int32(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.designatedLocation = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.exemptCode = reader.int32(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.perLegPrice = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ComboLeg { + return { + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + ratio: isSet(object.ratio) ? globalThis.Number(object.ratio) : undefined, + action: isSet(object.action) ? globalThis.String(object.action) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + openClose: isSet(object.openClose) ? globalThis.Number(object.openClose) : undefined, + shortSalesSlot: isSet(object.shortSalesSlot) ? globalThis.Number(object.shortSalesSlot) : undefined, + designatedLocation: isSet(object.designatedLocation) ? globalThis.String(object.designatedLocation) : undefined, + exemptCode: isSet(object.exemptCode) ? globalThis.Number(object.exemptCode) : undefined, + perLegPrice: isSet(object.perLegPrice) ? globalThis.Number(object.perLegPrice) : undefined, + }; + }, + + toJSON(message: ComboLeg): unknown { + const obj: any = {}; + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + if (message.ratio !== undefined) { + obj.ratio = Math.round(message.ratio); + } + if (message.action !== undefined) { + obj.action = message.action; + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.openClose !== undefined) { + obj.openClose = Math.round(message.openClose); + } + if (message.shortSalesSlot !== undefined) { + obj.shortSalesSlot = Math.round(message.shortSalesSlot); + } + if (message.designatedLocation !== undefined) { + obj.designatedLocation = message.designatedLocation; + } + if (message.exemptCode !== undefined) { + obj.exemptCode = Math.round(message.exemptCode); + } + if (message.perLegPrice !== undefined) { + obj.perLegPrice = message.perLegPrice; + } + return obj; + }, + + create(base?: DeepPartial): ComboLeg { + return ComboLeg.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ComboLeg { + const message = createBaseComboLeg(); + message.conId = object.conId ?? undefined; + message.ratio = object.ratio ?? undefined; + message.action = object.action ?? undefined; + message.exchange = object.exchange ?? undefined; + message.openClose = object.openClose ?? undefined; + message.shortSalesSlot = object.shortSalesSlot ?? undefined; + message.designatedLocation = object.designatedLocation ?? undefined; + message.exemptCode = object.exemptCode ?? undefined; + message.perLegPrice = object.perLegPrice ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CommissionAndFeesReport.ts b/packages/ibkr/src/protobuf/CommissionAndFeesReport.ts new file mode 100644 index 00000000..4df0f454 --- /dev/null +++ b/packages/ibkr/src/protobuf/CommissionAndFeesReport.ts @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CommissionAndFeesReport.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CommissionAndFeesReport { + execId?: string | undefined; + commissionAndFees?: number | undefined; + currency?: string | undefined; + realizedPNL?: number | undefined; + bondYield?: number | undefined; + yieldRedemptionDate?: string | undefined; +} + +function createBaseCommissionAndFeesReport(): CommissionAndFeesReport { + return { + execId: undefined, + commissionAndFees: undefined, + currency: undefined, + realizedPNL: undefined, + bondYield: undefined, + yieldRedemptionDate: undefined, + }; +} + +export const CommissionAndFeesReport: MessageFns = { + encode(message: CommissionAndFeesReport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.execId !== undefined) { + writer.uint32(10).string(message.execId); + } + if (message.commissionAndFees !== undefined) { + writer.uint32(17).double(message.commissionAndFees); + } + if (message.currency !== undefined) { + writer.uint32(26).string(message.currency); + } + if (message.realizedPNL !== undefined) { + writer.uint32(33).double(message.realizedPNL); + } + if (message.bondYield !== undefined) { + writer.uint32(41).double(message.bondYield); + } + if (message.yieldRedemptionDate !== undefined) { + writer.uint32(50).string(message.yieldRedemptionDate); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CommissionAndFeesReport { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommissionAndFeesReport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.execId = reader.string(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.commissionAndFees = reader.double(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.currency = reader.string(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.realizedPNL = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.bondYield = reader.double(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.yieldRedemptionDate = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CommissionAndFeesReport { + return { + execId: isSet(object.execId) ? globalThis.String(object.execId) : undefined, + commissionAndFees: isSet(object.commissionAndFees) ? globalThis.Number(object.commissionAndFees) : undefined, + currency: isSet(object.currency) ? globalThis.String(object.currency) : undefined, + realizedPNL: isSet(object.realizedPNL) ? globalThis.Number(object.realizedPNL) : undefined, + bondYield: isSet(object.bondYield) ? globalThis.Number(object.bondYield) : undefined, + yieldRedemptionDate: isSet(object.yieldRedemptionDate) + ? globalThis.String(object.yieldRedemptionDate) + : undefined, + }; + }, + + toJSON(message: CommissionAndFeesReport): unknown { + const obj: any = {}; + if (message.execId !== undefined) { + obj.execId = message.execId; + } + if (message.commissionAndFees !== undefined) { + obj.commissionAndFees = message.commissionAndFees; + } + if (message.currency !== undefined) { + obj.currency = message.currency; + } + if (message.realizedPNL !== undefined) { + obj.realizedPNL = message.realizedPNL; + } + if (message.bondYield !== undefined) { + obj.bondYield = message.bondYield; + } + if (message.yieldRedemptionDate !== undefined) { + obj.yieldRedemptionDate = message.yieldRedemptionDate; + } + return obj; + }, + + create(base?: DeepPartial): CommissionAndFeesReport { + return CommissionAndFeesReport.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CommissionAndFeesReport { + const message = createBaseCommissionAndFeesReport(); + message.execId = object.execId ?? undefined; + message.commissionAndFees = object.commissionAndFees ?? undefined; + message.currency = object.currency ?? undefined; + message.realizedPNL = object.realizedPNL ?? undefined; + message.bondYield = object.bondYield ?? undefined; + message.yieldRedemptionDate = object.yieldRedemptionDate ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CompletedOrder.ts b/packages/ibkr/src/protobuf/CompletedOrder.ts new file mode 100644 index 00000000..626b4705 --- /dev/null +++ b/packages/ibkr/src/protobuf/CompletedOrder.ts @@ -0,0 +1,136 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CompletedOrder.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; +import { Order } from "./Order"; +import { OrderState } from "./OrderState"; + +export const protobufPackage = "protobuf"; + +export interface CompletedOrder { + contract?: Contract | undefined; + order?: Order | undefined; + orderState?: OrderState | undefined; +} + +function createBaseCompletedOrder(): CompletedOrder { + return { contract: undefined, order: undefined, orderState: undefined }; +} + +export const CompletedOrder: MessageFns = { + encode(message: CompletedOrder, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(10).fork()).join(); + } + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(18).fork()).join(); + } + if (message.orderState !== undefined) { + OrderState.encode(message.orderState, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CompletedOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompletedOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.order = Order.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.orderState = OrderState.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CompletedOrder { + return { + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + order: isSet(object.order) ? Order.fromJSON(object.order) : undefined, + orderState: isSet(object.orderState) ? OrderState.fromJSON(object.orderState) : undefined, + }; + }, + + toJSON(message: CompletedOrder): unknown { + const obj: any = {}; + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.order !== undefined) { + obj.order = Order.toJSON(message.order); + } + if (message.orderState !== undefined) { + obj.orderState = OrderState.toJSON(message.orderState); + } + return obj; + }, + + create(base?: DeepPartial): CompletedOrder { + return CompletedOrder.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CompletedOrder { + const message = createBaseCompletedOrder(); + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.order = (object.order !== undefined && object.order !== null) ? Order.fromPartial(object.order) : undefined; + message.orderState = (object.orderState !== undefined && object.orderState !== null) + ? OrderState.fromPartial(object.orderState) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CompletedOrdersEnd.ts b/packages/ibkr/src/protobuf/CompletedOrdersEnd.ts new file mode 100644 index 00000000..b75ed85b --- /dev/null +++ b/packages/ibkr/src/protobuf/CompletedOrdersEnd.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CompletedOrdersEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface CompletedOrdersEnd { +} + +function createBaseCompletedOrdersEnd(): CompletedOrdersEnd { + return {}; +} + +export const CompletedOrdersEnd: MessageFns = { + encode(_: CompletedOrdersEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CompletedOrdersEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompletedOrdersEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): CompletedOrdersEnd { + return {}; + }, + + toJSON(_: CompletedOrdersEnd): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): CompletedOrdersEnd { + return CompletedOrdersEnd.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): CompletedOrdersEnd { + const message = createBaseCompletedOrdersEnd(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CompletedOrdersRequest.ts b/packages/ibkr/src/protobuf/CompletedOrdersRequest.ts new file mode 100644 index 00000000..8324aacb --- /dev/null +++ b/packages/ibkr/src/protobuf/CompletedOrdersRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CompletedOrdersRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CompletedOrdersRequest { + apiOnly?: boolean | undefined; +} + +function createBaseCompletedOrdersRequest(): CompletedOrdersRequest { + return { apiOnly: undefined }; +} + +export const CompletedOrdersRequest: MessageFns = { + encode(message: CompletedOrdersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.apiOnly !== undefined) { + writer.uint32(8).bool(message.apiOnly); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CompletedOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompletedOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.apiOnly = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CompletedOrdersRequest { + return { apiOnly: isSet(object.apiOnly) ? globalThis.Boolean(object.apiOnly) : undefined }; + }, + + toJSON(message: CompletedOrdersRequest): unknown { + const obj: any = {}; + if (message.apiOnly !== undefined) { + obj.apiOnly = message.apiOnly; + } + return obj; + }, + + create(base?: DeepPartial): CompletedOrdersRequest { + return CompletedOrdersRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CompletedOrdersRequest { + const message = createBaseCompletedOrdersRequest(); + message.apiOnly = object.apiOnly ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ConfigRequest.ts b/packages/ibkr/src/protobuf/ConfigRequest.ts new file mode 100644 index 00000000..b0b41968 --- /dev/null +++ b/packages/ibkr/src/protobuf/ConfigRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ConfigRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ConfigRequest { + reqId?: number | undefined; +} + +function createBaseConfigRequest(): ConfigRequest { + return { reqId: undefined }; +} + +export const ConfigRequest: MessageFns = { + encode(message: ConfigRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConfigRequest { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: ConfigRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): ConfigRequest { + return ConfigRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ConfigRequest { + const message = createBaseConfigRequest(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ConfigResponse.ts b/packages/ibkr/src/protobuf/ConfigResponse.ts new file mode 100644 index 00000000..1cd0291d --- /dev/null +++ b/packages/ibkr/src/protobuf/ConfigResponse.ts @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ConfigResponse.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { ApiConfig } from "./ApiConfig"; +import { LockAndExitConfig } from "./LockAndExitConfig"; +import { MessageConfig } from "./MessageConfig"; +import { OrdersConfig } from "./OrdersConfig"; + +export const protobufPackage = "protobuf"; + +export interface ConfigResponse { + reqId?: number | undefined; + lockAndExit?: LockAndExitConfig | undefined; + messages: MessageConfig[]; + api?: ApiConfig | undefined; + orders?: OrdersConfig | undefined; +} + +function createBaseConfigResponse(): ConfigResponse { + return { reqId: undefined, lockAndExit: undefined, messages: [], api: undefined, orders: undefined }; +} + +export const ConfigResponse: MessageFns = { + encode(message: ConfigResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.lockAndExit !== undefined) { + LockAndExitConfig.encode(message.lockAndExit, writer.uint32(18).fork()).join(); + } + for (const v of message.messages) { + MessageConfig.encode(v!, writer.uint32(26).fork()).join(); + } + if (message.api !== undefined) { + ApiConfig.encode(message.api, writer.uint32(34).fork()).join(); + } + if (message.orders !== undefined) { + OrdersConfig.encode(message.orders, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.lockAndExit = LockAndExitConfig.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.messages.push(MessageConfig.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.api = ApiConfig.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.orders = OrdersConfig.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ConfigResponse { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + lockAndExit: isSet(object.lockAndExit) ? LockAndExitConfig.fromJSON(object.lockAndExit) : undefined, + messages: globalThis.Array.isArray(object?.messages) + ? object.messages.map((e: any) => MessageConfig.fromJSON(e)) + : [], + api: isSet(object.api) ? ApiConfig.fromJSON(object.api) : undefined, + orders: isSet(object.orders) ? OrdersConfig.fromJSON(object.orders) : undefined, + }; + }, + + toJSON(message: ConfigResponse): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.lockAndExit !== undefined) { + obj.lockAndExit = LockAndExitConfig.toJSON(message.lockAndExit); + } + if (message.messages?.length) { + obj.messages = message.messages.map((e) => MessageConfig.toJSON(e)); + } + if (message.api !== undefined) { + obj.api = ApiConfig.toJSON(message.api); + } + if (message.orders !== undefined) { + obj.orders = OrdersConfig.toJSON(message.orders); + } + return obj; + }, + + create(base?: DeepPartial): ConfigResponse { + return ConfigResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ConfigResponse { + const message = createBaseConfigResponse(); + message.reqId = object.reqId ?? undefined; + message.lockAndExit = (object.lockAndExit !== undefined && object.lockAndExit !== null) + ? LockAndExitConfig.fromPartial(object.lockAndExit) + : undefined; + message.messages = object.messages?.map((e) => MessageConfig.fromPartial(e)) || []; + message.api = (object.api !== undefined && object.api !== null) ? ApiConfig.fromPartial(object.api) : undefined; + message.orders = (object.orders !== undefined && object.orders !== null) + ? OrdersConfig.fromPartial(object.orders) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/Contract.ts b/packages/ibkr/src/protobuf/Contract.ts new file mode 100644 index 00000000..2012af92 --- /dev/null +++ b/packages/ibkr/src/protobuf/Contract.ts @@ -0,0 +1,467 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: Contract.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { ComboLeg } from "./ComboLeg"; +import { DeltaNeutralContract } from "./DeltaNeutralContract"; + +export const protobufPackage = "protobuf"; + +export interface Contract { + conId?: number | undefined; + symbol?: string | undefined; + secType?: string | undefined; + lastTradeDateOrContractMonth?: string | undefined; + strike?: number | undefined; + right?: string | undefined; + multiplier?: number | undefined; + exchange?: string | undefined; + primaryExch?: string | undefined; + currency?: string | undefined; + localSymbol?: string | undefined; + tradingClass?: string | undefined; + secIdType?: string | undefined; + secId?: string | undefined; + description?: string | undefined; + issuerId?: string | undefined; + deltaNeutralContract?: DeltaNeutralContract | undefined; + includeExpired?: boolean | undefined; + comboLegsDescrip?: string | undefined; + comboLegs: ComboLeg[]; + lastTradeDate?: string | undefined; +} + +function createBaseContract(): Contract { + return { + conId: undefined, + symbol: undefined, + secType: undefined, + lastTradeDateOrContractMonth: undefined, + strike: undefined, + right: undefined, + multiplier: undefined, + exchange: undefined, + primaryExch: undefined, + currency: undefined, + localSymbol: undefined, + tradingClass: undefined, + secIdType: undefined, + secId: undefined, + description: undefined, + issuerId: undefined, + deltaNeutralContract: undefined, + includeExpired: undefined, + comboLegsDescrip: undefined, + comboLegs: [], + lastTradeDate: undefined, + }; +} + +export const Contract: MessageFns = { + encode(message: Contract, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.conId !== undefined) { + writer.uint32(8).int32(message.conId); + } + if (message.symbol !== undefined) { + writer.uint32(18).string(message.symbol); + } + if (message.secType !== undefined) { + writer.uint32(26).string(message.secType); + } + if (message.lastTradeDateOrContractMonth !== undefined) { + writer.uint32(34).string(message.lastTradeDateOrContractMonth); + } + if (message.strike !== undefined) { + writer.uint32(41).double(message.strike); + } + if (message.right !== undefined) { + writer.uint32(50).string(message.right); + } + if (message.multiplier !== undefined) { + writer.uint32(57).double(message.multiplier); + } + if (message.exchange !== undefined) { + writer.uint32(66).string(message.exchange); + } + if (message.primaryExch !== undefined) { + writer.uint32(74).string(message.primaryExch); + } + if (message.currency !== undefined) { + writer.uint32(82).string(message.currency); + } + if (message.localSymbol !== undefined) { + writer.uint32(90).string(message.localSymbol); + } + if (message.tradingClass !== undefined) { + writer.uint32(98).string(message.tradingClass); + } + if (message.secIdType !== undefined) { + writer.uint32(106).string(message.secIdType); + } + if (message.secId !== undefined) { + writer.uint32(114).string(message.secId); + } + if (message.description !== undefined) { + writer.uint32(122).string(message.description); + } + if (message.issuerId !== undefined) { + writer.uint32(130).string(message.issuerId); + } + if (message.deltaNeutralContract !== undefined) { + DeltaNeutralContract.encode(message.deltaNeutralContract, writer.uint32(138).fork()).join(); + } + if (message.includeExpired !== undefined) { + writer.uint32(144).bool(message.includeExpired); + } + if (message.comboLegsDescrip !== undefined) { + writer.uint32(154).string(message.comboLegsDescrip); + } + for (const v of message.comboLegs) { + ComboLeg.encode(v!, writer.uint32(162).fork()).join(); + } + if (message.lastTradeDate !== undefined) { + writer.uint32(170).string(message.lastTradeDate); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Contract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.conId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.symbol = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.secType = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.lastTradeDateOrContractMonth = reader.string(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.strike = reader.double(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.right = reader.string(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.multiplier = reader.double(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.primaryExch = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.currency = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.localSymbol = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.tradingClass = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.secIdType = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.secId = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.description = reader.string(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.issuerId = reader.string(); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + + message.deltaNeutralContract = DeltaNeutralContract.decode(reader, reader.uint32()); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.includeExpired = reader.bool(); + continue; + } + case 19: { + if (tag !== 154) { + break; + } + + message.comboLegsDescrip = reader.string(); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + + message.comboLegs.push(ComboLeg.decode(reader, reader.uint32())); + continue; + } + case 21: { + if (tag !== 170) { + break; + } + + message.lastTradeDate = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Contract { + return { + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : undefined, + secType: isSet(object.secType) ? globalThis.String(object.secType) : undefined, + lastTradeDateOrContractMonth: isSet(object.lastTradeDateOrContractMonth) + ? globalThis.String(object.lastTradeDateOrContractMonth) + : undefined, + strike: isSet(object.strike) ? globalThis.Number(object.strike) : undefined, + right: isSet(object.right) ? globalThis.String(object.right) : undefined, + multiplier: isSet(object.multiplier) ? globalThis.Number(object.multiplier) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + primaryExch: isSet(object.primaryExch) ? globalThis.String(object.primaryExch) : undefined, + currency: isSet(object.currency) ? globalThis.String(object.currency) : undefined, + localSymbol: isSet(object.localSymbol) ? globalThis.String(object.localSymbol) : undefined, + tradingClass: isSet(object.tradingClass) ? globalThis.String(object.tradingClass) : undefined, + secIdType: isSet(object.secIdType) ? globalThis.String(object.secIdType) : undefined, + secId: isSet(object.secId) ? globalThis.String(object.secId) : undefined, + description: isSet(object.description) ? globalThis.String(object.description) : undefined, + issuerId: isSet(object.issuerId) ? globalThis.String(object.issuerId) : undefined, + deltaNeutralContract: isSet(object.deltaNeutralContract) + ? DeltaNeutralContract.fromJSON(object.deltaNeutralContract) + : undefined, + includeExpired: isSet(object.includeExpired) ? globalThis.Boolean(object.includeExpired) : undefined, + comboLegsDescrip: isSet(object.comboLegsDescrip) ? globalThis.String(object.comboLegsDescrip) : undefined, + comboLegs: globalThis.Array.isArray(object?.comboLegs) + ? object.comboLegs.map((e: any) => ComboLeg.fromJSON(e)) + : [], + lastTradeDate: isSet(object.lastTradeDate) ? globalThis.String(object.lastTradeDate) : undefined, + }; + }, + + toJSON(message: Contract): unknown { + const obj: any = {}; + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + if (message.symbol !== undefined) { + obj.symbol = message.symbol; + } + if (message.secType !== undefined) { + obj.secType = message.secType; + } + if (message.lastTradeDateOrContractMonth !== undefined) { + obj.lastTradeDateOrContractMonth = message.lastTradeDateOrContractMonth; + } + if (message.strike !== undefined) { + obj.strike = message.strike; + } + if (message.right !== undefined) { + obj.right = message.right; + } + if (message.multiplier !== undefined) { + obj.multiplier = message.multiplier; + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.primaryExch !== undefined) { + obj.primaryExch = message.primaryExch; + } + if (message.currency !== undefined) { + obj.currency = message.currency; + } + if (message.localSymbol !== undefined) { + obj.localSymbol = message.localSymbol; + } + if (message.tradingClass !== undefined) { + obj.tradingClass = message.tradingClass; + } + if (message.secIdType !== undefined) { + obj.secIdType = message.secIdType; + } + if (message.secId !== undefined) { + obj.secId = message.secId; + } + if (message.description !== undefined) { + obj.description = message.description; + } + if (message.issuerId !== undefined) { + obj.issuerId = message.issuerId; + } + if (message.deltaNeutralContract !== undefined) { + obj.deltaNeutralContract = DeltaNeutralContract.toJSON(message.deltaNeutralContract); + } + if (message.includeExpired !== undefined) { + obj.includeExpired = message.includeExpired; + } + if (message.comboLegsDescrip !== undefined) { + obj.comboLegsDescrip = message.comboLegsDescrip; + } + if (message.comboLegs?.length) { + obj.comboLegs = message.comboLegs.map((e) => ComboLeg.toJSON(e)); + } + if (message.lastTradeDate !== undefined) { + obj.lastTradeDate = message.lastTradeDate; + } + return obj; + }, + + create(base?: DeepPartial): Contract { + return Contract.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Contract { + const message = createBaseContract(); + message.conId = object.conId ?? undefined; + message.symbol = object.symbol ?? undefined; + message.secType = object.secType ?? undefined; + message.lastTradeDateOrContractMonth = object.lastTradeDateOrContractMonth ?? undefined; + message.strike = object.strike ?? undefined; + message.right = object.right ?? undefined; + message.multiplier = object.multiplier ?? undefined; + message.exchange = object.exchange ?? undefined; + message.primaryExch = object.primaryExch ?? undefined; + message.currency = object.currency ?? undefined; + message.localSymbol = object.localSymbol ?? undefined; + message.tradingClass = object.tradingClass ?? undefined; + message.secIdType = object.secIdType ?? undefined; + message.secId = object.secId ?? undefined; + message.description = object.description ?? undefined; + message.issuerId = object.issuerId ?? undefined; + message.deltaNeutralContract = (object.deltaNeutralContract !== undefined && object.deltaNeutralContract !== null) + ? DeltaNeutralContract.fromPartial(object.deltaNeutralContract) + : undefined; + message.includeExpired = object.includeExpired ?? undefined; + message.comboLegsDescrip = object.comboLegsDescrip ?? undefined; + message.comboLegs = object.comboLegs?.map((e) => ComboLeg.fromPartial(e)) || []; + message.lastTradeDate = object.lastTradeDate ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ContractData.ts b/packages/ibkr/src/protobuf/ContractData.ts new file mode 100644 index 00000000..866baae5 --- /dev/null +++ b/packages/ibkr/src/protobuf/ContractData.ts @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ContractData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; +import { ContractDetails } from "./ContractDetails"; + +export const protobufPackage = "protobuf"; + +export interface ContractData { + reqId?: number | undefined; + contract?: Contract | undefined; + contractDetails?: ContractDetails | undefined; +} + +function createBaseContractData(): ContractData { + return { reqId: undefined, contract: undefined, contractDetails: undefined }; +} + +export const ContractData: MessageFns = { + encode(message: ContractData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.contractDetails !== undefined) { + ContractDetails.encode(message.contractDetails, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ContractData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.contractDetails = ContractDetails.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ContractData { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + contractDetails: isSet(object.contractDetails) ? ContractDetails.fromJSON(object.contractDetails) : undefined, + }; + }, + + toJSON(message: ContractData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.contractDetails !== undefined) { + obj.contractDetails = ContractDetails.toJSON(message.contractDetails); + } + return obj; + }, + + create(base?: DeepPartial): ContractData { + return ContractData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ContractData { + const message = createBaseContractData(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.contractDetails = (object.contractDetails !== undefined && object.contractDetails !== null) + ? ContractDetails.fromPartial(object.contractDetails) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ContractDataEnd.ts b/packages/ibkr/src/protobuf/ContractDataEnd.ts new file mode 100644 index 00000000..34708550 --- /dev/null +++ b/packages/ibkr/src/protobuf/ContractDataEnd.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ContractDataEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ContractDataEnd { + reqId?: number | undefined; +} + +function createBaseContractDataEnd(): ContractDataEnd { + return { reqId: undefined }; +} + +export const ContractDataEnd: MessageFns = { + encode(message: ContractDataEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ContractDataEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractDataEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ContractDataEnd { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: ContractDataEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): ContractDataEnd { + return ContractDataEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ContractDataEnd { + const message = createBaseContractDataEnd(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ContractDataRequest.ts b/packages/ibkr/src/protobuf/ContractDataRequest.ts new file mode 100644 index 00000000..c8fe8980 --- /dev/null +++ b/packages/ibkr/src/protobuf/ContractDataRequest.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ContractDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface ContractDataRequest { + reqId?: number | undefined; + contract?: Contract | undefined; +} + +function createBaseContractDataRequest(): ContractDataRequest { + return { reqId: undefined, contract: undefined }; +} + +export const ContractDataRequest: MessageFns = { + encode(message: ContractDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ContractDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ContractDataRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + }; + }, + + toJSON(message: ContractDataRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + return obj; + }, + + create(base?: DeepPartial): ContractDataRequest { + return ContractDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ContractDataRequest { + const message = createBaseContractDataRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ContractDescription.ts b/packages/ibkr/src/protobuf/ContractDescription.ts new file mode 100644 index 00000000..914ebe99 --- /dev/null +++ b/packages/ibkr/src/protobuf/ContractDescription.ts @@ -0,0 +1,117 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ContractDescription.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface ContractDescription { + contract?: Contract | undefined; + derivativeSecTypes: string[]; +} + +function createBaseContractDescription(): ContractDescription { + return { contract: undefined, derivativeSecTypes: [] }; +} + +export const ContractDescription: MessageFns = { + encode(message: ContractDescription, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(10).fork()).join(); + } + for (const v of message.derivativeSecTypes) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ContractDescription { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractDescription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.derivativeSecTypes.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ContractDescription { + return { + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + derivativeSecTypes: globalThis.Array.isArray(object?.derivativeSecTypes) + ? object.derivativeSecTypes.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: ContractDescription): unknown { + const obj: any = {}; + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.derivativeSecTypes?.length) { + obj.derivativeSecTypes = message.derivativeSecTypes; + } + return obj; + }, + + create(base?: DeepPartial): ContractDescription { + return ContractDescription.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ContractDescription { + const message = createBaseContractDescription(); + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.derivativeSecTypes = object.derivativeSecTypes?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ContractDetails.ts b/packages/ibkr/src/protobuf/ContractDetails.ts new file mode 100644 index 00000000..b60262bd --- /dev/null +++ b/packages/ibkr/src/protobuf/ContractDetails.ts @@ -0,0 +1,1372 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ContractDetails.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { IneligibilityReason } from "./IneligibilityReason"; + +export const protobufPackage = "protobuf"; + +export interface ContractDetails { + marketName?: string | undefined; + minTick?: string | undefined; + orderTypes?: string | undefined; + validExchanges?: string | undefined; + priceMagnifier?: number | undefined; + underConId?: number | undefined; + longName?: string | undefined; + contractMonth?: string | undefined; + industry?: string | undefined; + category?: string | undefined; + subcategory?: string | undefined; + timeZoneId?: string | undefined; + tradingHours?: string | undefined; + liquidHours?: string | undefined; + evRule?: string | undefined; + evMultiplier?: number | undefined; + secIdList: { [key: string]: string }; + aggGroup?: number | undefined; + underSymbol?: string | undefined; + underSecType?: string | undefined; + marketRuleIds?: string | undefined; + realExpirationDate?: string | undefined; + stockType?: string | undefined; + minSize?: string | undefined; + sizeIncrement?: string | undefined; + suggestedSizeIncrement?: + | string + | undefined; + /** fund fields */ + fundName?: string | undefined; + fundFamily?: string | undefined; + fundType?: string | undefined; + fundFrontLoad?: string | undefined; + fundBackLoad?: string | undefined; + fundBackLoadTimeInterval?: string | undefined; + fundManagementFee?: string | undefined; + fundClosed?: boolean | undefined; + fundClosedForNewInvestors?: boolean | undefined; + fundClosedForNewMoney?: boolean | undefined; + fundNotifyAmount?: string | undefined; + fundMinimumInitialPurchase?: string | undefined; + fundMinimumSubsequentPurchase?: string | undefined; + fundBlueSkyStates?: string | undefined; + fundBlueSkyTerritories?: string | undefined; + fundDistributionPolicyIndicator?: string | undefined; + fundAssetType?: + | string + | undefined; + /** bond fields */ + cusip?: string | undefined; + issueDate?: string | undefined; + ratings?: string | undefined; + bondType?: string | undefined; + coupon?: number | undefined; + couponType?: string | undefined; + convertible?: boolean | undefined; + callable?: boolean | undefined; + puttable?: boolean | undefined; + descAppend?: string | undefined; + nextOptionDate?: string | undefined; + nextOptionType?: string | undefined; + nextOptionPartial?: boolean | undefined; + bondNotes?: string | undefined; + ineligibilityReasonList: IneligibilityReason[]; + /** event contract fields */ + eventContract1?: string | undefined; + eventContractDescription1?: string | undefined; + eventContractDescription2?: string | undefined; + minAlgoSize?: string | undefined; + lastPricePrecision?: string | undefined; + lastSizePrecision?: string | undefined; +} + +export interface ContractDetails_SecIdListEntry { + key: string; + value: string; +} + +function createBaseContractDetails(): ContractDetails { + return { + marketName: undefined, + minTick: undefined, + orderTypes: undefined, + validExchanges: undefined, + priceMagnifier: undefined, + underConId: undefined, + longName: undefined, + contractMonth: undefined, + industry: undefined, + category: undefined, + subcategory: undefined, + timeZoneId: undefined, + tradingHours: undefined, + liquidHours: undefined, + evRule: undefined, + evMultiplier: undefined, + secIdList: {}, + aggGroup: undefined, + underSymbol: undefined, + underSecType: undefined, + marketRuleIds: undefined, + realExpirationDate: undefined, + stockType: undefined, + minSize: undefined, + sizeIncrement: undefined, + suggestedSizeIncrement: undefined, + fundName: undefined, + fundFamily: undefined, + fundType: undefined, + fundFrontLoad: undefined, + fundBackLoad: undefined, + fundBackLoadTimeInterval: undefined, + fundManagementFee: undefined, + fundClosed: undefined, + fundClosedForNewInvestors: undefined, + fundClosedForNewMoney: undefined, + fundNotifyAmount: undefined, + fundMinimumInitialPurchase: undefined, + fundMinimumSubsequentPurchase: undefined, + fundBlueSkyStates: undefined, + fundBlueSkyTerritories: undefined, + fundDistributionPolicyIndicator: undefined, + fundAssetType: undefined, + cusip: undefined, + issueDate: undefined, + ratings: undefined, + bondType: undefined, + coupon: undefined, + couponType: undefined, + convertible: undefined, + callable: undefined, + puttable: undefined, + descAppend: undefined, + nextOptionDate: undefined, + nextOptionType: undefined, + nextOptionPartial: undefined, + bondNotes: undefined, + ineligibilityReasonList: [], + eventContract1: undefined, + eventContractDescription1: undefined, + eventContractDescription2: undefined, + minAlgoSize: undefined, + lastPricePrecision: undefined, + lastSizePrecision: undefined, + }; +} + +export const ContractDetails: MessageFns = { + encode(message: ContractDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.marketName !== undefined) { + writer.uint32(10).string(message.marketName); + } + if (message.minTick !== undefined) { + writer.uint32(18).string(message.minTick); + } + if (message.orderTypes !== undefined) { + writer.uint32(26).string(message.orderTypes); + } + if (message.validExchanges !== undefined) { + writer.uint32(34).string(message.validExchanges); + } + if (message.priceMagnifier !== undefined) { + writer.uint32(40).int32(message.priceMagnifier); + } + if (message.underConId !== undefined) { + writer.uint32(48).int32(message.underConId); + } + if (message.longName !== undefined) { + writer.uint32(58).string(message.longName); + } + if (message.contractMonth !== undefined) { + writer.uint32(66).string(message.contractMonth); + } + if (message.industry !== undefined) { + writer.uint32(74).string(message.industry); + } + if (message.category !== undefined) { + writer.uint32(82).string(message.category); + } + if (message.subcategory !== undefined) { + writer.uint32(90).string(message.subcategory); + } + if (message.timeZoneId !== undefined) { + writer.uint32(98).string(message.timeZoneId); + } + if (message.tradingHours !== undefined) { + writer.uint32(106).string(message.tradingHours); + } + if (message.liquidHours !== undefined) { + writer.uint32(114).string(message.liquidHours); + } + if (message.evRule !== undefined) { + writer.uint32(122).string(message.evRule); + } + if (message.evMultiplier !== undefined) { + writer.uint32(129).double(message.evMultiplier); + } + globalThis.Object.entries(message.secIdList).forEach(([key, value]: [string, string]) => { + ContractDetails_SecIdListEntry.encode({ key: key as any, value }, writer.uint32(138).fork()).join(); + }); + if (message.aggGroup !== undefined) { + writer.uint32(144).int32(message.aggGroup); + } + if (message.underSymbol !== undefined) { + writer.uint32(154).string(message.underSymbol); + } + if (message.underSecType !== undefined) { + writer.uint32(162).string(message.underSecType); + } + if (message.marketRuleIds !== undefined) { + writer.uint32(170).string(message.marketRuleIds); + } + if (message.realExpirationDate !== undefined) { + writer.uint32(178).string(message.realExpirationDate); + } + if (message.stockType !== undefined) { + writer.uint32(186).string(message.stockType); + } + if (message.minSize !== undefined) { + writer.uint32(194).string(message.minSize); + } + if (message.sizeIncrement !== undefined) { + writer.uint32(202).string(message.sizeIncrement); + } + if (message.suggestedSizeIncrement !== undefined) { + writer.uint32(210).string(message.suggestedSizeIncrement); + } + if (message.fundName !== undefined) { + writer.uint32(218).string(message.fundName); + } + if (message.fundFamily !== undefined) { + writer.uint32(226).string(message.fundFamily); + } + if (message.fundType !== undefined) { + writer.uint32(234).string(message.fundType); + } + if (message.fundFrontLoad !== undefined) { + writer.uint32(242).string(message.fundFrontLoad); + } + if (message.fundBackLoad !== undefined) { + writer.uint32(250).string(message.fundBackLoad); + } + if (message.fundBackLoadTimeInterval !== undefined) { + writer.uint32(258).string(message.fundBackLoadTimeInterval); + } + if (message.fundManagementFee !== undefined) { + writer.uint32(266).string(message.fundManagementFee); + } + if (message.fundClosed !== undefined) { + writer.uint32(272).bool(message.fundClosed); + } + if (message.fundClosedForNewInvestors !== undefined) { + writer.uint32(280).bool(message.fundClosedForNewInvestors); + } + if (message.fundClosedForNewMoney !== undefined) { + writer.uint32(288).bool(message.fundClosedForNewMoney); + } + if (message.fundNotifyAmount !== undefined) { + writer.uint32(298).string(message.fundNotifyAmount); + } + if (message.fundMinimumInitialPurchase !== undefined) { + writer.uint32(306).string(message.fundMinimumInitialPurchase); + } + if (message.fundMinimumSubsequentPurchase !== undefined) { + writer.uint32(314).string(message.fundMinimumSubsequentPurchase); + } + if (message.fundBlueSkyStates !== undefined) { + writer.uint32(322).string(message.fundBlueSkyStates); + } + if (message.fundBlueSkyTerritories !== undefined) { + writer.uint32(330).string(message.fundBlueSkyTerritories); + } + if (message.fundDistributionPolicyIndicator !== undefined) { + writer.uint32(338).string(message.fundDistributionPolicyIndicator); + } + if (message.fundAssetType !== undefined) { + writer.uint32(346).string(message.fundAssetType); + } + if (message.cusip !== undefined) { + writer.uint32(354).string(message.cusip); + } + if (message.issueDate !== undefined) { + writer.uint32(362).string(message.issueDate); + } + if (message.ratings !== undefined) { + writer.uint32(370).string(message.ratings); + } + if (message.bondType !== undefined) { + writer.uint32(378).string(message.bondType); + } + if (message.coupon !== undefined) { + writer.uint32(385).double(message.coupon); + } + if (message.couponType !== undefined) { + writer.uint32(394).string(message.couponType); + } + if (message.convertible !== undefined) { + writer.uint32(400).bool(message.convertible); + } + if (message.callable !== undefined) { + writer.uint32(408).bool(message.callable); + } + if (message.puttable !== undefined) { + writer.uint32(416).bool(message.puttable); + } + if (message.descAppend !== undefined) { + writer.uint32(426).string(message.descAppend); + } + if (message.nextOptionDate !== undefined) { + writer.uint32(434).string(message.nextOptionDate); + } + if (message.nextOptionType !== undefined) { + writer.uint32(442).string(message.nextOptionType); + } + if (message.nextOptionPartial !== undefined) { + writer.uint32(448).bool(message.nextOptionPartial); + } + if (message.bondNotes !== undefined) { + writer.uint32(458).string(message.bondNotes); + } + for (const v of message.ineligibilityReasonList) { + IneligibilityReason.encode(v!, writer.uint32(466).fork()).join(); + } + if (message.eventContract1 !== undefined) { + writer.uint32(474).string(message.eventContract1); + } + if (message.eventContractDescription1 !== undefined) { + writer.uint32(482).string(message.eventContractDescription1); + } + if (message.eventContractDescription2 !== undefined) { + writer.uint32(490).string(message.eventContractDescription2); + } + if (message.minAlgoSize !== undefined) { + writer.uint32(498).string(message.minAlgoSize); + } + if (message.lastPricePrecision !== undefined) { + writer.uint32(506).string(message.lastPricePrecision); + } + if (message.lastSizePrecision !== undefined) { + writer.uint32(514).string(message.lastSizePrecision); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ContractDetails { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractDetails(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.marketName = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.minTick = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.orderTypes = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.validExchanges = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.priceMagnifier = reader.int32(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.underConId = reader.int32(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.longName = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.contractMonth = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.industry = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.category = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.subcategory = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.timeZoneId = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.tradingHours = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.liquidHours = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.evRule = reader.string(); + continue; + } + case 16: { + if (tag !== 129) { + break; + } + + message.evMultiplier = reader.double(); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + + const entry17 = ContractDetails_SecIdListEntry.decode(reader, reader.uint32()); + if (entry17.value !== undefined) { + message.secIdList[entry17.key] = entry17.value; + } + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.aggGroup = reader.int32(); + continue; + } + case 19: { + if (tag !== 154) { + break; + } + + message.underSymbol = reader.string(); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + + message.underSecType = reader.string(); + continue; + } + case 21: { + if (tag !== 170) { + break; + } + + message.marketRuleIds = reader.string(); + continue; + } + case 22: { + if (tag !== 178) { + break; + } + + message.realExpirationDate = reader.string(); + continue; + } + case 23: { + if (tag !== 186) { + break; + } + + message.stockType = reader.string(); + continue; + } + case 24: { + if (tag !== 194) { + break; + } + + message.minSize = reader.string(); + continue; + } + case 25: { + if (tag !== 202) { + break; + } + + message.sizeIncrement = reader.string(); + continue; + } + case 26: { + if (tag !== 210) { + break; + } + + message.suggestedSizeIncrement = reader.string(); + continue; + } + case 27: { + if (tag !== 218) { + break; + } + + message.fundName = reader.string(); + continue; + } + case 28: { + if (tag !== 226) { + break; + } + + message.fundFamily = reader.string(); + continue; + } + case 29: { + if (tag !== 234) { + break; + } + + message.fundType = reader.string(); + continue; + } + case 30: { + if (tag !== 242) { + break; + } + + message.fundFrontLoad = reader.string(); + continue; + } + case 31: { + if (tag !== 250) { + break; + } + + message.fundBackLoad = reader.string(); + continue; + } + case 32: { + if (tag !== 258) { + break; + } + + message.fundBackLoadTimeInterval = reader.string(); + continue; + } + case 33: { + if (tag !== 266) { + break; + } + + message.fundManagementFee = reader.string(); + continue; + } + case 34: { + if (tag !== 272) { + break; + } + + message.fundClosed = reader.bool(); + continue; + } + case 35: { + if (tag !== 280) { + break; + } + + message.fundClosedForNewInvestors = reader.bool(); + continue; + } + case 36: { + if (tag !== 288) { + break; + } + + message.fundClosedForNewMoney = reader.bool(); + continue; + } + case 37: { + if (tag !== 298) { + break; + } + + message.fundNotifyAmount = reader.string(); + continue; + } + case 38: { + if (tag !== 306) { + break; + } + + message.fundMinimumInitialPurchase = reader.string(); + continue; + } + case 39: { + if (tag !== 314) { + break; + } + + message.fundMinimumSubsequentPurchase = reader.string(); + continue; + } + case 40: { + if (tag !== 322) { + break; + } + + message.fundBlueSkyStates = reader.string(); + continue; + } + case 41: { + if (tag !== 330) { + break; + } + + message.fundBlueSkyTerritories = reader.string(); + continue; + } + case 42: { + if (tag !== 338) { + break; + } + + message.fundDistributionPolicyIndicator = reader.string(); + continue; + } + case 43: { + if (tag !== 346) { + break; + } + + message.fundAssetType = reader.string(); + continue; + } + case 44: { + if (tag !== 354) { + break; + } + + message.cusip = reader.string(); + continue; + } + case 45: { + if (tag !== 362) { + break; + } + + message.issueDate = reader.string(); + continue; + } + case 46: { + if (tag !== 370) { + break; + } + + message.ratings = reader.string(); + continue; + } + case 47: { + if (tag !== 378) { + break; + } + + message.bondType = reader.string(); + continue; + } + case 48: { + if (tag !== 385) { + break; + } + + message.coupon = reader.double(); + continue; + } + case 49: { + if (tag !== 394) { + break; + } + + message.couponType = reader.string(); + continue; + } + case 50: { + if (tag !== 400) { + break; + } + + message.convertible = reader.bool(); + continue; + } + case 51: { + if (tag !== 408) { + break; + } + + message.callable = reader.bool(); + continue; + } + case 52: { + if (tag !== 416) { + break; + } + + message.puttable = reader.bool(); + continue; + } + case 53: { + if (tag !== 426) { + break; + } + + message.descAppend = reader.string(); + continue; + } + case 54: { + if (tag !== 434) { + break; + } + + message.nextOptionDate = reader.string(); + continue; + } + case 55: { + if (tag !== 442) { + break; + } + + message.nextOptionType = reader.string(); + continue; + } + case 56: { + if (tag !== 448) { + break; + } + + message.nextOptionPartial = reader.bool(); + continue; + } + case 57: { + if (tag !== 458) { + break; + } + + message.bondNotes = reader.string(); + continue; + } + case 58: { + if (tag !== 466) { + break; + } + + message.ineligibilityReasonList.push(IneligibilityReason.decode(reader, reader.uint32())); + continue; + } + case 59: { + if (tag !== 474) { + break; + } + + message.eventContract1 = reader.string(); + continue; + } + case 60: { + if (tag !== 482) { + break; + } + + message.eventContractDescription1 = reader.string(); + continue; + } + case 61: { + if (tag !== 490) { + break; + } + + message.eventContractDescription2 = reader.string(); + continue; + } + case 62: { + if (tag !== 498) { + break; + } + + message.minAlgoSize = reader.string(); + continue; + } + case 63: { + if (tag !== 506) { + break; + } + + message.lastPricePrecision = reader.string(); + continue; + } + case 64: { + if (tag !== 514) { + break; + } + + message.lastSizePrecision = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ContractDetails { + return { + marketName: isSet(object.marketName) ? globalThis.String(object.marketName) : undefined, + minTick: isSet(object.minTick) ? globalThis.String(object.minTick) : undefined, + orderTypes: isSet(object.orderTypes) ? globalThis.String(object.orderTypes) : undefined, + validExchanges: isSet(object.validExchanges) ? globalThis.String(object.validExchanges) : undefined, + priceMagnifier: isSet(object.priceMagnifier) ? globalThis.Number(object.priceMagnifier) : undefined, + underConId: isSet(object.underConId) ? globalThis.Number(object.underConId) : undefined, + longName: isSet(object.longName) ? globalThis.String(object.longName) : undefined, + contractMonth: isSet(object.contractMonth) ? globalThis.String(object.contractMonth) : undefined, + industry: isSet(object.industry) ? globalThis.String(object.industry) : undefined, + category: isSet(object.category) ? globalThis.String(object.category) : undefined, + subcategory: isSet(object.subcategory) ? globalThis.String(object.subcategory) : undefined, + timeZoneId: isSet(object.timeZoneId) ? globalThis.String(object.timeZoneId) : undefined, + tradingHours: isSet(object.tradingHours) ? globalThis.String(object.tradingHours) : undefined, + liquidHours: isSet(object.liquidHours) ? globalThis.String(object.liquidHours) : undefined, + evRule: isSet(object.evRule) ? globalThis.String(object.evRule) : undefined, + evMultiplier: isSet(object.evMultiplier) ? globalThis.Number(object.evMultiplier) : undefined, + secIdList: isObject(object.secIdList) + ? (globalThis.Object.entries(object.secIdList) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + aggGroup: isSet(object.aggGroup) ? globalThis.Number(object.aggGroup) : undefined, + underSymbol: isSet(object.underSymbol) ? globalThis.String(object.underSymbol) : undefined, + underSecType: isSet(object.underSecType) ? globalThis.String(object.underSecType) : undefined, + marketRuleIds: isSet(object.marketRuleIds) ? globalThis.String(object.marketRuleIds) : undefined, + realExpirationDate: isSet(object.realExpirationDate) ? globalThis.String(object.realExpirationDate) : undefined, + stockType: isSet(object.stockType) ? globalThis.String(object.stockType) : undefined, + minSize: isSet(object.minSize) ? globalThis.String(object.minSize) : undefined, + sizeIncrement: isSet(object.sizeIncrement) ? globalThis.String(object.sizeIncrement) : undefined, + suggestedSizeIncrement: isSet(object.suggestedSizeIncrement) + ? globalThis.String(object.suggestedSizeIncrement) + : undefined, + fundName: isSet(object.fundName) ? globalThis.String(object.fundName) : undefined, + fundFamily: isSet(object.fundFamily) ? globalThis.String(object.fundFamily) : undefined, + fundType: isSet(object.fundType) ? globalThis.String(object.fundType) : undefined, + fundFrontLoad: isSet(object.fundFrontLoad) ? globalThis.String(object.fundFrontLoad) : undefined, + fundBackLoad: isSet(object.fundBackLoad) ? globalThis.String(object.fundBackLoad) : undefined, + fundBackLoadTimeInterval: isSet(object.fundBackLoadTimeInterval) + ? globalThis.String(object.fundBackLoadTimeInterval) + : undefined, + fundManagementFee: isSet(object.fundManagementFee) ? globalThis.String(object.fundManagementFee) : undefined, + fundClosed: isSet(object.fundClosed) ? globalThis.Boolean(object.fundClosed) : undefined, + fundClosedForNewInvestors: isSet(object.fundClosedForNewInvestors) + ? globalThis.Boolean(object.fundClosedForNewInvestors) + : undefined, + fundClosedForNewMoney: isSet(object.fundClosedForNewMoney) + ? globalThis.Boolean(object.fundClosedForNewMoney) + : undefined, + fundNotifyAmount: isSet(object.fundNotifyAmount) ? globalThis.String(object.fundNotifyAmount) : undefined, + fundMinimumInitialPurchase: isSet(object.fundMinimumInitialPurchase) + ? globalThis.String(object.fundMinimumInitialPurchase) + : undefined, + fundMinimumSubsequentPurchase: isSet(object.fundMinimumSubsequentPurchase) + ? globalThis.String(object.fundMinimumSubsequentPurchase) + : undefined, + fundBlueSkyStates: isSet(object.fundBlueSkyStates) ? globalThis.String(object.fundBlueSkyStates) : undefined, + fundBlueSkyTerritories: isSet(object.fundBlueSkyTerritories) + ? globalThis.String(object.fundBlueSkyTerritories) + : undefined, + fundDistributionPolicyIndicator: isSet(object.fundDistributionPolicyIndicator) + ? globalThis.String(object.fundDistributionPolicyIndicator) + : undefined, + fundAssetType: isSet(object.fundAssetType) ? globalThis.String(object.fundAssetType) : undefined, + cusip: isSet(object.cusip) ? globalThis.String(object.cusip) : undefined, + issueDate: isSet(object.issueDate) ? globalThis.String(object.issueDate) : undefined, + ratings: isSet(object.ratings) ? globalThis.String(object.ratings) : undefined, + bondType: isSet(object.bondType) ? globalThis.String(object.bondType) : undefined, + coupon: isSet(object.coupon) ? globalThis.Number(object.coupon) : undefined, + couponType: isSet(object.couponType) ? globalThis.String(object.couponType) : undefined, + convertible: isSet(object.convertible) ? globalThis.Boolean(object.convertible) : undefined, + callable: isSet(object.callable) ? globalThis.Boolean(object.callable) : undefined, + puttable: isSet(object.puttable) ? globalThis.Boolean(object.puttable) : undefined, + descAppend: isSet(object.descAppend) ? globalThis.String(object.descAppend) : undefined, + nextOptionDate: isSet(object.nextOptionDate) ? globalThis.String(object.nextOptionDate) : undefined, + nextOptionType: isSet(object.nextOptionType) ? globalThis.String(object.nextOptionType) : undefined, + nextOptionPartial: isSet(object.nextOptionPartial) ? globalThis.Boolean(object.nextOptionPartial) : undefined, + bondNotes: isSet(object.bondNotes) ? globalThis.String(object.bondNotes) : undefined, + ineligibilityReasonList: globalThis.Array.isArray(object?.ineligibilityReasonList) + ? object.ineligibilityReasonList.map((e: any) => IneligibilityReason.fromJSON(e)) + : [], + eventContract1: isSet(object.eventContract1) ? globalThis.String(object.eventContract1) : undefined, + eventContractDescription1: isSet(object.eventContractDescription1) + ? globalThis.String(object.eventContractDescription1) + : undefined, + eventContractDescription2: isSet(object.eventContractDescription2) + ? globalThis.String(object.eventContractDescription2) + : undefined, + minAlgoSize: isSet(object.minAlgoSize) ? globalThis.String(object.minAlgoSize) : undefined, + lastPricePrecision: isSet(object.lastPricePrecision) ? globalThis.String(object.lastPricePrecision) : undefined, + lastSizePrecision: isSet(object.lastSizePrecision) ? globalThis.String(object.lastSizePrecision) : undefined, + }; + }, + + toJSON(message: ContractDetails): unknown { + const obj: any = {}; + if (message.marketName !== undefined) { + obj.marketName = message.marketName; + } + if (message.minTick !== undefined) { + obj.minTick = message.minTick; + } + if (message.orderTypes !== undefined) { + obj.orderTypes = message.orderTypes; + } + if (message.validExchanges !== undefined) { + obj.validExchanges = message.validExchanges; + } + if (message.priceMagnifier !== undefined) { + obj.priceMagnifier = Math.round(message.priceMagnifier); + } + if (message.underConId !== undefined) { + obj.underConId = Math.round(message.underConId); + } + if (message.longName !== undefined) { + obj.longName = message.longName; + } + if (message.contractMonth !== undefined) { + obj.contractMonth = message.contractMonth; + } + if (message.industry !== undefined) { + obj.industry = message.industry; + } + if (message.category !== undefined) { + obj.category = message.category; + } + if (message.subcategory !== undefined) { + obj.subcategory = message.subcategory; + } + if (message.timeZoneId !== undefined) { + obj.timeZoneId = message.timeZoneId; + } + if (message.tradingHours !== undefined) { + obj.tradingHours = message.tradingHours; + } + if (message.liquidHours !== undefined) { + obj.liquidHours = message.liquidHours; + } + if (message.evRule !== undefined) { + obj.evRule = message.evRule; + } + if (message.evMultiplier !== undefined) { + obj.evMultiplier = message.evMultiplier; + } + if (message.secIdList) { + const entries = globalThis.Object.entries(message.secIdList) as [string, string][]; + if (entries.length > 0) { + obj.secIdList = {}; + entries.forEach(([k, v]) => { + obj.secIdList[k] = v; + }); + } + } + if (message.aggGroup !== undefined) { + obj.aggGroup = Math.round(message.aggGroup); + } + if (message.underSymbol !== undefined) { + obj.underSymbol = message.underSymbol; + } + if (message.underSecType !== undefined) { + obj.underSecType = message.underSecType; + } + if (message.marketRuleIds !== undefined) { + obj.marketRuleIds = message.marketRuleIds; + } + if (message.realExpirationDate !== undefined) { + obj.realExpirationDate = message.realExpirationDate; + } + if (message.stockType !== undefined) { + obj.stockType = message.stockType; + } + if (message.minSize !== undefined) { + obj.minSize = message.minSize; + } + if (message.sizeIncrement !== undefined) { + obj.sizeIncrement = message.sizeIncrement; + } + if (message.suggestedSizeIncrement !== undefined) { + obj.suggestedSizeIncrement = message.suggestedSizeIncrement; + } + if (message.fundName !== undefined) { + obj.fundName = message.fundName; + } + if (message.fundFamily !== undefined) { + obj.fundFamily = message.fundFamily; + } + if (message.fundType !== undefined) { + obj.fundType = message.fundType; + } + if (message.fundFrontLoad !== undefined) { + obj.fundFrontLoad = message.fundFrontLoad; + } + if (message.fundBackLoad !== undefined) { + obj.fundBackLoad = message.fundBackLoad; + } + if (message.fundBackLoadTimeInterval !== undefined) { + obj.fundBackLoadTimeInterval = message.fundBackLoadTimeInterval; + } + if (message.fundManagementFee !== undefined) { + obj.fundManagementFee = message.fundManagementFee; + } + if (message.fundClosed !== undefined) { + obj.fundClosed = message.fundClosed; + } + if (message.fundClosedForNewInvestors !== undefined) { + obj.fundClosedForNewInvestors = message.fundClosedForNewInvestors; + } + if (message.fundClosedForNewMoney !== undefined) { + obj.fundClosedForNewMoney = message.fundClosedForNewMoney; + } + if (message.fundNotifyAmount !== undefined) { + obj.fundNotifyAmount = message.fundNotifyAmount; + } + if (message.fundMinimumInitialPurchase !== undefined) { + obj.fundMinimumInitialPurchase = message.fundMinimumInitialPurchase; + } + if (message.fundMinimumSubsequentPurchase !== undefined) { + obj.fundMinimumSubsequentPurchase = message.fundMinimumSubsequentPurchase; + } + if (message.fundBlueSkyStates !== undefined) { + obj.fundBlueSkyStates = message.fundBlueSkyStates; + } + if (message.fundBlueSkyTerritories !== undefined) { + obj.fundBlueSkyTerritories = message.fundBlueSkyTerritories; + } + if (message.fundDistributionPolicyIndicator !== undefined) { + obj.fundDistributionPolicyIndicator = message.fundDistributionPolicyIndicator; + } + if (message.fundAssetType !== undefined) { + obj.fundAssetType = message.fundAssetType; + } + if (message.cusip !== undefined) { + obj.cusip = message.cusip; + } + if (message.issueDate !== undefined) { + obj.issueDate = message.issueDate; + } + if (message.ratings !== undefined) { + obj.ratings = message.ratings; + } + if (message.bondType !== undefined) { + obj.bondType = message.bondType; + } + if (message.coupon !== undefined) { + obj.coupon = message.coupon; + } + if (message.couponType !== undefined) { + obj.couponType = message.couponType; + } + if (message.convertible !== undefined) { + obj.convertible = message.convertible; + } + if (message.callable !== undefined) { + obj.callable = message.callable; + } + if (message.puttable !== undefined) { + obj.puttable = message.puttable; + } + if (message.descAppend !== undefined) { + obj.descAppend = message.descAppend; + } + if (message.nextOptionDate !== undefined) { + obj.nextOptionDate = message.nextOptionDate; + } + if (message.nextOptionType !== undefined) { + obj.nextOptionType = message.nextOptionType; + } + if (message.nextOptionPartial !== undefined) { + obj.nextOptionPartial = message.nextOptionPartial; + } + if (message.bondNotes !== undefined) { + obj.bondNotes = message.bondNotes; + } + if (message.ineligibilityReasonList?.length) { + obj.ineligibilityReasonList = message.ineligibilityReasonList.map((e) => IneligibilityReason.toJSON(e)); + } + if (message.eventContract1 !== undefined) { + obj.eventContract1 = message.eventContract1; + } + if (message.eventContractDescription1 !== undefined) { + obj.eventContractDescription1 = message.eventContractDescription1; + } + if (message.eventContractDescription2 !== undefined) { + obj.eventContractDescription2 = message.eventContractDescription2; + } + if (message.minAlgoSize !== undefined) { + obj.minAlgoSize = message.minAlgoSize; + } + if (message.lastPricePrecision !== undefined) { + obj.lastPricePrecision = message.lastPricePrecision; + } + if (message.lastSizePrecision !== undefined) { + obj.lastSizePrecision = message.lastSizePrecision; + } + return obj; + }, + + create(base?: DeepPartial): ContractDetails { + return ContractDetails.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ContractDetails { + const message = createBaseContractDetails(); + message.marketName = object.marketName ?? undefined; + message.minTick = object.minTick ?? undefined; + message.orderTypes = object.orderTypes ?? undefined; + message.validExchanges = object.validExchanges ?? undefined; + message.priceMagnifier = object.priceMagnifier ?? undefined; + message.underConId = object.underConId ?? undefined; + message.longName = object.longName ?? undefined; + message.contractMonth = object.contractMonth ?? undefined; + message.industry = object.industry ?? undefined; + message.category = object.category ?? undefined; + message.subcategory = object.subcategory ?? undefined; + message.timeZoneId = object.timeZoneId ?? undefined; + message.tradingHours = object.tradingHours ?? undefined; + message.liquidHours = object.liquidHours ?? undefined; + message.evRule = object.evRule ?? undefined; + message.evMultiplier = object.evMultiplier ?? undefined; + message.secIdList = (globalThis.Object.entries(object.secIdList ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + message.aggGroup = object.aggGroup ?? undefined; + message.underSymbol = object.underSymbol ?? undefined; + message.underSecType = object.underSecType ?? undefined; + message.marketRuleIds = object.marketRuleIds ?? undefined; + message.realExpirationDate = object.realExpirationDate ?? undefined; + message.stockType = object.stockType ?? undefined; + message.minSize = object.minSize ?? undefined; + message.sizeIncrement = object.sizeIncrement ?? undefined; + message.suggestedSizeIncrement = object.suggestedSizeIncrement ?? undefined; + message.fundName = object.fundName ?? undefined; + message.fundFamily = object.fundFamily ?? undefined; + message.fundType = object.fundType ?? undefined; + message.fundFrontLoad = object.fundFrontLoad ?? undefined; + message.fundBackLoad = object.fundBackLoad ?? undefined; + message.fundBackLoadTimeInterval = object.fundBackLoadTimeInterval ?? undefined; + message.fundManagementFee = object.fundManagementFee ?? undefined; + message.fundClosed = object.fundClosed ?? undefined; + message.fundClosedForNewInvestors = object.fundClosedForNewInvestors ?? undefined; + message.fundClosedForNewMoney = object.fundClosedForNewMoney ?? undefined; + message.fundNotifyAmount = object.fundNotifyAmount ?? undefined; + message.fundMinimumInitialPurchase = object.fundMinimumInitialPurchase ?? undefined; + message.fundMinimumSubsequentPurchase = object.fundMinimumSubsequentPurchase ?? undefined; + message.fundBlueSkyStates = object.fundBlueSkyStates ?? undefined; + message.fundBlueSkyTerritories = object.fundBlueSkyTerritories ?? undefined; + message.fundDistributionPolicyIndicator = object.fundDistributionPolicyIndicator ?? undefined; + message.fundAssetType = object.fundAssetType ?? undefined; + message.cusip = object.cusip ?? undefined; + message.issueDate = object.issueDate ?? undefined; + message.ratings = object.ratings ?? undefined; + message.bondType = object.bondType ?? undefined; + message.coupon = object.coupon ?? undefined; + message.couponType = object.couponType ?? undefined; + message.convertible = object.convertible ?? undefined; + message.callable = object.callable ?? undefined; + message.puttable = object.puttable ?? undefined; + message.descAppend = object.descAppend ?? undefined; + message.nextOptionDate = object.nextOptionDate ?? undefined; + message.nextOptionType = object.nextOptionType ?? undefined; + message.nextOptionPartial = object.nextOptionPartial ?? undefined; + message.bondNotes = object.bondNotes ?? undefined; + message.ineligibilityReasonList = object.ineligibilityReasonList?.map((e) => IneligibilityReason.fromPartial(e)) || + []; + message.eventContract1 = object.eventContract1 ?? undefined; + message.eventContractDescription1 = object.eventContractDescription1 ?? undefined; + message.eventContractDescription2 = object.eventContractDescription2 ?? undefined; + message.minAlgoSize = object.minAlgoSize ?? undefined; + message.lastPricePrecision = object.lastPricePrecision ?? undefined; + message.lastSizePrecision = object.lastSizePrecision ?? undefined; + return message; + }, +}; + +function createBaseContractDetails_SecIdListEntry(): ContractDetails_SecIdListEntry { + return { key: "", value: "" }; +} + +export const ContractDetails_SecIdListEntry: MessageFns = { + encode(message: ContractDetails_SecIdListEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ContractDetails_SecIdListEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractDetails_SecIdListEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ContractDetails_SecIdListEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: ContractDetails_SecIdListEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): ContractDetails_SecIdListEntry { + return ContractDetails_SecIdListEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ContractDetails_SecIdListEntry { + const message = createBaseContractDetails_SecIdListEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CurrentTime.ts b/packages/ibkr/src/protobuf/CurrentTime.ts new file mode 100644 index 00000000..c3d31a61 --- /dev/null +++ b/packages/ibkr/src/protobuf/CurrentTime.ts @@ -0,0 +1,104 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CurrentTime.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CurrentTime { + currentTime?: number | undefined; +} + +function createBaseCurrentTime(): CurrentTime { + return { currentTime: undefined }; +} + +export const CurrentTime: MessageFns = { + encode(message: CurrentTime, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.currentTime !== undefined) { + writer.uint32(8).int64(message.currentTime); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CurrentTime { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCurrentTime(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.currentTime = longToNumber(reader.int64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CurrentTime { + return { currentTime: isSet(object.currentTime) ? globalThis.Number(object.currentTime) : undefined }; + }, + + toJSON(message: CurrentTime): unknown { + const obj: any = {}; + if (message.currentTime !== undefined) { + obj.currentTime = Math.round(message.currentTime); + } + return obj; + }, + + create(base?: DeepPartial): CurrentTime { + return CurrentTime.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CurrentTime { + const message = createBaseCurrentTime(); + message.currentTime = object.currentTime ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CurrentTimeInMillis.ts b/packages/ibkr/src/protobuf/CurrentTimeInMillis.ts new file mode 100644 index 00000000..416474cb --- /dev/null +++ b/packages/ibkr/src/protobuf/CurrentTimeInMillis.ts @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CurrentTimeInMillis.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface CurrentTimeInMillis { + currentTimeInMillis?: number | undefined; +} + +function createBaseCurrentTimeInMillis(): CurrentTimeInMillis { + return { currentTimeInMillis: undefined }; +} + +export const CurrentTimeInMillis: MessageFns = { + encode(message: CurrentTimeInMillis, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.currentTimeInMillis !== undefined) { + writer.uint32(8).int64(message.currentTimeInMillis); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CurrentTimeInMillis { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCurrentTimeInMillis(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.currentTimeInMillis = longToNumber(reader.int64()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CurrentTimeInMillis { + return { + currentTimeInMillis: isSet(object.currentTimeInMillis) + ? globalThis.Number(object.currentTimeInMillis) + : undefined, + }; + }, + + toJSON(message: CurrentTimeInMillis): unknown { + const obj: any = {}; + if (message.currentTimeInMillis !== undefined) { + obj.currentTimeInMillis = Math.round(message.currentTimeInMillis); + } + return obj; + }, + + create(base?: DeepPartial): CurrentTimeInMillis { + return CurrentTimeInMillis.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CurrentTimeInMillis { + const message = createBaseCurrentTimeInMillis(); + message.currentTimeInMillis = object.currentTimeInMillis ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CurrentTimeInMillisRequest.ts b/packages/ibkr/src/protobuf/CurrentTimeInMillisRequest.ts new file mode 100644 index 00000000..42721f7a --- /dev/null +++ b/packages/ibkr/src/protobuf/CurrentTimeInMillisRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CurrentTimeInMillisRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface CurrentTimeInMillisRequest { +} + +function createBaseCurrentTimeInMillisRequest(): CurrentTimeInMillisRequest { + return {}; +} + +export const CurrentTimeInMillisRequest: MessageFns = { + encode(_: CurrentTimeInMillisRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CurrentTimeInMillisRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCurrentTimeInMillisRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): CurrentTimeInMillisRequest { + return {}; + }, + + toJSON(_: CurrentTimeInMillisRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): CurrentTimeInMillisRequest { + return CurrentTimeInMillisRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): CurrentTimeInMillisRequest { + const message = createBaseCurrentTimeInMillisRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/CurrentTimeRequest.ts b/packages/ibkr/src/protobuf/CurrentTimeRequest.ts new file mode 100644 index 00000000..b50d4807 --- /dev/null +++ b/packages/ibkr/src/protobuf/CurrentTimeRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: CurrentTimeRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface CurrentTimeRequest { +} + +function createBaseCurrentTimeRequest(): CurrentTimeRequest { + return {}; +} + +export const CurrentTimeRequest: MessageFns = { + encode(_: CurrentTimeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CurrentTimeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCurrentTimeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): CurrentTimeRequest { + return {}; + }, + + toJSON(_: CurrentTimeRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): CurrentTimeRequest { + return CurrentTimeRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): CurrentTimeRequest { + const message = createBaseCurrentTimeRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/DeltaNeutralContract.ts b/packages/ibkr/src/protobuf/DeltaNeutralContract.ts new file mode 100644 index 00000000..986fd25e --- /dev/null +++ b/packages/ibkr/src/protobuf/DeltaNeutralContract.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: DeltaNeutralContract.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface DeltaNeutralContract { + conId?: number | undefined; + delta?: number | undefined; + price?: number | undefined; +} + +function createBaseDeltaNeutralContract(): DeltaNeutralContract { + return { conId: undefined, delta: undefined, price: undefined }; +} + +export const DeltaNeutralContract: MessageFns = { + encode(message: DeltaNeutralContract, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.conId !== undefined) { + writer.uint32(8).int32(message.conId); + } + if (message.delta !== undefined) { + writer.uint32(17).double(message.delta); + } + if (message.price !== undefined) { + writer.uint32(25).double(message.price); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeltaNeutralContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeltaNeutralContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.conId = reader.int32(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.delta = reader.double(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.price = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeltaNeutralContract { + return { + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + delta: isSet(object.delta) ? globalThis.Number(object.delta) : undefined, + price: isSet(object.price) ? globalThis.Number(object.price) : undefined, + }; + }, + + toJSON(message: DeltaNeutralContract): unknown { + const obj: any = {}; + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + if (message.delta !== undefined) { + obj.delta = message.delta; + } + if (message.price !== undefined) { + obj.price = message.price; + } + return obj; + }, + + create(base?: DeepPartial): DeltaNeutralContract { + return DeltaNeutralContract.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeltaNeutralContract { + const message = createBaseDeltaNeutralContract(); + message.conId = object.conId ?? undefined; + message.delta = object.delta ?? undefined; + message.price = object.price ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/DepthMarketDataDescription.ts b/packages/ibkr/src/protobuf/DepthMarketDataDescription.ts new file mode 100644 index 00000000..36c97558 --- /dev/null +++ b/packages/ibkr/src/protobuf/DepthMarketDataDescription.ts @@ -0,0 +1,169 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: DepthMarketDataDescription.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface DepthMarketDataDescription { + exchange?: string | undefined; + secType?: string | undefined; + listingExch?: string | undefined; + serviceDataType?: string | undefined; + aggGroup?: number | undefined; +} + +function createBaseDepthMarketDataDescription(): DepthMarketDataDescription { + return { + exchange: undefined, + secType: undefined, + listingExch: undefined, + serviceDataType: undefined, + aggGroup: undefined, + }; +} + +export const DepthMarketDataDescription: MessageFns = { + encode(message: DepthMarketDataDescription, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.exchange !== undefined) { + writer.uint32(10).string(message.exchange); + } + if (message.secType !== undefined) { + writer.uint32(18).string(message.secType); + } + if (message.listingExch !== undefined) { + writer.uint32(26).string(message.listingExch); + } + if (message.serviceDataType !== undefined) { + writer.uint32(34).string(message.serviceDataType); + } + if (message.aggGroup !== undefined) { + writer.uint32(40).int32(message.aggGroup); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DepthMarketDataDescription { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepthMarketDataDescription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.secType = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.listingExch = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.serviceDataType = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.aggGroup = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DepthMarketDataDescription { + return { + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + secType: isSet(object.secType) ? globalThis.String(object.secType) : undefined, + listingExch: isSet(object.listingExch) ? globalThis.String(object.listingExch) : undefined, + serviceDataType: isSet(object.serviceDataType) ? globalThis.String(object.serviceDataType) : undefined, + aggGroup: isSet(object.aggGroup) ? globalThis.Number(object.aggGroup) : undefined, + }; + }, + + toJSON(message: DepthMarketDataDescription): unknown { + const obj: any = {}; + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.secType !== undefined) { + obj.secType = message.secType; + } + if (message.listingExch !== undefined) { + obj.listingExch = message.listingExch; + } + if (message.serviceDataType !== undefined) { + obj.serviceDataType = message.serviceDataType; + } + if (message.aggGroup !== undefined) { + obj.aggGroup = Math.round(message.aggGroup); + } + return obj; + }, + + create(base?: DeepPartial): DepthMarketDataDescription { + return DepthMarketDataDescription.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DepthMarketDataDescription { + const message = createBaseDepthMarketDataDescription(); + message.exchange = object.exchange ?? undefined; + message.secType = object.secType ?? undefined; + message.listingExch = object.listingExch ?? undefined; + message.serviceDataType = object.serviceDataType ?? undefined; + message.aggGroup = object.aggGroup ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/DisplayGroupList.ts b/packages/ibkr/src/protobuf/DisplayGroupList.ts new file mode 100644 index 00000000..91d33105 --- /dev/null +++ b/packages/ibkr/src/protobuf/DisplayGroupList.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: DisplayGroupList.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface DisplayGroupList { + reqId?: number | undefined; + groups?: string | undefined; +} + +function createBaseDisplayGroupList(): DisplayGroupList { + return { reqId: undefined, groups: undefined }; +} + +export const DisplayGroupList: MessageFns = { + encode(message: DisplayGroupList, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.groups !== undefined) { + writer.uint32(18).string(message.groups); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DisplayGroupList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDisplayGroupList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.groups = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DisplayGroupList { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + groups: isSet(object.groups) ? globalThis.String(object.groups) : undefined, + }; + }, + + toJSON(message: DisplayGroupList): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.groups !== undefined) { + obj.groups = message.groups; + } + return obj; + }, + + create(base?: DeepPartial): DisplayGroupList { + return DisplayGroupList.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DisplayGroupList { + const message = createBaseDisplayGroupList(); + message.reqId = object.reqId ?? undefined; + message.groups = object.groups ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/DisplayGroupUpdated.ts b/packages/ibkr/src/protobuf/DisplayGroupUpdated.ts new file mode 100644 index 00000000..b7da4a9e --- /dev/null +++ b/packages/ibkr/src/protobuf/DisplayGroupUpdated.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: DisplayGroupUpdated.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface DisplayGroupUpdated { + reqId?: number | undefined; + contractInfo?: string | undefined; +} + +function createBaseDisplayGroupUpdated(): DisplayGroupUpdated { + return { reqId: undefined, contractInfo: undefined }; +} + +export const DisplayGroupUpdated: MessageFns = { + encode(message: DisplayGroupUpdated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contractInfo !== undefined) { + writer.uint32(18).string(message.contractInfo); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DisplayGroupUpdated { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDisplayGroupUpdated(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contractInfo = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DisplayGroupUpdated { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contractInfo: isSet(object.contractInfo) ? globalThis.String(object.contractInfo) : undefined, + }; + }, + + toJSON(message: DisplayGroupUpdated): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contractInfo !== undefined) { + obj.contractInfo = message.contractInfo; + } + return obj; + }, + + create(base?: DeepPartial): DisplayGroupUpdated { + return DisplayGroupUpdated.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DisplayGroupUpdated { + const message = createBaseDisplayGroupUpdated(); + message.reqId = object.reqId ?? undefined; + message.contractInfo = object.contractInfo ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ErrorMessage.ts b/packages/ibkr/src/protobuf/ErrorMessage.ts new file mode 100644 index 00000000..b9cc509a --- /dev/null +++ b/packages/ibkr/src/protobuf/ErrorMessage.ts @@ -0,0 +1,182 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ErrorMessage.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ErrorMessage { + id?: number | undefined; + errorTime?: number | undefined; + errorCode?: number | undefined; + errorMsg?: string | undefined; + advancedOrderRejectJson?: string | undefined; +} + +function createBaseErrorMessage(): ErrorMessage { + return { + id: undefined, + errorTime: undefined, + errorCode: undefined, + errorMsg: undefined, + advancedOrderRejectJson: undefined, + }; +} + +export const ErrorMessage: MessageFns = { + encode(message: ErrorMessage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== undefined) { + writer.uint32(8).int32(message.id); + } + if (message.errorTime !== undefined) { + writer.uint32(16).int64(message.errorTime); + } + if (message.errorCode !== undefined) { + writer.uint32(24).int32(message.errorCode); + } + if (message.errorMsg !== undefined) { + writer.uint32(34).string(message.errorMsg); + } + if (message.advancedOrderRejectJson !== undefined) { + writer.uint32(42).string(message.advancedOrderRejectJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ErrorMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseErrorMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.errorTime = longToNumber(reader.int64()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.errorCode = reader.int32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.errorMsg = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.advancedOrderRejectJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ErrorMessage { + return { + id: isSet(object.id) ? globalThis.Number(object.id) : undefined, + errorTime: isSet(object.errorTime) ? globalThis.Number(object.errorTime) : undefined, + errorCode: isSet(object.errorCode) ? globalThis.Number(object.errorCode) : undefined, + errorMsg: isSet(object.errorMsg) ? globalThis.String(object.errorMsg) : undefined, + advancedOrderRejectJson: isSet(object.advancedOrderRejectJson) + ? globalThis.String(object.advancedOrderRejectJson) + : undefined, + }; + }, + + toJSON(message: ErrorMessage): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = Math.round(message.id); + } + if (message.errorTime !== undefined) { + obj.errorTime = Math.round(message.errorTime); + } + if (message.errorCode !== undefined) { + obj.errorCode = Math.round(message.errorCode); + } + if (message.errorMsg !== undefined) { + obj.errorMsg = message.errorMsg; + } + if (message.advancedOrderRejectJson !== undefined) { + obj.advancedOrderRejectJson = message.advancedOrderRejectJson; + } + return obj; + }, + + create(base?: DeepPartial): ErrorMessage { + return ErrorMessage.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ErrorMessage { + const message = createBaseErrorMessage(); + message.id = object.id ?? undefined; + message.errorTime = object.errorTime ?? undefined; + message.errorCode = object.errorCode ?? undefined; + message.errorMsg = object.errorMsg ?? undefined; + message.advancedOrderRejectJson = object.advancedOrderRejectJson ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/Execution.ts b/packages/ibkr/src/protobuf/Execution.ts new file mode 100644 index 00000000..913bd309 --- /dev/null +++ b/packages/ibkr/src/protobuf/Execution.ts @@ -0,0 +1,472 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: Execution.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface Execution { + orderId?: number | undefined; + execId?: string | undefined; + time?: string | undefined; + acctNumber?: string | undefined; + exchange?: string | undefined; + side?: string | undefined; + shares?: string | undefined; + price?: number | undefined; + permId?: number | undefined; + clientId?: number | undefined; + isLiquidation?: boolean | undefined; + cumQty?: string | undefined; + avgPrice?: number | undefined; + orderRef?: string | undefined; + evRule?: string | undefined; + evMultiplier?: number | undefined; + modelCode?: string | undefined; + lastLiquidity?: number | undefined; + isPriceRevisionPending?: boolean | undefined; + submitter?: string | undefined; + optExerciseOrLapseType?: number | undefined; +} + +function createBaseExecution(): Execution { + return { + orderId: undefined, + execId: undefined, + time: undefined, + acctNumber: undefined, + exchange: undefined, + side: undefined, + shares: undefined, + price: undefined, + permId: undefined, + clientId: undefined, + isLiquidation: undefined, + cumQty: undefined, + avgPrice: undefined, + orderRef: undefined, + evRule: undefined, + evMultiplier: undefined, + modelCode: undefined, + lastLiquidity: undefined, + isPriceRevisionPending: undefined, + submitter: undefined, + optExerciseOrLapseType: undefined, + }; +} + +export const Execution: MessageFns = { + encode(message: Execution, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.orderId !== undefined) { + writer.uint32(8).int32(message.orderId); + } + if (message.execId !== undefined) { + writer.uint32(18).string(message.execId); + } + if (message.time !== undefined) { + writer.uint32(26).string(message.time); + } + if (message.acctNumber !== undefined) { + writer.uint32(34).string(message.acctNumber); + } + if (message.exchange !== undefined) { + writer.uint32(42).string(message.exchange); + } + if (message.side !== undefined) { + writer.uint32(50).string(message.side); + } + if (message.shares !== undefined) { + writer.uint32(58).string(message.shares); + } + if (message.price !== undefined) { + writer.uint32(65).double(message.price); + } + if (message.permId !== undefined) { + writer.uint32(72).int64(message.permId); + } + if (message.clientId !== undefined) { + writer.uint32(80).int32(message.clientId); + } + if (message.isLiquidation !== undefined) { + writer.uint32(88).bool(message.isLiquidation); + } + if (message.cumQty !== undefined) { + writer.uint32(98).string(message.cumQty); + } + if (message.avgPrice !== undefined) { + writer.uint32(105).double(message.avgPrice); + } + if (message.orderRef !== undefined) { + writer.uint32(114).string(message.orderRef); + } + if (message.evRule !== undefined) { + writer.uint32(122).string(message.evRule); + } + if (message.evMultiplier !== undefined) { + writer.uint32(129).double(message.evMultiplier); + } + if (message.modelCode !== undefined) { + writer.uint32(138).string(message.modelCode); + } + if (message.lastLiquidity !== undefined) { + writer.uint32(144).int32(message.lastLiquidity); + } + if (message.isPriceRevisionPending !== undefined) { + writer.uint32(152).bool(message.isPriceRevisionPending); + } + if (message.submitter !== undefined) { + writer.uint32(162).string(message.submitter); + } + if (message.optExerciseOrLapseType !== undefined) { + writer.uint32(168).int32(message.optExerciseOrLapseType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Execution { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecution(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.orderId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.execId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.time = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.acctNumber = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.side = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.shares = reader.string(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.price = reader.double(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.permId = longToNumber(reader.int64()); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.clientId = reader.int32(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.isLiquidation = reader.bool(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.cumQty = reader.string(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.avgPrice = reader.double(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.orderRef = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.evRule = reader.string(); + continue; + } + case 16: { + if (tag !== 129) { + break; + } + + message.evMultiplier = reader.double(); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + + message.modelCode = reader.string(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.lastLiquidity = reader.int32(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.isPriceRevisionPending = reader.bool(); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + + message.submitter = reader.string(); + continue; + } + case 21: { + if (tag !== 168) { + break; + } + + message.optExerciseOrLapseType = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Execution { + return { + orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined, + execId: isSet(object.execId) ? globalThis.String(object.execId) : undefined, + time: isSet(object.time) ? globalThis.String(object.time) : undefined, + acctNumber: isSet(object.acctNumber) ? globalThis.String(object.acctNumber) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + side: isSet(object.side) ? globalThis.String(object.side) : undefined, + shares: isSet(object.shares) ? globalThis.String(object.shares) : undefined, + price: isSet(object.price) ? globalThis.Number(object.price) : undefined, + permId: isSet(object.permId) ? globalThis.Number(object.permId) : undefined, + clientId: isSet(object.clientId) ? globalThis.Number(object.clientId) : undefined, + isLiquidation: isSet(object.isLiquidation) ? globalThis.Boolean(object.isLiquidation) : undefined, + cumQty: isSet(object.cumQty) ? globalThis.String(object.cumQty) : undefined, + avgPrice: isSet(object.avgPrice) ? globalThis.Number(object.avgPrice) : undefined, + orderRef: isSet(object.orderRef) ? globalThis.String(object.orderRef) : undefined, + evRule: isSet(object.evRule) ? globalThis.String(object.evRule) : undefined, + evMultiplier: isSet(object.evMultiplier) ? globalThis.Number(object.evMultiplier) : undefined, + modelCode: isSet(object.modelCode) ? globalThis.String(object.modelCode) : undefined, + lastLiquidity: isSet(object.lastLiquidity) ? globalThis.Number(object.lastLiquidity) : undefined, + isPriceRevisionPending: isSet(object.isPriceRevisionPending) + ? globalThis.Boolean(object.isPriceRevisionPending) + : undefined, + submitter: isSet(object.submitter) ? globalThis.String(object.submitter) : undefined, + optExerciseOrLapseType: isSet(object.optExerciseOrLapseType) + ? globalThis.Number(object.optExerciseOrLapseType) + : undefined, + }; + }, + + toJSON(message: Execution): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + if (message.execId !== undefined) { + obj.execId = message.execId; + } + if (message.time !== undefined) { + obj.time = message.time; + } + if (message.acctNumber !== undefined) { + obj.acctNumber = message.acctNumber; + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.side !== undefined) { + obj.side = message.side; + } + if (message.shares !== undefined) { + obj.shares = message.shares; + } + if (message.price !== undefined) { + obj.price = message.price; + } + if (message.permId !== undefined) { + obj.permId = Math.round(message.permId); + } + if (message.clientId !== undefined) { + obj.clientId = Math.round(message.clientId); + } + if (message.isLiquidation !== undefined) { + obj.isLiquidation = message.isLiquidation; + } + if (message.cumQty !== undefined) { + obj.cumQty = message.cumQty; + } + if (message.avgPrice !== undefined) { + obj.avgPrice = message.avgPrice; + } + if (message.orderRef !== undefined) { + obj.orderRef = message.orderRef; + } + if (message.evRule !== undefined) { + obj.evRule = message.evRule; + } + if (message.evMultiplier !== undefined) { + obj.evMultiplier = message.evMultiplier; + } + if (message.modelCode !== undefined) { + obj.modelCode = message.modelCode; + } + if (message.lastLiquidity !== undefined) { + obj.lastLiquidity = Math.round(message.lastLiquidity); + } + if (message.isPriceRevisionPending !== undefined) { + obj.isPriceRevisionPending = message.isPriceRevisionPending; + } + if (message.submitter !== undefined) { + obj.submitter = message.submitter; + } + if (message.optExerciseOrLapseType !== undefined) { + obj.optExerciseOrLapseType = Math.round(message.optExerciseOrLapseType); + } + return obj; + }, + + create(base?: DeepPartial): Execution { + return Execution.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Execution { + const message = createBaseExecution(); + message.orderId = object.orderId ?? undefined; + message.execId = object.execId ?? undefined; + message.time = object.time ?? undefined; + message.acctNumber = object.acctNumber ?? undefined; + message.exchange = object.exchange ?? undefined; + message.side = object.side ?? undefined; + message.shares = object.shares ?? undefined; + message.price = object.price ?? undefined; + message.permId = object.permId ?? undefined; + message.clientId = object.clientId ?? undefined; + message.isLiquidation = object.isLiquidation ?? undefined; + message.cumQty = object.cumQty ?? undefined; + message.avgPrice = object.avgPrice ?? undefined; + message.orderRef = object.orderRef ?? undefined; + message.evRule = object.evRule ?? undefined; + message.evMultiplier = object.evMultiplier ?? undefined; + message.modelCode = object.modelCode ?? undefined; + message.lastLiquidity = object.lastLiquidity ?? undefined; + message.isPriceRevisionPending = object.isPriceRevisionPending ?? undefined; + message.submitter = object.submitter ?? undefined; + message.optExerciseOrLapseType = object.optExerciseOrLapseType ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ExecutionDetails.ts b/packages/ibkr/src/protobuf/ExecutionDetails.ts new file mode 100644 index 00000000..b422e80d --- /dev/null +++ b/packages/ibkr/src/protobuf/ExecutionDetails.ts @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ExecutionDetails.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; +import { Execution } from "./Execution"; + +export const protobufPackage = "protobuf"; + +export interface ExecutionDetails { + reqId?: number | undefined; + contract?: Contract | undefined; + execution?: Execution | undefined; +} + +function createBaseExecutionDetails(): ExecutionDetails { + return { reqId: undefined, contract: undefined, execution: undefined }; +} + +export const ExecutionDetails: MessageFns = { + encode(message: ExecutionDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.execution !== undefined) { + Execution.encode(message.execution, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExecutionDetails { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecutionDetails(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.execution = Execution.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExecutionDetails { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + execution: isSet(object.execution) ? Execution.fromJSON(object.execution) : undefined, + }; + }, + + toJSON(message: ExecutionDetails): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.execution !== undefined) { + obj.execution = Execution.toJSON(message.execution); + } + return obj; + }, + + create(base?: DeepPartial): ExecutionDetails { + return ExecutionDetails.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExecutionDetails { + const message = createBaseExecutionDetails(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.execution = (object.execution !== undefined && object.execution !== null) + ? Execution.fromPartial(object.execution) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ExecutionDetailsEnd.ts b/packages/ibkr/src/protobuf/ExecutionDetailsEnd.ts new file mode 100644 index 00000000..14c92abc --- /dev/null +++ b/packages/ibkr/src/protobuf/ExecutionDetailsEnd.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ExecutionDetailsEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ExecutionDetailsEnd { + reqId?: number | undefined; +} + +function createBaseExecutionDetailsEnd(): ExecutionDetailsEnd { + return { reqId: undefined }; +} + +export const ExecutionDetailsEnd: MessageFns = { + encode(message: ExecutionDetailsEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExecutionDetailsEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecutionDetailsEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExecutionDetailsEnd { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: ExecutionDetailsEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): ExecutionDetailsEnd { + return ExecutionDetailsEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExecutionDetailsEnd { + const message = createBaseExecutionDetailsEnd(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ExecutionFilter.ts b/packages/ibkr/src/protobuf/ExecutionFilter.ts new file mode 100644 index 00000000..c36b100c --- /dev/null +++ b/packages/ibkr/src/protobuf/ExecutionFilter.ts @@ -0,0 +1,255 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ExecutionFilter.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ExecutionFilter { + clientId?: number | undefined; + acctCode?: string | undefined; + time?: string | undefined; + symbol?: string | undefined; + secType?: string | undefined; + exchange?: string | undefined; + side?: string | undefined; + lastNDays?: number | undefined; + specificDates: number[]; +} + +function createBaseExecutionFilter(): ExecutionFilter { + return { + clientId: undefined, + acctCode: undefined, + time: undefined, + symbol: undefined, + secType: undefined, + exchange: undefined, + side: undefined, + lastNDays: undefined, + specificDates: [], + }; +} + +export const ExecutionFilter: MessageFns = { + encode(message: ExecutionFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.clientId !== undefined) { + writer.uint32(8).int32(message.clientId); + } + if (message.acctCode !== undefined) { + writer.uint32(18).string(message.acctCode); + } + if (message.time !== undefined) { + writer.uint32(26).string(message.time); + } + if (message.symbol !== undefined) { + writer.uint32(34).string(message.symbol); + } + if (message.secType !== undefined) { + writer.uint32(42).string(message.secType); + } + if (message.exchange !== undefined) { + writer.uint32(50).string(message.exchange); + } + if (message.side !== undefined) { + writer.uint32(58).string(message.side); + } + if (message.lastNDays !== undefined) { + writer.uint32(64).int32(message.lastNDays); + } + writer.uint32(74).fork(); + for (const v of message.specificDates) { + writer.int32(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExecutionFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecutionFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.clientId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.acctCode = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.time = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.symbol = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.secType = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.side = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.lastNDays = reader.int32(); + continue; + } + case 9: { + if (tag === 72) { + message.specificDates.push(reader.int32()); + + continue; + } + + if (tag === 74) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.specificDates.push(reader.int32()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExecutionFilter { + return { + clientId: isSet(object.clientId) ? globalThis.Number(object.clientId) : undefined, + acctCode: isSet(object.acctCode) ? globalThis.String(object.acctCode) : undefined, + time: isSet(object.time) ? globalThis.String(object.time) : undefined, + symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : undefined, + secType: isSet(object.secType) ? globalThis.String(object.secType) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + side: isSet(object.side) ? globalThis.String(object.side) : undefined, + lastNDays: isSet(object.lastNDays) ? globalThis.Number(object.lastNDays) : undefined, + specificDates: globalThis.Array.isArray(object?.specificDates) + ? object.specificDates.map((e: any) => globalThis.Number(e)) + : [], + }; + }, + + toJSON(message: ExecutionFilter): unknown { + const obj: any = {}; + if (message.clientId !== undefined) { + obj.clientId = Math.round(message.clientId); + } + if (message.acctCode !== undefined) { + obj.acctCode = message.acctCode; + } + if (message.time !== undefined) { + obj.time = message.time; + } + if (message.symbol !== undefined) { + obj.symbol = message.symbol; + } + if (message.secType !== undefined) { + obj.secType = message.secType; + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.side !== undefined) { + obj.side = message.side; + } + if (message.lastNDays !== undefined) { + obj.lastNDays = Math.round(message.lastNDays); + } + if (message.specificDates?.length) { + obj.specificDates = message.specificDates.map((e) => Math.round(e)); + } + return obj; + }, + + create(base?: DeepPartial): ExecutionFilter { + return ExecutionFilter.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExecutionFilter { + const message = createBaseExecutionFilter(); + message.clientId = object.clientId ?? undefined; + message.acctCode = object.acctCode ?? undefined; + message.time = object.time ?? undefined; + message.symbol = object.symbol ?? undefined; + message.secType = object.secType ?? undefined; + message.exchange = object.exchange ?? undefined; + message.side = object.side ?? undefined; + message.lastNDays = object.lastNDays ?? undefined; + message.specificDates = object.specificDates?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ExecutionRequest.ts b/packages/ibkr/src/protobuf/ExecutionRequest.ts new file mode 100644 index 00000000..b81f3be4 --- /dev/null +++ b/packages/ibkr/src/protobuf/ExecutionRequest.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ExecutionRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { ExecutionFilter } from "./ExecutionFilter"; + +export const protobufPackage = "protobuf"; + +export interface ExecutionRequest { + reqId?: number | undefined; + executionFilter?: ExecutionFilter | undefined; +} + +function createBaseExecutionRequest(): ExecutionRequest { + return { reqId: undefined, executionFilter: undefined }; +} + +export const ExecutionRequest: MessageFns = { + encode(message: ExecutionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.executionFilter !== undefined) { + ExecutionFilter.encode(message.executionFilter, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExecutionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecutionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.executionFilter = ExecutionFilter.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExecutionRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + executionFilter: isSet(object.executionFilter) ? ExecutionFilter.fromJSON(object.executionFilter) : undefined, + }; + }, + + toJSON(message: ExecutionRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.executionFilter !== undefined) { + obj.executionFilter = ExecutionFilter.toJSON(message.executionFilter); + } + return obj; + }, + + create(base?: DeepPartial): ExecutionRequest { + return ExecutionRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExecutionRequest { + const message = createBaseExecutionRequest(); + message.reqId = object.reqId ?? undefined; + message.executionFilter = (object.executionFilter !== undefined && object.executionFilter !== null) + ? ExecutionFilter.fromPartial(object.executionFilter) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ExerciseOptionsRequest.ts b/packages/ibkr/src/protobuf/ExerciseOptionsRequest.ts new file mode 100644 index 00000000..f74d85f4 --- /dev/null +++ b/packages/ibkr/src/protobuf/ExerciseOptionsRequest.ts @@ -0,0 +1,246 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ExerciseOptionsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface ExerciseOptionsRequest { + orderId?: number | undefined; + contract?: Contract | undefined; + exerciseAction?: number | undefined; + exerciseQuantity?: number | undefined; + account?: string | undefined; + override?: boolean | undefined; + manualOrderTime?: string | undefined; + customerAccount?: string | undefined; + professionalCustomer?: boolean | undefined; +} + +function createBaseExerciseOptionsRequest(): ExerciseOptionsRequest { + return { + orderId: undefined, + contract: undefined, + exerciseAction: undefined, + exerciseQuantity: undefined, + account: undefined, + override: undefined, + manualOrderTime: undefined, + customerAccount: undefined, + professionalCustomer: undefined, + }; +} + +export const ExerciseOptionsRequest: MessageFns = { + encode(message: ExerciseOptionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.orderId !== undefined) { + writer.uint32(8).int32(message.orderId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.exerciseAction !== undefined) { + writer.uint32(24).int32(message.exerciseAction); + } + if (message.exerciseQuantity !== undefined) { + writer.uint32(32).int32(message.exerciseQuantity); + } + if (message.account !== undefined) { + writer.uint32(42).string(message.account); + } + if (message.override !== undefined) { + writer.uint32(48).bool(message.override); + } + if (message.manualOrderTime !== undefined) { + writer.uint32(58).string(message.manualOrderTime); + } + if (message.customerAccount !== undefined) { + writer.uint32(66).string(message.customerAccount); + } + if (message.professionalCustomer !== undefined) { + writer.uint32(72).bool(message.professionalCustomer); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExerciseOptionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExerciseOptionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.orderId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.exerciseAction = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.exerciseQuantity = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.account = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.override = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.manualOrderTime = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.customerAccount = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.professionalCustomer = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExerciseOptionsRequest { + return { + orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + exerciseAction: isSet(object.exerciseAction) ? globalThis.Number(object.exerciseAction) : undefined, + exerciseQuantity: isSet(object.exerciseQuantity) ? globalThis.Number(object.exerciseQuantity) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + override: isSet(object.override) ? globalThis.Boolean(object.override) : undefined, + manualOrderTime: isSet(object.manualOrderTime) ? globalThis.String(object.manualOrderTime) : undefined, + customerAccount: isSet(object.customerAccount) ? globalThis.String(object.customerAccount) : undefined, + professionalCustomer: isSet(object.professionalCustomer) + ? globalThis.Boolean(object.professionalCustomer) + : undefined, + }; + }, + + toJSON(message: ExerciseOptionsRequest): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.exerciseAction !== undefined) { + obj.exerciseAction = Math.round(message.exerciseAction); + } + if (message.exerciseQuantity !== undefined) { + obj.exerciseQuantity = Math.round(message.exerciseQuantity); + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.override !== undefined) { + obj.override = message.override; + } + if (message.manualOrderTime !== undefined) { + obj.manualOrderTime = message.manualOrderTime; + } + if (message.customerAccount !== undefined) { + obj.customerAccount = message.customerAccount; + } + if (message.professionalCustomer !== undefined) { + obj.professionalCustomer = message.professionalCustomer; + } + return obj; + }, + + create(base?: DeepPartial): ExerciseOptionsRequest { + return ExerciseOptionsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExerciseOptionsRequest { + const message = createBaseExerciseOptionsRequest(); + message.orderId = object.orderId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.exerciseAction = object.exerciseAction ?? undefined; + message.exerciseQuantity = object.exerciseQuantity ?? undefined; + message.account = object.account ?? undefined; + message.override = object.override ?? undefined; + message.manualOrderTime = object.manualOrderTime ?? undefined; + message.customerAccount = object.customerAccount ?? undefined; + message.professionalCustomer = object.professionalCustomer ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/FAReplace.ts b/packages/ibkr/src/protobuf/FAReplace.ts new file mode 100644 index 00000000..5d12ee7a --- /dev/null +++ b/packages/ibkr/src/protobuf/FAReplace.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: FAReplace.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface FAReplace { + reqId?: number | undefined; + faDataType?: number | undefined; + xml?: string | undefined; +} + +function createBaseFAReplace(): FAReplace { + return { reqId: undefined, faDataType: undefined, xml: undefined }; +} + +export const FAReplace: MessageFns = { + encode(message: FAReplace, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.faDataType !== undefined) { + writer.uint32(16).int32(message.faDataType); + } + if (message.xml !== undefined) { + writer.uint32(26).string(message.xml); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FAReplace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFAReplace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.faDataType = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.xml = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FAReplace { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + faDataType: isSet(object.faDataType) ? globalThis.Number(object.faDataType) : undefined, + xml: isSet(object.xml) ? globalThis.String(object.xml) : undefined, + }; + }, + + toJSON(message: FAReplace): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.faDataType !== undefined) { + obj.faDataType = Math.round(message.faDataType); + } + if (message.xml !== undefined) { + obj.xml = message.xml; + } + return obj; + }, + + create(base?: DeepPartial): FAReplace { + return FAReplace.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FAReplace { + const message = createBaseFAReplace(); + message.reqId = object.reqId ?? undefined; + message.faDataType = object.faDataType ?? undefined; + message.xml = object.xml ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/FARequest.ts b/packages/ibkr/src/protobuf/FARequest.ts new file mode 100644 index 00000000..8e0f40c8 --- /dev/null +++ b/packages/ibkr/src/protobuf/FARequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: FARequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface FARequest { + faDataType?: number | undefined; +} + +function createBaseFARequest(): FARequest { + return { faDataType: undefined }; +} + +export const FARequest: MessageFns = { + encode(message: FARequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.faDataType !== undefined) { + writer.uint32(8).int32(message.faDataType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FARequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFARequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.faDataType = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FARequest { + return { faDataType: isSet(object.faDataType) ? globalThis.Number(object.faDataType) : undefined }; + }, + + toJSON(message: FARequest): unknown { + const obj: any = {}; + if (message.faDataType !== undefined) { + obj.faDataType = Math.round(message.faDataType); + } + return obj; + }, + + create(base?: DeepPartial): FARequest { + return FARequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FARequest { + const message = createBaseFARequest(); + message.faDataType = object.faDataType ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/FamilyCode.ts b/packages/ibkr/src/protobuf/FamilyCode.ts new file mode 100644 index 00000000..13e5d9e6 --- /dev/null +++ b/packages/ibkr/src/protobuf/FamilyCode.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: FamilyCode.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface FamilyCode { + accountId?: string | undefined; + familyCode?: string | undefined; +} + +function createBaseFamilyCode(): FamilyCode { + return { accountId: undefined, familyCode: undefined }; +} + +export const FamilyCode: MessageFns = { + encode(message: FamilyCode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.accountId !== undefined) { + writer.uint32(10).string(message.accountId); + } + if (message.familyCode !== undefined) { + writer.uint32(18).string(message.familyCode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FamilyCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFamilyCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.accountId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.familyCode = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FamilyCode { + return { + accountId: isSet(object.accountId) ? globalThis.String(object.accountId) : undefined, + familyCode: isSet(object.familyCode) ? globalThis.String(object.familyCode) : undefined, + }; + }, + + toJSON(message: FamilyCode): unknown { + const obj: any = {}; + if (message.accountId !== undefined) { + obj.accountId = message.accountId; + } + if (message.familyCode !== undefined) { + obj.familyCode = message.familyCode; + } + return obj; + }, + + create(base?: DeepPartial): FamilyCode { + return FamilyCode.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FamilyCode { + const message = createBaseFamilyCode(); + message.accountId = object.accountId ?? undefined; + message.familyCode = object.familyCode ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/FamilyCodes.ts b/packages/ibkr/src/protobuf/FamilyCodes.ts new file mode 100644 index 00000000..b37ac45f --- /dev/null +++ b/packages/ibkr/src/protobuf/FamilyCodes.ts @@ -0,0 +1,94 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: FamilyCodes.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { FamilyCode } from "./FamilyCode"; + +export const protobufPackage = "protobuf"; + +export interface FamilyCodes { + familyCodes: FamilyCode[]; +} + +function createBaseFamilyCodes(): FamilyCodes { + return { familyCodes: [] }; +} + +export const FamilyCodes: MessageFns = { + encode(message: FamilyCodes, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.familyCodes) { + FamilyCode.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FamilyCodes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFamilyCodes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.familyCodes.push(FamilyCode.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FamilyCodes { + return { + familyCodes: globalThis.Array.isArray(object?.familyCodes) + ? object.familyCodes.map((e: any) => FamilyCode.fromJSON(e)) + : [], + }; + }, + + toJSON(message: FamilyCodes): unknown { + const obj: any = {}; + if (message.familyCodes?.length) { + obj.familyCodes = message.familyCodes.map((e) => FamilyCode.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): FamilyCodes { + return FamilyCodes.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FamilyCodes { + const message = createBaseFamilyCodes(); + message.familyCodes = object.familyCodes?.map((e) => FamilyCode.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/FamilyCodesRequest.ts b/packages/ibkr/src/protobuf/FamilyCodesRequest.ts new file mode 100644 index 00000000..c59cb98d --- /dev/null +++ b/packages/ibkr/src/protobuf/FamilyCodesRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: FamilyCodesRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface FamilyCodesRequest { +} + +function createBaseFamilyCodesRequest(): FamilyCodesRequest { + return {}; +} + +export const FamilyCodesRequest: MessageFns = { + encode(_: FamilyCodesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FamilyCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFamilyCodesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): FamilyCodesRequest { + return {}; + }, + + toJSON(_: FamilyCodesRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): FamilyCodesRequest { + return FamilyCodesRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): FamilyCodesRequest { + const message = createBaseFamilyCodesRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/FundamentalsData.ts b/packages/ibkr/src/protobuf/FundamentalsData.ts new file mode 100644 index 00000000..fd6b4881 --- /dev/null +++ b/packages/ibkr/src/protobuf/FundamentalsData.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: FundamentalsData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface FundamentalsData { + reqId?: number | undefined; + data?: string | undefined; +} + +function createBaseFundamentalsData(): FundamentalsData { + return { reqId: undefined, data: undefined }; +} + +export const FundamentalsData: MessageFns = { + encode(message: FundamentalsData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.data !== undefined) { + writer.uint32(18).string(message.data); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FundamentalsData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFundamentalsData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FundamentalsData { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + data: isSet(object.data) ? globalThis.String(object.data) : undefined, + }; + }, + + toJSON(message: FundamentalsData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.data !== undefined) { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): FundamentalsData { + return FundamentalsData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FundamentalsData { + const message = createBaseFundamentalsData(); + message.reqId = object.reqId ?? undefined; + message.data = object.data ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/FundamentalsDataRequest.ts b/packages/ibkr/src/protobuf/FundamentalsDataRequest.ts new file mode 100644 index 00000000..a7bfcec6 --- /dev/null +++ b/packages/ibkr/src/protobuf/FundamentalsDataRequest.ts @@ -0,0 +1,270 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: FundamentalsDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface FundamentalsDataRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + reportType?: string | undefined; + fundamentalsDataOptions: { [key: string]: string }; +} + +export interface FundamentalsDataRequest_FundamentalsDataOptionsEntry { + key: string; + value: string; +} + +function createBaseFundamentalsDataRequest(): FundamentalsDataRequest { + return { reqId: undefined, contract: undefined, reportType: undefined, fundamentalsDataOptions: {} }; +} + +export const FundamentalsDataRequest: MessageFns = { + encode(message: FundamentalsDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.reportType !== undefined) { + writer.uint32(26).string(message.reportType); + } + globalThis.Object.entries(message.fundamentalsDataOptions).forEach(([key, value]: [string, string]) => { + FundamentalsDataRequest_FundamentalsDataOptionsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()) + .join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FundamentalsDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFundamentalsDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.reportType = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + const entry4 = FundamentalsDataRequest_FundamentalsDataOptionsEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.fundamentalsDataOptions[entry4.key] = entry4.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FundamentalsDataRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + reportType: isSet(object.reportType) ? globalThis.String(object.reportType) : undefined, + fundamentalsDataOptions: isObject(object.fundamentalsDataOptions) + ? (globalThis.Object.entries(object.fundamentalsDataOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: FundamentalsDataRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.reportType !== undefined) { + obj.reportType = message.reportType; + } + if (message.fundamentalsDataOptions) { + const entries = globalThis.Object.entries(message.fundamentalsDataOptions) as [string, string][]; + if (entries.length > 0) { + obj.fundamentalsDataOptions = {}; + entries.forEach(([k, v]) => { + obj.fundamentalsDataOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): FundamentalsDataRequest { + return FundamentalsDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FundamentalsDataRequest { + const message = createBaseFundamentalsDataRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.reportType = object.reportType ?? undefined; + message.fundamentalsDataOptions = + (globalThis.Object.entries(object.fundamentalsDataOptions ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseFundamentalsDataRequest_FundamentalsDataOptionsEntry(): FundamentalsDataRequest_FundamentalsDataOptionsEntry { + return { key: "", value: "" }; +} + +export const FundamentalsDataRequest_FundamentalsDataOptionsEntry: MessageFns< + FundamentalsDataRequest_FundamentalsDataOptionsEntry +> = { + encode( + message: FundamentalsDataRequest_FundamentalsDataOptionsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FundamentalsDataRequest_FundamentalsDataOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFundamentalsDataRequest_FundamentalsDataOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FundamentalsDataRequest_FundamentalsDataOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: FundamentalsDataRequest_FundamentalsDataOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create( + base?: DeepPartial, + ): FundamentalsDataRequest_FundamentalsDataOptionsEntry { + return FundamentalsDataRequest_FundamentalsDataOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): FundamentalsDataRequest_FundamentalsDataOptionsEntry { + const message = createBaseFundamentalsDataRequest_FundamentalsDataOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/GlobalCancelRequest.ts b/packages/ibkr/src/protobuf/GlobalCancelRequest.ts new file mode 100644 index 00000000..44a3acee --- /dev/null +++ b/packages/ibkr/src/protobuf/GlobalCancelRequest.ts @@ -0,0 +1,96 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: GlobalCancelRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { OrderCancel } from "./OrderCancel"; + +export const protobufPackage = "protobuf"; + +export interface GlobalCancelRequest { + orderCancel?: OrderCancel | undefined; +} + +function createBaseGlobalCancelRequest(): GlobalCancelRequest { + return { orderCancel: undefined }; +} + +export const GlobalCancelRequest: MessageFns = { + encode(message: GlobalCancelRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.orderCancel !== undefined) { + OrderCancel.encode(message.orderCancel, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GlobalCancelRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGlobalCancelRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.orderCancel = OrderCancel.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GlobalCancelRequest { + return { orderCancel: isSet(object.orderCancel) ? OrderCancel.fromJSON(object.orderCancel) : undefined }; + }, + + toJSON(message: GlobalCancelRequest): unknown { + const obj: any = {}; + if (message.orderCancel !== undefined) { + obj.orderCancel = OrderCancel.toJSON(message.orderCancel); + } + return obj; + }, + + create(base?: DeepPartial): GlobalCancelRequest { + return GlobalCancelRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GlobalCancelRequest { + const message = createBaseGlobalCancelRequest(); + message.orderCancel = (object.orderCancel !== undefined && object.orderCancel !== null) + ? OrderCancel.fromPartial(object.orderCancel) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HeadTimestamp.ts b/packages/ibkr/src/protobuf/HeadTimestamp.ts new file mode 100644 index 00000000..a19f38f9 --- /dev/null +++ b/packages/ibkr/src/protobuf/HeadTimestamp.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HeadTimestamp.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HeadTimestamp { + reqId?: number | undefined; + headTimestamp?: string | undefined; +} + +function createBaseHeadTimestamp(): HeadTimestamp { + return { reqId: undefined, headTimestamp: undefined }; +} + +export const HeadTimestamp: MessageFns = { + encode(message: HeadTimestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.headTimestamp !== undefined) { + writer.uint32(18).string(message.headTimestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HeadTimestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeadTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.headTimestamp = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HeadTimestamp { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + headTimestamp: isSet(object.headTimestamp) ? globalThis.String(object.headTimestamp) : undefined, + }; + }, + + toJSON(message: HeadTimestamp): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.headTimestamp !== undefined) { + obj.headTimestamp = message.headTimestamp; + } + return obj; + }, + + create(base?: DeepPartial): HeadTimestamp { + return HeadTimestamp.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HeadTimestamp { + const message = createBaseHeadTimestamp(); + message.reqId = object.reqId ?? undefined; + message.headTimestamp = object.headTimestamp ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HeadTimestampRequest.ts b/packages/ibkr/src/protobuf/HeadTimestampRequest.ts new file mode 100644 index 00000000..71b1f102 --- /dev/null +++ b/packages/ibkr/src/protobuf/HeadTimestampRequest.ts @@ -0,0 +1,166 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HeadTimestampRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface HeadTimestampRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + useRTH?: boolean | undefined; + whatToShow?: string | undefined; + formatDate?: number | undefined; +} + +function createBaseHeadTimestampRequest(): HeadTimestampRequest { + return { reqId: undefined, contract: undefined, useRTH: undefined, whatToShow: undefined, formatDate: undefined }; +} + +export const HeadTimestampRequest: MessageFns = { + encode(message: HeadTimestampRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.useRTH !== undefined) { + writer.uint32(24).bool(message.useRTH); + } + if (message.whatToShow !== undefined) { + writer.uint32(34).string(message.whatToShow); + } + if (message.formatDate !== undefined) { + writer.uint32(40).int32(message.formatDate); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HeadTimestampRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeadTimestampRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.useRTH = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.whatToShow = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.formatDate = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HeadTimestampRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + useRTH: isSet(object.useRTH) ? globalThis.Boolean(object.useRTH) : undefined, + whatToShow: isSet(object.whatToShow) ? globalThis.String(object.whatToShow) : undefined, + formatDate: isSet(object.formatDate) ? globalThis.Number(object.formatDate) : undefined, + }; + }, + + toJSON(message: HeadTimestampRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.useRTH !== undefined) { + obj.useRTH = message.useRTH; + } + if (message.whatToShow !== undefined) { + obj.whatToShow = message.whatToShow; + } + if (message.formatDate !== undefined) { + obj.formatDate = Math.round(message.formatDate); + } + return obj; + }, + + create(base?: DeepPartial): HeadTimestampRequest { + return HeadTimestampRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HeadTimestampRequest { + const message = createBaseHeadTimestampRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.useRTH = object.useRTH ?? undefined; + message.whatToShow = object.whatToShow ?? undefined; + message.formatDate = object.formatDate ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistogramData.ts b/packages/ibkr/src/protobuf/HistogramData.ts new file mode 100644 index 00000000..92b90777 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistogramData.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistogramData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { HistogramDataEntry } from "./HistogramDataEntry"; + +export const protobufPackage = "protobuf"; + +export interface HistogramData { + reqId?: number | undefined; + histogramDataEntries: HistogramDataEntry[]; +} + +function createBaseHistogramData(): HistogramData { + return { reqId: undefined, histogramDataEntries: [] }; +} + +export const HistogramData: MessageFns = { + encode(message: HistogramData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.histogramDataEntries) { + HistogramDataEntry.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistogramData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistogramData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.histogramDataEntries.push(HistogramDataEntry.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistogramData { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + histogramDataEntries: globalThis.Array.isArray(object?.histogramDataEntries) + ? object.histogramDataEntries.map((e: any) => HistogramDataEntry.fromJSON(e)) + : [], + }; + }, + + toJSON(message: HistogramData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.histogramDataEntries?.length) { + obj.histogramDataEntries = message.histogramDataEntries.map((e) => HistogramDataEntry.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): HistogramData { + return HistogramData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistogramData { + const message = createBaseHistogramData(); + message.reqId = object.reqId ?? undefined; + message.histogramDataEntries = object.histogramDataEntries?.map((e) => HistogramDataEntry.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistogramDataEntry.ts b/packages/ibkr/src/protobuf/HistogramDataEntry.ts new file mode 100644 index 00000000..bbe21b92 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistogramDataEntry.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistogramDataEntry.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HistogramDataEntry { + price?: number | undefined; + size?: string | undefined; +} + +function createBaseHistogramDataEntry(): HistogramDataEntry { + return { price: undefined, size: undefined }; +} + +export const HistogramDataEntry: MessageFns = { + encode(message: HistogramDataEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.price !== undefined) { + writer.uint32(9).double(message.price); + } + if (message.size !== undefined) { + writer.uint32(18).string(message.size); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistogramDataEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistogramDataEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.price = reader.double(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.size = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistogramDataEntry { + return { + price: isSet(object.price) ? globalThis.Number(object.price) : undefined, + size: isSet(object.size) ? globalThis.String(object.size) : undefined, + }; + }, + + toJSON(message: HistogramDataEntry): unknown { + const obj: any = {}; + if (message.price !== undefined) { + obj.price = message.price; + } + if (message.size !== undefined) { + obj.size = message.size; + } + return obj; + }, + + create(base?: DeepPartial): HistogramDataEntry { + return HistogramDataEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistogramDataEntry { + const message = createBaseHistogramDataEntry(); + message.price = object.price ?? undefined; + message.size = object.size ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistogramDataRequest.ts b/packages/ibkr/src/protobuf/HistogramDataRequest.ts new file mode 100644 index 00000000..821a3817 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistogramDataRequest.ts @@ -0,0 +1,149 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistogramDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface HistogramDataRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + useRTH?: boolean | undefined; + timePeriod?: string | undefined; +} + +function createBaseHistogramDataRequest(): HistogramDataRequest { + return { reqId: undefined, contract: undefined, useRTH: undefined, timePeriod: undefined }; +} + +export const HistogramDataRequest: MessageFns = { + encode(message: HistogramDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.useRTH !== undefined) { + writer.uint32(24).bool(message.useRTH); + } + if (message.timePeriod !== undefined) { + writer.uint32(34).string(message.timePeriod); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistogramDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistogramDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.useRTH = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.timePeriod = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistogramDataRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + useRTH: isSet(object.useRTH) ? globalThis.Boolean(object.useRTH) : undefined, + timePeriod: isSet(object.timePeriod) ? globalThis.String(object.timePeriod) : undefined, + }; + }, + + toJSON(message: HistogramDataRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.useRTH !== undefined) { + obj.useRTH = message.useRTH; + } + if (message.timePeriod !== undefined) { + obj.timePeriod = message.timePeriod; + } + return obj; + }, + + create(base?: DeepPartial): HistogramDataRequest { + return HistogramDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistogramDataRequest { + const message = createBaseHistogramDataRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.useRTH = object.useRTH ?? undefined; + message.timePeriod = object.timePeriod ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalData.ts b/packages/ibkr/src/protobuf/HistoricalData.ts new file mode 100644 index 00000000..e4a279e8 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalData.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { HistoricalDataBar } from "./HistoricalDataBar"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalData { + reqId?: number | undefined; + historicalDataBars: HistoricalDataBar[]; +} + +function createBaseHistoricalData(): HistoricalData { + return { reqId: undefined, historicalDataBars: [] }; +} + +export const HistoricalData: MessageFns = { + encode(message: HistoricalData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.historicalDataBars) { + HistoricalDataBar.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.historicalDataBars.push(HistoricalDataBar.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalData { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + historicalDataBars: globalThis.Array.isArray(object?.historicalDataBars) + ? object.historicalDataBars.map((e: any) => HistoricalDataBar.fromJSON(e)) + : [], + }; + }, + + toJSON(message: HistoricalData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.historicalDataBars?.length) { + obj.historicalDataBars = message.historicalDataBars.map((e) => HistoricalDataBar.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): HistoricalData { + return HistoricalData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalData { + const message = createBaseHistoricalData(); + message.reqId = object.reqId ?? undefined; + message.historicalDataBars = object.historicalDataBars?.map((e) => HistoricalDataBar.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalDataBar.ts b/packages/ibkr/src/protobuf/HistoricalDataBar.ts new file mode 100644 index 00000000..9f8f91ce --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalDataBar.ts @@ -0,0 +1,223 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalDataBar.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalDataBar { + date?: string | undefined; + open?: number | undefined; + high?: number | undefined; + low?: number | undefined; + close?: number | undefined; + volume?: string | undefined; + WAP?: string | undefined; + barCount?: number | undefined; +} + +function createBaseHistoricalDataBar(): HistoricalDataBar { + return { + date: undefined, + open: undefined, + high: undefined, + low: undefined, + close: undefined, + volume: undefined, + WAP: undefined, + barCount: undefined, + }; +} + +export const HistoricalDataBar: MessageFns = { + encode(message: HistoricalDataBar, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.date !== undefined) { + writer.uint32(10).string(message.date); + } + if (message.open !== undefined) { + writer.uint32(17).double(message.open); + } + if (message.high !== undefined) { + writer.uint32(25).double(message.high); + } + if (message.low !== undefined) { + writer.uint32(33).double(message.low); + } + if (message.close !== undefined) { + writer.uint32(41).double(message.close); + } + if (message.volume !== undefined) { + writer.uint32(50).string(message.volume); + } + if (message.WAP !== undefined) { + writer.uint32(58).string(message.WAP); + } + if (message.barCount !== undefined) { + writer.uint32(64).int32(message.barCount); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalDataBar { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalDataBar(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.date = reader.string(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.open = reader.double(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.high = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.low = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.close = reader.double(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.volume = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.WAP = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.barCount = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalDataBar { + return { + date: isSet(object.date) ? globalThis.String(object.date) : undefined, + open: isSet(object.open) ? globalThis.Number(object.open) : undefined, + high: isSet(object.high) ? globalThis.Number(object.high) : undefined, + low: isSet(object.low) ? globalThis.Number(object.low) : undefined, + close: isSet(object.close) ? globalThis.Number(object.close) : undefined, + volume: isSet(object.volume) ? globalThis.String(object.volume) : undefined, + WAP: isSet(object.WAP) ? globalThis.String(object.WAP) : undefined, + barCount: isSet(object.barCount) ? globalThis.Number(object.barCount) : undefined, + }; + }, + + toJSON(message: HistoricalDataBar): unknown { + const obj: any = {}; + if (message.date !== undefined) { + obj.date = message.date; + } + if (message.open !== undefined) { + obj.open = message.open; + } + if (message.high !== undefined) { + obj.high = message.high; + } + if (message.low !== undefined) { + obj.low = message.low; + } + if (message.close !== undefined) { + obj.close = message.close; + } + if (message.volume !== undefined) { + obj.volume = message.volume; + } + if (message.WAP !== undefined) { + obj.WAP = message.WAP; + } + if (message.barCount !== undefined) { + obj.barCount = Math.round(message.barCount); + } + return obj; + }, + + create(base?: DeepPartial): HistoricalDataBar { + return HistoricalDataBar.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalDataBar { + const message = createBaseHistoricalDataBar(); + message.date = object.date ?? undefined; + message.open = object.open ?? undefined; + message.high = object.high ?? undefined; + message.low = object.low ?? undefined; + message.close = object.close ?? undefined; + message.volume = object.volume ?? undefined; + message.WAP = object.WAP ?? undefined; + message.barCount = object.barCount ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalDataEnd.ts b/packages/ibkr/src/protobuf/HistoricalDataEnd.ts new file mode 100644 index 00000000..87379080 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalDataEnd.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalDataEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalDataEnd { + reqId?: number | undefined; + startDateStr?: string | undefined; + endDateStr?: string | undefined; +} + +function createBaseHistoricalDataEnd(): HistoricalDataEnd { + return { reqId: undefined, startDateStr: undefined, endDateStr: undefined }; +} + +export const HistoricalDataEnd: MessageFns = { + encode(message: HistoricalDataEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.startDateStr !== undefined) { + writer.uint32(18).string(message.startDateStr); + } + if (message.endDateStr !== undefined) { + writer.uint32(26).string(message.endDateStr); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalDataEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalDataEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.startDateStr = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.endDateStr = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalDataEnd { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + startDateStr: isSet(object.startDateStr) ? globalThis.String(object.startDateStr) : undefined, + endDateStr: isSet(object.endDateStr) ? globalThis.String(object.endDateStr) : undefined, + }; + }, + + toJSON(message: HistoricalDataEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.startDateStr !== undefined) { + obj.startDateStr = message.startDateStr; + } + if (message.endDateStr !== undefined) { + obj.endDateStr = message.endDateStr; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalDataEnd { + return HistoricalDataEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalDataEnd { + const message = createBaseHistoricalDataEnd(); + message.reqId = object.reqId ?? undefined; + message.startDateStr = object.startDateStr ?? undefined; + message.endDateStr = object.endDateStr ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalDataRequest.ts b/packages/ibkr/src/protobuf/HistoricalDataRequest.ts new file mode 100644 index 00000000..0a9ab724 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalDataRequest.ts @@ -0,0 +1,372 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalDataRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + endDateTime?: string | undefined; + barSizeSetting?: string | undefined; + duration?: string | undefined; + useRTH?: boolean | undefined; + whatToShow?: string | undefined; + formatDate?: number | undefined; + keepUpToDate?: boolean | undefined; + chartOptions: { [key: string]: string }; +} + +export interface HistoricalDataRequest_ChartOptionsEntry { + key: string; + value: string; +} + +function createBaseHistoricalDataRequest(): HistoricalDataRequest { + return { + reqId: undefined, + contract: undefined, + endDateTime: undefined, + barSizeSetting: undefined, + duration: undefined, + useRTH: undefined, + whatToShow: undefined, + formatDate: undefined, + keepUpToDate: undefined, + chartOptions: {}, + }; +} + +export const HistoricalDataRequest: MessageFns = { + encode(message: HistoricalDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.endDateTime !== undefined) { + writer.uint32(26).string(message.endDateTime); + } + if (message.barSizeSetting !== undefined) { + writer.uint32(34).string(message.barSizeSetting); + } + if (message.duration !== undefined) { + writer.uint32(42).string(message.duration); + } + if (message.useRTH !== undefined) { + writer.uint32(48).bool(message.useRTH); + } + if (message.whatToShow !== undefined) { + writer.uint32(58).string(message.whatToShow); + } + if (message.formatDate !== undefined) { + writer.uint32(64).int32(message.formatDate); + } + if (message.keepUpToDate !== undefined) { + writer.uint32(72).bool(message.keepUpToDate); + } + globalThis.Object.entries(message.chartOptions).forEach(([key, value]: [string, string]) => { + HistoricalDataRequest_ChartOptionsEntry.encode({ key: key as any, value }, writer.uint32(82).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.endDateTime = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.barSizeSetting = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.duration = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.useRTH = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.whatToShow = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.formatDate = reader.int32(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.keepUpToDate = reader.bool(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + const entry10 = HistoricalDataRequest_ChartOptionsEntry.decode(reader, reader.uint32()); + if (entry10.value !== undefined) { + message.chartOptions[entry10.key] = entry10.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalDataRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + endDateTime: isSet(object.endDateTime) ? globalThis.String(object.endDateTime) : undefined, + barSizeSetting: isSet(object.barSizeSetting) ? globalThis.String(object.barSizeSetting) : undefined, + duration: isSet(object.duration) ? globalThis.String(object.duration) : undefined, + useRTH: isSet(object.useRTH) ? globalThis.Boolean(object.useRTH) : undefined, + whatToShow: isSet(object.whatToShow) ? globalThis.String(object.whatToShow) : undefined, + formatDate: isSet(object.formatDate) ? globalThis.Number(object.formatDate) : undefined, + keepUpToDate: isSet(object.keepUpToDate) ? globalThis.Boolean(object.keepUpToDate) : undefined, + chartOptions: isObject(object.chartOptions) + ? (globalThis.Object.entries(object.chartOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: HistoricalDataRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.endDateTime !== undefined) { + obj.endDateTime = message.endDateTime; + } + if (message.barSizeSetting !== undefined) { + obj.barSizeSetting = message.barSizeSetting; + } + if (message.duration !== undefined) { + obj.duration = message.duration; + } + if (message.useRTH !== undefined) { + obj.useRTH = message.useRTH; + } + if (message.whatToShow !== undefined) { + obj.whatToShow = message.whatToShow; + } + if (message.formatDate !== undefined) { + obj.formatDate = Math.round(message.formatDate); + } + if (message.keepUpToDate !== undefined) { + obj.keepUpToDate = message.keepUpToDate; + } + if (message.chartOptions) { + const entries = globalThis.Object.entries(message.chartOptions) as [string, string][]; + if (entries.length > 0) { + obj.chartOptions = {}; + entries.forEach(([k, v]) => { + obj.chartOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): HistoricalDataRequest { + return HistoricalDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalDataRequest { + const message = createBaseHistoricalDataRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.endDateTime = object.endDateTime ?? undefined; + message.barSizeSetting = object.barSizeSetting ?? undefined; + message.duration = object.duration ?? undefined; + message.useRTH = object.useRTH ?? undefined; + message.whatToShow = object.whatToShow ?? undefined; + message.formatDate = object.formatDate ?? undefined; + message.keepUpToDate = object.keepUpToDate ?? undefined; + message.chartOptions = (globalThis.Object.entries(object.chartOptions ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseHistoricalDataRequest_ChartOptionsEntry(): HistoricalDataRequest_ChartOptionsEntry { + return { key: "", value: "" }; +} + +export const HistoricalDataRequest_ChartOptionsEntry: MessageFns = { + encode(message: HistoricalDataRequest_ChartOptionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalDataRequest_ChartOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalDataRequest_ChartOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalDataRequest_ChartOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: HistoricalDataRequest_ChartOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalDataRequest_ChartOptionsEntry { + return HistoricalDataRequest_ChartOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalDataRequest_ChartOptionsEntry { + const message = createBaseHistoricalDataRequest_ChartOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalDataUpdate.ts b/packages/ibkr/src/protobuf/HistoricalDataUpdate.ts new file mode 100644 index 00000000..a2339a74 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalDataUpdate.ts @@ -0,0 +1,117 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalDataUpdate.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { HistoricalDataBar } from "./HistoricalDataBar"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalDataUpdate { + reqId?: number | undefined; + historicalDataBar?: HistoricalDataBar | undefined; +} + +function createBaseHistoricalDataUpdate(): HistoricalDataUpdate { + return { reqId: undefined, historicalDataBar: undefined }; +} + +export const HistoricalDataUpdate: MessageFns = { + encode(message: HistoricalDataUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.historicalDataBar !== undefined) { + HistoricalDataBar.encode(message.historicalDataBar, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalDataUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalDataUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.historicalDataBar = HistoricalDataBar.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalDataUpdate { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + historicalDataBar: isSet(object.historicalDataBar) + ? HistoricalDataBar.fromJSON(object.historicalDataBar) + : undefined, + }; + }, + + toJSON(message: HistoricalDataUpdate): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.historicalDataBar !== undefined) { + obj.historicalDataBar = HistoricalDataBar.toJSON(message.historicalDataBar); + } + return obj; + }, + + create(base?: DeepPartial): HistoricalDataUpdate { + return HistoricalDataUpdate.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalDataUpdate { + const message = createBaseHistoricalDataUpdate(); + message.reqId = object.reqId ?? undefined; + message.historicalDataBar = (object.historicalDataBar !== undefined && object.historicalDataBar !== null) + ? HistoricalDataBar.fromPartial(object.historicalDataBar) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalNews.ts b/packages/ibkr/src/protobuf/HistoricalNews.ts new file mode 100644 index 00000000..1de7bb2a --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalNews.ts @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalNews.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalNews { + reqId?: number | undefined; + time?: string | undefined; + providerCode?: string | undefined; + articleId?: string | undefined; + headline?: string | undefined; +} + +function createBaseHistoricalNews(): HistoricalNews { + return { reqId: undefined, time: undefined, providerCode: undefined, articleId: undefined, headline: undefined }; +} + +export const HistoricalNews: MessageFns = { + encode(message: HistoricalNews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.time !== undefined) { + writer.uint32(18).string(message.time); + } + if (message.providerCode !== undefined) { + writer.uint32(26).string(message.providerCode); + } + if (message.articleId !== undefined) { + writer.uint32(34).string(message.articleId); + } + if (message.headline !== undefined) { + writer.uint32(42).string(message.headline); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalNews { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalNews(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.time = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.providerCode = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.articleId = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.headline = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalNews { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + time: isSet(object.time) ? globalThis.String(object.time) : undefined, + providerCode: isSet(object.providerCode) ? globalThis.String(object.providerCode) : undefined, + articleId: isSet(object.articleId) ? globalThis.String(object.articleId) : undefined, + headline: isSet(object.headline) ? globalThis.String(object.headline) : undefined, + }; + }, + + toJSON(message: HistoricalNews): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.time !== undefined) { + obj.time = message.time; + } + if (message.providerCode !== undefined) { + obj.providerCode = message.providerCode; + } + if (message.articleId !== undefined) { + obj.articleId = message.articleId; + } + if (message.headline !== undefined) { + obj.headline = message.headline; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalNews { + return HistoricalNews.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalNews { + const message = createBaseHistoricalNews(); + message.reqId = object.reqId ?? undefined; + message.time = object.time ?? undefined; + message.providerCode = object.providerCode ?? undefined; + message.articleId = object.articleId ?? undefined; + message.headline = object.headline ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalNewsEnd.ts b/packages/ibkr/src/protobuf/HistoricalNewsEnd.ts new file mode 100644 index 00000000..262970bc --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalNewsEnd.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalNewsEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalNewsEnd { + reqId?: number | undefined; + hasMore?: boolean | undefined; +} + +function createBaseHistoricalNewsEnd(): HistoricalNewsEnd { + return { reqId: undefined, hasMore: undefined }; +} + +export const HistoricalNewsEnd: MessageFns = { + encode(message: HistoricalNewsEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.hasMore !== undefined) { + writer.uint32(16).bool(message.hasMore); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalNewsEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalNewsEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.hasMore = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalNewsEnd { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + hasMore: isSet(object.hasMore) ? globalThis.Boolean(object.hasMore) : undefined, + }; + }, + + toJSON(message: HistoricalNewsEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.hasMore !== undefined) { + obj.hasMore = message.hasMore; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalNewsEnd { + return HistoricalNewsEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalNewsEnd { + const message = createBaseHistoricalNewsEnd(); + message.reqId = object.reqId ?? undefined; + message.hasMore = object.hasMore ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalNewsRequest.ts b/packages/ibkr/src/protobuf/HistoricalNewsRequest.ts new file mode 100644 index 00000000..d3e9a42f --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalNewsRequest.ts @@ -0,0 +1,326 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalNewsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalNewsRequest { + reqId?: number | undefined; + conId?: number | undefined; + providerCodes?: string | undefined; + startDateTime?: string | undefined; + endDateTime?: string | undefined; + totalResults?: number | undefined; + historicalNewsOptions: { [key: string]: string }; +} + +export interface HistoricalNewsRequest_HistoricalNewsOptionsEntry { + key: string; + value: string; +} + +function createBaseHistoricalNewsRequest(): HistoricalNewsRequest { + return { + reqId: undefined, + conId: undefined, + providerCodes: undefined, + startDateTime: undefined, + endDateTime: undefined, + totalResults: undefined, + historicalNewsOptions: {}, + }; +} + +export const HistoricalNewsRequest: MessageFns = { + encode(message: HistoricalNewsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.conId !== undefined) { + writer.uint32(16).int32(message.conId); + } + if (message.providerCodes !== undefined) { + writer.uint32(26).string(message.providerCodes); + } + if (message.startDateTime !== undefined) { + writer.uint32(34).string(message.startDateTime); + } + if (message.endDateTime !== undefined) { + writer.uint32(42).string(message.endDateTime); + } + if (message.totalResults !== undefined) { + writer.uint32(48).int32(message.totalResults); + } + globalThis.Object.entries(message.historicalNewsOptions).forEach(([key, value]: [string, string]) => { + HistoricalNewsRequest_HistoricalNewsOptionsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()) + .join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalNewsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalNewsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.conId = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.providerCodes = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.startDateTime = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.endDateTime = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.totalResults = reader.int32(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + const entry7 = HistoricalNewsRequest_HistoricalNewsOptionsEntry.decode(reader, reader.uint32()); + if (entry7.value !== undefined) { + message.historicalNewsOptions[entry7.key] = entry7.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalNewsRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + providerCodes: isSet(object.providerCodes) ? globalThis.String(object.providerCodes) : undefined, + startDateTime: isSet(object.startDateTime) ? globalThis.String(object.startDateTime) : undefined, + endDateTime: isSet(object.endDateTime) ? globalThis.String(object.endDateTime) : undefined, + totalResults: isSet(object.totalResults) ? globalThis.Number(object.totalResults) : undefined, + historicalNewsOptions: isObject(object.historicalNewsOptions) + ? (globalThis.Object.entries(object.historicalNewsOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: HistoricalNewsRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + if (message.providerCodes !== undefined) { + obj.providerCodes = message.providerCodes; + } + if (message.startDateTime !== undefined) { + obj.startDateTime = message.startDateTime; + } + if (message.endDateTime !== undefined) { + obj.endDateTime = message.endDateTime; + } + if (message.totalResults !== undefined) { + obj.totalResults = Math.round(message.totalResults); + } + if (message.historicalNewsOptions) { + const entries = globalThis.Object.entries(message.historicalNewsOptions) as [string, string][]; + if (entries.length > 0) { + obj.historicalNewsOptions = {}; + entries.forEach(([k, v]) => { + obj.historicalNewsOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): HistoricalNewsRequest { + return HistoricalNewsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalNewsRequest { + const message = createBaseHistoricalNewsRequest(); + message.reqId = object.reqId ?? undefined; + message.conId = object.conId ?? undefined; + message.providerCodes = object.providerCodes ?? undefined; + message.startDateTime = object.startDateTime ?? undefined; + message.endDateTime = object.endDateTime ?? undefined; + message.totalResults = object.totalResults ?? undefined; + message.historicalNewsOptions = + (globalThis.Object.entries(object.historicalNewsOptions ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseHistoricalNewsRequest_HistoricalNewsOptionsEntry(): HistoricalNewsRequest_HistoricalNewsOptionsEntry { + return { key: "", value: "" }; +} + +export const HistoricalNewsRequest_HistoricalNewsOptionsEntry: MessageFns< + HistoricalNewsRequest_HistoricalNewsOptionsEntry +> = { + encode( + message: HistoricalNewsRequest_HistoricalNewsOptionsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalNewsRequest_HistoricalNewsOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalNewsRequest_HistoricalNewsOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalNewsRequest_HistoricalNewsOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: HistoricalNewsRequest_HistoricalNewsOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create( + base?: DeepPartial, + ): HistoricalNewsRequest_HistoricalNewsOptionsEntry { + return HistoricalNewsRequest_HistoricalNewsOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): HistoricalNewsRequest_HistoricalNewsOptionsEntry { + const message = createBaseHistoricalNewsRequest_HistoricalNewsOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalSchedule.ts b/packages/ibkr/src/protobuf/HistoricalSchedule.ts new file mode 100644 index 00000000..33e0991e --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalSchedule.ts @@ -0,0 +1,172 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalSchedule.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { HistoricalSession } from "./HistoricalSession"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalSchedule { + reqId?: number | undefined; + startDateTime?: string | undefined; + endDateTime?: string | undefined; + timeZone?: string | undefined; + historicalSessions: HistoricalSession[]; +} + +function createBaseHistoricalSchedule(): HistoricalSchedule { + return { + reqId: undefined, + startDateTime: undefined, + endDateTime: undefined, + timeZone: undefined, + historicalSessions: [], + }; +} + +export const HistoricalSchedule: MessageFns = { + encode(message: HistoricalSchedule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.startDateTime !== undefined) { + writer.uint32(18).string(message.startDateTime); + } + if (message.endDateTime !== undefined) { + writer.uint32(26).string(message.endDateTime); + } + if (message.timeZone !== undefined) { + writer.uint32(34).string(message.timeZone); + } + for (const v of message.historicalSessions) { + HistoricalSession.encode(v!, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalSchedule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalSchedule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.startDateTime = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.endDateTime = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.timeZone = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.historicalSessions.push(HistoricalSession.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalSchedule { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + startDateTime: isSet(object.startDateTime) ? globalThis.String(object.startDateTime) : undefined, + endDateTime: isSet(object.endDateTime) ? globalThis.String(object.endDateTime) : undefined, + timeZone: isSet(object.timeZone) ? globalThis.String(object.timeZone) : undefined, + historicalSessions: globalThis.Array.isArray(object?.historicalSessions) + ? object.historicalSessions.map((e: any) => HistoricalSession.fromJSON(e)) + : [], + }; + }, + + toJSON(message: HistoricalSchedule): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.startDateTime !== undefined) { + obj.startDateTime = message.startDateTime; + } + if (message.endDateTime !== undefined) { + obj.endDateTime = message.endDateTime; + } + if (message.timeZone !== undefined) { + obj.timeZone = message.timeZone; + } + if (message.historicalSessions?.length) { + obj.historicalSessions = message.historicalSessions.map((e) => HistoricalSession.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): HistoricalSchedule { + return HistoricalSchedule.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalSchedule { + const message = createBaseHistoricalSchedule(); + message.reqId = object.reqId ?? undefined; + message.startDateTime = object.startDateTime ?? undefined; + message.endDateTime = object.endDateTime ?? undefined; + message.timeZone = object.timeZone ?? undefined; + message.historicalSessions = object.historicalSessions?.map((e) => HistoricalSession.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalSession.ts b/packages/ibkr/src/protobuf/HistoricalSession.ts new file mode 100644 index 00000000..e9ab91a7 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalSession.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalSession.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalSession { + startDateTime?: string | undefined; + endDateTime?: string | undefined; + refDate?: string | undefined; +} + +function createBaseHistoricalSession(): HistoricalSession { + return { startDateTime: undefined, endDateTime: undefined, refDate: undefined }; +} + +export const HistoricalSession: MessageFns = { + encode(message: HistoricalSession, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.startDateTime !== undefined) { + writer.uint32(10).string(message.startDateTime); + } + if (message.endDateTime !== undefined) { + writer.uint32(18).string(message.endDateTime); + } + if (message.refDate !== undefined) { + writer.uint32(26).string(message.refDate); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalSession { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalSession(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.startDateTime = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.endDateTime = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.refDate = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalSession { + return { + startDateTime: isSet(object.startDateTime) ? globalThis.String(object.startDateTime) : undefined, + endDateTime: isSet(object.endDateTime) ? globalThis.String(object.endDateTime) : undefined, + refDate: isSet(object.refDate) ? globalThis.String(object.refDate) : undefined, + }; + }, + + toJSON(message: HistoricalSession): unknown { + const obj: any = {}; + if (message.startDateTime !== undefined) { + obj.startDateTime = message.startDateTime; + } + if (message.endDateTime !== undefined) { + obj.endDateTime = message.endDateTime; + } + if (message.refDate !== undefined) { + obj.refDate = message.refDate; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalSession { + return HistoricalSession.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalSession { + const message = createBaseHistoricalSession(); + message.startDateTime = object.startDateTime ?? undefined; + message.endDateTime = object.endDateTime ?? undefined; + message.refDate = object.refDate ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalTick.ts b/packages/ibkr/src/protobuf/HistoricalTick.ts new file mode 100644 index 00000000..06676c9e --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalTick.ts @@ -0,0 +1,140 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalTick.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalTick { + time?: number | undefined; + price?: number | undefined; + size?: string | undefined; +} + +function createBaseHistoricalTick(): HistoricalTick { + return { time: undefined, price: undefined, size: undefined }; +} + +export const HistoricalTick: MessageFns = { + encode(message: HistoricalTick, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.time !== undefined) { + writer.uint32(8).int64(message.time); + } + if (message.price !== undefined) { + writer.uint32(17).double(message.price); + } + if (message.size !== undefined) { + writer.uint32(26).string(message.size); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalTick { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalTick(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.time = longToNumber(reader.int64()); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.price = reader.double(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.size = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalTick { + return { + time: isSet(object.time) ? globalThis.Number(object.time) : undefined, + price: isSet(object.price) ? globalThis.Number(object.price) : undefined, + size: isSet(object.size) ? globalThis.String(object.size) : undefined, + }; + }, + + toJSON(message: HistoricalTick): unknown { + const obj: any = {}; + if (message.time !== undefined) { + obj.time = Math.round(message.time); + } + if (message.price !== undefined) { + obj.price = message.price; + } + if (message.size !== undefined) { + obj.size = message.size; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalTick { + return HistoricalTick.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalTick { + const message = createBaseHistoricalTick(); + message.time = object.time ?? undefined; + message.price = object.price ?? undefined; + message.size = object.size ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalTickBidAsk.ts b/packages/ibkr/src/protobuf/HistoricalTickBidAsk.ts new file mode 100644 index 00000000..8bbe286d --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalTickBidAsk.ts @@ -0,0 +1,201 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalTickBidAsk.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { TickAttribBidAsk } from "./TickAttribBidAsk"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalTickBidAsk { + time?: number | undefined; + tickAttribBidAsk?: TickAttribBidAsk | undefined; + priceBid?: number | undefined; + priceAsk?: number | undefined; + sizeBid?: string | undefined; + sizeAsk?: string | undefined; +} + +function createBaseHistoricalTickBidAsk(): HistoricalTickBidAsk { + return { + time: undefined, + tickAttribBidAsk: undefined, + priceBid: undefined, + priceAsk: undefined, + sizeBid: undefined, + sizeAsk: undefined, + }; +} + +export const HistoricalTickBidAsk: MessageFns = { + encode(message: HistoricalTickBidAsk, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.time !== undefined) { + writer.uint32(8).int64(message.time); + } + if (message.tickAttribBidAsk !== undefined) { + TickAttribBidAsk.encode(message.tickAttribBidAsk, writer.uint32(18).fork()).join(); + } + if (message.priceBid !== undefined) { + writer.uint32(25).double(message.priceBid); + } + if (message.priceAsk !== undefined) { + writer.uint32(33).double(message.priceAsk); + } + if (message.sizeBid !== undefined) { + writer.uint32(42).string(message.sizeBid); + } + if (message.sizeAsk !== undefined) { + writer.uint32(50).string(message.sizeAsk); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalTickBidAsk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalTickBidAsk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.time = longToNumber(reader.int64()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.tickAttribBidAsk = TickAttribBidAsk.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.priceBid = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.priceAsk = reader.double(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.sizeBid = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.sizeAsk = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalTickBidAsk { + return { + time: isSet(object.time) ? globalThis.Number(object.time) : undefined, + tickAttribBidAsk: isSet(object.tickAttribBidAsk) ? TickAttribBidAsk.fromJSON(object.tickAttribBidAsk) : undefined, + priceBid: isSet(object.priceBid) ? globalThis.Number(object.priceBid) : undefined, + priceAsk: isSet(object.priceAsk) ? globalThis.Number(object.priceAsk) : undefined, + sizeBid: isSet(object.sizeBid) ? globalThis.String(object.sizeBid) : undefined, + sizeAsk: isSet(object.sizeAsk) ? globalThis.String(object.sizeAsk) : undefined, + }; + }, + + toJSON(message: HistoricalTickBidAsk): unknown { + const obj: any = {}; + if (message.time !== undefined) { + obj.time = Math.round(message.time); + } + if (message.tickAttribBidAsk !== undefined) { + obj.tickAttribBidAsk = TickAttribBidAsk.toJSON(message.tickAttribBidAsk); + } + if (message.priceBid !== undefined) { + obj.priceBid = message.priceBid; + } + if (message.priceAsk !== undefined) { + obj.priceAsk = message.priceAsk; + } + if (message.sizeBid !== undefined) { + obj.sizeBid = message.sizeBid; + } + if (message.sizeAsk !== undefined) { + obj.sizeAsk = message.sizeAsk; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalTickBidAsk { + return HistoricalTickBidAsk.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalTickBidAsk { + const message = createBaseHistoricalTickBidAsk(); + message.time = object.time ?? undefined; + message.tickAttribBidAsk = (object.tickAttribBidAsk !== undefined && object.tickAttribBidAsk !== null) + ? TickAttribBidAsk.fromPartial(object.tickAttribBidAsk) + : undefined; + message.priceBid = object.priceBid ?? undefined; + message.priceAsk = object.priceAsk ?? undefined; + message.sizeBid = object.sizeBid ?? undefined; + message.sizeAsk = object.sizeAsk ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalTickLast.ts b/packages/ibkr/src/protobuf/HistoricalTickLast.ts new file mode 100644 index 00000000..8c884d41 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalTickLast.ts @@ -0,0 +1,201 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalTickLast.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { TickAttribLast } from "./TickAttribLast"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalTickLast { + time?: number | undefined; + tickAttribLast?: TickAttribLast | undefined; + price?: number | undefined; + size?: string | undefined; + exchange?: string | undefined; + specialConditions?: string | undefined; +} + +function createBaseHistoricalTickLast(): HistoricalTickLast { + return { + time: undefined, + tickAttribLast: undefined, + price: undefined, + size: undefined, + exchange: undefined, + specialConditions: undefined, + }; +} + +export const HistoricalTickLast: MessageFns = { + encode(message: HistoricalTickLast, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.time !== undefined) { + writer.uint32(8).int64(message.time); + } + if (message.tickAttribLast !== undefined) { + TickAttribLast.encode(message.tickAttribLast, writer.uint32(18).fork()).join(); + } + if (message.price !== undefined) { + writer.uint32(25).double(message.price); + } + if (message.size !== undefined) { + writer.uint32(34).string(message.size); + } + if (message.exchange !== undefined) { + writer.uint32(42).string(message.exchange); + } + if (message.specialConditions !== undefined) { + writer.uint32(50).string(message.specialConditions); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalTickLast { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalTickLast(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.time = longToNumber(reader.int64()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.tickAttribLast = TickAttribLast.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.price = reader.double(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.size = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.specialConditions = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalTickLast { + return { + time: isSet(object.time) ? globalThis.Number(object.time) : undefined, + tickAttribLast: isSet(object.tickAttribLast) ? TickAttribLast.fromJSON(object.tickAttribLast) : undefined, + price: isSet(object.price) ? globalThis.Number(object.price) : undefined, + size: isSet(object.size) ? globalThis.String(object.size) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + specialConditions: isSet(object.specialConditions) ? globalThis.String(object.specialConditions) : undefined, + }; + }, + + toJSON(message: HistoricalTickLast): unknown { + const obj: any = {}; + if (message.time !== undefined) { + obj.time = Math.round(message.time); + } + if (message.tickAttribLast !== undefined) { + obj.tickAttribLast = TickAttribLast.toJSON(message.tickAttribLast); + } + if (message.price !== undefined) { + obj.price = message.price; + } + if (message.size !== undefined) { + obj.size = message.size; + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.specialConditions !== undefined) { + obj.specialConditions = message.specialConditions; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalTickLast { + return HistoricalTickLast.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalTickLast { + const message = createBaseHistoricalTickLast(); + message.time = object.time ?? undefined; + message.tickAttribLast = (object.tickAttribLast !== undefined && object.tickAttribLast !== null) + ? TickAttribLast.fromPartial(object.tickAttribLast) + : undefined; + message.price = object.price ?? undefined; + message.size = object.size ?? undefined; + message.exchange = object.exchange ?? undefined; + message.specialConditions = object.specialConditions ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalTicks.ts b/packages/ibkr/src/protobuf/HistoricalTicks.ts new file mode 100644 index 00000000..31587f3a --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalTicks.ts @@ -0,0 +1,132 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalTicks.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { HistoricalTick } from "./HistoricalTick"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalTicks { + reqId?: number | undefined; + historicalTicks: HistoricalTick[]; + isDone?: boolean | undefined; +} + +function createBaseHistoricalTicks(): HistoricalTicks { + return { reqId: undefined, historicalTicks: [], isDone: undefined }; +} + +export const HistoricalTicks: MessageFns = { + encode(message: HistoricalTicks, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.historicalTicks) { + HistoricalTick.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.isDone !== undefined) { + writer.uint32(24).bool(message.isDone); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalTicks { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalTicks(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.historicalTicks.push(HistoricalTick.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.isDone = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalTicks { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + historicalTicks: globalThis.Array.isArray(object?.historicalTicks) + ? object.historicalTicks.map((e: any) => HistoricalTick.fromJSON(e)) + : [], + isDone: isSet(object.isDone) ? globalThis.Boolean(object.isDone) : undefined, + }; + }, + + toJSON(message: HistoricalTicks): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.historicalTicks?.length) { + obj.historicalTicks = message.historicalTicks.map((e) => HistoricalTick.toJSON(e)); + } + if (message.isDone !== undefined) { + obj.isDone = message.isDone; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalTicks { + return HistoricalTicks.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalTicks { + const message = createBaseHistoricalTicks(); + message.reqId = object.reqId ?? undefined; + message.historicalTicks = object.historicalTicks?.map((e) => HistoricalTick.fromPartial(e)) || []; + message.isDone = object.isDone ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalTicksBidAsk.ts b/packages/ibkr/src/protobuf/HistoricalTicksBidAsk.ts new file mode 100644 index 00000000..bd1084e6 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalTicksBidAsk.ts @@ -0,0 +1,132 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalTicksBidAsk.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { HistoricalTickBidAsk } from "./HistoricalTickBidAsk"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalTicksBidAsk { + reqId?: number | undefined; + historicalTicksBidAsk: HistoricalTickBidAsk[]; + isDone?: boolean | undefined; +} + +function createBaseHistoricalTicksBidAsk(): HistoricalTicksBidAsk { + return { reqId: undefined, historicalTicksBidAsk: [], isDone: undefined }; +} + +export const HistoricalTicksBidAsk: MessageFns = { + encode(message: HistoricalTicksBidAsk, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.historicalTicksBidAsk) { + HistoricalTickBidAsk.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.isDone !== undefined) { + writer.uint32(24).bool(message.isDone); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalTicksBidAsk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalTicksBidAsk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.historicalTicksBidAsk.push(HistoricalTickBidAsk.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.isDone = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalTicksBidAsk { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + historicalTicksBidAsk: globalThis.Array.isArray(object?.historicalTicksBidAsk) + ? object.historicalTicksBidAsk.map((e: any) => HistoricalTickBidAsk.fromJSON(e)) + : [], + isDone: isSet(object.isDone) ? globalThis.Boolean(object.isDone) : undefined, + }; + }, + + toJSON(message: HistoricalTicksBidAsk): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.historicalTicksBidAsk?.length) { + obj.historicalTicksBidAsk = message.historicalTicksBidAsk.map((e) => HistoricalTickBidAsk.toJSON(e)); + } + if (message.isDone !== undefined) { + obj.isDone = message.isDone; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalTicksBidAsk { + return HistoricalTicksBidAsk.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalTicksBidAsk { + const message = createBaseHistoricalTicksBidAsk(); + message.reqId = object.reqId ?? undefined; + message.historicalTicksBidAsk = object.historicalTicksBidAsk?.map((e) => HistoricalTickBidAsk.fromPartial(e)) || []; + message.isDone = object.isDone ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalTicksLast.ts b/packages/ibkr/src/protobuf/HistoricalTicksLast.ts new file mode 100644 index 00000000..1efde3c3 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalTicksLast.ts @@ -0,0 +1,132 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalTicksLast.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { HistoricalTickLast } from "./HistoricalTickLast"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalTicksLast { + reqId?: number | undefined; + historicalTicksLast: HistoricalTickLast[]; + isDone?: boolean | undefined; +} + +function createBaseHistoricalTicksLast(): HistoricalTicksLast { + return { reqId: undefined, historicalTicksLast: [], isDone: undefined }; +} + +export const HistoricalTicksLast: MessageFns = { + encode(message: HistoricalTicksLast, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.historicalTicksLast) { + HistoricalTickLast.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.isDone !== undefined) { + writer.uint32(24).bool(message.isDone); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalTicksLast { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalTicksLast(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.historicalTicksLast.push(HistoricalTickLast.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.isDone = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalTicksLast { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + historicalTicksLast: globalThis.Array.isArray(object?.historicalTicksLast) + ? object.historicalTicksLast.map((e: any) => HistoricalTickLast.fromJSON(e)) + : [], + isDone: isSet(object.isDone) ? globalThis.Boolean(object.isDone) : undefined, + }; + }, + + toJSON(message: HistoricalTicksLast): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.historicalTicksLast?.length) { + obj.historicalTicksLast = message.historicalTicksLast.map((e) => HistoricalTickLast.toJSON(e)); + } + if (message.isDone !== undefined) { + obj.isDone = message.isDone; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalTicksLast { + return HistoricalTicksLast.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalTicksLast { + const message = createBaseHistoricalTicksLast(); + message.reqId = object.reqId ?? undefined; + message.historicalTicksLast = object.historicalTicksLast?.map((e) => HistoricalTickLast.fromPartial(e)) || []; + message.isDone = object.isDone ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/HistoricalTicksRequest.ts b/packages/ibkr/src/protobuf/HistoricalTicksRequest.ts new file mode 100644 index 00000000..c627fa45 --- /dev/null +++ b/packages/ibkr/src/protobuf/HistoricalTicksRequest.ts @@ -0,0 +1,354 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: HistoricalTicksRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface HistoricalTicksRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + startDateTime?: string | undefined; + endDateTime?: string | undefined; + numberOfTicks?: number | undefined; + whatToShow?: string | undefined; + useRTH?: boolean | undefined; + ignoreSize?: boolean | undefined; + miscOptions: { [key: string]: string }; +} + +export interface HistoricalTicksRequest_MiscOptionsEntry { + key: string; + value: string; +} + +function createBaseHistoricalTicksRequest(): HistoricalTicksRequest { + return { + reqId: undefined, + contract: undefined, + startDateTime: undefined, + endDateTime: undefined, + numberOfTicks: undefined, + whatToShow: undefined, + useRTH: undefined, + ignoreSize: undefined, + miscOptions: {}, + }; +} + +export const HistoricalTicksRequest: MessageFns = { + encode(message: HistoricalTicksRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.startDateTime !== undefined) { + writer.uint32(26).string(message.startDateTime); + } + if (message.endDateTime !== undefined) { + writer.uint32(34).string(message.endDateTime); + } + if (message.numberOfTicks !== undefined) { + writer.uint32(40).int32(message.numberOfTicks); + } + if (message.whatToShow !== undefined) { + writer.uint32(50).string(message.whatToShow); + } + if (message.useRTH !== undefined) { + writer.uint32(56).bool(message.useRTH); + } + if (message.ignoreSize !== undefined) { + writer.uint32(64).bool(message.ignoreSize); + } + globalThis.Object.entries(message.miscOptions).forEach(([key, value]: [string, string]) => { + HistoricalTicksRequest_MiscOptionsEntry.encode({ key: key as any, value }, writer.uint32(74).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalTicksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalTicksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.startDateTime = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.endDateTime = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.numberOfTicks = reader.int32(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.whatToShow = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.useRTH = reader.bool(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreSize = reader.bool(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + const entry9 = HistoricalTicksRequest_MiscOptionsEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.miscOptions[entry9.key] = entry9.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalTicksRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + startDateTime: isSet(object.startDateTime) ? globalThis.String(object.startDateTime) : undefined, + endDateTime: isSet(object.endDateTime) ? globalThis.String(object.endDateTime) : undefined, + numberOfTicks: isSet(object.numberOfTicks) ? globalThis.Number(object.numberOfTicks) : undefined, + whatToShow: isSet(object.whatToShow) ? globalThis.String(object.whatToShow) : undefined, + useRTH: isSet(object.useRTH) ? globalThis.Boolean(object.useRTH) : undefined, + ignoreSize: isSet(object.ignoreSize) ? globalThis.Boolean(object.ignoreSize) : undefined, + miscOptions: isObject(object.miscOptions) + ? (globalThis.Object.entries(object.miscOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: HistoricalTicksRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.startDateTime !== undefined) { + obj.startDateTime = message.startDateTime; + } + if (message.endDateTime !== undefined) { + obj.endDateTime = message.endDateTime; + } + if (message.numberOfTicks !== undefined) { + obj.numberOfTicks = Math.round(message.numberOfTicks); + } + if (message.whatToShow !== undefined) { + obj.whatToShow = message.whatToShow; + } + if (message.useRTH !== undefined) { + obj.useRTH = message.useRTH; + } + if (message.ignoreSize !== undefined) { + obj.ignoreSize = message.ignoreSize; + } + if (message.miscOptions) { + const entries = globalThis.Object.entries(message.miscOptions) as [string, string][]; + if (entries.length > 0) { + obj.miscOptions = {}; + entries.forEach(([k, v]) => { + obj.miscOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): HistoricalTicksRequest { + return HistoricalTicksRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalTicksRequest { + const message = createBaseHistoricalTicksRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.startDateTime = object.startDateTime ?? undefined; + message.endDateTime = object.endDateTime ?? undefined; + message.numberOfTicks = object.numberOfTicks ?? undefined; + message.whatToShow = object.whatToShow ?? undefined; + message.useRTH = object.useRTH ?? undefined; + message.ignoreSize = object.ignoreSize ?? undefined; + message.miscOptions = (globalThis.Object.entries(object.miscOptions ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseHistoricalTicksRequest_MiscOptionsEntry(): HistoricalTicksRequest_MiscOptionsEntry { + return { key: "", value: "" }; +} + +export const HistoricalTicksRequest_MiscOptionsEntry: MessageFns = { + encode(message: HistoricalTicksRequest_MiscOptionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalTicksRequest_MiscOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHistoricalTicksRequest_MiscOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HistoricalTicksRequest_MiscOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: HistoricalTicksRequest_MiscOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): HistoricalTicksRequest_MiscOptionsEntry { + return HistoricalTicksRequest_MiscOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HistoricalTicksRequest_MiscOptionsEntry { + const message = createBaseHistoricalTicksRequest_MiscOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/IdsRequest.ts b/packages/ibkr/src/protobuf/IdsRequest.ts new file mode 100644 index 00000000..c4503655 --- /dev/null +++ b/packages/ibkr/src/protobuf/IdsRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: IdsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface IdsRequest { + numIds?: number | undefined; +} + +function createBaseIdsRequest(): IdsRequest { + return { numIds: undefined }; +} + +export const IdsRequest: MessageFns = { + encode(message: IdsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.numIds !== undefined) { + writer.uint32(8).int32(message.numIds); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): IdsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.numIds = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): IdsRequest { + return { numIds: isSet(object.numIds) ? globalThis.Number(object.numIds) : undefined }; + }, + + toJSON(message: IdsRequest): unknown { + const obj: any = {}; + if (message.numIds !== undefined) { + obj.numIds = Math.round(message.numIds); + } + return obj; + }, + + create(base?: DeepPartial): IdsRequest { + return IdsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): IdsRequest { + const message = createBaseIdsRequest(); + message.numIds = object.numIds ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/IneligibilityReason.ts b/packages/ibkr/src/protobuf/IneligibilityReason.ts new file mode 100644 index 00000000..4b25fef1 --- /dev/null +++ b/packages/ibkr/src/protobuf/IneligibilityReason.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: IneligibilityReason.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface IneligibilityReason { + id?: string | undefined; + description?: string | undefined; +} + +function createBaseIneligibilityReason(): IneligibilityReason { + return { id: undefined, description: undefined }; +} + +export const IneligibilityReason: MessageFns = { + encode(message: IneligibilityReason, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== undefined) { + writer.uint32(10).string(message.id); + } + if (message.description !== undefined) { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): IneligibilityReason { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIneligibilityReason(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.description = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): IneligibilityReason { + return { + id: isSet(object.id) ? globalThis.String(object.id) : undefined, + description: isSet(object.description) ? globalThis.String(object.description) : undefined, + }; + }, + + toJSON(message: IneligibilityReason): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = message.id; + } + if (message.description !== undefined) { + obj.description = message.description; + } + return obj; + }, + + create(base?: DeepPartial): IneligibilityReason { + return IneligibilityReason.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): IneligibilityReason { + const message = createBaseIneligibilityReason(); + message.id = object.id ?? undefined; + message.description = object.description ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/LockAndExitConfig.ts b/packages/ibkr/src/protobuf/LockAndExitConfig.ts new file mode 100644 index 00000000..97c2640d --- /dev/null +++ b/packages/ibkr/src/protobuf/LockAndExitConfig.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: LockAndExitConfig.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface LockAndExitConfig { + autoLogoffTime?: string | undefined; + autoLogoffPeriod?: string | undefined; + autoLogoffType?: string | undefined; +} + +function createBaseLockAndExitConfig(): LockAndExitConfig { + return { autoLogoffTime: undefined, autoLogoffPeriod: undefined, autoLogoffType: undefined }; +} + +export const LockAndExitConfig: MessageFns = { + encode(message: LockAndExitConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.autoLogoffTime !== undefined) { + writer.uint32(10).string(message.autoLogoffTime); + } + if (message.autoLogoffPeriod !== undefined) { + writer.uint32(18).string(message.autoLogoffPeriod); + } + if (message.autoLogoffType !== undefined) { + writer.uint32(26).string(message.autoLogoffType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): LockAndExitConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLockAndExitConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.autoLogoffTime = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.autoLogoffPeriod = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.autoLogoffType = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): LockAndExitConfig { + return { + autoLogoffTime: isSet(object.autoLogoffTime) ? globalThis.String(object.autoLogoffTime) : undefined, + autoLogoffPeriod: isSet(object.autoLogoffPeriod) ? globalThis.String(object.autoLogoffPeriod) : undefined, + autoLogoffType: isSet(object.autoLogoffType) ? globalThis.String(object.autoLogoffType) : undefined, + }; + }, + + toJSON(message: LockAndExitConfig): unknown { + const obj: any = {}; + if (message.autoLogoffTime !== undefined) { + obj.autoLogoffTime = message.autoLogoffTime; + } + if (message.autoLogoffPeriod !== undefined) { + obj.autoLogoffPeriod = message.autoLogoffPeriod; + } + if (message.autoLogoffType !== undefined) { + obj.autoLogoffType = message.autoLogoffType; + } + return obj; + }, + + create(base?: DeepPartial): LockAndExitConfig { + return LockAndExitConfig.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): LockAndExitConfig { + const message = createBaseLockAndExitConfig(); + message.autoLogoffTime = object.autoLogoffTime ?? undefined; + message.autoLogoffPeriod = object.autoLogoffPeriod ?? undefined; + message.autoLogoffType = object.autoLogoffType ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ManagedAccounts.ts b/packages/ibkr/src/protobuf/ManagedAccounts.ts new file mode 100644 index 00000000..783c3973 --- /dev/null +++ b/packages/ibkr/src/protobuf/ManagedAccounts.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ManagedAccounts.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ManagedAccounts { + accountsList?: string | undefined; +} + +function createBaseManagedAccounts(): ManagedAccounts { + return { accountsList: undefined }; +} + +export const ManagedAccounts: MessageFns = { + encode(message: ManagedAccounts, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.accountsList !== undefined) { + writer.uint32(10).string(message.accountsList); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ManagedAccounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseManagedAccounts(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.accountsList = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ManagedAccounts { + return { accountsList: isSet(object.accountsList) ? globalThis.String(object.accountsList) : undefined }; + }, + + toJSON(message: ManagedAccounts): unknown { + const obj: any = {}; + if (message.accountsList !== undefined) { + obj.accountsList = message.accountsList; + } + return obj; + }, + + create(base?: DeepPartial): ManagedAccounts { + return ManagedAccounts.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ManagedAccounts { + const message = createBaseManagedAccounts(); + message.accountsList = object.accountsList ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ManagedAccountsRequest.ts b/packages/ibkr/src/protobuf/ManagedAccountsRequest.ts new file mode 100644 index 00000000..54dbad22 --- /dev/null +++ b/packages/ibkr/src/protobuf/ManagedAccountsRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ManagedAccountsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface ManagedAccountsRequest { +} + +function createBaseManagedAccountsRequest(): ManagedAccountsRequest { + return {}; +} + +export const ManagedAccountsRequest: MessageFns = { + encode(_: ManagedAccountsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ManagedAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseManagedAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): ManagedAccountsRequest { + return {}; + }, + + toJSON(_: ManagedAccountsRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): ManagedAccountsRequest { + return ManagedAccountsRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): ManagedAccountsRequest { + const message = createBaseManagedAccountsRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDataRequest.ts b/packages/ibkr/src/protobuf/MarketDataRequest.ts new file mode 100644 index 00000000..4bafcccf --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDataRequest.ts @@ -0,0 +1,298 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface MarketDataRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + genericTickList?: string | undefined; + snapshot?: boolean | undefined; + regulatorySnapshot?: boolean | undefined; + marketDataOptions: { [key: string]: string }; +} + +export interface MarketDataRequest_MarketDataOptionsEntry { + key: string; + value: string; +} + +function createBaseMarketDataRequest(): MarketDataRequest { + return { + reqId: undefined, + contract: undefined, + genericTickList: undefined, + snapshot: undefined, + regulatorySnapshot: undefined, + marketDataOptions: {}, + }; +} + +export const MarketDataRequest: MessageFns = { + encode(message: MarketDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.genericTickList !== undefined) { + writer.uint32(26).string(message.genericTickList); + } + if (message.snapshot !== undefined) { + writer.uint32(32).bool(message.snapshot); + } + if (message.regulatorySnapshot !== undefined) { + writer.uint32(40).bool(message.regulatorySnapshot); + } + globalThis.Object.entries(message.marketDataOptions).forEach(([key, value]: [string, string]) => { + MarketDataRequest_MarketDataOptionsEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.genericTickList = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.snapshot = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.regulatorySnapshot = reader.bool(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + const entry6 = MarketDataRequest_MarketDataOptionsEntry.decode(reader, reader.uint32()); + if (entry6.value !== undefined) { + message.marketDataOptions[entry6.key] = entry6.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDataRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + genericTickList: isSet(object.genericTickList) ? globalThis.String(object.genericTickList) : undefined, + snapshot: isSet(object.snapshot) ? globalThis.Boolean(object.snapshot) : undefined, + regulatorySnapshot: isSet(object.regulatorySnapshot) ? globalThis.Boolean(object.regulatorySnapshot) : undefined, + marketDataOptions: isObject(object.marketDataOptions) + ? (globalThis.Object.entries(object.marketDataOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: MarketDataRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.genericTickList !== undefined) { + obj.genericTickList = message.genericTickList; + } + if (message.snapshot !== undefined) { + obj.snapshot = message.snapshot; + } + if (message.regulatorySnapshot !== undefined) { + obj.regulatorySnapshot = message.regulatorySnapshot; + } + if (message.marketDataOptions) { + const entries = globalThis.Object.entries(message.marketDataOptions) as [string, string][]; + if (entries.length > 0) { + obj.marketDataOptions = {}; + entries.forEach(([k, v]) => { + obj.marketDataOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): MarketDataRequest { + return MarketDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDataRequest { + const message = createBaseMarketDataRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.genericTickList = object.genericTickList ?? undefined; + message.snapshot = object.snapshot ?? undefined; + message.regulatorySnapshot = object.regulatorySnapshot ?? undefined; + message.marketDataOptions = (globalThis.Object.entries(object.marketDataOptions ?? {}) as [string, string][]) + .reduce((acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseMarketDataRequest_MarketDataOptionsEntry(): MarketDataRequest_MarketDataOptionsEntry { + return { key: "", value: "" }; +} + +export const MarketDataRequest_MarketDataOptionsEntry: MessageFns = { + encode(message: MarketDataRequest_MarketDataOptionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDataRequest_MarketDataOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDataRequest_MarketDataOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDataRequest_MarketDataOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: MarketDataRequest_MarketDataOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): MarketDataRequest_MarketDataOptionsEntry { + return MarketDataRequest_MarketDataOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDataRequest_MarketDataOptionsEntry { + const message = createBaseMarketDataRequest_MarketDataOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDataType.ts b/packages/ibkr/src/protobuf/MarketDataType.ts new file mode 100644 index 00000000..0b4ca521 --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDataType.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDataType.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface MarketDataType { + reqId?: number | undefined; + marketDataType?: number | undefined; +} + +function createBaseMarketDataType(): MarketDataType { + return { reqId: undefined, marketDataType: undefined }; +} + +export const MarketDataType: MessageFns = { + encode(message: MarketDataType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.marketDataType !== undefined) { + writer.uint32(16).int32(message.marketDataType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDataType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDataType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.marketDataType = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDataType { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + marketDataType: isSet(object.marketDataType) ? globalThis.Number(object.marketDataType) : undefined, + }; + }, + + toJSON(message: MarketDataType): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.marketDataType !== undefined) { + obj.marketDataType = Math.round(message.marketDataType); + } + return obj; + }, + + create(base?: DeepPartial): MarketDataType { + return MarketDataType.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDataType { + const message = createBaseMarketDataType(); + message.reqId = object.reqId ?? undefined; + message.marketDataType = object.marketDataType ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDataTypeRequest.ts b/packages/ibkr/src/protobuf/MarketDataTypeRequest.ts new file mode 100644 index 00000000..41c82676 --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDataTypeRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDataTypeRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface MarketDataTypeRequest { + marketDataType?: number | undefined; +} + +function createBaseMarketDataTypeRequest(): MarketDataTypeRequest { + return { marketDataType: undefined }; +} + +export const MarketDataTypeRequest: MessageFns = { + encode(message: MarketDataTypeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.marketDataType !== undefined) { + writer.uint32(8).int32(message.marketDataType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDataTypeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDataTypeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.marketDataType = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDataTypeRequest { + return { marketDataType: isSet(object.marketDataType) ? globalThis.Number(object.marketDataType) : undefined }; + }, + + toJSON(message: MarketDataTypeRequest): unknown { + const obj: any = {}; + if (message.marketDataType !== undefined) { + obj.marketDataType = Math.round(message.marketDataType); + } + return obj; + }, + + create(base?: DeepPartial): MarketDataTypeRequest { + return MarketDataTypeRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDataTypeRequest { + const message = createBaseMarketDataTypeRequest(); + message.marketDataType = object.marketDataType ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDepth.ts b/packages/ibkr/src/protobuf/MarketDepth.ts new file mode 100644 index 00000000..5d452c2b --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDepth.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDepth.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { MarketDepthData } from "./MarketDepthData"; + +export const protobufPackage = "protobuf"; + +export interface MarketDepth { + reqId?: number | undefined; + marketDepthData?: MarketDepthData | undefined; +} + +function createBaseMarketDepth(): MarketDepth { + return { reqId: undefined, marketDepthData: undefined }; +} + +export const MarketDepth: MessageFns = { + encode(message: MarketDepth, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.marketDepthData !== undefined) { + MarketDepthData.encode(message.marketDepthData, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDepth { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDepth(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.marketDepthData = MarketDepthData.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDepth { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + marketDepthData: isSet(object.marketDepthData) ? MarketDepthData.fromJSON(object.marketDepthData) : undefined, + }; + }, + + toJSON(message: MarketDepth): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.marketDepthData !== undefined) { + obj.marketDepthData = MarketDepthData.toJSON(message.marketDepthData); + } + return obj; + }, + + create(base?: DeepPartial): MarketDepth { + return MarketDepth.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDepth { + const message = createBaseMarketDepth(); + message.reqId = object.reqId ?? undefined; + message.marketDepthData = (object.marketDepthData !== undefined && object.marketDepthData !== null) + ? MarketDepthData.fromPartial(object.marketDepthData) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDepthData.ts b/packages/ibkr/src/protobuf/MarketDepthData.ts new file mode 100644 index 00000000..34ce26d7 --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDepthData.ts @@ -0,0 +1,205 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDepthData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface MarketDepthData { + position?: number | undefined; + operation?: number | undefined; + side?: number | undefined; + price?: number | undefined; + size?: string | undefined; + marketMaker?: string | undefined; + isSmartDepth?: boolean | undefined; +} + +function createBaseMarketDepthData(): MarketDepthData { + return { + position: undefined, + operation: undefined, + side: undefined, + price: undefined, + size: undefined, + marketMaker: undefined, + isSmartDepth: undefined, + }; +} + +export const MarketDepthData: MessageFns = { + encode(message: MarketDepthData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.position !== undefined) { + writer.uint32(8).int32(message.position); + } + if (message.operation !== undefined) { + writer.uint32(16).int32(message.operation); + } + if (message.side !== undefined) { + writer.uint32(24).int32(message.side); + } + if (message.price !== undefined) { + writer.uint32(33).double(message.price); + } + if (message.size !== undefined) { + writer.uint32(42).string(message.size); + } + if (message.marketMaker !== undefined) { + writer.uint32(50).string(message.marketMaker); + } + if (message.isSmartDepth !== undefined) { + writer.uint32(56).bool(message.isSmartDepth); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDepthData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDepthData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.position = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.operation = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.side = reader.int32(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.price = reader.double(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.size = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.marketMaker = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.isSmartDepth = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDepthData { + return { + position: isSet(object.position) ? globalThis.Number(object.position) : undefined, + operation: isSet(object.operation) ? globalThis.Number(object.operation) : undefined, + side: isSet(object.side) ? globalThis.Number(object.side) : undefined, + price: isSet(object.price) ? globalThis.Number(object.price) : undefined, + size: isSet(object.size) ? globalThis.String(object.size) : undefined, + marketMaker: isSet(object.marketMaker) ? globalThis.String(object.marketMaker) : undefined, + isSmartDepth: isSet(object.isSmartDepth) ? globalThis.Boolean(object.isSmartDepth) : undefined, + }; + }, + + toJSON(message: MarketDepthData): unknown { + const obj: any = {}; + if (message.position !== undefined) { + obj.position = Math.round(message.position); + } + if (message.operation !== undefined) { + obj.operation = Math.round(message.operation); + } + if (message.side !== undefined) { + obj.side = Math.round(message.side); + } + if (message.price !== undefined) { + obj.price = message.price; + } + if (message.size !== undefined) { + obj.size = message.size; + } + if (message.marketMaker !== undefined) { + obj.marketMaker = message.marketMaker; + } + if (message.isSmartDepth !== undefined) { + obj.isSmartDepth = message.isSmartDepth; + } + return obj; + }, + + create(base?: DeepPartial): MarketDepthData { + return MarketDepthData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDepthData { + const message = createBaseMarketDepthData(); + message.position = object.position ?? undefined; + message.operation = object.operation ?? undefined; + message.side = object.side ?? undefined; + message.price = object.price ?? undefined; + message.size = object.size ?? undefined; + message.marketMaker = object.marketMaker ?? undefined; + message.isSmartDepth = object.isSmartDepth ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDepthExchanges.ts b/packages/ibkr/src/protobuf/MarketDepthExchanges.ts new file mode 100644 index 00000000..ea352104 --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDepthExchanges.ts @@ -0,0 +1,97 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDepthExchanges.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { DepthMarketDataDescription } from "./DepthMarketDataDescription"; + +export const protobufPackage = "protobuf"; + +export interface MarketDepthExchanges { + depthMarketDataDescriptions: DepthMarketDataDescription[]; +} + +function createBaseMarketDepthExchanges(): MarketDepthExchanges { + return { depthMarketDataDescriptions: [] }; +} + +export const MarketDepthExchanges: MessageFns = { + encode(message: MarketDepthExchanges, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.depthMarketDataDescriptions) { + DepthMarketDataDescription.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDepthExchanges { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDepthExchanges(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.depthMarketDataDescriptions.push(DepthMarketDataDescription.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDepthExchanges { + return { + depthMarketDataDescriptions: globalThis.Array.isArray(object?.depthMarketDataDescriptions) + ? object.depthMarketDataDescriptions.map((e: any) => DepthMarketDataDescription.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MarketDepthExchanges): unknown { + const obj: any = {}; + if (message.depthMarketDataDescriptions?.length) { + obj.depthMarketDataDescriptions = message.depthMarketDataDescriptions.map((e) => + DepthMarketDataDescription.toJSON(e) + ); + } + return obj; + }, + + create(base?: DeepPartial): MarketDepthExchanges { + return MarketDepthExchanges.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDepthExchanges { + const message = createBaseMarketDepthExchanges(); + message.depthMarketDataDescriptions = + object.depthMarketDataDescriptions?.map((e) => DepthMarketDataDescription.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDepthExchangesRequest.ts b/packages/ibkr/src/protobuf/MarketDepthExchangesRequest.ts new file mode 100644 index 00000000..86a66bbb --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDepthExchangesRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDepthExchangesRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface MarketDepthExchangesRequest { +} + +function createBaseMarketDepthExchangesRequest(): MarketDepthExchangesRequest { + return {}; +} + +export const MarketDepthExchangesRequest: MessageFns = { + encode(_: MarketDepthExchangesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDepthExchangesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDepthExchangesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): MarketDepthExchangesRequest { + return {}; + }, + + toJSON(_: MarketDepthExchangesRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): MarketDepthExchangesRequest { + return MarketDepthExchangesRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): MarketDepthExchangesRequest { + const message = createBaseMarketDepthExchangesRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDepthL2.ts b/packages/ibkr/src/protobuf/MarketDepthL2.ts new file mode 100644 index 00000000..fb6c72cc --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDepthL2.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDepthL2.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { MarketDepthData } from "./MarketDepthData"; + +export const protobufPackage = "protobuf"; + +export interface MarketDepthL2 { + reqId?: number | undefined; + marketDepthData?: MarketDepthData | undefined; +} + +function createBaseMarketDepthL2(): MarketDepthL2 { + return { reqId: undefined, marketDepthData: undefined }; +} + +export const MarketDepthL2: MessageFns = { + encode(message: MarketDepthL2, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.marketDepthData !== undefined) { + MarketDepthData.encode(message.marketDepthData, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDepthL2 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDepthL2(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.marketDepthData = MarketDepthData.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDepthL2 { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + marketDepthData: isSet(object.marketDepthData) ? MarketDepthData.fromJSON(object.marketDepthData) : undefined, + }; + }, + + toJSON(message: MarketDepthL2): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.marketDepthData !== undefined) { + obj.marketDepthData = MarketDepthData.toJSON(message.marketDepthData); + } + return obj; + }, + + create(base?: DeepPartial): MarketDepthL2 { + return MarketDepthL2.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDepthL2 { + const message = createBaseMarketDepthL2(); + message.reqId = object.reqId ?? undefined; + message.marketDepthData = (object.marketDepthData !== undefined && object.marketDepthData !== null) + ? MarketDepthData.fromPartial(object.marketDepthData) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketDepthRequest.ts b/packages/ibkr/src/protobuf/MarketDepthRequest.ts new file mode 100644 index 00000000..7ad2bc8f --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketDepthRequest.ts @@ -0,0 +1,276 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketDepthRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface MarketDepthRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + numRows?: number | undefined; + isSmartDepth?: boolean | undefined; + marketDepthOptions: { [key: string]: string }; +} + +export interface MarketDepthRequest_MarketDepthOptionsEntry { + key: string; + value: string; +} + +function createBaseMarketDepthRequest(): MarketDepthRequest { + return { reqId: undefined, contract: undefined, numRows: undefined, isSmartDepth: undefined, marketDepthOptions: {} }; +} + +export const MarketDepthRequest: MessageFns = { + encode(message: MarketDepthRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.numRows !== undefined) { + writer.uint32(24).int32(message.numRows); + } + if (message.isSmartDepth !== undefined) { + writer.uint32(32).bool(message.isSmartDepth); + } + globalThis.Object.entries(message.marketDepthOptions).forEach(([key, value]: [string, string]) => { + MarketDepthRequest_MarketDepthOptionsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDepthRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDepthRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.numRows = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.isSmartDepth = reader.bool(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + const entry5 = MarketDepthRequest_MarketDepthOptionsEntry.decode(reader, reader.uint32()); + if (entry5.value !== undefined) { + message.marketDepthOptions[entry5.key] = entry5.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDepthRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + numRows: isSet(object.numRows) ? globalThis.Number(object.numRows) : undefined, + isSmartDepth: isSet(object.isSmartDepth) ? globalThis.Boolean(object.isSmartDepth) : undefined, + marketDepthOptions: isObject(object.marketDepthOptions) + ? (globalThis.Object.entries(object.marketDepthOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: MarketDepthRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.numRows !== undefined) { + obj.numRows = Math.round(message.numRows); + } + if (message.isSmartDepth !== undefined) { + obj.isSmartDepth = message.isSmartDepth; + } + if (message.marketDepthOptions) { + const entries = globalThis.Object.entries(message.marketDepthOptions) as [string, string][]; + if (entries.length > 0) { + obj.marketDepthOptions = {}; + entries.forEach(([k, v]) => { + obj.marketDepthOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): MarketDepthRequest { + return MarketDepthRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketDepthRequest { + const message = createBaseMarketDepthRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.numRows = object.numRows ?? undefined; + message.isSmartDepth = object.isSmartDepth ?? undefined; + message.marketDepthOptions = (globalThis.Object.entries(object.marketDepthOptions ?? {}) as [string, string][]) + .reduce((acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseMarketDepthRequest_MarketDepthOptionsEntry(): MarketDepthRequest_MarketDepthOptionsEntry { + return { key: "", value: "" }; +} + +export const MarketDepthRequest_MarketDepthOptionsEntry: MessageFns = { + encode(message: MarketDepthRequest_MarketDepthOptionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketDepthRequest_MarketDepthOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketDepthRequest_MarketDepthOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketDepthRequest_MarketDepthOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: MarketDepthRequest_MarketDepthOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): MarketDepthRequest_MarketDepthOptionsEntry { + return MarketDepthRequest_MarketDepthOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): MarketDepthRequest_MarketDepthOptionsEntry { + const message = createBaseMarketDepthRequest_MarketDepthOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketRule.ts b/packages/ibkr/src/protobuf/MarketRule.ts new file mode 100644 index 00000000..44000ecb --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketRule.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketRule.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { PriceIncrement } from "./PriceIncrement"; + +export const protobufPackage = "protobuf"; + +export interface MarketRule { + marketRuleId?: number | undefined; + priceIncrements: PriceIncrement[]; +} + +function createBaseMarketRule(): MarketRule { + return { marketRuleId: undefined, priceIncrements: [] }; +} + +export const MarketRule: MessageFns = { + encode(message: MarketRule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.marketRuleId !== undefined) { + writer.uint32(8).int32(message.marketRuleId); + } + for (const v of message.priceIncrements) { + PriceIncrement.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketRule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.marketRuleId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.priceIncrements.push(PriceIncrement.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketRule { + return { + marketRuleId: isSet(object.marketRuleId) ? globalThis.Number(object.marketRuleId) : undefined, + priceIncrements: globalThis.Array.isArray(object?.priceIncrements) + ? object.priceIncrements.map((e: any) => PriceIncrement.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MarketRule): unknown { + const obj: any = {}; + if (message.marketRuleId !== undefined) { + obj.marketRuleId = Math.round(message.marketRuleId); + } + if (message.priceIncrements?.length) { + obj.priceIncrements = message.priceIncrements.map((e) => PriceIncrement.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): MarketRule { + return MarketRule.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketRule { + const message = createBaseMarketRule(); + message.marketRuleId = object.marketRuleId ?? undefined; + message.priceIncrements = object.priceIncrements?.map((e) => PriceIncrement.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MarketRuleRequest.ts b/packages/ibkr/src/protobuf/MarketRuleRequest.ts new file mode 100644 index 00000000..b48a3102 --- /dev/null +++ b/packages/ibkr/src/protobuf/MarketRuleRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MarketRuleRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface MarketRuleRequest { + marketRuleId?: number | undefined; +} + +function createBaseMarketRuleRequest(): MarketRuleRequest { + return { marketRuleId: undefined }; +} + +export const MarketRuleRequest: MessageFns = { + encode(message: MarketRuleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.marketRuleId !== undefined) { + writer.uint32(8).int32(message.marketRuleId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MarketRuleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMarketRuleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.marketRuleId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MarketRuleRequest { + return { marketRuleId: isSet(object.marketRuleId) ? globalThis.Number(object.marketRuleId) : undefined }; + }, + + toJSON(message: MarketRuleRequest): unknown { + const obj: any = {}; + if (message.marketRuleId !== undefined) { + obj.marketRuleId = Math.round(message.marketRuleId); + } + return obj; + }, + + create(base?: DeepPartial): MarketRuleRequest { + return MarketRuleRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MarketRuleRequest { + const message = createBaseMarketRuleRequest(); + message.marketRuleId = object.marketRuleId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MatchingSymbolsRequest.ts b/packages/ibkr/src/protobuf/MatchingSymbolsRequest.ts new file mode 100644 index 00000000..4b583aa4 --- /dev/null +++ b/packages/ibkr/src/protobuf/MatchingSymbolsRequest.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MatchingSymbolsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface MatchingSymbolsRequest { + reqId?: number | undefined; + pattern?: string | undefined; +} + +function createBaseMatchingSymbolsRequest(): MatchingSymbolsRequest { + return { reqId: undefined, pattern: undefined }; +} + +export const MatchingSymbolsRequest: MessageFns = { + encode(message: MatchingSymbolsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.pattern !== undefined) { + writer.uint32(18).string(message.pattern); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MatchingSymbolsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMatchingSymbolsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.pattern = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MatchingSymbolsRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : undefined, + }; + }, + + toJSON(message: MatchingSymbolsRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.pattern !== undefined) { + obj.pattern = message.pattern; + } + return obj; + }, + + create(base?: DeepPartial): MatchingSymbolsRequest { + return MatchingSymbolsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MatchingSymbolsRequest { + const message = createBaseMatchingSymbolsRequest(); + message.reqId = object.reqId ?? undefined; + message.pattern = object.pattern ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/MessageConfig.ts b/packages/ibkr/src/protobuf/MessageConfig.ts new file mode 100644 index 00000000..72238013 --- /dev/null +++ b/packages/ibkr/src/protobuf/MessageConfig.ts @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: MessageConfig.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface MessageConfig { + id?: number | undefined; + title?: string | undefined; + message?: string | undefined; + defaultAction?: string | undefined; + enabled?: boolean | undefined; +} + +function createBaseMessageConfig(): MessageConfig { + return { id: undefined, title: undefined, message: undefined, defaultAction: undefined, enabled: undefined }; +} + +export const MessageConfig: MessageFns = { + encode(message: MessageConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== undefined) { + writer.uint32(8).int32(message.id); + } + if (message.title !== undefined) { + writer.uint32(18).string(message.title); + } + if (message.message !== undefined) { + writer.uint32(26).string(message.message); + } + if (message.defaultAction !== undefined) { + writer.uint32(34).string(message.defaultAction); + } + if (message.enabled !== undefined) { + writer.uint32(40).bool(message.enabled); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MessageConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.title = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.message = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.defaultAction = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.enabled = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MessageConfig { + return { + id: isSet(object.id) ? globalThis.Number(object.id) : undefined, + title: isSet(object.title) ? globalThis.String(object.title) : undefined, + message: isSet(object.message) ? globalThis.String(object.message) : undefined, + defaultAction: isSet(object.defaultAction) ? globalThis.String(object.defaultAction) : undefined, + enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : undefined, + }; + }, + + toJSON(message: MessageConfig): unknown { + const obj: any = {}; + if (message.id !== undefined) { + obj.id = Math.round(message.id); + } + if (message.title !== undefined) { + obj.title = message.title; + } + if (message.message !== undefined) { + obj.message = message.message; + } + if (message.defaultAction !== undefined) { + obj.defaultAction = message.defaultAction; + } + if (message.enabled !== undefined) { + obj.enabled = message.enabled; + } + return obj; + }, + + create(base?: DeepPartial): MessageConfig { + return MessageConfig.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MessageConfig { + const message = createBaseMessageConfig(); + message.id = object.id ?? undefined; + message.title = object.title ?? undefined; + message.message = object.message ?? undefined; + message.defaultAction = object.defaultAction ?? undefined; + message.enabled = object.enabled ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/NewsArticle.ts b/packages/ibkr/src/protobuf/NewsArticle.ts new file mode 100644 index 00000000..cee6ee65 --- /dev/null +++ b/packages/ibkr/src/protobuf/NewsArticle.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: NewsArticle.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface NewsArticle { + reqId?: number | undefined; + articleType?: number | undefined; + articleText?: string | undefined; +} + +function createBaseNewsArticle(): NewsArticle { + return { reqId: undefined, articleType: undefined, articleText: undefined }; +} + +export const NewsArticle: MessageFns = { + encode(message: NewsArticle, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.articleType !== undefined) { + writer.uint32(16).int32(message.articleType); + } + if (message.articleText !== undefined) { + writer.uint32(26).string(message.articleText); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NewsArticle { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewsArticle(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.articleType = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.articleText = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): NewsArticle { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + articleType: isSet(object.articleType) ? globalThis.Number(object.articleType) : undefined, + articleText: isSet(object.articleText) ? globalThis.String(object.articleText) : undefined, + }; + }, + + toJSON(message: NewsArticle): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.articleType !== undefined) { + obj.articleType = Math.round(message.articleType); + } + if (message.articleText !== undefined) { + obj.articleText = message.articleText; + } + return obj; + }, + + create(base?: DeepPartial): NewsArticle { + return NewsArticle.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): NewsArticle { + const message = createBaseNewsArticle(); + message.reqId = object.reqId ?? undefined; + message.articleType = object.articleType ?? undefined; + message.articleText = object.articleText ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/NewsArticleRequest.ts b/packages/ibkr/src/protobuf/NewsArticleRequest.ts new file mode 100644 index 00000000..ffb64a3c --- /dev/null +++ b/packages/ibkr/src/protobuf/NewsArticleRequest.ts @@ -0,0 +1,256 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: NewsArticleRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface NewsArticleRequest { + reqId?: number | undefined; + providerCode?: string | undefined; + articleId?: string | undefined; + newsArticleOptions: { [key: string]: string }; +} + +export interface NewsArticleRequest_NewsArticleOptionsEntry { + key: string; + value: string; +} + +function createBaseNewsArticleRequest(): NewsArticleRequest { + return { reqId: undefined, providerCode: undefined, articleId: undefined, newsArticleOptions: {} }; +} + +export const NewsArticleRequest: MessageFns = { + encode(message: NewsArticleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.providerCode !== undefined) { + writer.uint32(18).string(message.providerCode); + } + if (message.articleId !== undefined) { + writer.uint32(26).string(message.articleId); + } + globalThis.Object.entries(message.newsArticleOptions).forEach(([key, value]: [string, string]) => { + NewsArticleRequest_NewsArticleOptionsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NewsArticleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewsArticleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.providerCode = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.articleId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + const entry4 = NewsArticleRequest_NewsArticleOptionsEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.newsArticleOptions[entry4.key] = entry4.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): NewsArticleRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + providerCode: isSet(object.providerCode) ? globalThis.String(object.providerCode) : undefined, + articleId: isSet(object.articleId) ? globalThis.String(object.articleId) : undefined, + newsArticleOptions: isObject(object.newsArticleOptions) + ? (globalThis.Object.entries(object.newsArticleOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: NewsArticleRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.providerCode !== undefined) { + obj.providerCode = message.providerCode; + } + if (message.articleId !== undefined) { + obj.articleId = message.articleId; + } + if (message.newsArticleOptions) { + const entries = globalThis.Object.entries(message.newsArticleOptions) as [string, string][]; + if (entries.length > 0) { + obj.newsArticleOptions = {}; + entries.forEach(([k, v]) => { + obj.newsArticleOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): NewsArticleRequest { + return NewsArticleRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): NewsArticleRequest { + const message = createBaseNewsArticleRequest(); + message.reqId = object.reqId ?? undefined; + message.providerCode = object.providerCode ?? undefined; + message.articleId = object.articleId ?? undefined; + message.newsArticleOptions = (globalThis.Object.entries(object.newsArticleOptions ?? {}) as [string, string][]) + .reduce((acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseNewsArticleRequest_NewsArticleOptionsEntry(): NewsArticleRequest_NewsArticleOptionsEntry { + return { key: "", value: "" }; +} + +export const NewsArticleRequest_NewsArticleOptionsEntry: MessageFns = { + encode(message: NewsArticleRequest_NewsArticleOptionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NewsArticleRequest_NewsArticleOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewsArticleRequest_NewsArticleOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): NewsArticleRequest_NewsArticleOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: NewsArticleRequest_NewsArticleOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): NewsArticleRequest_NewsArticleOptionsEntry { + return NewsArticleRequest_NewsArticleOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): NewsArticleRequest_NewsArticleOptionsEntry { + const message = createBaseNewsArticleRequest_NewsArticleOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/NewsBulletin.ts b/packages/ibkr/src/protobuf/NewsBulletin.ts new file mode 100644 index 00000000..d7506c8c --- /dev/null +++ b/packages/ibkr/src/protobuf/NewsBulletin.ts @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: NewsBulletin.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface NewsBulletin { + newsMsgId?: number | undefined; + newsMsgType?: number | undefined; + newsMessage?: string | undefined; + originatingExch?: string | undefined; +} + +function createBaseNewsBulletin(): NewsBulletin { + return { newsMsgId: undefined, newsMsgType: undefined, newsMessage: undefined, originatingExch: undefined }; +} + +export const NewsBulletin: MessageFns = { + encode(message: NewsBulletin, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.newsMsgId !== undefined) { + writer.uint32(8).int32(message.newsMsgId); + } + if (message.newsMsgType !== undefined) { + writer.uint32(16).int32(message.newsMsgType); + } + if (message.newsMessage !== undefined) { + writer.uint32(26).string(message.newsMessage); + } + if (message.originatingExch !== undefined) { + writer.uint32(34).string(message.originatingExch); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NewsBulletin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewsBulletin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.newsMsgId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.newsMsgType = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.newsMessage = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.originatingExch = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): NewsBulletin { + return { + newsMsgId: isSet(object.newsMsgId) ? globalThis.Number(object.newsMsgId) : undefined, + newsMsgType: isSet(object.newsMsgType) ? globalThis.Number(object.newsMsgType) : undefined, + newsMessage: isSet(object.newsMessage) ? globalThis.String(object.newsMessage) : undefined, + originatingExch: isSet(object.originatingExch) ? globalThis.String(object.originatingExch) : undefined, + }; + }, + + toJSON(message: NewsBulletin): unknown { + const obj: any = {}; + if (message.newsMsgId !== undefined) { + obj.newsMsgId = Math.round(message.newsMsgId); + } + if (message.newsMsgType !== undefined) { + obj.newsMsgType = Math.round(message.newsMsgType); + } + if (message.newsMessage !== undefined) { + obj.newsMessage = message.newsMessage; + } + if (message.originatingExch !== undefined) { + obj.originatingExch = message.originatingExch; + } + return obj; + }, + + create(base?: DeepPartial): NewsBulletin { + return NewsBulletin.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): NewsBulletin { + const message = createBaseNewsBulletin(); + message.newsMsgId = object.newsMsgId ?? undefined; + message.newsMsgType = object.newsMsgType ?? undefined; + message.newsMessage = object.newsMessage ?? undefined; + message.originatingExch = object.originatingExch ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/NewsBulletinsRequest.ts b/packages/ibkr/src/protobuf/NewsBulletinsRequest.ts new file mode 100644 index 00000000..dfa07dc8 --- /dev/null +++ b/packages/ibkr/src/protobuf/NewsBulletinsRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: NewsBulletinsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface NewsBulletinsRequest { + allMessages?: boolean | undefined; +} + +function createBaseNewsBulletinsRequest(): NewsBulletinsRequest { + return { allMessages: undefined }; +} + +export const NewsBulletinsRequest: MessageFns = { + encode(message: NewsBulletinsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.allMessages !== undefined) { + writer.uint32(8).bool(message.allMessages); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NewsBulletinsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewsBulletinsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.allMessages = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): NewsBulletinsRequest { + return { allMessages: isSet(object.allMessages) ? globalThis.Boolean(object.allMessages) : undefined }; + }, + + toJSON(message: NewsBulletinsRequest): unknown { + const obj: any = {}; + if (message.allMessages !== undefined) { + obj.allMessages = message.allMessages; + } + return obj; + }, + + create(base?: DeepPartial): NewsBulletinsRequest { + return NewsBulletinsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): NewsBulletinsRequest { + const message = createBaseNewsBulletinsRequest(); + message.allMessages = object.allMessages ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/NewsProvider.ts b/packages/ibkr/src/protobuf/NewsProvider.ts new file mode 100644 index 00000000..39ac5ee6 --- /dev/null +++ b/packages/ibkr/src/protobuf/NewsProvider.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: NewsProvider.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface NewsProvider { + providerCode?: string | undefined; + providerName?: string | undefined; +} + +function createBaseNewsProvider(): NewsProvider { + return { providerCode: undefined, providerName: undefined }; +} + +export const NewsProvider: MessageFns = { + encode(message: NewsProvider, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.providerCode !== undefined) { + writer.uint32(10).string(message.providerCode); + } + if (message.providerName !== undefined) { + writer.uint32(18).string(message.providerName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NewsProvider { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewsProvider(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.providerCode = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.providerName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): NewsProvider { + return { + providerCode: isSet(object.providerCode) ? globalThis.String(object.providerCode) : undefined, + providerName: isSet(object.providerName) ? globalThis.String(object.providerName) : undefined, + }; + }, + + toJSON(message: NewsProvider): unknown { + const obj: any = {}; + if (message.providerCode !== undefined) { + obj.providerCode = message.providerCode; + } + if (message.providerName !== undefined) { + obj.providerName = message.providerName; + } + return obj; + }, + + create(base?: DeepPartial): NewsProvider { + return NewsProvider.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): NewsProvider { + const message = createBaseNewsProvider(); + message.providerCode = object.providerCode ?? undefined; + message.providerName = object.providerName ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/NewsProviders.ts b/packages/ibkr/src/protobuf/NewsProviders.ts new file mode 100644 index 00000000..bb914558 --- /dev/null +++ b/packages/ibkr/src/protobuf/NewsProviders.ts @@ -0,0 +1,94 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: NewsProviders.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { NewsProvider } from "./NewsProvider"; + +export const protobufPackage = "protobuf"; + +export interface NewsProviders { + newsProviders: NewsProvider[]; +} + +function createBaseNewsProviders(): NewsProviders { + return { newsProviders: [] }; +} + +export const NewsProviders: MessageFns = { + encode(message: NewsProviders, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.newsProviders) { + NewsProvider.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NewsProviders { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewsProviders(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.newsProviders.push(NewsProvider.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): NewsProviders { + return { + newsProviders: globalThis.Array.isArray(object?.newsProviders) + ? object.newsProviders.map((e: any) => NewsProvider.fromJSON(e)) + : [], + }; + }, + + toJSON(message: NewsProviders): unknown { + const obj: any = {}; + if (message.newsProviders?.length) { + obj.newsProviders = message.newsProviders.map((e) => NewsProvider.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): NewsProviders { + return NewsProviders.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): NewsProviders { + const message = createBaseNewsProviders(); + message.newsProviders = object.newsProviders?.map((e) => NewsProvider.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/NewsProvidersRequest.ts b/packages/ibkr/src/protobuf/NewsProvidersRequest.ts new file mode 100644 index 00000000..cc1f7b24 --- /dev/null +++ b/packages/ibkr/src/protobuf/NewsProvidersRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: NewsProvidersRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface NewsProvidersRequest { +} + +function createBaseNewsProvidersRequest(): NewsProvidersRequest { + return {}; +} + +export const NewsProvidersRequest: MessageFns = { + encode(_: NewsProvidersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NewsProvidersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNewsProvidersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): NewsProvidersRequest { + return {}; + }, + + toJSON(_: NewsProvidersRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): NewsProvidersRequest { + return NewsProvidersRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): NewsProvidersRequest { + const message = createBaseNewsProvidersRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/NextValidId.ts b/packages/ibkr/src/protobuf/NextValidId.ts new file mode 100644 index 00000000..d154c6a7 --- /dev/null +++ b/packages/ibkr/src/protobuf/NextValidId.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: NextValidId.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface NextValidId { + orderId?: number | undefined; +} + +function createBaseNextValidId(): NextValidId { + return { orderId: undefined }; +} + +export const NextValidId: MessageFns = { + encode(message: NextValidId, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.orderId !== undefined) { + writer.uint32(8).int32(message.orderId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): NextValidId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNextValidId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.orderId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): NextValidId { + return { orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined }; + }, + + toJSON(message: NextValidId): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + return obj; + }, + + create(base?: DeepPartial): NextValidId { + return NextValidId.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): NextValidId { + const message = createBaseNextValidId(); + message.orderId = object.orderId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OpenOrder.ts b/packages/ibkr/src/protobuf/OpenOrder.ts new file mode 100644 index 00000000..39a0ba5e --- /dev/null +++ b/packages/ibkr/src/protobuf/OpenOrder.ts @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OpenOrder.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; +import { Order } from "./Order"; +import { OrderState } from "./OrderState"; + +export const protobufPackage = "protobuf"; + +export interface OpenOrder { + orderId?: number | undefined; + contract?: Contract | undefined; + order?: Order | undefined; + orderState?: OrderState | undefined; +} + +function createBaseOpenOrder(): OpenOrder { + return { orderId: undefined, contract: undefined, order: undefined, orderState: undefined }; +} + +export const OpenOrder: MessageFns = { + encode(message: OpenOrder, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.orderId !== undefined) { + writer.uint32(8).int32(message.orderId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(26).fork()).join(); + } + if (message.orderState !== undefined) { + OrderState.encode(message.orderState, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OpenOrder { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOpenOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.orderId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.order = Order.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.orderState = OrderState.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OpenOrder { + return { + orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + order: isSet(object.order) ? Order.fromJSON(object.order) : undefined, + orderState: isSet(object.orderState) ? OrderState.fromJSON(object.orderState) : undefined, + }; + }, + + toJSON(message: OpenOrder): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.order !== undefined) { + obj.order = Order.toJSON(message.order); + } + if (message.orderState !== undefined) { + obj.orderState = OrderState.toJSON(message.orderState); + } + return obj; + }, + + create(base?: DeepPartial): OpenOrder { + return OpenOrder.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OpenOrder { + const message = createBaseOpenOrder(); + message.orderId = object.orderId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.order = (object.order !== undefined && object.order !== null) ? Order.fromPartial(object.order) : undefined; + message.orderState = (object.orderState !== undefined && object.orderState !== null) + ? OrderState.fromPartial(object.orderState) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OpenOrdersEnd.ts b/packages/ibkr/src/protobuf/OpenOrdersEnd.ts new file mode 100644 index 00000000..4beccfe2 --- /dev/null +++ b/packages/ibkr/src/protobuf/OpenOrdersEnd.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OpenOrdersEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface OpenOrdersEnd { +} + +function createBaseOpenOrdersEnd(): OpenOrdersEnd { + return {}; +} + +export const OpenOrdersEnd: MessageFns = { + encode(_: OpenOrdersEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OpenOrdersEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOpenOrdersEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): OpenOrdersEnd { + return {}; + }, + + toJSON(_: OpenOrdersEnd): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): OpenOrdersEnd { + return OpenOrdersEnd.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): OpenOrdersEnd { + const message = createBaseOpenOrdersEnd(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OpenOrdersRequest.ts b/packages/ibkr/src/protobuf/OpenOrdersRequest.ts new file mode 100644 index 00000000..f20a9775 --- /dev/null +++ b/packages/ibkr/src/protobuf/OpenOrdersRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OpenOrdersRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface OpenOrdersRequest { +} + +function createBaseOpenOrdersRequest(): OpenOrdersRequest { + return {}; +} + +export const OpenOrdersRequest: MessageFns = { + encode(_: OpenOrdersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OpenOrdersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOpenOrdersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): OpenOrdersRequest { + return {}; + }, + + toJSON(_: OpenOrdersRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): OpenOrdersRequest { + return OpenOrdersRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): OpenOrdersRequest { + const message = createBaseOpenOrdersRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/Order.ts b/packages/ibkr/src/protobuf/Order.ts new file mode 100644 index 00000000..02e386b3 --- /dev/null +++ b/packages/ibkr/src/protobuf/Order.ts @@ -0,0 +1,3124 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: Order.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { OrderCondition } from "./OrderCondition"; +import { SoftDollarTier } from "./SoftDollarTier"; + +export const protobufPackage = "protobuf"; + +export interface Order { + /** order ids */ + clientId?: number | undefined; + orderId?: number | undefined; + permId?: number | undefined; + parentId?: + | number + | undefined; + /** primary attributes */ + action?: string | undefined; + totalQuantity?: string | undefined; + displaySize?: number | undefined; + orderType?: string | undefined; + lmtPrice?: number | undefined; + auxPrice?: number | undefined; + tif?: + | string + | undefined; + /** clearing info */ + account?: string | undefined; + settlingFirm?: string | undefined; + clearingAccount?: string | undefined; + clearingIntent?: + | string + | undefined; + /** secondary attributes */ + allOrNone?: boolean | undefined; + blockOrder?: boolean | undefined; + hidden?: boolean | undefined; + outsideRth?: boolean | undefined; + sweepToFill?: boolean | undefined; + percentOffset?: number | undefined; + trailingPercent?: number | undefined; + trailStopPrice?: number | undefined; + minQty?: number | undefined; + goodAfterTime?: string | undefined; + goodTillDate?: string | undefined; + ocaGroup?: string | undefined; + orderRef?: string | undefined; + rule80A?: string | undefined; + ocaType?: number | undefined; + triggerMethod?: + | number + | undefined; + /** extended order fields */ + activeStartTime?: string | undefined; + activeStopTime?: + | string + | undefined; + /** advisor allocation orders */ + faGroup?: string | undefined; + faMethod?: string | undefined; + faPercentage?: + | string + | undefined; + /** volatility orders */ + volatility?: number | undefined; + volatilityType?: number | undefined; + continuousUpdate?: boolean | undefined; + referencePriceType?: number | undefined; + deltaNeutralOrderType?: string | undefined; + deltaNeutralAuxPrice?: number | undefined; + deltaNeutralConId?: number | undefined; + deltaNeutralOpenClose?: string | undefined; + deltaNeutralShortSale?: boolean | undefined; + deltaNeutralShortSaleSlot?: number | undefined; + deltaNeutralDesignatedLocation?: + | string + | undefined; + /** scale orders */ + scaleInitLevelSize?: number | undefined; + scaleSubsLevelSize?: number | undefined; + scalePriceIncrement?: number | undefined; + scalePriceAdjustValue?: number | undefined; + scalePriceAdjustInterval?: number | undefined; + scaleProfitOffset?: number | undefined; + scaleAutoReset?: boolean | undefined; + scaleInitPosition?: number | undefined; + scaleInitFillQty?: number | undefined; + scaleRandomPercent?: boolean | undefined; + scaleTable?: + | string + | undefined; + /** hedge orders */ + hedgeType?: string | undefined; + hedgeParam?: + | string + | undefined; + /** algo orders */ + algoStrategy?: string | undefined; + algoParams: { [key: string]: string }; + algoId?: + | string + | undefined; + /** combo orders */ + smartComboRoutingParams: { [key: string]: string }; + /** processing control */ + whatIf?: boolean | undefined; + transmit?: boolean | undefined; + overridePercentageConstraints?: + | boolean + | undefined; + /** Institutional orders only */ + openClose?: string | undefined; + origin?: number | undefined; + shortSaleSlot?: number | undefined; + designatedLocation?: string | undefined; + exemptCode?: number | undefined; + deltaNeutralSettlingFirm?: string | undefined; + deltaNeutralClearingAccount?: string | undefined; + deltaNeutralClearingIntent?: + | string + | undefined; + /** SMART routing only */ + discretionaryAmt?: number | undefined; + optOutSmartRouting?: + | boolean + | undefined; + /** BOX ORDERS ONLY */ + startingPrice?: number | undefined; + stockRefPrice?: number | undefined; + delta?: + | number + | undefined; + /** pegged to stock or VOL orders */ + stockRangeLower?: number | undefined; + stockRangeUpper?: + | number + | undefined; + /** Not Held */ + notHeld?: + | boolean + | undefined; + /** order misc options */ + orderMiscOptions: { [key: string]: string }; + /** order algo id */ + solicited?: boolean | undefined; + randomizeSize?: boolean | undefined; + randomizePrice?: + | boolean + | undefined; + /** PEG2BENCH fields */ + referenceContractId?: number | undefined; + peggedChangeAmount?: number | undefined; + isPeggedChangeAmountDecrease?: boolean | undefined; + referenceChangeAmount?: number | undefined; + referenceExchangeId?: string | undefined; + adjustedOrderType?: string | undefined; + triggerPrice?: number | undefined; + adjustedStopPrice?: number | undefined; + adjustedStopLimitPrice?: number | undefined; + adjustedTrailingAmount?: number | undefined; + adjustableTrailingUnit?: number | undefined; + lmtPriceOffset?: number | undefined; + conditions: OrderCondition[]; + conditionsCancelOrder?: boolean | undefined; + conditionsIgnoreRth?: + | boolean + | undefined; + /** models */ + modelCode?: string | undefined; + extOperator?: string | undefined; + softDollarTier?: + | SoftDollarTier + | undefined; + /** native cash quantity */ + cashQty?: number | undefined; + mifid2DecisionMaker?: string | undefined; + mifid2DecisionAlgo?: string | undefined; + mifid2ExecutionTrader?: string | undefined; + mifid2ExecutionAlgo?: + | string + | undefined; + /** don't use auto price for hedge */ + dontUseAutoPriceForHedge?: boolean | undefined; + isOmsContainer?: boolean | undefined; + discretionaryUpToLimitPrice?: boolean | undefined; + autoCancelDate?: string | undefined; + filledQuantity?: string | undefined; + refFuturesConId?: number | undefined; + autoCancelParent?: boolean | undefined; + shareholder?: string | undefined; + imbalanceOnly?: boolean | undefined; + routeMarketableToBbo?: number | undefined; + parentPermId?: number | undefined; + usePriceMgmtAlgo?: number | undefined; + duration?: number | undefined; + postToAts?: number | undefined; + advancedErrorOverride?: string | undefined; + manualOrderTime?: string | undefined; + minTradeQty?: number | undefined; + minCompeteSize?: number | undefined; + competeAgainstBestOffset?: number | undefined; + midOffsetAtWhole?: number | undefined; + midOffsetAtHalf?: number | undefined; + customerAccount?: string | undefined; + professionalCustomer?: boolean | undefined; + bondAccruedInterest?: string | undefined; + includeOvernight?: boolean | undefined; + manualOrderIndicator?: number | undefined; + submitter?: string | undefined; + deactivate?: boolean | undefined; + postOnly?: boolean | undefined; + allowPreOpen?: boolean | undefined; + ignoreOpenAuction?: boolean | undefined; + seekPriceImprovement?: number | undefined; + whatIfType?: number | undefined; +} + +export interface Order_AlgoParamsEntry { + key: string; + value: string; +} + +export interface Order_SmartComboRoutingParamsEntry { + key: string; + value: string; +} + +export interface Order_OrderMiscOptionsEntry { + key: string; + value: string; +} + +function createBaseOrder(): Order { + return { + clientId: undefined, + orderId: undefined, + permId: undefined, + parentId: undefined, + action: undefined, + totalQuantity: undefined, + displaySize: undefined, + orderType: undefined, + lmtPrice: undefined, + auxPrice: undefined, + tif: undefined, + account: undefined, + settlingFirm: undefined, + clearingAccount: undefined, + clearingIntent: undefined, + allOrNone: undefined, + blockOrder: undefined, + hidden: undefined, + outsideRth: undefined, + sweepToFill: undefined, + percentOffset: undefined, + trailingPercent: undefined, + trailStopPrice: undefined, + minQty: undefined, + goodAfterTime: undefined, + goodTillDate: undefined, + ocaGroup: undefined, + orderRef: undefined, + rule80A: undefined, + ocaType: undefined, + triggerMethod: undefined, + activeStartTime: undefined, + activeStopTime: undefined, + faGroup: undefined, + faMethod: undefined, + faPercentage: undefined, + volatility: undefined, + volatilityType: undefined, + continuousUpdate: undefined, + referencePriceType: undefined, + deltaNeutralOrderType: undefined, + deltaNeutralAuxPrice: undefined, + deltaNeutralConId: undefined, + deltaNeutralOpenClose: undefined, + deltaNeutralShortSale: undefined, + deltaNeutralShortSaleSlot: undefined, + deltaNeutralDesignatedLocation: undefined, + scaleInitLevelSize: undefined, + scaleSubsLevelSize: undefined, + scalePriceIncrement: undefined, + scalePriceAdjustValue: undefined, + scalePriceAdjustInterval: undefined, + scaleProfitOffset: undefined, + scaleAutoReset: undefined, + scaleInitPosition: undefined, + scaleInitFillQty: undefined, + scaleRandomPercent: undefined, + scaleTable: undefined, + hedgeType: undefined, + hedgeParam: undefined, + algoStrategy: undefined, + algoParams: {}, + algoId: undefined, + smartComboRoutingParams: {}, + whatIf: undefined, + transmit: undefined, + overridePercentageConstraints: undefined, + openClose: undefined, + origin: undefined, + shortSaleSlot: undefined, + designatedLocation: undefined, + exemptCode: undefined, + deltaNeutralSettlingFirm: undefined, + deltaNeutralClearingAccount: undefined, + deltaNeutralClearingIntent: undefined, + discretionaryAmt: undefined, + optOutSmartRouting: undefined, + startingPrice: undefined, + stockRefPrice: undefined, + delta: undefined, + stockRangeLower: undefined, + stockRangeUpper: undefined, + notHeld: undefined, + orderMiscOptions: {}, + solicited: undefined, + randomizeSize: undefined, + randomizePrice: undefined, + referenceContractId: undefined, + peggedChangeAmount: undefined, + isPeggedChangeAmountDecrease: undefined, + referenceChangeAmount: undefined, + referenceExchangeId: undefined, + adjustedOrderType: undefined, + triggerPrice: undefined, + adjustedStopPrice: undefined, + adjustedStopLimitPrice: undefined, + adjustedTrailingAmount: undefined, + adjustableTrailingUnit: undefined, + lmtPriceOffset: undefined, + conditions: [], + conditionsCancelOrder: undefined, + conditionsIgnoreRth: undefined, + modelCode: undefined, + extOperator: undefined, + softDollarTier: undefined, + cashQty: undefined, + mifid2DecisionMaker: undefined, + mifid2DecisionAlgo: undefined, + mifid2ExecutionTrader: undefined, + mifid2ExecutionAlgo: undefined, + dontUseAutoPriceForHedge: undefined, + isOmsContainer: undefined, + discretionaryUpToLimitPrice: undefined, + autoCancelDate: undefined, + filledQuantity: undefined, + refFuturesConId: undefined, + autoCancelParent: undefined, + shareholder: undefined, + imbalanceOnly: undefined, + routeMarketableToBbo: undefined, + parentPermId: undefined, + usePriceMgmtAlgo: undefined, + duration: undefined, + postToAts: undefined, + advancedErrorOverride: undefined, + manualOrderTime: undefined, + minTradeQty: undefined, + minCompeteSize: undefined, + competeAgainstBestOffset: undefined, + midOffsetAtWhole: undefined, + midOffsetAtHalf: undefined, + customerAccount: undefined, + professionalCustomer: undefined, + bondAccruedInterest: undefined, + includeOvernight: undefined, + manualOrderIndicator: undefined, + submitter: undefined, + deactivate: undefined, + postOnly: undefined, + allowPreOpen: undefined, + ignoreOpenAuction: undefined, + seekPriceImprovement: undefined, + whatIfType: undefined, + }; +} + +export const Order: MessageFns = { + encode(message: Order, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.clientId !== undefined) { + writer.uint32(8).int32(message.clientId); + } + if (message.orderId !== undefined) { + writer.uint32(16).int32(message.orderId); + } + if (message.permId !== undefined) { + writer.uint32(24).int64(message.permId); + } + if (message.parentId !== undefined) { + writer.uint32(32).int32(message.parentId); + } + if (message.action !== undefined) { + writer.uint32(42).string(message.action); + } + if (message.totalQuantity !== undefined) { + writer.uint32(50).string(message.totalQuantity); + } + if (message.displaySize !== undefined) { + writer.uint32(56).int32(message.displaySize); + } + if (message.orderType !== undefined) { + writer.uint32(66).string(message.orderType); + } + if (message.lmtPrice !== undefined) { + writer.uint32(73).double(message.lmtPrice); + } + if (message.auxPrice !== undefined) { + writer.uint32(81).double(message.auxPrice); + } + if (message.tif !== undefined) { + writer.uint32(90).string(message.tif); + } + if (message.account !== undefined) { + writer.uint32(98).string(message.account); + } + if (message.settlingFirm !== undefined) { + writer.uint32(106).string(message.settlingFirm); + } + if (message.clearingAccount !== undefined) { + writer.uint32(114).string(message.clearingAccount); + } + if (message.clearingIntent !== undefined) { + writer.uint32(122).string(message.clearingIntent); + } + if (message.allOrNone !== undefined) { + writer.uint32(128).bool(message.allOrNone); + } + if (message.blockOrder !== undefined) { + writer.uint32(136).bool(message.blockOrder); + } + if (message.hidden !== undefined) { + writer.uint32(144).bool(message.hidden); + } + if (message.outsideRth !== undefined) { + writer.uint32(152).bool(message.outsideRth); + } + if (message.sweepToFill !== undefined) { + writer.uint32(160).bool(message.sweepToFill); + } + if (message.percentOffset !== undefined) { + writer.uint32(169).double(message.percentOffset); + } + if (message.trailingPercent !== undefined) { + writer.uint32(177).double(message.trailingPercent); + } + if (message.trailStopPrice !== undefined) { + writer.uint32(185).double(message.trailStopPrice); + } + if (message.minQty !== undefined) { + writer.uint32(192).int32(message.minQty); + } + if (message.goodAfterTime !== undefined) { + writer.uint32(202).string(message.goodAfterTime); + } + if (message.goodTillDate !== undefined) { + writer.uint32(210).string(message.goodTillDate); + } + if (message.ocaGroup !== undefined) { + writer.uint32(218).string(message.ocaGroup); + } + if (message.orderRef !== undefined) { + writer.uint32(226).string(message.orderRef); + } + if (message.rule80A !== undefined) { + writer.uint32(234).string(message.rule80A); + } + if (message.ocaType !== undefined) { + writer.uint32(240).int32(message.ocaType); + } + if (message.triggerMethod !== undefined) { + writer.uint32(248).int32(message.triggerMethod); + } + if (message.activeStartTime !== undefined) { + writer.uint32(258).string(message.activeStartTime); + } + if (message.activeStopTime !== undefined) { + writer.uint32(266).string(message.activeStopTime); + } + if (message.faGroup !== undefined) { + writer.uint32(274).string(message.faGroup); + } + if (message.faMethod !== undefined) { + writer.uint32(282).string(message.faMethod); + } + if (message.faPercentage !== undefined) { + writer.uint32(290).string(message.faPercentage); + } + if (message.volatility !== undefined) { + writer.uint32(297).double(message.volatility); + } + if (message.volatilityType !== undefined) { + writer.uint32(304).int32(message.volatilityType); + } + if (message.continuousUpdate !== undefined) { + writer.uint32(312).bool(message.continuousUpdate); + } + if (message.referencePriceType !== undefined) { + writer.uint32(320).int32(message.referencePriceType); + } + if (message.deltaNeutralOrderType !== undefined) { + writer.uint32(330).string(message.deltaNeutralOrderType); + } + if (message.deltaNeutralAuxPrice !== undefined) { + writer.uint32(337).double(message.deltaNeutralAuxPrice); + } + if (message.deltaNeutralConId !== undefined) { + writer.uint32(344).int32(message.deltaNeutralConId); + } + if (message.deltaNeutralOpenClose !== undefined) { + writer.uint32(354).string(message.deltaNeutralOpenClose); + } + if (message.deltaNeutralShortSale !== undefined) { + writer.uint32(360).bool(message.deltaNeutralShortSale); + } + if (message.deltaNeutralShortSaleSlot !== undefined) { + writer.uint32(368).int32(message.deltaNeutralShortSaleSlot); + } + if (message.deltaNeutralDesignatedLocation !== undefined) { + writer.uint32(378).string(message.deltaNeutralDesignatedLocation); + } + if (message.scaleInitLevelSize !== undefined) { + writer.uint32(384).int32(message.scaleInitLevelSize); + } + if (message.scaleSubsLevelSize !== undefined) { + writer.uint32(392).int32(message.scaleSubsLevelSize); + } + if (message.scalePriceIncrement !== undefined) { + writer.uint32(401).double(message.scalePriceIncrement); + } + if (message.scalePriceAdjustValue !== undefined) { + writer.uint32(409).double(message.scalePriceAdjustValue); + } + if (message.scalePriceAdjustInterval !== undefined) { + writer.uint32(416).int32(message.scalePriceAdjustInterval); + } + if (message.scaleProfitOffset !== undefined) { + writer.uint32(425).double(message.scaleProfitOffset); + } + if (message.scaleAutoReset !== undefined) { + writer.uint32(432).bool(message.scaleAutoReset); + } + if (message.scaleInitPosition !== undefined) { + writer.uint32(440).int32(message.scaleInitPosition); + } + if (message.scaleInitFillQty !== undefined) { + writer.uint32(448).int32(message.scaleInitFillQty); + } + if (message.scaleRandomPercent !== undefined) { + writer.uint32(456).bool(message.scaleRandomPercent); + } + if (message.scaleTable !== undefined) { + writer.uint32(466).string(message.scaleTable); + } + if (message.hedgeType !== undefined) { + writer.uint32(474).string(message.hedgeType); + } + if (message.hedgeParam !== undefined) { + writer.uint32(482).string(message.hedgeParam); + } + if (message.algoStrategy !== undefined) { + writer.uint32(490).string(message.algoStrategy); + } + globalThis.Object.entries(message.algoParams).forEach(([key, value]: [string, string]) => { + Order_AlgoParamsEntry.encode({ key: key as any, value }, writer.uint32(498).fork()).join(); + }); + if (message.algoId !== undefined) { + writer.uint32(506).string(message.algoId); + } + globalThis.Object.entries(message.smartComboRoutingParams).forEach(([key, value]: [string, string]) => { + Order_SmartComboRoutingParamsEntry.encode({ key: key as any, value }, writer.uint32(514).fork()).join(); + }); + if (message.whatIf !== undefined) { + writer.uint32(520).bool(message.whatIf); + } + if (message.transmit !== undefined) { + writer.uint32(528).bool(message.transmit); + } + if (message.overridePercentageConstraints !== undefined) { + writer.uint32(536).bool(message.overridePercentageConstraints); + } + if (message.openClose !== undefined) { + writer.uint32(546).string(message.openClose); + } + if (message.origin !== undefined) { + writer.uint32(552).int32(message.origin); + } + if (message.shortSaleSlot !== undefined) { + writer.uint32(560).int32(message.shortSaleSlot); + } + if (message.designatedLocation !== undefined) { + writer.uint32(570).string(message.designatedLocation); + } + if (message.exemptCode !== undefined) { + writer.uint32(576).int32(message.exemptCode); + } + if (message.deltaNeutralSettlingFirm !== undefined) { + writer.uint32(586).string(message.deltaNeutralSettlingFirm); + } + if (message.deltaNeutralClearingAccount !== undefined) { + writer.uint32(594).string(message.deltaNeutralClearingAccount); + } + if (message.deltaNeutralClearingIntent !== undefined) { + writer.uint32(602).string(message.deltaNeutralClearingIntent); + } + if (message.discretionaryAmt !== undefined) { + writer.uint32(609).double(message.discretionaryAmt); + } + if (message.optOutSmartRouting !== undefined) { + writer.uint32(616).bool(message.optOutSmartRouting); + } + if (message.startingPrice !== undefined) { + writer.uint32(625).double(message.startingPrice); + } + if (message.stockRefPrice !== undefined) { + writer.uint32(633).double(message.stockRefPrice); + } + if (message.delta !== undefined) { + writer.uint32(641).double(message.delta); + } + if (message.stockRangeLower !== undefined) { + writer.uint32(649).double(message.stockRangeLower); + } + if (message.stockRangeUpper !== undefined) { + writer.uint32(657).double(message.stockRangeUpper); + } + if (message.notHeld !== undefined) { + writer.uint32(664).bool(message.notHeld); + } + globalThis.Object.entries(message.orderMiscOptions).forEach(([key, value]: [string, string]) => { + Order_OrderMiscOptionsEntry.encode({ key: key as any, value }, writer.uint32(674).fork()).join(); + }); + if (message.solicited !== undefined) { + writer.uint32(680).bool(message.solicited); + } + if (message.randomizeSize !== undefined) { + writer.uint32(688).bool(message.randomizeSize); + } + if (message.randomizePrice !== undefined) { + writer.uint32(696).bool(message.randomizePrice); + } + if (message.referenceContractId !== undefined) { + writer.uint32(704).int32(message.referenceContractId); + } + if (message.peggedChangeAmount !== undefined) { + writer.uint32(713).double(message.peggedChangeAmount); + } + if (message.isPeggedChangeAmountDecrease !== undefined) { + writer.uint32(720).bool(message.isPeggedChangeAmountDecrease); + } + if (message.referenceChangeAmount !== undefined) { + writer.uint32(729).double(message.referenceChangeAmount); + } + if (message.referenceExchangeId !== undefined) { + writer.uint32(738).string(message.referenceExchangeId); + } + if (message.adjustedOrderType !== undefined) { + writer.uint32(746).string(message.adjustedOrderType); + } + if (message.triggerPrice !== undefined) { + writer.uint32(753).double(message.triggerPrice); + } + if (message.adjustedStopPrice !== undefined) { + writer.uint32(761).double(message.adjustedStopPrice); + } + if (message.adjustedStopLimitPrice !== undefined) { + writer.uint32(769).double(message.adjustedStopLimitPrice); + } + if (message.adjustedTrailingAmount !== undefined) { + writer.uint32(777).double(message.adjustedTrailingAmount); + } + if (message.adjustableTrailingUnit !== undefined) { + writer.uint32(784).int32(message.adjustableTrailingUnit); + } + if (message.lmtPriceOffset !== undefined) { + writer.uint32(793).double(message.lmtPriceOffset); + } + for (const v of message.conditions) { + OrderCondition.encode(v!, writer.uint32(802).fork()).join(); + } + if (message.conditionsCancelOrder !== undefined) { + writer.uint32(808).bool(message.conditionsCancelOrder); + } + if (message.conditionsIgnoreRth !== undefined) { + writer.uint32(816).bool(message.conditionsIgnoreRth); + } + if (message.modelCode !== undefined) { + writer.uint32(826).string(message.modelCode); + } + if (message.extOperator !== undefined) { + writer.uint32(834).string(message.extOperator); + } + if (message.softDollarTier !== undefined) { + SoftDollarTier.encode(message.softDollarTier, writer.uint32(842).fork()).join(); + } + if (message.cashQty !== undefined) { + writer.uint32(849).double(message.cashQty); + } + if (message.mifid2DecisionMaker !== undefined) { + writer.uint32(858).string(message.mifid2DecisionMaker); + } + if (message.mifid2DecisionAlgo !== undefined) { + writer.uint32(866).string(message.mifid2DecisionAlgo); + } + if (message.mifid2ExecutionTrader !== undefined) { + writer.uint32(874).string(message.mifid2ExecutionTrader); + } + if (message.mifid2ExecutionAlgo !== undefined) { + writer.uint32(882).string(message.mifid2ExecutionAlgo); + } + if (message.dontUseAutoPriceForHedge !== undefined) { + writer.uint32(888).bool(message.dontUseAutoPriceForHedge); + } + if (message.isOmsContainer !== undefined) { + writer.uint32(896).bool(message.isOmsContainer); + } + if (message.discretionaryUpToLimitPrice !== undefined) { + writer.uint32(904).bool(message.discretionaryUpToLimitPrice); + } + if (message.autoCancelDate !== undefined) { + writer.uint32(914).string(message.autoCancelDate); + } + if (message.filledQuantity !== undefined) { + writer.uint32(922).string(message.filledQuantity); + } + if (message.refFuturesConId !== undefined) { + writer.uint32(928).int32(message.refFuturesConId); + } + if (message.autoCancelParent !== undefined) { + writer.uint32(936).bool(message.autoCancelParent); + } + if (message.shareholder !== undefined) { + writer.uint32(946).string(message.shareholder); + } + if (message.imbalanceOnly !== undefined) { + writer.uint32(952).bool(message.imbalanceOnly); + } + if (message.routeMarketableToBbo !== undefined) { + writer.uint32(960).int32(message.routeMarketableToBbo); + } + if (message.parentPermId !== undefined) { + writer.uint32(968).int64(message.parentPermId); + } + if (message.usePriceMgmtAlgo !== undefined) { + writer.uint32(976).int32(message.usePriceMgmtAlgo); + } + if (message.duration !== undefined) { + writer.uint32(984).int32(message.duration); + } + if (message.postToAts !== undefined) { + writer.uint32(992).int32(message.postToAts); + } + if (message.advancedErrorOverride !== undefined) { + writer.uint32(1002).string(message.advancedErrorOverride); + } + if (message.manualOrderTime !== undefined) { + writer.uint32(1010).string(message.manualOrderTime); + } + if (message.minTradeQty !== undefined) { + writer.uint32(1016).int32(message.minTradeQty); + } + if (message.minCompeteSize !== undefined) { + writer.uint32(1024).int32(message.minCompeteSize); + } + if (message.competeAgainstBestOffset !== undefined) { + writer.uint32(1033).double(message.competeAgainstBestOffset); + } + if (message.midOffsetAtWhole !== undefined) { + writer.uint32(1041).double(message.midOffsetAtWhole); + } + if (message.midOffsetAtHalf !== undefined) { + writer.uint32(1049).double(message.midOffsetAtHalf); + } + if (message.customerAccount !== undefined) { + writer.uint32(1058).string(message.customerAccount); + } + if (message.professionalCustomer !== undefined) { + writer.uint32(1064).bool(message.professionalCustomer); + } + if (message.bondAccruedInterest !== undefined) { + writer.uint32(1074).string(message.bondAccruedInterest); + } + if (message.includeOvernight !== undefined) { + writer.uint32(1080).bool(message.includeOvernight); + } + if (message.manualOrderIndicator !== undefined) { + writer.uint32(1088).int32(message.manualOrderIndicator); + } + if (message.submitter !== undefined) { + writer.uint32(1098).string(message.submitter); + } + if (message.deactivate !== undefined) { + writer.uint32(1104).bool(message.deactivate); + } + if (message.postOnly !== undefined) { + writer.uint32(1112).bool(message.postOnly); + } + if (message.allowPreOpen !== undefined) { + writer.uint32(1120).bool(message.allowPreOpen); + } + if (message.ignoreOpenAuction !== undefined) { + writer.uint32(1128).bool(message.ignoreOpenAuction); + } + if (message.seekPriceImprovement !== undefined) { + writer.uint32(1136).int32(message.seekPriceImprovement); + } + if (message.whatIfType !== undefined) { + writer.uint32(1144).int32(message.whatIfType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Order { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrder(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.clientId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.orderId = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.permId = longToNumber(reader.int64()); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.parentId = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.action = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.totalQuantity = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.displaySize = reader.int32(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.orderType = reader.string(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.lmtPrice = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.auxPrice = reader.double(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.tif = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.account = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.settlingFirm = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.clearingAccount = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.clearingIntent = reader.string(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.allOrNone = reader.bool(); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.blockOrder = reader.bool(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.hidden = reader.bool(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.outsideRth = reader.bool(); + continue; + } + case 20: { + if (tag !== 160) { + break; + } + + message.sweepToFill = reader.bool(); + continue; + } + case 21: { + if (tag !== 169) { + break; + } + + message.percentOffset = reader.double(); + continue; + } + case 22: { + if (tag !== 177) { + break; + } + + message.trailingPercent = reader.double(); + continue; + } + case 23: { + if (tag !== 185) { + break; + } + + message.trailStopPrice = reader.double(); + continue; + } + case 24: { + if (tag !== 192) { + break; + } + + message.minQty = reader.int32(); + continue; + } + case 25: { + if (tag !== 202) { + break; + } + + message.goodAfterTime = reader.string(); + continue; + } + case 26: { + if (tag !== 210) { + break; + } + + message.goodTillDate = reader.string(); + continue; + } + case 27: { + if (tag !== 218) { + break; + } + + message.ocaGroup = reader.string(); + continue; + } + case 28: { + if (tag !== 226) { + break; + } + + message.orderRef = reader.string(); + continue; + } + case 29: { + if (tag !== 234) { + break; + } + + message.rule80A = reader.string(); + continue; + } + case 30: { + if (tag !== 240) { + break; + } + + message.ocaType = reader.int32(); + continue; + } + case 31: { + if (tag !== 248) { + break; + } + + message.triggerMethod = reader.int32(); + continue; + } + case 32: { + if (tag !== 258) { + break; + } + + message.activeStartTime = reader.string(); + continue; + } + case 33: { + if (tag !== 266) { + break; + } + + message.activeStopTime = reader.string(); + continue; + } + case 34: { + if (tag !== 274) { + break; + } + + message.faGroup = reader.string(); + continue; + } + case 35: { + if (tag !== 282) { + break; + } + + message.faMethod = reader.string(); + continue; + } + case 36: { + if (tag !== 290) { + break; + } + + message.faPercentage = reader.string(); + continue; + } + case 37: { + if (tag !== 297) { + break; + } + + message.volatility = reader.double(); + continue; + } + case 38: { + if (tag !== 304) { + break; + } + + message.volatilityType = reader.int32(); + continue; + } + case 39: { + if (tag !== 312) { + break; + } + + message.continuousUpdate = reader.bool(); + continue; + } + case 40: { + if (tag !== 320) { + break; + } + + message.referencePriceType = reader.int32(); + continue; + } + case 41: { + if (tag !== 330) { + break; + } + + message.deltaNeutralOrderType = reader.string(); + continue; + } + case 42: { + if (tag !== 337) { + break; + } + + message.deltaNeutralAuxPrice = reader.double(); + continue; + } + case 43: { + if (tag !== 344) { + break; + } + + message.deltaNeutralConId = reader.int32(); + continue; + } + case 44: { + if (tag !== 354) { + break; + } + + message.deltaNeutralOpenClose = reader.string(); + continue; + } + case 45: { + if (tag !== 360) { + break; + } + + message.deltaNeutralShortSale = reader.bool(); + continue; + } + case 46: { + if (tag !== 368) { + break; + } + + message.deltaNeutralShortSaleSlot = reader.int32(); + continue; + } + case 47: { + if (tag !== 378) { + break; + } + + message.deltaNeutralDesignatedLocation = reader.string(); + continue; + } + case 48: { + if (tag !== 384) { + break; + } + + message.scaleInitLevelSize = reader.int32(); + continue; + } + case 49: { + if (tag !== 392) { + break; + } + + message.scaleSubsLevelSize = reader.int32(); + continue; + } + case 50: { + if (tag !== 401) { + break; + } + + message.scalePriceIncrement = reader.double(); + continue; + } + case 51: { + if (tag !== 409) { + break; + } + + message.scalePriceAdjustValue = reader.double(); + continue; + } + case 52: { + if (tag !== 416) { + break; + } + + message.scalePriceAdjustInterval = reader.int32(); + continue; + } + case 53: { + if (tag !== 425) { + break; + } + + message.scaleProfitOffset = reader.double(); + continue; + } + case 54: { + if (tag !== 432) { + break; + } + + message.scaleAutoReset = reader.bool(); + continue; + } + case 55: { + if (tag !== 440) { + break; + } + + message.scaleInitPosition = reader.int32(); + continue; + } + case 56: { + if (tag !== 448) { + break; + } + + message.scaleInitFillQty = reader.int32(); + continue; + } + case 57: { + if (tag !== 456) { + break; + } + + message.scaleRandomPercent = reader.bool(); + continue; + } + case 58: { + if (tag !== 466) { + break; + } + + message.scaleTable = reader.string(); + continue; + } + case 59: { + if (tag !== 474) { + break; + } + + message.hedgeType = reader.string(); + continue; + } + case 60: { + if (tag !== 482) { + break; + } + + message.hedgeParam = reader.string(); + continue; + } + case 61: { + if (tag !== 490) { + break; + } + + message.algoStrategy = reader.string(); + continue; + } + case 62: { + if (tag !== 498) { + break; + } + + const entry62 = Order_AlgoParamsEntry.decode(reader, reader.uint32()); + if (entry62.value !== undefined) { + message.algoParams[entry62.key] = entry62.value; + } + continue; + } + case 63: { + if (tag !== 506) { + break; + } + + message.algoId = reader.string(); + continue; + } + case 64: { + if (tag !== 514) { + break; + } + + const entry64 = Order_SmartComboRoutingParamsEntry.decode(reader, reader.uint32()); + if (entry64.value !== undefined) { + message.smartComboRoutingParams[entry64.key] = entry64.value; + } + continue; + } + case 65: { + if (tag !== 520) { + break; + } + + message.whatIf = reader.bool(); + continue; + } + case 66: { + if (tag !== 528) { + break; + } + + message.transmit = reader.bool(); + continue; + } + case 67: { + if (tag !== 536) { + break; + } + + message.overridePercentageConstraints = reader.bool(); + continue; + } + case 68: { + if (tag !== 546) { + break; + } + + message.openClose = reader.string(); + continue; + } + case 69: { + if (tag !== 552) { + break; + } + + message.origin = reader.int32(); + continue; + } + case 70: { + if (tag !== 560) { + break; + } + + message.shortSaleSlot = reader.int32(); + continue; + } + case 71: { + if (tag !== 570) { + break; + } + + message.designatedLocation = reader.string(); + continue; + } + case 72: { + if (tag !== 576) { + break; + } + + message.exemptCode = reader.int32(); + continue; + } + case 73: { + if (tag !== 586) { + break; + } + + message.deltaNeutralSettlingFirm = reader.string(); + continue; + } + case 74: { + if (tag !== 594) { + break; + } + + message.deltaNeutralClearingAccount = reader.string(); + continue; + } + case 75: { + if (tag !== 602) { + break; + } + + message.deltaNeutralClearingIntent = reader.string(); + continue; + } + case 76: { + if (tag !== 609) { + break; + } + + message.discretionaryAmt = reader.double(); + continue; + } + case 77: { + if (tag !== 616) { + break; + } + + message.optOutSmartRouting = reader.bool(); + continue; + } + case 78: { + if (tag !== 625) { + break; + } + + message.startingPrice = reader.double(); + continue; + } + case 79: { + if (tag !== 633) { + break; + } + + message.stockRefPrice = reader.double(); + continue; + } + case 80: { + if (tag !== 641) { + break; + } + + message.delta = reader.double(); + continue; + } + case 81: { + if (tag !== 649) { + break; + } + + message.stockRangeLower = reader.double(); + continue; + } + case 82: { + if (tag !== 657) { + break; + } + + message.stockRangeUpper = reader.double(); + continue; + } + case 83: { + if (tag !== 664) { + break; + } + + message.notHeld = reader.bool(); + continue; + } + case 84: { + if (tag !== 674) { + break; + } + + const entry84 = Order_OrderMiscOptionsEntry.decode(reader, reader.uint32()); + if (entry84.value !== undefined) { + message.orderMiscOptions[entry84.key] = entry84.value; + } + continue; + } + case 85: { + if (tag !== 680) { + break; + } + + message.solicited = reader.bool(); + continue; + } + case 86: { + if (tag !== 688) { + break; + } + + message.randomizeSize = reader.bool(); + continue; + } + case 87: { + if (tag !== 696) { + break; + } + + message.randomizePrice = reader.bool(); + continue; + } + case 88: { + if (tag !== 704) { + break; + } + + message.referenceContractId = reader.int32(); + continue; + } + case 89: { + if (tag !== 713) { + break; + } + + message.peggedChangeAmount = reader.double(); + continue; + } + case 90: { + if (tag !== 720) { + break; + } + + message.isPeggedChangeAmountDecrease = reader.bool(); + continue; + } + case 91: { + if (tag !== 729) { + break; + } + + message.referenceChangeAmount = reader.double(); + continue; + } + case 92: { + if (tag !== 738) { + break; + } + + message.referenceExchangeId = reader.string(); + continue; + } + case 93: { + if (tag !== 746) { + break; + } + + message.adjustedOrderType = reader.string(); + continue; + } + case 94: { + if (tag !== 753) { + break; + } + + message.triggerPrice = reader.double(); + continue; + } + case 95: { + if (tag !== 761) { + break; + } + + message.adjustedStopPrice = reader.double(); + continue; + } + case 96: { + if (tag !== 769) { + break; + } + + message.adjustedStopLimitPrice = reader.double(); + continue; + } + case 97: { + if (tag !== 777) { + break; + } + + message.adjustedTrailingAmount = reader.double(); + continue; + } + case 98: { + if (tag !== 784) { + break; + } + + message.adjustableTrailingUnit = reader.int32(); + continue; + } + case 99: { + if (tag !== 793) { + break; + } + + message.lmtPriceOffset = reader.double(); + continue; + } + case 100: { + if (tag !== 802) { + break; + } + + message.conditions.push(OrderCondition.decode(reader, reader.uint32())); + continue; + } + case 101: { + if (tag !== 808) { + break; + } + + message.conditionsCancelOrder = reader.bool(); + continue; + } + case 102: { + if (tag !== 816) { + break; + } + + message.conditionsIgnoreRth = reader.bool(); + continue; + } + case 103: { + if (tag !== 826) { + break; + } + + message.modelCode = reader.string(); + continue; + } + case 104: { + if (tag !== 834) { + break; + } + + message.extOperator = reader.string(); + continue; + } + case 105: { + if (tag !== 842) { + break; + } + + message.softDollarTier = SoftDollarTier.decode(reader, reader.uint32()); + continue; + } + case 106: { + if (tag !== 849) { + break; + } + + message.cashQty = reader.double(); + continue; + } + case 107: { + if (tag !== 858) { + break; + } + + message.mifid2DecisionMaker = reader.string(); + continue; + } + case 108: { + if (tag !== 866) { + break; + } + + message.mifid2DecisionAlgo = reader.string(); + continue; + } + case 109: { + if (tag !== 874) { + break; + } + + message.mifid2ExecutionTrader = reader.string(); + continue; + } + case 110: { + if (tag !== 882) { + break; + } + + message.mifid2ExecutionAlgo = reader.string(); + continue; + } + case 111: { + if (tag !== 888) { + break; + } + + message.dontUseAutoPriceForHedge = reader.bool(); + continue; + } + case 112: { + if (tag !== 896) { + break; + } + + message.isOmsContainer = reader.bool(); + continue; + } + case 113: { + if (tag !== 904) { + break; + } + + message.discretionaryUpToLimitPrice = reader.bool(); + continue; + } + case 114: { + if (tag !== 914) { + break; + } + + message.autoCancelDate = reader.string(); + continue; + } + case 115: { + if (tag !== 922) { + break; + } + + message.filledQuantity = reader.string(); + continue; + } + case 116: { + if (tag !== 928) { + break; + } + + message.refFuturesConId = reader.int32(); + continue; + } + case 117: { + if (tag !== 936) { + break; + } + + message.autoCancelParent = reader.bool(); + continue; + } + case 118: { + if (tag !== 946) { + break; + } + + message.shareholder = reader.string(); + continue; + } + case 119: { + if (tag !== 952) { + break; + } + + message.imbalanceOnly = reader.bool(); + continue; + } + case 120: { + if (tag !== 960) { + break; + } + + message.routeMarketableToBbo = reader.int32(); + continue; + } + case 121: { + if (tag !== 968) { + break; + } + + message.parentPermId = longToNumber(reader.int64()); + continue; + } + case 122: { + if (tag !== 976) { + break; + } + + message.usePriceMgmtAlgo = reader.int32(); + continue; + } + case 123: { + if (tag !== 984) { + break; + } + + message.duration = reader.int32(); + continue; + } + case 124: { + if (tag !== 992) { + break; + } + + message.postToAts = reader.int32(); + continue; + } + case 125: { + if (tag !== 1002) { + break; + } + + message.advancedErrorOverride = reader.string(); + continue; + } + case 126: { + if (tag !== 1010) { + break; + } + + message.manualOrderTime = reader.string(); + continue; + } + case 127: { + if (tag !== 1016) { + break; + } + + message.minTradeQty = reader.int32(); + continue; + } + case 128: { + if (tag !== 1024) { + break; + } + + message.minCompeteSize = reader.int32(); + continue; + } + case 129: { + if (tag !== 1033) { + break; + } + + message.competeAgainstBestOffset = reader.double(); + continue; + } + case 130: { + if (tag !== 1041) { + break; + } + + message.midOffsetAtWhole = reader.double(); + continue; + } + case 131: { + if (tag !== 1049) { + break; + } + + message.midOffsetAtHalf = reader.double(); + continue; + } + case 132: { + if (tag !== 1058) { + break; + } + + message.customerAccount = reader.string(); + continue; + } + case 133: { + if (tag !== 1064) { + break; + } + + message.professionalCustomer = reader.bool(); + continue; + } + case 134: { + if (tag !== 1074) { + break; + } + + message.bondAccruedInterest = reader.string(); + continue; + } + case 135: { + if (tag !== 1080) { + break; + } + + message.includeOvernight = reader.bool(); + continue; + } + case 136: { + if (tag !== 1088) { + break; + } + + message.manualOrderIndicator = reader.int32(); + continue; + } + case 137: { + if (tag !== 1098) { + break; + } + + message.submitter = reader.string(); + continue; + } + case 138: { + if (tag !== 1104) { + break; + } + + message.deactivate = reader.bool(); + continue; + } + case 139: { + if (tag !== 1112) { + break; + } + + message.postOnly = reader.bool(); + continue; + } + case 140: { + if (tag !== 1120) { + break; + } + + message.allowPreOpen = reader.bool(); + continue; + } + case 141: { + if (tag !== 1128) { + break; + } + + message.ignoreOpenAuction = reader.bool(); + continue; + } + case 142: { + if (tag !== 1136) { + break; + } + + message.seekPriceImprovement = reader.int32(); + continue; + } + case 143: { + if (tag !== 1144) { + break; + } + + message.whatIfType = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Order { + return { + clientId: isSet(object.clientId) ? globalThis.Number(object.clientId) : undefined, + orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined, + permId: isSet(object.permId) ? globalThis.Number(object.permId) : undefined, + parentId: isSet(object.parentId) ? globalThis.Number(object.parentId) : undefined, + action: isSet(object.action) ? globalThis.String(object.action) : undefined, + totalQuantity: isSet(object.totalQuantity) ? globalThis.String(object.totalQuantity) : undefined, + displaySize: isSet(object.displaySize) ? globalThis.Number(object.displaySize) : undefined, + orderType: isSet(object.orderType) ? globalThis.String(object.orderType) : undefined, + lmtPrice: isSet(object.lmtPrice) ? globalThis.Number(object.lmtPrice) : undefined, + auxPrice: isSet(object.auxPrice) ? globalThis.Number(object.auxPrice) : undefined, + tif: isSet(object.tif) ? globalThis.String(object.tif) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + settlingFirm: isSet(object.settlingFirm) ? globalThis.String(object.settlingFirm) : undefined, + clearingAccount: isSet(object.clearingAccount) ? globalThis.String(object.clearingAccount) : undefined, + clearingIntent: isSet(object.clearingIntent) ? globalThis.String(object.clearingIntent) : undefined, + allOrNone: isSet(object.allOrNone) ? globalThis.Boolean(object.allOrNone) : undefined, + blockOrder: isSet(object.blockOrder) ? globalThis.Boolean(object.blockOrder) : undefined, + hidden: isSet(object.hidden) ? globalThis.Boolean(object.hidden) : undefined, + outsideRth: isSet(object.outsideRth) ? globalThis.Boolean(object.outsideRth) : undefined, + sweepToFill: isSet(object.sweepToFill) ? globalThis.Boolean(object.sweepToFill) : undefined, + percentOffset: isSet(object.percentOffset) ? globalThis.Number(object.percentOffset) : undefined, + trailingPercent: isSet(object.trailingPercent) ? globalThis.Number(object.trailingPercent) : undefined, + trailStopPrice: isSet(object.trailStopPrice) ? globalThis.Number(object.trailStopPrice) : undefined, + minQty: isSet(object.minQty) ? globalThis.Number(object.minQty) : undefined, + goodAfterTime: isSet(object.goodAfterTime) ? globalThis.String(object.goodAfterTime) : undefined, + goodTillDate: isSet(object.goodTillDate) ? globalThis.String(object.goodTillDate) : undefined, + ocaGroup: isSet(object.ocaGroup) ? globalThis.String(object.ocaGroup) : undefined, + orderRef: isSet(object.orderRef) ? globalThis.String(object.orderRef) : undefined, + rule80A: isSet(object.rule80A) ? globalThis.String(object.rule80A) : undefined, + ocaType: isSet(object.ocaType) ? globalThis.Number(object.ocaType) : undefined, + triggerMethod: isSet(object.triggerMethod) ? globalThis.Number(object.triggerMethod) : undefined, + activeStartTime: isSet(object.activeStartTime) ? globalThis.String(object.activeStartTime) : undefined, + activeStopTime: isSet(object.activeStopTime) ? globalThis.String(object.activeStopTime) : undefined, + faGroup: isSet(object.faGroup) ? globalThis.String(object.faGroup) : undefined, + faMethod: isSet(object.faMethod) ? globalThis.String(object.faMethod) : undefined, + faPercentage: isSet(object.faPercentage) ? globalThis.String(object.faPercentage) : undefined, + volatility: isSet(object.volatility) ? globalThis.Number(object.volatility) : undefined, + volatilityType: isSet(object.volatilityType) ? globalThis.Number(object.volatilityType) : undefined, + continuousUpdate: isSet(object.continuousUpdate) ? globalThis.Boolean(object.continuousUpdate) : undefined, + referencePriceType: isSet(object.referencePriceType) ? globalThis.Number(object.referencePriceType) : undefined, + deltaNeutralOrderType: isSet(object.deltaNeutralOrderType) + ? globalThis.String(object.deltaNeutralOrderType) + : undefined, + deltaNeutralAuxPrice: isSet(object.deltaNeutralAuxPrice) + ? globalThis.Number(object.deltaNeutralAuxPrice) + : undefined, + deltaNeutralConId: isSet(object.deltaNeutralConId) ? globalThis.Number(object.deltaNeutralConId) : undefined, + deltaNeutralOpenClose: isSet(object.deltaNeutralOpenClose) + ? globalThis.String(object.deltaNeutralOpenClose) + : undefined, + deltaNeutralShortSale: isSet(object.deltaNeutralShortSale) + ? globalThis.Boolean(object.deltaNeutralShortSale) + : undefined, + deltaNeutralShortSaleSlot: isSet(object.deltaNeutralShortSaleSlot) + ? globalThis.Number(object.deltaNeutralShortSaleSlot) + : undefined, + deltaNeutralDesignatedLocation: isSet(object.deltaNeutralDesignatedLocation) + ? globalThis.String(object.deltaNeutralDesignatedLocation) + : undefined, + scaleInitLevelSize: isSet(object.scaleInitLevelSize) ? globalThis.Number(object.scaleInitLevelSize) : undefined, + scaleSubsLevelSize: isSet(object.scaleSubsLevelSize) ? globalThis.Number(object.scaleSubsLevelSize) : undefined, + scalePriceIncrement: isSet(object.scalePriceIncrement) + ? globalThis.Number(object.scalePriceIncrement) + : undefined, + scalePriceAdjustValue: isSet(object.scalePriceAdjustValue) + ? globalThis.Number(object.scalePriceAdjustValue) + : undefined, + scalePriceAdjustInterval: isSet(object.scalePriceAdjustInterval) + ? globalThis.Number(object.scalePriceAdjustInterval) + : undefined, + scaleProfitOffset: isSet(object.scaleProfitOffset) ? globalThis.Number(object.scaleProfitOffset) : undefined, + scaleAutoReset: isSet(object.scaleAutoReset) ? globalThis.Boolean(object.scaleAutoReset) : undefined, + scaleInitPosition: isSet(object.scaleInitPosition) ? globalThis.Number(object.scaleInitPosition) : undefined, + scaleInitFillQty: isSet(object.scaleInitFillQty) ? globalThis.Number(object.scaleInitFillQty) : undefined, + scaleRandomPercent: isSet(object.scaleRandomPercent) ? globalThis.Boolean(object.scaleRandomPercent) : undefined, + scaleTable: isSet(object.scaleTable) ? globalThis.String(object.scaleTable) : undefined, + hedgeType: isSet(object.hedgeType) ? globalThis.String(object.hedgeType) : undefined, + hedgeParam: isSet(object.hedgeParam) ? globalThis.String(object.hedgeParam) : undefined, + algoStrategy: isSet(object.algoStrategy) ? globalThis.String(object.algoStrategy) : undefined, + algoParams: isObject(object.algoParams) + ? (globalThis.Object.entries(object.algoParams) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + algoId: isSet(object.algoId) ? globalThis.String(object.algoId) : undefined, + smartComboRoutingParams: isObject(object.smartComboRoutingParams) + ? (globalThis.Object.entries(object.smartComboRoutingParams) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + whatIf: isSet(object.whatIf) ? globalThis.Boolean(object.whatIf) : undefined, + transmit: isSet(object.transmit) ? globalThis.Boolean(object.transmit) : undefined, + overridePercentageConstraints: isSet(object.overridePercentageConstraints) + ? globalThis.Boolean(object.overridePercentageConstraints) + : undefined, + openClose: isSet(object.openClose) ? globalThis.String(object.openClose) : undefined, + origin: isSet(object.origin) ? globalThis.Number(object.origin) : undefined, + shortSaleSlot: isSet(object.shortSaleSlot) ? globalThis.Number(object.shortSaleSlot) : undefined, + designatedLocation: isSet(object.designatedLocation) ? globalThis.String(object.designatedLocation) : undefined, + exemptCode: isSet(object.exemptCode) ? globalThis.Number(object.exemptCode) : undefined, + deltaNeutralSettlingFirm: isSet(object.deltaNeutralSettlingFirm) + ? globalThis.String(object.deltaNeutralSettlingFirm) + : undefined, + deltaNeutralClearingAccount: isSet(object.deltaNeutralClearingAccount) + ? globalThis.String(object.deltaNeutralClearingAccount) + : undefined, + deltaNeutralClearingIntent: isSet(object.deltaNeutralClearingIntent) + ? globalThis.String(object.deltaNeutralClearingIntent) + : undefined, + discretionaryAmt: isSet(object.discretionaryAmt) ? globalThis.Number(object.discretionaryAmt) : undefined, + optOutSmartRouting: isSet(object.optOutSmartRouting) ? globalThis.Boolean(object.optOutSmartRouting) : undefined, + startingPrice: isSet(object.startingPrice) ? globalThis.Number(object.startingPrice) : undefined, + stockRefPrice: isSet(object.stockRefPrice) ? globalThis.Number(object.stockRefPrice) : undefined, + delta: isSet(object.delta) ? globalThis.Number(object.delta) : undefined, + stockRangeLower: isSet(object.stockRangeLower) ? globalThis.Number(object.stockRangeLower) : undefined, + stockRangeUpper: isSet(object.stockRangeUpper) ? globalThis.Number(object.stockRangeUpper) : undefined, + notHeld: isSet(object.notHeld) ? globalThis.Boolean(object.notHeld) : undefined, + orderMiscOptions: isObject(object.orderMiscOptions) + ? (globalThis.Object.entries(object.orderMiscOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + solicited: isSet(object.solicited) ? globalThis.Boolean(object.solicited) : undefined, + randomizeSize: isSet(object.randomizeSize) ? globalThis.Boolean(object.randomizeSize) : undefined, + randomizePrice: isSet(object.randomizePrice) ? globalThis.Boolean(object.randomizePrice) : undefined, + referenceContractId: isSet(object.referenceContractId) + ? globalThis.Number(object.referenceContractId) + : undefined, + peggedChangeAmount: isSet(object.peggedChangeAmount) ? globalThis.Number(object.peggedChangeAmount) : undefined, + isPeggedChangeAmountDecrease: isSet(object.isPeggedChangeAmountDecrease) + ? globalThis.Boolean(object.isPeggedChangeAmountDecrease) + : undefined, + referenceChangeAmount: isSet(object.referenceChangeAmount) + ? globalThis.Number(object.referenceChangeAmount) + : undefined, + referenceExchangeId: isSet(object.referenceExchangeId) + ? globalThis.String(object.referenceExchangeId) + : undefined, + adjustedOrderType: isSet(object.adjustedOrderType) ? globalThis.String(object.adjustedOrderType) : undefined, + triggerPrice: isSet(object.triggerPrice) ? globalThis.Number(object.triggerPrice) : undefined, + adjustedStopPrice: isSet(object.adjustedStopPrice) ? globalThis.Number(object.adjustedStopPrice) : undefined, + adjustedStopLimitPrice: isSet(object.adjustedStopLimitPrice) + ? globalThis.Number(object.adjustedStopLimitPrice) + : undefined, + adjustedTrailingAmount: isSet(object.adjustedTrailingAmount) + ? globalThis.Number(object.adjustedTrailingAmount) + : undefined, + adjustableTrailingUnit: isSet(object.adjustableTrailingUnit) + ? globalThis.Number(object.adjustableTrailingUnit) + : undefined, + lmtPriceOffset: isSet(object.lmtPriceOffset) ? globalThis.Number(object.lmtPriceOffset) : undefined, + conditions: globalThis.Array.isArray(object?.conditions) + ? object.conditions.map((e: any) => OrderCondition.fromJSON(e)) + : [], + conditionsCancelOrder: isSet(object.conditionsCancelOrder) + ? globalThis.Boolean(object.conditionsCancelOrder) + : undefined, + conditionsIgnoreRth: isSet(object.conditionsIgnoreRth) + ? globalThis.Boolean(object.conditionsIgnoreRth) + : undefined, + modelCode: isSet(object.modelCode) ? globalThis.String(object.modelCode) : undefined, + extOperator: isSet(object.extOperator) ? globalThis.String(object.extOperator) : undefined, + softDollarTier: isSet(object.softDollarTier) ? SoftDollarTier.fromJSON(object.softDollarTier) : undefined, + cashQty: isSet(object.cashQty) ? globalThis.Number(object.cashQty) : undefined, + mifid2DecisionMaker: isSet(object.mifid2DecisionMaker) + ? globalThis.String(object.mifid2DecisionMaker) + : undefined, + mifid2DecisionAlgo: isSet(object.mifid2DecisionAlgo) ? globalThis.String(object.mifid2DecisionAlgo) : undefined, + mifid2ExecutionTrader: isSet(object.mifid2ExecutionTrader) + ? globalThis.String(object.mifid2ExecutionTrader) + : undefined, + mifid2ExecutionAlgo: isSet(object.mifid2ExecutionAlgo) + ? globalThis.String(object.mifid2ExecutionAlgo) + : undefined, + dontUseAutoPriceForHedge: isSet(object.dontUseAutoPriceForHedge) + ? globalThis.Boolean(object.dontUseAutoPriceForHedge) + : undefined, + isOmsContainer: isSet(object.isOmsContainer) ? globalThis.Boolean(object.isOmsContainer) : undefined, + discretionaryUpToLimitPrice: isSet(object.discretionaryUpToLimitPrice) + ? globalThis.Boolean(object.discretionaryUpToLimitPrice) + : undefined, + autoCancelDate: isSet(object.autoCancelDate) ? globalThis.String(object.autoCancelDate) : undefined, + filledQuantity: isSet(object.filledQuantity) ? globalThis.String(object.filledQuantity) : undefined, + refFuturesConId: isSet(object.refFuturesConId) ? globalThis.Number(object.refFuturesConId) : undefined, + autoCancelParent: isSet(object.autoCancelParent) ? globalThis.Boolean(object.autoCancelParent) : undefined, + shareholder: isSet(object.shareholder) ? globalThis.String(object.shareholder) : undefined, + imbalanceOnly: isSet(object.imbalanceOnly) ? globalThis.Boolean(object.imbalanceOnly) : undefined, + routeMarketableToBbo: isSet(object.routeMarketableToBbo) + ? globalThis.Number(object.routeMarketableToBbo) + : undefined, + parentPermId: isSet(object.parentPermId) ? globalThis.Number(object.parentPermId) : undefined, + usePriceMgmtAlgo: isSet(object.usePriceMgmtAlgo) ? globalThis.Number(object.usePriceMgmtAlgo) : undefined, + duration: isSet(object.duration) ? globalThis.Number(object.duration) : undefined, + postToAts: isSet(object.postToAts) ? globalThis.Number(object.postToAts) : undefined, + advancedErrorOverride: isSet(object.advancedErrorOverride) + ? globalThis.String(object.advancedErrorOverride) + : undefined, + manualOrderTime: isSet(object.manualOrderTime) ? globalThis.String(object.manualOrderTime) : undefined, + minTradeQty: isSet(object.minTradeQty) ? globalThis.Number(object.minTradeQty) : undefined, + minCompeteSize: isSet(object.minCompeteSize) ? globalThis.Number(object.minCompeteSize) : undefined, + competeAgainstBestOffset: isSet(object.competeAgainstBestOffset) + ? globalThis.Number(object.competeAgainstBestOffset) + : undefined, + midOffsetAtWhole: isSet(object.midOffsetAtWhole) ? globalThis.Number(object.midOffsetAtWhole) : undefined, + midOffsetAtHalf: isSet(object.midOffsetAtHalf) ? globalThis.Number(object.midOffsetAtHalf) : undefined, + customerAccount: isSet(object.customerAccount) ? globalThis.String(object.customerAccount) : undefined, + professionalCustomer: isSet(object.professionalCustomer) + ? globalThis.Boolean(object.professionalCustomer) + : undefined, + bondAccruedInterest: isSet(object.bondAccruedInterest) + ? globalThis.String(object.bondAccruedInterest) + : undefined, + includeOvernight: isSet(object.includeOvernight) ? globalThis.Boolean(object.includeOvernight) : undefined, + manualOrderIndicator: isSet(object.manualOrderIndicator) + ? globalThis.Number(object.manualOrderIndicator) + : undefined, + submitter: isSet(object.submitter) ? globalThis.String(object.submitter) : undefined, + deactivate: isSet(object.deactivate) ? globalThis.Boolean(object.deactivate) : undefined, + postOnly: isSet(object.postOnly) ? globalThis.Boolean(object.postOnly) : undefined, + allowPreOpen: isSet(object.allowPreOpen) ? globalThis.Boolean(object.allowPreOpen) : undefined, + ignoreOpenAuction: isSet(object.ignoreOpenAuction) ? globalThis.Boolean(object.ignoreOpenAuction) : undefined, + seekPriceImprovement: isSet(object.seekPriceImprovement) + ? globalThis.Number(object.seekPriceImprovement) + : undefined, + whatIfType: isSet(object.whatIfType) ? globalThis.Number(object.whatIfType) : undefined, + }; + }, + + toJSON(message: Order): unknown { + const obj: any = {}; + if (message.clientId !== undefined) { + obj.clientId = Math.round(message.clientId); + } + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + if (message.permId !== undefined) { + obj.permId = Math.round(message.permId); + } + if (message.parentId !== undefined) { + obj.parentId = Math.round(message.parentId); + } + if (message.action !== undefined) { + obj.action = message.action; + } + if (message.totalQuantity !== undefined) { + obj.totalQuantity = message.totalQuantity; + } + if (message.displaySize !== undefined) { + obj.displaySize = Math.round(message.displaySize); + } + if (message.orderType !== undefined) { + obj.orderType = message.orderType; + } + if (message.lmtPrice !== undefined) { + obj.lmtPrice = message.lmtPrice; + } + if (message.auxPrice !== undefined) { + obj.auxPrice = message.auxPrice; + } + if (message.tif !== undefined) { + obj.tif = message.tif; + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.settlingFirm !== undefined) { + obj.settlingFirm = message.settlingFirm; + } + if (message.clearingAccount !== undefined) { + obj.clearingAccount = message.clearingAccount; + } + if (message.clearingIntent !== undefined) { + obj.clearingIntent = message.clearingIntent; + } + if (message.allOrNone !== undefined) { + obj.allOrNone = message.allOrNone; + } + if (message.blockOrder !== undefined) { + obj.blockOrder = message.blockOrder; + } + if (message.hidden !== undefined) { + obj.hidden = message.hidden; + } + if (message.outsideRth !== undefined) { + obj.outsideRth = message.outsideRth; + } + if (message.sweepToFill !== undefined) { + obj.sweepToFill = message.sweepToFill; + } + if (message.percentOffset !== undefined) { + obj.percentOffset = message.percentOffset; + } + if (message.trailingPercent !== undefined) { + obj.trailingPercent = message.trailingPercent; + } + if (message.trailStopPrice !== undefined) { + obj.trailStopPrice = message.trailStopPrice; + } + if (message.minQty !== undefined) { + obj.minQty = Math.round(message.minQty); + } + if (message.goodAfterTime !== undefined) { + obj.goodAfterTime = message.goodAfterTime; + } + if (message.goodTillDate !== undefined) { + obj.goodTillDate = message.goodTillDate; + } + if (message.ocaGroup !== undefined) { + obj.ocaGroup = message.ocaGroup; + } + if (message.orderRef !== undefined) { + obj.orderRef = message.orderRef; + } + if (message.rule80A !== undefined) { + obj.rule80A = message.rule80A; + } + if (message.ocaType !== undefined) { + obj.ocaType = Math.round(message.ocaType); + } + if (message.triggerMethod !== undefined) { + obj.triggerMethod = Math.round(message.triggerMethod); + } + if (message.activeStartTime !== undefined) { + obj.activeStartTime = message.activeStartTime; + } + if (message.activeStopTime !== undefined) { + obj.activeStopTime = message.activeStopTime; + } + if (message.faGroup !== undefined) { + obj.faGroup = message.faGroup; + } + if (message.faMethod !== undefined) { + obj.faMethod = message.faMethod; + } + if (message.faPercentage !== undefined) { + obj.faPercentage = message.faPercentage; + } + if (message.volatility !== undefined) { + obj.volatility = message.volatility; + } + if (message.volatilityType !== undefined) { + obj.volatilityType = Math.round(message.volatilityType); + } + if (message.continuousUpdate !== undefined) { + obj.continuousUpdate = message.continuousUpdate; + } + if (message.referencePriceType !== undefined) { + obj.referencePriceType = Math.round(message.referencePriceType); + } + if (message.deltaNeutralOrderType !== undefined) { + obj.deltaNeutralOrderType = message.deltaNeutralOrderType; + } + if (message.deltaNeutralAuxPrice !== undefined) { + obj.deltaNeutralAuxPrice = message.deltaNeutralAuxPrice; + } + if (message.deltaNeutralConId !== undefined) { + obj.deltaNeutralConId = Math.round(message.deltaNeutralConId); + } + if (message.deltaNeutralOpenClose !== undefined) { + obj.deltaNeutralOpenClose = message.deltaNeutralOpenClose; + } + if (message.deltaNeutralShortSale !== undefined) { + obj.deltaNeutralShortSale = message.deltaNeutralShortSale; + } + if (message.deltaNeutralShortSaleSlot !== undefined) { + obj.deltaNeutralShortSaleSlot = Math.round(message.deltaNeutralShortSaleSlot); + } + if (message.deltaNeutralDesignatedLocation !== undefined) { + obj.deltaNeutralDesignatedLocation = message.deltaNeutralDesignatedLocation; + } + if (message.scaleInitLevelSize !== undefined) { + obj.scaleInitLevelSize = Math.round(message.scaleInitLevelSize); + } + if (message.scaleSubsLevelSize !== undefined) { + obj.scaleSubsLevelSize = Math.round(message.scaleSubsLevelSize); + } + if (message.scalePriceIncrement !== undefined) { + obj.scalePriceIncrement = message.scalePriceIncrement; + } + if (message.scalePriceAdjustValue !== undefined) { + obj.scalePriceAdjustValue = message.scalePriceAdjustValue; + } + if (message.scalePriceAdjustInterval !== undefined) { + obj.scalePriceAdjustInterval = Math.round(message.scalePriceAdjustInterval); + } + if (message.scaleProfitOffset !== undefined) { + obj.scaleProfitOffset = message.scaleProfitOffset; + } + if (message.scaleAutoReset !== undefined) { + obj.scaleAutoReset = message.scaleAutoReset; + } + if (message.scaleInitPosition !== undefined) { + obj.scaleInitPosition = Math.round(message.scaleInitPosition); + } + if (message.scaleInitFillQty !== undefined) { + obj.scaleInitFillQty = Math.round(message.scaleInitFillQty); + } + if (message.scaleRandomPercent !== undefined) { + obj.scaleRandomPercent = message.scaleRandomPercent; + } + if (message.scaleTable !== undefined) { + obj.scaleTable = message.scaleTable; + } + if (message.hedgeType !== undefined) { + obj.hedgeType = message.hedgeType; + } + if (message.hedgeParam !== undefined) { + obj.hedgeParam = message.hedgeParam; + } + if (message.algoStrategy !== undefined) { + obj.algoStrategy = message.algoStrategy; + } + if (message.algoParams) { + const entries = globalThis.Object.entries(message.algoParams) as [string, string][]; + if (entries.length > 0) { + obj.algoParams = {}; + entries.forEach(([k, v]) => { + obj.algoParams[k] = v; + }); + } + } + if (message.algoId !== undefined) { + obj.algoId = message.algoId; + } + if (message.smartComboRoutingParams) { + const entries = globalThis.Object.entries(message.smartComboRoutingParams) as [string, string][]; + if (entries.length > 0) { + obj.smartComboRoutingParams = {}; + entries.forEach(([k, v]) => { + obj.smartComboRoutingParams[k] = v; + }); + } + } + if (message.whatIf !== undefined) { + obj.whatIf = message.whatIf; + } + if (message.transmit !== undefined) { + obj.transmit = message.transmit; + } + if (message.overridePercentageConstraints !== undefined) { + obj.overridePercentageConstraints = message.overridePercentageConstraints; + } + if (message.openClose !== undefined) { + obj.openClose = message.openClose; + } + if (message.origin !== undefined) { + obj.origin = Math.round(message.origin); + } + if (message.shortSaleSlot !== undefined) { + obj.shortSaleSlot = Math.round(message.shortSaleSlot); + } + if (message.designatedLocation !== undefined) { + obj.designatedLocation = message.designatedLocation; + } + if (message.exemptCode !== undefined) { + obj.exemptCode = Math.round(message.exemptCode); + } + if (message.deltaNeutralSettlingFirm !== undefined) { + obj.deltaNeutralSettlingFirm = message.deltaNeutralSettlingFirm; + } + if (message.deltaNeutralClearingAccount !== undefined) { + obj.deltaNeutralClearingAccount = message.deltaNeutralClearingAccount; + } + if (message.deltaNeutralClearingIntent !== undefined) { + obj.deltaNeutralClearingIntent = message.deltaNeutralClearingIntent; + } + if (message.discretionaryAmt !== undefined) { + obj.discretionaryAmt = message.discretionaryAmt; + } + if (message.optOutSmartRouting !== undefined) { + obj.optOutSmartRouting = message.optOutSmartRouting; + } + if (message.startingPrice !== undefined) { + obj.startingPrice = message.startingPrice; + } + if (message.stockRefPrice !== undefined) { + obj.stockRefPrice = message.stockRefPrice; + } + if (message.delta !== undefined) { + obj.delta = message.delta; + } + if (message.stockRangeLower !== undefined) { + obj.stockRangeLower = message.stockRangeLower; + } + if (message.stockRangeUpper !== undefined) { + obj.stockRangeUpper = message.stockRangeUpper; + } + if (message.notHeld !== undefined) { + obj.notHeld = message.notHeld; + } + if (message.orderMiscOptions) { + const entries = globalThis.Object.entries(message.orderMiscOptions) as [string, string][]; + if (entries.length > 0) { + obj.orderMiscOptions = {}; + entries.forEach(([k, v]) => { + obj.orderMiscOptions[k] = v; + }); + } + } + if (message.solicited !== undefined) { + obj.solicited = message.solicited; + } + if (message.randomizeSize !== undefined) { + obj.randomizeSize = message.randomizeSize; + } + if (message.randomizePrice !== undefined) { + obj.randomizePrice = message.randomizePrice; + } + if (message.referenceContractId !== undefined) { + obj.referenceContractId = Math.round(message.referenceContractId); + } + if (message.peggedChangeAmount !== undefined) { + obj.peggedChangeAmount = message.peggedChangeAmount; + } + if (message.isPeggedChangeAmountDecrease !== undefined) { + obj.isPeggedChangeAmountDecrease = message.isPeggedChangeAmountDecrease; + } + if (message.referenceChangeAmount !== undefined) { + obj.referenceChangeAmount = message.referenceChangeAmount; + } + if (message.referenceExchangeId !== undefined) { + obj.referenceExchangeId = message.referenceExchangeId; + } + if (message.adjustedOrderType !== undefined) { + obj.adjustedOrderType = message.adjustedOrderType; + } + if (message.triggerPrice !== undefined) { + obj.triggerPrice = message.triggerPrice; + } + if (message.adjustedStopPrice !== undefined) { + obj.adjustedStopPrice = message.adjustedStopPrice; + } + if (message.adjustedStopLimitPrice !== undefined) { + obj.adjustedStopLimitPrice = message.adjustedStopLimitPrice; + } + if (message.adjustedTrailingAmount !== undefined) { + obj.adjustedTrailingAmount = message.adjustedTrailingAmount; + } + if (message.adjustableTrailingUnit !== undefined) { + obj.adjustableTrailingUnit = Math.round(message.adjustableTrailingUnit); + } + if (message.lmtPriceOffset !== undefined) { + obj.lmtPriceOffset = message.lmtPriceOffset; + } + if (message.conditions?.length) { + obj.conditions = message.conditions.map((e) => OrderCondition.toJSON(e)); + } + if (message.conditionsCancelOrder !== undefined) { + obj.conditionsCancelOrder = message.conditionsCancelOrder; + } + if (message.conditionsIgnoreRth !== undefined) { + obj.conditionsIgnoreRth = message.conditionsIgnoreRth; + } + if (message.modelCode !== undefined) { + obj.modelCode = message.modelCode; + } + if (message.extOperator !== undefined) { + obj.extOperator = message.extOperator; + } + if (message.softDollarTier !== undefined) { + obj.softDollarTier = SoftDollarTier.toJSON(message.softDollarTier); + } + if (message.cashQty !== undefined) { + obj.cashQty = message.cashQty; + } + if (message.mifid2DecisionMaker !== undefined) { + obj.mifid2DecisionMaker = message.mifid2DecisionMaker; + } + if (message.mifid2DecisionAlgo !== undefined) { + obj.mifid2DecisionAlgo = message.mifid2DecisionAlgo; + } + if (message.mifid2ExecutionTrader !== undefined) { + obj.mifid2ExecutionTrader = message.mifid2ExecutionTrader; + } + if (message.mifid2ExecutionAlgo !== undefined) { + obj.mifid2ExecutionAlgo = message.mifid2ExecutionAlgo; + } + if (message.dontUseAutoPriceForHedge !== undefined) { + obj.dontUseAutoPriceForHedge = message.dontUseAutoPriceForHedge; + } + if (message.isOmsContainer !== undefined) { + obj.isOmsContainer = message.isOmsContainer; + } + if (message.discretionaryUpToLimitPrice !== undefined) { + obj.discretionaryUpToLimitPrice = message.discretionaryUpToLimitPrice; + } + if (message.autoCancelDate !== undefined) { + obj.autoCancelDate = message.autoCancelDate; + } + if (message.filledQuantity !== undefined) { + obj.filledQuantity = message.filledQuantity; + } + if (message.refFuturesConId !== undefined) { + obj.refFuturesConId = Math.round(message.refFuturesConId); + } + if (message.autoCancelParent !== undefined) { + obj.autoCancelParent = message.autoCancelParent; + } + if (message.shareholder !== undefined) { + obj.shareholder = message.shareholder; + } + if (message.imbalanceOnly !== undefined) { + obj.imbalanceOnly = message.imbalanceOnly; + } + if (message.routeMarketableToBbo !== undefined) { + obj.routeMarketableToBbo = Math.round(message.routeMarketableToBbo); + } + if (message.parentPermId !== undefined) { + obj.parentPermId = Math.round(message.parentPermId); + } + if (message.usePriceMgmtAlgo !== undefined) { + obj.usePriceMgmtAlgo = Math.round(message.usePriceMgmtAlgo); + } + if (message.duration !== undefined) { + obj.duration = Math.round(message.duration); + } + if (message.postToAts !== undefined) { + obj.postToAts = Math.round(message.postToAts); + } + if (message.advancedErrorOverride !== undefined) { + obj.advancedErrorOverride = message.advancedErrorOverride; + } + if (message.manualOrderTime !== undefined) { + obj.manualOrderTime = message.manualOrderTime; + } + if (message.minTradeQty !== undefined) { + obj.minTradeQty = Math.round(message.minTradeQty); + } + if (message.minCompeteSize !== undefined) { + obj.minCompeteSize = Math.round(message.minCompeteSize); + } + if (message.competeAgainstBestOffset !== undefined) { + obj.competeAgainstBestOffset = message.competeAgainstBestOffset; + } + if (message.midOffsetAtWhole !== undefined) { + obj.midOffsetAtWhole = message.midOffsetAtWhole; + } + if (message.midOffsetAtHalf !== undefined) { + obj.midOffsetAtHalf = message.midOffsetAtHalf; + } + if (message.customerAccount !== undefined) { + obj.customerAccount = message.customerAccount; + } + if (message.professionalCustomer !== undefined) { + obj.professionalCustomer = message.professionalCustomer; + } + if (message.bondAccruedInterest !== undefined) { + obj.bondAccruedInterest = message.bondAccruedInterest; + } + if (message.includeOvernight !== undefined) { + obj.includeOvernight = message.includeOvernight; + } + if (message.manualOrderIndicator !== undefined) { + obj.manualOrderIndicator = Math.round(message.manualOrderIndicator); + } + if (message.submitter !== undefined) { + obj.submitter = message.submitter; + } + if (message.deactivate !== undefined) { + obj.deactivate = message.deactivate; + } + if (message.postOnly !== undefined) { + obj.postOnly = message.postOnly; + } + if (message.allowPreOpen !== undefined) { + obj.allowPreOpen = message.allowPreOpen; + } + if (message.ignoreOpenAuction !== undefined) { + obj.ignoreOpenAuction = message.ignoreOpenAuction; + } + if (message.seekPriceImprovement !== undefined) { + obj.seekPriceImprovement = Math.round(message.seekPriceImprovement); + } + if (message.whatIfType !== undefined) { + obj.whatIfType = Math.round(message.whatIfType); + } + return obj; + }, + + create(base?: DeepPartial): Order { + return Order.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Order { + const message = createBaseOrder(); + message.clientId = object.clientId ?? undefined; + message.orderId = object.orderId ?? undefined; + message.permId = object.permId ?? undefined; + message.parentId = object.parentId ?? undefined; + message.action = object.action ?? undefined; + message.totalQuantity = object.totalQuantity ?? undefined; + message.displaySize = object.displaySize ?? undefined; + message.orderType = object.orderType ?? undefined; + message.lmtPrice = object.lmtPrice ?? undefined; + message.auxPrice = object.auxPrice ?? undefined; + message.tif = object.tif ?? undefined; + message.account = object.account ?? undefined; + message.settlingFirm = object.settlingFirm ?? undefined; + message.clearingAccount = object.clearingAccount ?? undefined; + message.clearingIntent = object.clearingIntent ?? undefined; + message.allOrNone = object.allOrNone ?? undefined; + message.blockOrder = object.blockOrder ?? undefined; + message.hidden = object.hidden ?? undefined; + message.outsideRth = object.outsideRth ?? undefined; + message.sweepToFill = object.sweepToFill ?? undefined; + message.percentOffset = object.percentOffset ?? undefined; + message.trailingPercent = object.trailingPercent ?? undefined; + message.trailStopPrice = object.trailStopPrice ?? undefined; + message.minQty = object.minQty ?? undefined; + message.goodAfterTime = object.goodAfterTime ?? undefined; + message.goodTillDate = object.goodTillDate ?? undefined; + message.ocaGroup = object.ocaGroup ?? undefined; + message.orderRef = object.orderRef ?? undefined; + message.rule80A = object.rule80A ?? undefined; + message.ocaType = object.ocaType ?? undefined; + message.triggerMethod = object.triggerMethod ?? undefined; + message.activeStartTime = object.activeStartTime ?? undefined; + message.activeStopTime = object.activeStopTime ?? undefined; + message.faGroup = object.faGroup ?? undefined; + message.faMethod = object.faMethod ?? undefined; + message.faPercentage = object.faPercentage ?? undefined; + message.volatility = object.volatility ?? undefined; + message.volatilityType = object.volatilityType ?? undefined; + message.continuousUpdate = object.continuousUpdate ?? undefined; + message.referencePriceType = object.referencePriceType ?? undefined; + message.deltaNeutralOrderType = object.deltaNeutralOrderType ?? undefined; + message.deltaNeutralAuxPrice = object.deltaNeutralAuxPrice ?? undefined; + message.deltaNeutralConId = object.deltaNeutralConId ?? undefined; + message.deltaNeutralOpenClose = object.deltaNeutralOpenClose ?? undefined; + message.deltaNeutralShortSale = object.deltaNeutralShortSale ?? undefined; + message.deltaNeutralShortSaleSlot = object.deltaNeutralShortSaleSlot ?? undefined; + message.deltaNeutralDesignatedLocation = object.deltaNeutralDesignatedLocation ?? undefined; + message.scaleInitLevelSize = object.scaleInitLevelSize ?? undefined; + message.scaleSubsLevelSize = object.scaleSubsLevelSize ?? undefined; + message.scalePriceIncrement = object.scalePriceIncrement ?? undefined; + message.scalePriceAdjustValue = object.scalePriceAdjustValue ?? undefined; + message.scalePriceAdjustInterval = object.scalePriceAdjustInterval ?? undefined; + message.scaleProfitOffset = object.scaleProfitOffset ?? undefined; + message.scaleAutoReset = object.scaleAutoReset ?? undefined; + message.scaleInitPosition = object.scaleInitPosition ?? undefined; + message.scaleInitFillQty = object.scaleInitFillQty ?? undefined; + message.scaleRandomPercent = object.scaleRandomPercent ?? undefined; + message.scaleTable = object.scaleTable ?? undefined; + message.hedgeType = object.hedgeType ?? undefined; + message.hedgeParam = object.hedgeParam ?? undefined; + message.algoStrategy = object.algoStrategy ?? undefined; + message.algoParams = (globalThis.Object.entries(object.algoParams ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + message.algoId = object.algoId ?? undefined; + message.smartComboRoutingParams = + (globalThis.Object.entries(object.smartComboRoutingParams ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + message.whatIf = object.whatIf ?? undefined; + message.transmit = object.transmit ?? undefined; + message.overridePercentageConstraints = object.overridePercentageConstraints ?? undefined; + message.openClose = object.openClose ?? undefined; + message.origin = object.origin ?? undefined; + message.shortSaleSlot = object.shortSaleSlot ?? undefined; + message.designatedLocation = object.designatedLocation ?? undefined; + message.exemptCode = object.exemptCode ?? undefined; + message.deltaNeutralSettlingFirm = object.deltaNeutralSettlingFirm ?? undefined; + message.deltaNeutralClearingAccount = object.deltaNeutralClearingAccount ?? undefined; + message.deltaNeutralClearingIntent = object.deltaNeutralClearingIntent ?? undefined; + message.discretionaryAmt = object.discretionaryAmt ?? undefined; + message.optOutSmartRouting = object.optOutSmartRouting ?? undefined; + message.startingPrice = object.startingPrice ?? undefined; + message.stockRefPrice = object.stockRefPrice ?? undefined; + message.delta = object.delta ?? undefined; + message.stockRangeLower = object.stockRangeLower ?? undefined; + message.stockRangeUpper = object.stockRangeUpper ?? undefined; + message.notHeld = object.notHeld ?? undefined; + message.orderMiscOptions = (globalThis.Object.entries(object.orderMiscOptions ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + message.solicited = object.solicited ?? undefined; + message.randomizeSize = object.randomizeSize ?? undefined; + message.randomizePrice = object.randomizePrice ?? undefined; + message.referenceContractId = object.referenceContractId ?? undefined; + message.peggedChangeAmount = object.peggedChangeAmount ?? undefined; + message.isPeggedChangeAmountDecrease = object.isPeggedChangeAmountDecrease ?? undefined; + message.referenceChangeAmount = object.referenceChangeAmount ?? undefined; + message.referenceExchangeId = object.referenceExchangeId ?? undefined; + message.adjustedOrderType = object.adjustedOrderType ?? undefined; + message.triggerPrice = object.triggerPrice ?? undefined; + message.adjustedStopPrice = object.adjustedStopPrice ?? undefined; + message.adjustedStopLimitPrice = object.adjustedStopLimitPrice ?? undefined; + message.adjustedTrailingAmount = object.adjustedTrailingAmount ?? undefined; + message.adjustableTrailingUnit = object.adjustableTrailingUnit ?? undefined; + message.lmtPriceOffset = object.lmtPriceOffset ?? undefined; + message.conditions = object.conditions?.map((e) => OrderCondition.fromPartial(e)) || []; + message.conditionsCancelOrder = object.conditionsCancelOrder ?? undefined; + message.conditionsIgnoreRth = object.conditionsIgnoreRth ?? undefined; + message.modelCode = object.modelCode ?? undefined; + message.extOperator = object.extOperator ?? undefined; + message.softDollarTier = (object.softDollarTier !== undefined && object.softDollarTier !== null) + ? SoftDollarTier.fromPartial(object.softDollarTier) + : undefined; + message.cashQty = object.cashQty ?? undefined; + message.mifid2DecisionMaker = object.mifid2DecisionMaker ?? undefined; + message.mifid2DecisionAlgo = object.mifid2DecisionAlgo ?? undefined; + message.mifid2ExecutionTrader = object.mifid2ExecutionTrader ?? undefined; + message.mifid2ExecutionAlgo = object.mifid2ExecutionAlgo ?? undefined; + message.dontUseAutoPriceForHedge = object.dontUseAutoPriceForHedge ?? undefined; + message.isOmsContainer = object.isOmsContainer ?? undefined; + message.discretionaryUpToLimitPrice = object.discretionaryUpToLimitPrice ?? undefined; + message.autoCancelDate = object.autoCancelDate ?? undefined; + message.filledQuantity = object.filledQuantity ?? undefined; + message.refFuturesConId = object.refFuturesConId ?? undefined; + message.autoCancelParent = object.autoCancelParent ?? undefined; + message.shareholder = object.shareholder ?? undefined; + message.imbalanceOnly = object.imbalanceOnly ?? undefined; + message.routeMarketableToBbo = object.routeMarketableToBbo ?? undefined; + message.parentPermId = object.parentPermId ?? undefined; + message.usePriceMgmtAlgo = object.usePriceMgmtAlgo ?? undefined; + message.duration = object.duration ?? undefined; + message.postToAts = object.postToAts ?? undefined; + message.advancedErrorOverride = object.advancedErrorOverride ?? undefined; + message.manualOrderTime = object.manualOrderTime ?? undefined; + message.minTradeQty = object.minTradeQty ?? undefined; + message.minCompeteSize = object.minCompeteSize ?? undefined; + message.competeAgainstBestOffset = object.competeAgainstBestOffset ?? undefined; + message.midOffsetAtWhole = object.midOffsetAtWhole ?? undefined; + message.midOffsetAtHalf = object.midOffsetAtHalf ?? undefined; + message.customerAccount = object.customerAccount ?? undefined; + message.professionalCustomer = object.professionalCustomer ?? undefined; + message.bondAccruedInterest = object.bondAccruedInterest ?? undefined; + message.includeOvernight = object.includeOvernight ?? undefined; + message.manualOrderIndicator = object.manualOrderIndicator ?? undefined; + message.submitter = object.submitter ?? undefined; + message.deactivate = object.deactivate ?? undefined; + message.postOnly = object.postOnly ?? undefined; + message.allowPreOpen = object.allowPreOpen ?? undefined; + message.ignoreOpenAuction = object.ignoreOpenAuction ?? undefined; + message.seekPriceImprovement = object.seekPriceImprovement ?? undefined; + message.whatIfType = object.whatIfType ?? undefined; + return message; + }, +}; + +function createBaseOrder_AlgoParamsEntry(): Order_AlgoParamsEntry { + return { key: "", value: "" }; +} + +export const Order_AlgoParamsEntry: MessageFns = { + encode(message: Order_AlgoParamsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Order_AlgoParamsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrder_AlgoParamsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Order_AlgoParamsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: Order_AlgoParamsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Order_AlgoParamsEntry { + return Order_AlgoParamsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Order_AlgoParamsEntry { + const message = createBaseOrder_AlgoParamsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseOrder_SmartComboRoutingParamsEntry(): Order_SmartComboRoutingParamsEntry { + return { key: "", value: "" }; +} + +export const Order_SmartComboRoutingParamsEntry: MessageFns = { + encode(message: Order_SmartComboRoutingParamsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Order_SmartComboRoutingParamsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrder_SmartComboRoutingParamsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Order_SmartComboRoutingParamsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: Order_SmartComboRoutingParamsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Order_SmartComboRoutingParamsEntry { + return Order_SmartComboRoutingParamsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Order_SmartComboRoutingParamsEntry { + const message = createBaseOrder_SmartComboRoutingParamsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseOrder_OrderMiscOptionsEntry(): Order_OrderMiscOptionsEntry { + return { key: "", value: "" }; +} + +export const Order_OrderMiscOptionsEntry: MessageFns = { + encode(message: Order_OrderMiscOptionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Order_OrderMiscOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrder_OrderMiscOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Order_OrderMiscOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: Order_OrderMiscOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Order_OrderMiscOptionsEntry { + return Order_OrderMiscOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Order_OrderMiscOptionsEntry { + const message = createBaseOrder_OrderMiscOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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 isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OrderAllocation.ts b/packages/ibkr/src/protobuf/OrderAllocation.ts new file mode 100644 index 00000000..2acbcabf --- /dev/null +++ b/packages/ibkr/src/protobuf/OrderAllocation.ts @@ -0,0 +1,205 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OrderAllocation.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface OrderAllocation { + account?: string | undefined; + position?: string | undefined; + positionDesired?: string | undefined; + positionAfter?: string | undefined; + desiredAllocQty?: string | undefined; + allowedAllocQty?: string | undefined; + isMonetary?: boolean | undefined; +} + +function createBaseOrderAllocation(): OrderAllocation { + return { + account: undefined, + position: undefined, + positionDesired: undefined, + positionAfter: undefined, + desiredAllocQty: undefined, + allowedAllocQty: undefined, + isMonetary: undefined, + }; +} + +export const OrderAllocation: MessageFns = { + encode(message: OrderAllocation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.account !== undefined) { + writer.uint32(10).string(message.account); + } + if (message.position !== undefined) { + writer.uint32(18).string(message.position); + } + if (message.positionDesired !== undefined) { + writer.uint32(26).string(message.positionDesired); + } + if (message.positionAfter !== undefined) { + writer.uint32(34).string(message.positionAfter); + } + if (message.desiredAllocQty !== undefined) { + writer.uint32(42).string(message.desiredAllocQty); + } + if (message.allowedAllocQty !== undefined) { + writer.uint32(50).string(message.allowedAllocQty); + } + if (message.isMonetary !== undefined) { + writer.uint32(56).bool(message.isMonetary); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OrderAllocation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderAllocation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.account = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.position = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.positionDesired = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.positionAfter = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.desiredAllocQty = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.allowedAllocQty = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.isMonetary = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderAllocation { + return { + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + position: isSet(object.position) ? globalThis.String(object.position) : undefined, + positionDesired: isSet(object.positionDesired) ? globalThis.String(object.positionDesired) : undefined, + positionAfter: isSet(object.positionAfter) ? globalThis.String(object.positionAfter) : undefined, + desiredAllocQty: isSet(object.desiredAllocQty) ? globalThis.String(object.desiredAllocQty) : undefined, + allowedAllocQty: isSet(object.allowedAllocQty) ? globalThis.String(object.allowedAllocQty) : undefined, + isMonetary: isSet(object.isMonetary) ? globalThis.Boolean(object.isMonetary) : undefined, + }; + }, + + toJSON(message: OrderAllocation): unknown { + const obj: any = {}; + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.position !== undefined) { + obj.position = message.position; + } + if (message.positionDesired !== undefined) { + obj.positionDesired = message.positionDesired; + } + if (message.positionAfter !== undefined) { + obj.positionAfter = message.positionAfter; + } + if (message.desiredAllocQty !== undefined) { + obj.desiredAllocQty = message.desiredAllocQty; + } + if (message.allowedAllocQty !== undefined) { + obj.allowedAllocQty = message.allowedAllocQty; + } + if (message.isMonetary !== undefined) { + obj.isMonetary = message.isMonetary; + } + return obj; + }, + + create(base?: DeepPartial): OrderAllocation { + return OrderAllocation.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OrderAllocation { + const message = createBaseOrderAllocation(); + message.account = object.account ?? undefined; + message.position = object.position ?? undefined; + message.positionDesired = object.positionDesired ?? undefined; + message.positionAfter = object.positionAfter ?? undefined; + message.desiredAllocQty = object.desiredAllocQty ?? undefined; + message.allowedAllocQty = object.allowedAllocQty ?? undefined; + message.isMonetary = object.isMonetary ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OrderBound.ts b/packages/ibkr/src/protobuf/OrderBound.ts new file mode 100644 index 00000000..5d51464b --- /dev/null +++ b/packages/ibkr/src/protobuf/OrderBound.ts @@ -0,0 +1,140 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OrderBound.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface OrderBound { + permId?: number | undefined; + clientId?: number | undefined; + orderId?: number | undefined; +} + +function createBaseOrderBound(): OrderBound { + return { permId: undefined, clientId: undefined, orderId: undefined }; +} + +export const OrderBound: MessageFns = { + encode(message: OrderBound, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.permId !== undefined) { + writer.uint32(8).int64(message.permId); + } + if (message.clientId !== undefined) { + writer.uint32(16).int32(message.clientId); + } + if (message.orderId !== undefined) { + writer.uint32(24).int32(message.orderId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OrderBound { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderBound(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.permId = longToNumber(reader.int64()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.clientId = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.orderId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderBound { + return { + permId: isSet(object.permId) ? globalThis.Number(object.permId) : undefined, + clientId: isSet(object.clientId) ? globalThis.Number(object.clientId) : undefined, + orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined, + }; + }, + + toJSON(message: OrderBound): unknown { + const obj: any = {}; + if (message.permId !== undefined) { + obj.permId = Math.round(message.permId); + } + if (message.clientId !== undefined) { + obj.clientId = Math.round(message.clientId); + } + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + return obj; + }, + + create(base?: DeepPartial): OrderBound { + return OrderBound.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OrderBound { + const message = createBaseOrderBound(); + message.permId = object.permId ?? undefined; + message.clientId = object.clientId ?? undefined; + message.orderId = object.orderId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OrderCancel.ts b/packages/ibkr/src/protobuf/OrderCancel.ts new file mode 100644 index 00000000..dfd5d0cf --- /dev/null +++ b/packages/ibkr/src/protobuf/OrderCancel.ts @@ -0,0 +1,133 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OrderCancel.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface OrderCancel { + manualOrderCancelTime?: string | undefined; + extOperator?: string | undefined; + manualOrderIndicator?: number | undefined; +} + +function createBaseOrderCancel(): OrderCancel { + return { manualOrderCancelTime: undefined, extOperator: undefined, manualOrderIndicator: undefined }; +} + +export const OrderCancel: MessageFns = { + encode(message: OrderCancel, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.manualOrderCancelTime !== undefined) { + writer.uint32(10).string(message.manualOrderCancelTime); + } + if (message.extOperator !== undefined) { + writer.uint32(18).string(message.extOperator); + } + if (message.manualOrderIndicator !== undefined) { + writer.uint32(24).int32(message.manualOrderIndicator); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OrderCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderCancel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.manualOrderCancelTime = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.extOperator = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.manualOrderIndicator = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderCancel { + return { + manualOrderCancelTime: isSet(object.manualOrderCancelTime) + ? globalThis.String(object.manualOrderCancelTime) + : undefined, + extOperator: isSet(object.extOperator) ? globalThis.String(object.extOperator) : undefined, + manualOrderIndicator: isSet(object.manualOrderIndicator) + ? globalThis.Number(object.manualOrderIndicator) + : undefined, + }; + }, + + toJSON(message: OrderCancel): unknown { + const obj: any = {}; + if (message.manualOrderCancelTime !== undefined) { + obj.manualOrderCancelTime = message.manualOrderCancelTime; + } + if (message.extOperator !== undefined) { + obj.extOperator = message.extOperator; + } + if (message.manualOrderIndicator !== undefined) { + obj.manualOrderIndicator = Math.round(message.manualOrderIndicator); + } + return obj; + }, + + create(base?: DeepPartial): OrderCancel { + return OrderCancel.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OrderCancel { + const message = createBaseOrderCancel(); + message.manualOrderCancelTime = object.manualOrderCancelTime ?? undefined; + message.extOperator = object.extOperator ?? undefined; + message.manualOrderIndicator = object.manualOrderIndicator ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OrderCondition.ts b/packages/ibkr/src/protobuf/OrderCondition.ts new file mode 100644 index 00000000..dce5cc25 --- /dev/null +++ b/packages/ibkr/src/protobuf/OrderCondition.ts @@ -0,0 +1,315 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OrderCondition.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface OrderCondition { + type?: number | undefined; + isConjunctionConnection?: boolean | undefined; + isMore?: boolean | undefined; + conId?: number | undefined; + exchange?: string | undefined; + symbol?: string | undefined; + secType?: string | undefined; + percent?: number | undefined; + changePercent?: number | undefined; + price?: number | undefined; + triggerMethod?: number | undefined; + time?: string | undefined; + volume?: number | undefined; +} + +function createBaseOrderCondition(): OrderCondition { + return { + type: undefined, + isConjunctionConnection: undefined, + isMore: undefined, + conId: undefined, + exchange: undefined, + symbol: undefined, + secType: undefined, + percent: undefined, + changePercent: undefined, + price: undefined, + triggerMethod: undefined, + time: undefined, + volume: undefined, + }; +} + +export const OrderCondition: MessageFns = { + encode(message: OrderCondition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== undefined) { + writer.uint32(8).int32(message.type); + } + if (message.isConjunctionConnection !== undefined) { + writer.uint32(16).bool(message.isConjunctionConnection); + } + if (message.isMore !== undefined) { + writer.uint32(24).bool(message.isMore); + } + if (message.conId !== undefined) { + writer.uint32(32).int32(message.conId); + } + if (message.exchange !== undefined) { + writer.uint32(42).string(message.exchange); + } + if (message.symbol !== undefined) { + writer.uint32(50).string(message.symbol); + } + if (message.secType !== undefined) { + writer.uint32(58).string(message.secType); + } + if (message.percent !== undefined) { + writer.uint32(64).int32(message.percent); + } + if (message.changePercent !== undefined) { + writer.uint32(73).double(message.changePercent); + } + if (message.price !== undefined) { + writer.uint32(81).double(message.price); + } + if (message.triggerMethod !== undefined) { + writer.uint32(88).int32(message.triggerMethod); + } + if (message.time !== undefined) { + writer.uint32(98).string(message.time); + } + if (message.volume !== undefined) { + writer.uint32(104).int32(message.volume); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OrderCondition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderCondition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.type = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.isConjunctionConnection = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.isMore = reader.bool(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.conId = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.symbol = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.secType = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.percent = reader.int32(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.changePercent = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.price = reader.double(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.triggerMethod = reader.int32(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.time = reader.string(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.volume = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderCondition { + return { + type: isSet(object.type) ? globalThis.Number(object.type) : undefined, + isConjunctionConnection: isSet(object.isConjunctionConnection) + ? globalThis.Boolean(object.isConjunctionConnection) + : undefined, + isMore: isSet(object.isMore) ? globalThis.Boolean(object.isMore) : undefined, + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : undefined, + secType: isSet(object.secType) ? globalThis.String(object.secType) : undefined, + percent: isSet(object.percent) ? globalThis.Number(object.percent) : undefined, + changePercent: isSet(object.changePercent) ? globalThis.Number(object.changePercent) : undefined, + price: isSet(object.price) ? globalThis.Number(object.price) : undefined, + triggerMethod: isSet(object.triggerMethod) ? globalThis.Number(object.triggerMethod) : undefined, + time: isSet(object.time) ? globalThis.String(object.time) : undefined, + volume: isSet(object.volume) ? globalThis.Number(object.volume) : undefined, + }; + }, + + toJSON(message: OrderCondition): unknown { + const obj: any = {}; + if (message.type !== undefined) { + obj.type = Math.round(message.type); + } + if (message.isConjunctionConnection !== undefined) { + obj.isConjunctionConnection = message.isConjunctionConnection; + } + if (message.isMore !== undefined) { + obj.isMore = message.isMore; + } + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.symbol !== undefined) { + obj.symbol = message.symbol; + } + if (message.secType !== undefined) { + obj.secType = message.secType; + } + if (message.percent !== undefined) { + obj.percent = Math.round(message.percent); + } + if (message.changePercent !== undefined) { + obj.changePercent = message.changePercent; + } + if (message.price !== undefined) { + obj.price = message.price; + } + if (message.triggerMethod !== undefined) { + obj.triggerMethod = Math.round(message.triggerMethod); + } + if (message.time !== undefined) { + obj.time = message.time; + } + if (message.volume !== undefined) { + obj.volume = Math.round(message.volume); + } + return obj; + }, + + create(base?: DeepPartial): OrderCondition { + return OrderCondition.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OrderCondition { + const message = createBaseOrderCondition(); + message.type = object.type ?? undefined; + message.isConjunctionConnection = object.isConjunctionConnection ?? undefined; + message.isMore = object.isMore ?? undefined; + message.conId = object.conId ?? undefined; + message.exchange = object.exchange ?? undefined; + message.symbol = object.symbol ?? undefined; + message.secType = object.secType ?? undefined; + message.percent = object.percent ?? undefined; + message.changePercent = object.changePercent ?? undefined; + message.price = object.price ?? undefined; + message.triggerMethod = object.triggerMethod ?? undefined; + message.time = object.time ?? undefined; + message.volume = object.volume ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OrderState.ts b/packages/ibkr/src/protobuf/OrderState.ts new file mode 100644 index 00000000..2d2bd719 --- /dev/null +++ b/packages/ibkr/src/protobuf/OrderState.ts @@ -0,0 +1,652 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OrderState.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { OrderAllocation } from "./OrderAllocation"; + +export const protobufPackage = "protobuf"; + +export interface OrderState { + status?: string | undefined; + initMarginBefore?: number | undefined; + maintMarginBefore?: number | undefined; + equityWithLoanBefore?: number | undefined; + initMarginChange?: number | undefined; + maintMarginChange?: number | undefined; + equityWithLoanChange?: number | undefined; + initMarginAfter?: number | undefined; + maintMarginAfter?: number | undefined; + equityWithLoanAfter?: number | undefined; + commissionAndFees?: number | undefined; + minCommissionAndFees?: number | undefined; + maxCommissionAndFees?: number | undefined; + commissionAndFeesCurrency?: string | undefined; + marginCurrency?: string | undefined; + initMarginBeforeOutsideRTH?: number | undefined; + maintMarginBeforeOutsideRTH?: number | undefined; + equityWithLoanBeforeOutsideRTH?: number | undefined; + initMarginChangeOutsideRTH?: number | undefined; + maintMarginChangeOutsideRTH?: number | undefined; + equityWithLoanChangeOutsideRTH?: number | undefined; + initMarginAfterOutsideRTH?: number | undefined; + maintMarginAfterOutsideRTH?: number | undefined; + equityWithLoanAfterOutsideRTH?: number | undefined; + suggestedSize?: string | undefined; + rejectReason?: string | undefined; + orderAllocations: OrderAllocation[]; + warningText?: string | undefined; + completedTime?: string | undefined; + completedStatus?: string | undefined; +} + +function createBaseOrderState(): OrderState { + return { + status: undefined, + initMarginBefore: undefined, + maintMarginBefore: undefined, + equityWithLoanBefore: undefined, + initMarginChange: undefined, + maintMarginChange: undefined, + equityWithLoanChange: undefined, + initMarginAfter: undefined, + maintMarginAfter: undefined, + equityWithLoanAfter: undefined, + commissionAndFees: undefined, + minCommissionAndFees: undefined, + maxCommissionAndFees: undefined, + commissionAndFeesCurrency: undefined, + marginCurrency: undefined, + initMarginBeforeOutsideRTH: undefined, + maintMarginBeforeOutsideRTH: undefined, + equityWithLoanBeforeOutsideRTH: undefined, + initMarginChangeOutsideRTH: undefined, + maintMarginChangeOutsideRTH: undefined, + equityWithLoanChangeOutsideRTH: undefined, + initMarginAfterOutsideRTH: undefined, + maintMarginAfterOutsideRTH: undefined, + equityWithLoanAfterOutsideRTH: undefined, + suggestedSize: undefined, + rejectReason: undefined, + orderAllocations: [], + warningText: undefined, + completedTime: undefined, + completedStatus: undefined, + }; +} + +export const OrderState: MessageFns = { + encode(message: OrderState, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.status !== undefined) { + writer.uint32(10).string(message.status); + } + if (message.initMarginBefore !== undefined) { + writer.uint32(17).double(message.initMarginBefore); + } + if (message.maintMarginBefore !== undefined) { + writer.uint32(25).double(message.maintMarginBefore); + } + if (message.equityWithLoanBefore !== undefined) { + writer.uint32(33).double(message.equityWithLoanBefore); + } + if (message.initMarginChange !== undefined) { + writer.uint32(41).double(message.initMarginChange); + } + if (message.maintMarginChange !== undefined) { + writer.uint32(49).double(message.maintMarginChange); + } + if (message.equityWithLoanChange !== undefined) { + writer.uint32(57).double(message.equityWithLoanChange); + } + if (message.initMarginAfter !== undefined) { + writer.uint32(65).double(message.initMarginAfter); + } + if (message.maintMarginAfter !== undefined) { + writer.uint32(73).double(message.maintMarginAfter); + } + if (message.equityWithLoanAfter !== undefined) { + writer.uint32(81).double(message.equityWithLoanAfter); + } + if (message.commissionAndFees !== undefined) { + writer.uint32(89).double(message.commissionAndFees); + } + if (message.minCommissionAndFees !== undefined) { + writer.uint32(97).double(message.minCommissionAndFees); + } + if (message.maxCommissionAndFees !== undefined) { + writer.uint32(105).double(message.maxCommissionAndFees); + } + if (message.commissionAndFeesCurrency !== undefined) { + writer.uint32(114).string(message.commissionAndFeesCurrency); + } + if (message.marginCurrency !== undefined) { + writer.uint32(122).string(message.marginCurrency); + } + if (message.initMarginBeforeOutsideRTH !== undefined) { + writer.uint32(129).double(message.initMarginBeforeOutsideRTH); + } + if (message.maintMarginBeforeOutsideRTH !== undefined) { + writer.uint32(137).double(message.maintMarginBeforeOutsideRTH); + } + if (message.equityWithLoanBeforeOutsideRTH !== undefined) { + writer.uint32(145).double(message.equityWithLoanBeforeOutsideRTH); + } + if (message.initMarginChangeOutsideRTH !== undefined) { + writer.uint32(153).double(message.initMarginChangeOutsideRTH); + } + if (message.maintMarginChangeOutsideRTH !== undefined) { + writer.uint32(161).double(message.maintMarginChangeOutsideRTH); + } + if (message.equityWithLoanChangeOutsideRTH !== undefined) { + writer.uint32(169).double(message.equityWithLoanChangeOutsideRTH); + } + if (message.initMarginAfterOutsideRTH !== undefined) { + writer.uint32(177).double(message.initMarginAfterOutsideRTH); + } + if (message.maintMarginAfterOutsideRTH !== undefined) { + writer.uint32(185).double(message.maintMarginAfterOutsideRTH); + } + if (message.equityWithLoanAfterOutsideRTH !== undefined) { + writer.uint32(193).double(message.equityWithLoanAfterOutsideRTH); + } + if (message.suggestedSize !== undefined) { + writer.uint32(202).string(message.suggestedSize); + } + if (message.rejectReason !== undefined) { + writer.uint32(210).string(message.rejectReason); + } + for (const v of message.orderAllocations) { + OrderAllocation.encode(v!, writer.uint32(218).fork()).join(); + } + if (message.warningText !== undefined) { + writer.uint32(226).string(message.warningText); + } + if (message.completedTime !== undefined) { + writer.uint32(234).string(message.completedTime); + } + if (message.completedStatus !== undefined) { + writer.uint32(242).string(message.completedStatus); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OrderState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.status = reader.string(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.initMarginBefore = reader.double(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.maintMarginBefore = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.equityWithLoanBefore = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.initMarginChange = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.maintMarginChange = reader.double(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.equityWithLoanChange = reader.double(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.initMarginAfter = reader.double(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.maintMarginAfter = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.equityWithLoanAfter = reader.double(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.commissionAndFees = reader.double(); + continue; + } + case 12: { + if (tag !== 97) { + break; + } + + message.minCommissionAndFees = reader.double(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.maxCommissionAndFees = reader.double(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.commissionAndFeesCurrency = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.marginCurrency = reader.string(); + continue; + } + case 16: { + if (tag !== 129) { + break; + } + + message.initMarginBeforeOutsideRTH = reader.double(); + continue; + } + case 17: { + if (tag !== 137) { + break; + } + + message.maintMarginBeforeOutsideRTH = reader.double(); + continue; + } + case 18: { + if (tag !== 145) { + break; + } + + message.equityWithLoanBeforeOutsideRTH = reader.double(); + continue; + } + case 19: { + if (tag !== 153) { + break; + } + + message.initMarginChangeOutsideRTH = reader.double(); + continue; + } + case 20: { + if (tag !== 161) { + break; + } + + message.maintMarginChangeOutsideRTH = reader.double(); + continue; + } + case 21: { + if (tag !== 169) { + break; + } + + message.equityWithLoanChangeOutsideRTH = reader.double(); + continue; + } + case 22: { + if (tag !== 177) { + break; + } + + message.initMarginAfterOutsideRTH = reader.double(); + continue; + } + case 23: { + if (tag !== 185) { + break; + } + + message.maintMarginAfterOutsideRTH = reader.double(); + continue; + } + case 24: { + if (tag !== 193) { + break; + } + + message.equityWithLoanAfterOutsideRTH = reader.double(); + continue; + } + case 25: { + if (tag !== 202) { + break; + } + + message.suggestedSize = reader.string(); + continue; + } + case 26: { + if (tag !== 210) { + break; + } + + message.rejectReason = reader.string(); + continue; + } + case 27: { + if (tag !== 218) { + break; + } + + message.orderAllocations.push(OrderAllocation.decode(reader, reader.uint32())); + continue; + } + case 28: { + if (tag !== 226) { + break; + } + + message.warningText = reader.string(); + continue; + } + case 29: { + if (tag !== 234) { + break; + } + + message.completedTime = reader.string(); + continue; + } + case 30: { + if (tag !== 242) { + break; + } + + message.completedStatus = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderState { + return { + status: isSet(object.status) ? globalThis.String(object.status) : undefined, + initMarginBefore: isSet(object.initMarginBefore) ? globalThis.Number(object.initMarginBefore) : undefined, + maintMarginBefore: isSet(object.maintMarginBefore) ? globalThis.Number(object.maintMarginBefore) : undefined, + equityWithLoanBefore: isSet(object.equityWithLoanBefore) + ? globalThis.Number(object.equityWithLoanBefore) + : undefined, + initMarginChange: isSet(object.initMarginChange) ? globalThis.Number(object.initMarginChange) : undefined, + maintMarginChange: isSet(object.maintMarginChange) ? globalThis.Number(object.maintMarginChange) : undefined, + equityWithLoanChange: isSet(object.equityWithLoanChange) + ? globalThis.Number(object.equityWithLoanChange) + : undefined, + initMarginAfter: isSet(object.initMarginAfter) ? globalThis.Number(object.initMarginAfter) : undefined, + maintMarginAfter: isSet(object.maintMarginAfter) ? globalThis.Number(object.maintMarginAfter) : undefined, + equityWithLoanAfter: isSet(object.equityWithLoanAfter) + ? globalThis.Number(object.equityWithLoanAfter) + : undefined, + commissionAndFees: isSet(object.commissionAndFees) ? globalThis.Number(object.commissionAndFees) : undefined, + minCommissionAndFees: isSet(object.minCommissionAndFees) + ? globalThis.Number(object.minCommissionAndFees) + : undefined, + maxCommissionAndFees: isSet(object.maxCommissionAndFees) + ? globalThis.Number(object.maxCommissionAndFees) + : undefined, + commissionAndFeesCurrency: isSet(object.commissionAndFeesCurrency) + ? globalThis.String(object.commissionAndFeesCurrency) + : undefined, + marginCurrency: isSet(object.marginCurrency) ? globalThis.String(object.marginCurrency) : undefined, + initMarginBeforeOutsideRTH: isSet(object.initMarginBeforeOutsideRTH) + ? globalThis.Number(object.initMarginBeforeOutsideRTH) + : undefined, + maintMarginBeforeOutsideRTH: isSet(object.maintMarginBeforeOutsideRTH) + ? globalThis.Number(object.maintMarginBeforeOutsideRTH) + : undefined, + equityWithLoanBeforeOutsideRTH: isSet(object.equityWithLoanBeforeOutsideRTH) + ? globalThis.Number(object.equityWithLoanBeforeOutsideRTH) + : undefined, + initMarginChangeOutsideRTH: isSet(object.initMarginChangeOutsideRTH) + ? globalThis.Number(object.initMarginChangeOutsideRTH) + : undefined, + maintMarginChangeOutsideRTH: isSet(object.maintMarginChangeOutsideRTH) + ? globalThis.Number(object.maintMarginChangeOutsideRTH) + : undefined, + equityWithLoanChangeOutsideRTH: isSet(object.equityWithLoanChangeOutsideRTH) + ? globalThis.Number(object.equityWithLoanChangeOutsideRTH) + : undefined, + initMarginAfterOutsideRTH: isSet(object.initMarginAfterOutsideRTH) + ? globalThis.Number(object.initMarginAfterOutsideRTH) + : undefined, + maintMarginAfterOutsideRTH: isSet(object.maintMarginAfterOutsideRTH) + ? globalThis.Number(object.maintMarginAfterOutsideRTH) + : undefined, + equityWithLoanAfterOutsideRTH: isSet(object.equityWithLoanAfterOutsideRTH) + ? globalThis.Number(object.equityWithLoanAfterOutsideRTH) + : undefined, + suggestedSize: isSet(object.suggestedSize) ? globalThis.String(object.suggestedSize) : undefined, + rejectReason: isSet(object.rejectReason) ? globalThis.String(object.rejectReason) : undefined, + orderAllocations: globalThis.Array.isArray(object?.orderAllocations) + ? object.orderAllocations.map((e: any) => OrderAllocation.fromJSON(e)) + : [], + warningText: isSet(object.warningText) ? globalThis.String(object.warningText) : undefined, + completedTime: isSet(object.completedTime) ? globalThis.String(object.completedTime) : undefined, + completedStatus: isSet(object.completedStatus) ? globalThis.String(object.completedStatus) : undefined, + }; + }, + + toJSON(message: OrderState): unknown { + const obj: any = {}; + if (message.status !== undefined) { + obj.status = message.status; + } + if (message.initMarginBefore !== undefined) { + obj.initMarginBefore = message.initMarginBefore; + } + if (message.maintMarginBefore !== undefined) { + obj.maintMarginBefore = message.maintMarginBefore; + } + if (message.equityWithLoanBefore !== undefined) { + obj.equityWithLoanBefore = message.equityWithLoanBefore; + } + if (message.initMarginChange !== undefined) { + obj.initMarginChange = message.initMarginChange; + } + if (message.maintMarginChange !== undefined) { + obj.maintMarginChange = message.maintMarginChange; + } + if (message.equityWithLoanChange !== undefined) { + obj.equityWithLoanChange = message.equityWithLoanChange; + } + if (message.initMarginAfter !== undefined) { + obj.initMarginAfter = message.initMarginAfter; + } + if (message.maintMarginAfter !== undefined) { + obj.maintMarginAfter = message.maintMarginAfter; + } + if (message.equityWithLoanAfter !== undefined) { + obj.equityWithLoanAfter = message.equityWithLoanAfter; + } + if (message.commissionAndFees !== undefined) { + obj.commissionAndFees = message.commissionAndFees; + } + if (message.minCommissionAndFees !== undefined) { + obj.minCommissionAndFees = message.minCommissionAndFees; + } + if (message.maxCommissionAndFees !== undefined) { + obj.maxCommissionAndFees = message.maxCommissionAndFees; + } + if (message.commissionAndFeesCurrency !== undefined) { + obj.commissionAndFeesCurrency = message.commissionAndFeesCurrency; + } + if (message.marginCurrency !== undefined) { + obj.marginCurrency = message.marginCurrency; + } + if (message.initMarginBeforeOutsideRTH !== undefined) { + obj.initMarginBeforeOutsideRTH = message.initMarginBeforeOutsideRTH; + } + if (message.maintMarginBeforeOutsideRTH !== undefined) { + obj.maintMarginBeforeOutsideRTH = message.maintMarginBeforeOutsideRTH; + } + if (message.equityWithLoanBeforeOutsideRTH !== undefined) { + obj.equityWithLoanBeforeOutsideRTH = message.equityWithLoanBeforeOutsideRTH; + } + if (message.initMarginChangeOutsideRTH !== undefined) { + obj.initMarginChangeOutsideRTH = message.initMarginChangeOutsideRTH; + } + if (message.maintMarginChangeOutsideRTH !== undefined) { + obj.maintMarginChangeOutsideRTH = message.maintMarginChangeOutsideRTH; + } + if (message.equityWithLoanChangeOutsideRTH !== undefined) { + obj.equityWithLoanChangeOutsideRTH = message.equityWithLoanChangeOutsideRTH; + } + if (message.initMarginAfterOutsideRTH !== undefined) { + obj.initMarginAfterOutsideRTH = message.initMarginAfterOutsideRTH; + } + if (message.maintMarginAfterOutsideRTH !== undefined) { + obj.maintMarginAfterOutsideRTH = message.maintMarginAfterOutsideRTH; + } + if (message.equityWithLoanAfterOutsideRTH !== undefined) { + obj.equityWithLoanAfterOutsideRTH = message.equityWithLoanAfterOutsideRTH; + } + if (message.suggestedSize !== undefined) { + obj.suggestedSize = message.suggestedSize; + } + if (message.rejectReason !== undefined) { + obj.rejectReason = message.rejectReason; + } + if (message.orderAllocations?.length) { + obj.orderAllocations = message.orderAllocations.map((e) => OrderAllocation.toJSON(e)); + } + if (message.warningText !== undefined) { + obj.warningText = message.warningText; + } + if (message.completedTime !== undefined) { + obj.completedTime = message.completedTime; + } + if (message.completedStatus !== undefined) { + obj.completedStatus = message.completedStatus; + } + return obj; + }, + + create(base?: DeepPartial): OrderState { + return OrderState.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OrderState { + const message = createBaseOrderState(); + message.status = object.status ?? undefined; + message.initMarginBefore = object.initMarginBefore ?? undefined; + message.maintMarginBefore = object.maintMarginBefore ?? undefined; + message.equityWithLoanBefore = object.equityWithLoanBefore ?? undefined; + message.initMarginChange = object.initMarginChange ?? undefined; + message.maintMarginChange = object.maintMarginChange ?? undefined; + message.equityWithLoanChange = object.equityWithLoanChange ?? undefined; + message.initMarginAfter = object.initMarginAfter ?? undefined; + message.maintMarginAfter = object.maintMarginAfter ?? undefined; + message.equityWithLoanAfter = object.equityWithLoanAfter ?? undefined; + message.commissionAndFees = object.commissionAndFees ?? undefined; + message.minCommissionAndFees = object.minCommissionAndFees ?? undefined; + message.maxCommissionAndFees = object.maxCommissionAndFees ?? undefined; + message.commissionAndFeesCurrency = object.commissionAndFeesCurrency ?? undefined; + message.marginCurrency = object.marginCurrency ?? undefined; + message.initMarginBeforeOutsideRTH = object.initMarginBeforeOutsideRTH ?? undefined; + message.maintMarginBeforeOutsideRTH = object.maintMarginBeforeOutsideRTH ?? undefined; + message.equityWithLoanBeforeOutsideRTH = object.equityWithLoanBeforeOutsideRTH ?? undefined; + message.initMarginChangeOutsideRTH = object.initMarginChangeOutsideRTH ?? undefined; + message.maintMarginChangeOutsideRTH = object.maintMarginChangeOutsideRTH ?? undefined; + message.equityWithLoanChangeOutsideRTH = object.equityWithLoanChangeOutsideRTH ?? undefined; + message.initMarginAfterOutsideRTH = object.initMarginAfterOutsideRTH ?? undefined; + message.maintMarginAfterOutsideRTH = object.maintMarginAfterOutsideRTH ?? undefined; + message.equityWithLoanAfterOutsideRTH = object.equityWithLoanAfterOutsideRTH ?? undefined; + message.suggestedSize = object.suggestedSize ?? undefined; + message.rejectReason = object.rejectReason ?? undefined; + message.orderAllocations = object.orderAllocations?.map((e) => OrderAllocation.fromPartial(e)) || []; + message.warningText = object.warningText ?? undefined; + message.completedTime = object.completedTime ?? undefined; + message.completedStatus = object.completedStatus ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OrderStatus.ts b/packages/ibkr/src/protobuf/OrderStatus.ts new file mode 100644 index 00000000..5cbda3a3 --- /dev/null +++ b/packages/ibkr/src/protobuf/OrderStatus.ts @@ -0,0 +1,288 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OrderStatus.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface OrderStatus { + orderId?: number | undefined; + status?: string | undefined; + filled?: string | undefined; + remaining?: string | undefined; + avgFillPrice?: number | undefined; + permId?: number | undefined; + parentId?: number | undefined; + lastFillPrice?: number | undefined; + clientId?: number | undefined; + whyHeld?: string | undefined; + mktCapPrice?: number | undefined; +} + +function createBaseOrderStatus(): OrderStatus { + return { + orderId: undefined, + status: undefined, + filled: undefined, + remaining: undefined, + avgFillPrice: undefined, + permId: undefined, + parentId: undefined, + lastFillPrice: undefined, + clientId: undefined, + whyHeld: undefined, + mktCapPrice: undefined, + }; +} + +export const OrderStatus: MessageFns = { + encode(message: OrderStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.orderId !== undefined) { + writer.uint32(8).int32(message.orderId); + } + if (message.status !== undefined) { + writer.uint32(18).string(message.status); + } + if (message.filled !== undefined) { + writer.uint32(26).string(message.filled); + } + if (message.remaining !== undefined) { + writer.uint32(34).string(message.remaining); + } + if (message.avgFillPrice !== undefined) { + writer.uint32(41).double(message.avgFillPrice); + } + if (message.permId !== undefined) { + writer.uint32(48).int64(message.permId); + } + if (message.parentId !== undefined) { + writer.uint32(56).int32(message.parentId); + } + if (message.lastFillPrice !== undefined) { + writer.uint32(65).double(message.lastFillPrice); + } + if (message.clientId !== undefined) { + writer.uint32(72).int32(message.clientId); + } + if (message.whyHeld !== undefined) { + writer.uint32(82).string(message.whyHeld); + } + if (message.mktCapPrice !== undefined) { + writer.uint32(89).double(message.mktCapPrice); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OrderStatus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrderStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.orderId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.status = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.filled = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.remaining = reader.string(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.avgFillPrice = reader.double(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.permId = longToNumber(reader.int64()); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.parentId = reader.int32(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.lastFillPrice = reader.double(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.clientId = reader.int32(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.whyHeld = reader.string(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.mktCapPrice = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrderStatus { + return { + orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined, + status: isSet(object.status) ? globalThis.String(object.status) : undefined, + filled: isSet(object.filled) ? globalThis.String(object.filled) : undefined, + remaining: isSet(object.remaining) ? globalThis.String(object.remaining) : undefined, + avgFillPrice: isSet(object.avgFillPrice) ? globalThis.Number(object.avgFillPrice) : undefined, + permId: isSet(object.permId) ? globalThis.Number(object.permId) : undefined, + parentId: isSet(object.parentId) ? globalThis.Number(object.parentId) : undefined, + lastFillPrice: isSet(object.lastFillPrice) ? globalThis.Number(object.lastFillPrice) : undefined, + clientId: isSet(object.clientId) ? globalThis.Number(object.clientId) : undefined, + whyHeld: isSet(object.whyHeld) ? globalThis.String(object.whyHeld) : undefined, + mktCapPrice: isSet(object.mktCapPrice) ? globalThis.Number(object.mktCapPrice) : undefined, + }; + }, + + toJSON(message: OrderStatus): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + if (message.status !== undefined) { + obj.status = message.status; + } + if (message.filled !== undefined) { + obj.filled = message.filled; + } + if (message.remaining !== undefined) { + obj.remaining = message.remaining; + } + if (message.avgFillPrice !== undefined) { + obj.avgFillPrice = message.avgFillPrice; + } + if (message.permId !== undefined) { + obj.permId = Math.round(message.permId); + } + if (message.parentId !== undefined) { + obj.parentId = Math.round(message.parentId); + } + if (message.lastFillPrice !== undefined) { + obj.lastFillPrice = message.lastFillPrice; + } + if (message.clientId !== undefined) { + obj.clientId = Math.round(message.clientId); + } + if (message.whyHeld !== undefined) { + obj.whyHeld = message.whyHeld; + } + if (message.mktCapPrice !== undefined) { + obj.mktCapPrice = message.mktCapPrice; + } + return obj; + }, + + create(base?: DeepPartial): OrderStatus { + return OrderStatus.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OrderStatus { + const message = createBaseOrderStatus(); + message.orderId = object.orderId ?? undefined; + message.status = object.status ?? undefined; + message.filled = object.filled ?? undefined; + message.remaining = object.remaining ?? undefined; + message.avgFillPrice = object.avgFillPrice ?? undefined; + message.permId = object.permId ?? undefined; + message.parentId = object.parentId ?? undefined; + message.lastFillPrice = object.lastFillPrice ?? undefined; + message.clientId = object.clientId ?? undefined; + message.whyHeld = object.whyHeld ?? undefined; + message.mktCapPrice = object.mktCapPrice ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OrdersConfig.ts b/packages/ibkr/src/protobuf/OrdersConfig.ts new file mode 100644 index 00000000..94c348ba --- /dev/null +++ b/packages/ibkr/src/protobuf/OrdersConfig.ts @@ -0,0 +1,98 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OrdersConfig.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { OrdersSmartRoutingConfig } from "./OrdersSmartRoutingConfig"; + +export const protobufPackage = "protobuf"; + +export interface OrdersConfig { + smartRouting: OrdersSmartRoutingConfig | undefined; +} + +function createBaseOrdersConfig(): OrdersConfig { + return { smartRouting: undefined }; +} + +export const OrdersConfig: MessageFns = { + encode(message: OrdersConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.smartRouting !== undefined) { + OrdersSmartRoutingConfig.encode(message.smartRouting, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OrdersConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrdersConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.smartRouting = OrdersSmartRoutingConfig.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrdersConfig { + return { + smartRouting: isSet(object.smartRouting) ? OrdersSmartRoutingConfig.fromJSON(object.smartRouting) : undefined, + }; + }, + + toJSON(message: OrdersConfig): unknown { + const obj: any = {}; + if (message.smartRouting !== undefined) { + obj.smartRouting = OrdersSmartRoutingConfig.toJSON(message.smartRouting); + } + return obj; + }, + + create(base?: DeepPartial): OrdersConfig { + return OrdersConfig.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OrdersConfig { + const message = createBaseOrdersConfig(); + message.smartRouting = (object.smartRouting !== undefined && object.smartRouting !== null) + ? OrdersSmartRoutingConfig.fromPartial(object.smartRouting) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/OrdersSmartRoutingConfig.ts b/packages/ibkr/src/protobuf/OrdersSmartRoutingConfig.ts new file mode 100644 index 00000000..b37b0f6e --- /dev/null +++ b/packages/ibkr/src/protobuf/OrdersSmartRoutingConfig.ts @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: OrdersSmartRoutingConfig.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface OrdersSmartRoutingConfig { + seekPriceImprovement?: boolean | undefined; + preOpenReroute?: boolean | undefined; + doNotRouteToDarkPools?: boolean | undefined; + defaultAlgorithm?: string | undefined; +} + +function createBaseOrdersSmartRoutingConfig(): OrdersSmartRoutingConfig { + return { + seekPriceImprovement: undefined, + preOpenReroute: undefined, + doNotRouteToDarkPools: undefined, + defaultAlgorithm: undefined, + }; +} + +export const OrdersSmartRoutingConfig: MessageFns = { + encode(message: OrdersSmartRoutingConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.seekPriceImprovement !== undefined) { + writer.uint32(8).bool(message.seekPriceImprovement); + } + if (message.preOpenReroute !== undefined) { + writer.uint32(16).bool(message.preOpenReroute); + } + if (message.doNotRouteToDarkPools !== undefined) { + writer.uint32(24).bool(message.doNotRouteToDarkPools); + } + if (message.defaultAlgorithm !== undefined) { + writer.uint32(34).string(message.defaultAlgorithm); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OrdersSmartRoutingConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOrdersSmartRoutingConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.seekPriceImprovement = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.preOpenReroute = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.doNotRouteToDarkPools = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.defaultAlgorithm = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OrdersSmartRoutingConfig { + return { + seekPriceImprovement: isSet(object.seekPriceImprovement) + ? globalThis.Boolean(object.seekPriceImprovement) + : undefined, + preOpenReroute: isSet(object.preOpenReroute) ? globalThis.Boolean(object.preOpenReroute) : undefined, + doNotRouteToDarkPools: isSet(object.doNotRouteToDarkPools) + ? globalThis.Boolean(object.doNotRouteToDarkPools) + : undefined, + defaultAlgorithm: isSet(object.defaultAlgorithm) ? globalThis.String(object.defaultAlgorithm) : undefined, + }; + }, + + toJSON(message: OrdersSmartRoutingConfig): unknown { + const obj: any = {}; + if (message.seekPriceImprovement !== undefined) { + obj.seekPriceImprovement = message.seekPriceImprovement; + } + if (message.preOpenReroute !== undefined) { + obj.preOpenReroute = message.preOpenReroute; + } + if (message.doNotRouteToDarkPools !== undefined) { + obj.doNotRouteToDarkPools = message.doNotRouteToDarkPools; + } + if (message.defaultAlgorithm !== undefined) { + obj.defaultAlgorithm = message.defaultAlgorithm; + } + return obj; + }, + + create(base?: DeepPartial): OrdersSmartRoutingConfig { + return OrdersSmartRoutingConfig.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OrdersSmartRoutingConfig { + const message = createBaseOrdersSmartRoutingConfig(); + message.seekPriceImprovement = object.seekPriceImprovement ?? undefined; + message.preOpenReroute = object.preOpenReroute ?? undefined; + message.doNotRouteToDarkPools = object.doNotRouteToDarkPools ?? undefined; + message.defaultAlgorithm = object.defaultAlgorithm ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PlaceOrderRequest.ts b/packages/ibkr/src/protobuf/PlaceOrderRequest.ts new file mode 100644 index 00000000..23db7ce0 --- /dev/null +++ b/packages/ibkr/src/protobuf/PlaceOrderRequest.ts @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PlaceOrderRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { AttachedOrders } from "./AttachedOrders"; +import { Contract } from "./Contract"; +import { Order } from "./Order"; + +export const protobufPackage = "protobuf"; + +export interface PlaceOrderRequest { + orderId?: number | undefined; + contract?: Contract | undefined; + order?: Order | undefined; + attachedOrders?: AttachedOrders | undefined; +} + +function createBasePlaceOrderRequest(): PlaceOrderRequest { + return { orderId: undefined, contract: undefined, order: undefined, attachedOrders: undefined }; +} + +export const PlaceOrderRequest: MessageFns = { + encode(message: PlaceOrderRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.orderId !== undefined) { + writer.uint32(8).int32(message.orderId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.order !== undefined) { + Order.encode(message.order, writer.uint32(26).fork()).join(); + } + if (message.attachedOrders !== undefined) { + AttachedOrders.encode(message.attachedOrders, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PlaceOrderRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlaceOrderRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.orderId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.order = Order.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.attachedOrders = AttachedOrders.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PlaceOrderRequest { + return { + orderId: isSet(object.orderId) ? globalThis.Number(object.orderId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + order: isSet(object.order) ? Order.fromJSON(object.order) : undefined, + attachedOrders: isSet(object.attachedOrders) ? AttachedOrders.fromJSON(object.attachedOrders) : undefined, + }; + }, + + toJSON(message: PlaceOrderRequest): unknown { + const obj: any = {}; + if (message.orderId !== undefined) { + obj.orderId = Math.round(message.orderId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.order !== undefined) { + obj.order = Order.toJSON(message.order); + } + if (message.attachedOrders !== undefined) { + obj.attachedOrders = AttachedOrders.toJSON(message.attachedOrders); + } + return obj; + }, + + create(base?: DeepPartial): PlaceOrderRequest { + return PlaceOrderRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PlaceOrderRequest { + const message = createBasePlaceOrderRequest(); + message.orderId = object.orderId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.order = (object.order !== undefined && object.order !== null) ? Order.fromPartial(object.order) : undefined; + message.attachedOrders = (object.attachedOrders !== undefined && object.attachedOrders !== null) + ? AttachedOrders.fromPartial(object.attachedOrders) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PnL.ts b/packages/ibkr/src/protobuf/PnL.ts new file mode 100644 index 00000000..f0e15157 --- /dev/null +++ b/packages/ibkr/src/protobuf/PnL.ts @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PnL.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface PnL { + reqId?: number | undefined; + dailyPnL?: number | undefined; + unrealizedPnL?: number | undefined; + realizedPnL?: number | undefined; +} + +function createBasePnL(): PnL { + return { reqId: undefined, dailyPnL: undefined, unrealizedPnL: undefined, realizedPnL: undefined }; +} + +export const PnL: MessageFns = { + encode(message: PnL, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.dailyPnL !== undefined) { + writer.uint32(17).double(message.dailyPnL); + } + if (message.unrealizedPnL !== undefined) { + writer.uint32(25).double(message.unrealizedPnL); + } + if (message.realizedPnL !== undefined) { + writer.uint32(33).double(message.realizedPnL); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PnL { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePnL(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.dailyPnL = reader.double(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.unrealizedPnL = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.realizedPnL = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PnL { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + dailyPnL: isSet(object.dailyPnL) ? globalThis.Number(object.dailyPnL) : undefined, + unrealizedPnL: isSet(object.unrealizedPnL) ? globalThis.Number(object.unrealizedPnL) : undefined, + realizedPnL: isSet(object.realizedPnL) ? globalThis.Number(object.realizedPnL) : undefined, + }; + }, + + toJSON(message: PnL): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.dailyPnL !== undefined) { + obj.dailyPnL = message.dailyPnL; + } + if (message.unrealizedPnL !== undefined) { + obj.unrealizedPnL = message.unrealizedPnL; + } + if (message.realizedPnL !== undefined) { + obj.realizedPnL = message.realizedPnL; + } + return obj; + }, + + create(base?: DeepPartial): PnL { + return PnL.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PnL { + const message = createBasePnL(); + message.reqId = object.reqId ?? undefined; + message.dailyPnL = object.dailyPnL ?? undefined; + message.unrealizedPnL = object.unrealizedPnL ?? undefined; + message.realizedPnL = object.realizedPnL ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PnLRequest.ts b/packages/ibkr/src/protobuf/PnLRequest.ts new file mode 100644 index 00000000..e0c6ba80 --- /dev/null +++ b/packages/ibkr/src/protobuf/PnLRequest.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PnLRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface PnLRequest { + reqId?: number | undefined; + account?: string | undefined; + modelCode?: string | undefined; +} + +function createBasePnLRequest(): PnLRequest { + return { reqId: undefined, account: undefined, modelCode: undefined }; +} + +export const PnLRequest: MessageFns = { + encode(message: PnLRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.account !== undefined) { + writer.uint32(18).string(message.account); + } + if (message.modelCode !== undefined) { + writer.uint32(26).string(message.modelCode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PnLRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePnLRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.account = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.modelCode = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PnLRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + modelCode: isSet(object.modelCode) ? globalThis.String(object.modelCode) : undefined, + }; + }, + + toJSON(message: PnLRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.modelCode !== undefined) { + obj.modelCode = message.modelCode; + } + return obj; + }, + + create(base?: DeepPartial): PnLRequest { + return PnLRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PnLRequest { + const message = createBasePnLRequest(); + message.reqId = object.reqId ?? undefined; + message.account = object.account ?? undefined; + message.modelCode = object.modelCode ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PnLSingle.ts b/packages/ibkr/src/protobuf/PnLSingle.ts new file mode 100644 index 00000000..e0e2fb2b --- /dev/null +++ b/packages/ibkr/src/protobuf/PnLSingle.ts @@ -0,0 +1,187 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PnLSingle.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface PnLSingle { + reqId?: number | undefined; + position?: string | undefined; + dailyPnL?: number | undefined; + unrealizedPnL?: number | undefined; + realizedPnL?: number | undefined; + value?: number | undefined; +} + +function createBasePnLSingle(): PnLSingle { + return { + reqId: undefined, + position: undefined, + dailyPnL: undefined, + unrealizedPnL: undefined, + realizedPnL: undefined, + value: undefined, + }; +} + +export const PnLSingle: MessageFns = { + encode(message: PnLSingle, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.position !== undefined) { + writer.uint32(18).string(message.position); + } + if (message.dailyPnL !== undefined) { + writer.uint32(25).double(message.dailyPnL); + } + if (message.unrealizedPnL !== undefined) { + writer.uint32(33).double(message.unrealizedPnL); + } + if (message.realizedPnL !== undefined) { + writer.uint32(41).double(message.realizedPnL); + } + if (message.value !== undefined) { + writer.uint32(49).double(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PnLSingle { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePnLSingle(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.position = reader.string(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.dailyPnL = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.unrealizedPnL = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.realizedPnL = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.value = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PnLSingle { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + position: isSet(object.position) ? globalThis.String(object.position) : undefined, + dailyPnL: isSet(object.dailyPnL) ? globalThis.Number(object.dailyPnL) : undefined, + unrealizedPnL: isSet(object.unrealizedPnL) ? globalThis.Number(object.unrealizedPnL) : undefined, + realizedPnL: isSet(object.realizedPnL) ? globalThis.Number(object.realizedPnL) : undefined, + value: isSet(object.value) ? globalThis.Number(object.value) : undefined, + }; + }, + + toJSON(message: PnLSingle): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.position !== undefined) { + obj.position = message.position; + } + if (message.dailyPnL !== undefined) { + obj.dailyPnL = message.dailyPnL; + } + if (message.unrealizedPnL !== undefined) { + obj.unrealizedPnL = message.unrealizedPnL; + } + if (message.realizedPnL !== undefined) { + obj.realizedPnL = message.realizedPnL; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): PnLSingle { + return PnLSingle.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PnLSingle { + const message = createBasePnLSingle(); + message.reqId = object.reqId ?? undefined; + message.position = object.position ?? undefined; + message.dailyPnL = object.dailyPnL ?? undefined; + message.unrealizedPnL = object.unrealizedPnL ?? undefined; + message.realizedPnL = object.realizedPnL ?? undefined; + message.value = object.value ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PnLSingleRequest.ts b/packages/ibkr/src/protobuf/PnLSingleRequest.ts new file mode 100644 index 00000000..d0fa2786 --- /dev/null +++ b/packages/ibkr/src/protobuf/PnLSingleRequest.ts @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PnLSingleRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface PnLSingleRequest { + reqId?: number | undefined; + account?: string | undefined; + modelCode?: string | undefined; + conId?: number | undefined; +} + +function createBasePnLSingleRequest(): PnLSingleRequest { + return { reqId: undefined, account: undefined, modelCode: undefined, conId: undefined }; +} + +export const PnLSingleRequest: MessageFns = { + encode(message: PnLSingleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.account !== undefined) { + writer.uint32(18).string(message.account); + } + if (message.modelCode !== undefined) { + writer.uint32(26).string(message.modelCode); + } + if (message.conId !== undefined) { + writer.uint32(32).int32(message.conId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PnLSingleRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePnLSingleRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.account = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.modelCode = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.conId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PnLSingleRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + modelCode: isSet(object.modelCode) ? globalThis.String(object.modelCode) : undefined, + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + }; + }, + + toJSON(message: PnLSingleRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.modelCode !== undefined) { + obj.modelCode = message.modelCode; + } + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + return obj; + }, + + create(base?: DeepPartial): PnLSingleRequest { + return PnLSingleRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PnLSingleRequest { + const message = createBasePnLSingleRequest(); + message.reqId = object.reqId ?? undefined; + message.account = object.account ?? undefined; + message.modelCode = object.modelCode ?? undefined; + message.conId = object.conId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PortfolioValue.ts b/packages/ibkr/src/protobuf/PortfolioValue.ts new file mode 100644 index 00000000..5cd7800b --- /dev/null +++ b/packages/ibkr/src/protobuf/PortfolioValue.ts @@ -0,0 +1,226 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PortfolioValue.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface PortfolioValue { + contract?: Contract | undefined; + position?: string | undefined; + marketPrice?: number | undefined; + marketValue?: number | undefined; + averageCost?: number | undefined; + unrealizedPNL?: number | undefined; + realizedPNL?: number | undefined; + accountName?: string | undefined; +} + +function createBasePortfolioValue(): PortfolioValue { + return { + contract: undefined, + position: undefined, + marketPrice: undefined, + marketValue: undefined, + averageCost: undefined, + unrealizedPNL: undefined, + realizedPNL: undefined, + accountName: undefined, + }; +} + +export const PortfolioValue: MessageFns = { + encode(message: PortfolioValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(10).fork()).join(); + } + if (message.position !== undefined) { + writer.uint32(18).string(message.position); + } + if (message.marketPrice !== undefined) { + writer.uint32(25).double(message.marketPrice); + } + if (message.marketValue !== undefined) { + writer.uint32(33).double(message.marketValue); + } + if (message.averageCost !== undefined) { + writer.uint32(41).double(message.averageCost); + } + if (message.unrealizedPNL !== undefined) { + writer.uint32(49).double(message.unrealizedPNL); + } + if (message.realizedPNL !== undefined) { + writer.uint32(57).double(message.realizedPNL); + } + if (message.accountName !== undefined) { + writer.uint32(66).string(message.accountName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PortfolioValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePortfolioValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.position = reader.string(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.marketPrice = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.marketValue = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.averageCost = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.unrealizedPNL = reader.double(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.realizedPNL = reader.double(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.accountName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PortfolioValue { + return { + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + position: isSet(object.position) ? globalThis.String(object.position) : undefined, + marketPrice: isSet(object.marketPrice) ? globalThis.Number(object.marketPrice) : undefined, + marketValue: isSet(object.marketValue) ? globalThis.Number(object.marketValue) : undefined, + averageCost: isSet(object.averageCost) ? globalThis.Number(object.averageCost) : undefined, + unrealizedPNL: isSet(object.unrealizedPNL) ? globalThis.Number(object.unrealizedPNL) : undefined, + realizedPNL: isSet(object.realizedPNL) ? globalThis.Number(object.realizedPNL) : undefined, + accountName: isSet(object.accountName) ? globalThis.String(object.accountName) : undefined, + }; + }, + + toJSON(message: PortfolioValue): unknown { + const obj: any = {}; + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.position !== undefined) { + obj.position = message.position; + } + if (message.marketPrice !== undefined) { + obj.marketPrice = message.marketPrice; + } + if (message.marketValue !== undefined) { + obj.marketValue = message.marketValue; + } + if (message.averageCost !== undefined) { + obj.averageCost = message.averageCost; + } + if (message.unrealizedPNL !== undefined) { + obj.unrealizedPNL = message.unrealizedPNL; + } + if (message.realizedPNL !== undefined) { + obj.realizedPNL = message.realizedPNL; + } + if (message.accountName !== undefined) { + obj.accountName = message.accountName; + } + return obj; + }, + + create(base?: DeepPartial): PortfolioValue { + return PortfolioValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PortfolioValue { + const message = createBasePortfolioValue(); + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.position = object.position ?? undefined; + message.marketPrice = object.marketPrice ?? undefined; + message.marketValue = object.marketValue ?? undefined; + message.averageCost = object.averageCost ?? undefined; + message.unrealizedPNL = object.unrealizedPNL ?? undefined; + message.realizedPNL = object.realizedPNL ?? undefined; + message.accountName = object.accountName ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/Position.ts b/packages/ibkr/src/protobuf/Position.ts new file mode 100644 index 00000000..3c8c359b --- /dev/null +++ b/packages/ibkr/src/protobuf/Position.ts @@ -0,0 +1,149 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: Position.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface Position { + account?: string | undefined; + contract?: Contract | undefined; + position?: string | undefined; + avgCost?: number | undefined; +} + +function createBasePosition(): Position { + return { account: undefined, contract: undefined, position: undefined, avgCost: undefined }; +} + +export const Position: MessageFns = { + encode(message: Position, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.account !== undefined) { + writer.uint32(10).string(message.account); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.position !== undefined) { + writer.uint32(26).string(message.position); + } + if (message.avgCost !== undefined) { + writer.uint32(33).double(message.avgCost); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Position { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.account = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.position = reader.string(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.avgCost = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Position { + return { + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + position: isSet(object.position) ? globalThis.String(object.position) : undefined, + avgCost: isSet(object.avgCost) ? globalThis.Number(object.avgCost) : undefined, + }; + }, + + toJSON(message: Position): unknown { + const obj: any = {}; + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.position !== undefined) { + obj.position = message.position; + } + if (message.avgCost !== undefined) { + obj.avgCost = message.avgCost; + } + return obj; + }, + + create(base?: DeepPartial): Position { + return Position.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Position { + const message = createBasePosition(); + message.account = object.account ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.position = object.position ?? undefined; + message.avgCost = object.avgCost ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PositionEnd.ts b/packages/ibkr/src/protobuf/PositionEnd.ts new file mode 100644 index 00000000..49777693 --- /dev/null +++ b/packages/ibkr/src/protobuf/PositionEnd.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PositionEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface PositionEnd { +} + +function createBasePositionEnd(): PositionEnd { + return {}; +} + +export const PositionEnd: MessageFns = { + encode(_: PositionEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PositionEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): PositionEnd { + return {}; + }, + + toJSON(_: PositionEnd): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): PositionEnd { + return PositionEnd.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): PositionEnd { + const message = createBasePositionEnd(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PositionMulti.ts b/packages/ibkr/src/protobuf/PositionMulti.ts new file mode 100644 index 00000000..984865d1 --- /dev/null +++ b/packages/ibkr/src/protobuf/PositionMulti.ts @@ -0,0 +1,190 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PositionMulti.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface PositionMulti { + reqId?: number | undefined; + account?: string | undefined; + contract?: Contract | undefined; + position?: string | undefined; + avgCost?: number | undefined; + modelCode?: string | undefined; +} + +function createBasePositionMulti(): PositionMulti { + return { + reqId: undefined, + account: undefined, + contract: undefined, + position: undefined, + avgCost: undefined, + modelCode: undefined, + }; +} + +export const PositionMulti: MessageFns = { + encode(message: PositionMulti, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.account !== undefined) { + writer.uint32(18).string(message.account); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(26).fork()).join(); + } + if (message.position !== undefined) { + writer.uint32(34).string(message.position); + } + if (message.avgCost !== undefined) { + writer.uint32(41).double(message.avgCost); + } + if (message.modelCode !== undefined) { + writer.uint32(50).string(message.modelCode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PositionMulti { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionMulti(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.account = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.position = reader.string(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.avgCost = reader.double(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.modelCode = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PositionMulti { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + position: isSet(object.position) ? globalThis.String(object.position) : undefined, + avgCost: isSet(object.avgCost) ? globalThis.Number(object.avgCost) : undefined, + modelCode: isSet(object.modelCode) ? globalThis.String(object.modelCode) : undefined, + }; + }, + + toJSON(message: PositionMulti): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.position !== undefined) { + obj.position = message.position; + } + if (message.avgCost !== undefined) { + obj.avgCost = message.avgCost; + } + if (message.modelCode !== undefined) { + obj.modelCode = message.modelCode; + } + return obj; + }, + + create(base?: DeepPartial): PositionMulti { + return PositionMulti.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PositionMulti { + const message = createBasePositionMulti(); + message.reqId = object.reqId ?? undefined; + message.account = object.account ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.position = object.position ?? undefined; + message.avgCost = object.avgCost ?? undefined; + message.modelCode = object.modelCode ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PositionMultiEnd.ts b/packages/ibkr/src/protobuf/PositionMultiEnd.ts new file mode 100644 index 00000000..dcf3da57 --- /dev/null +++ b/packages/ibkr/src/protobuf/PositionMultiEnd.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PositionMultiEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface PositionMultiEnd { + reqId?: number | undefined; +} + +function createBasePositionMultiEnd(): PositionMultiEnd { + return { reqId: undefined }; +} + +export const PositionMultiEnd: MessageFns = { + encode(message: PositionMultiEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PositionMultiEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionMultiEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PositionMultiEnd { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: PositionMultiEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): PositionMultiEnd { + return PositionMultiEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PositionMultiEnd { + const message = createBasePositionMultiEnd(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PositionsMultiRequest.ts b/packages/ibkr/src/protobuf/PositionsMultiRequest.ts new file mode 100644 index 00000000..d5fcd6ad --- /dev/null +++ b/packages/ibkr/src/protobuf/PositionsMultiRequest.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PositionsMultiRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface PositionsMultiRequest { + reqId?: number | undefined; + account?: string | undefined; + modelCode?: string | undefined; +} + +function createBasePositionsMultiRequest(): PositionsMultiRequest { + return { reqId: undefined, account: undefined, modelCode: undefined }; +} + +export const PositionsMultiRequest: MessageFns = { + encode(message: PositionsMultiRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.account !== undefined) { + writer.uint32(18).string(message.account); + } + if (message.modelCode !== undefined) { + writer.uint32(26).string(message.modelCode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PositionsMultiRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsMultiRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.account = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.modelCode = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PositionsMultiRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + account: isSet(object.account) ? globalThis.String(object.account) : undefined, + modelCode: isSet(object.modelCode) ? globalThis.String(object.modelCode) : undefined, + }; + }, + + toJSON(message: PositionsMultiRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.account !== undefined) { + obj.account = message.account; + } + if (message.modelCode !== undefined) { + obj.modelCode = message.modelCode; + } + return obj; + }, + + create(base?: DeepPartial): PositionsMultiRequest { + return PositionsMultiRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PositionsMultiRequest { + const message = createBasePositionsMultiRequest(); + message.reqId = object.reqId ?? undefined; + message.account = object.account ?? undefined; + message.modelCode = object.modelCode ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PositionsRequest.ts b/packages/ibkr/src/protobuf/PositionsRequest.ts new file mode 100644 index 00000000..5327c497 --- /dev/null +++ b/packages/ibkr/src/protobuf/PositionsRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PositionsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface PositionsRequest { +} + +function createBasePositionsRequest(): PositionsRequest { + return {}; +} + +export const PositionsRequest: MessageFns = { + encode(_: PositionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PositionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): PositionsRequest { + return {}; + }, + + toJSON(_: PositionsRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): PositionsRequest { + return PositionsRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): PositionsRequest { + const message = createBasePositionsRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/PriceIncrement.ts b/packages/ibkr/src/protobuf/PriceIncrement.ts new file mode 100644 index 00000000..d3bd4634 --- /dev/null +++ b/packages/ibkr/src/protobuf/PriceIncrement.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: PriceIncrement.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface PriceIncrement { + lowEdge?: number | undefined; + increment?: number | undefined; +} + +function createBasePriceIncrement(): PriceIncrement { + return { lowEdge: undefined, increment: undefined }; +} + +export const PriceIncrement: MessageFns = { + encode(message: PriceIncrement, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lowEdge !== undefined) { + writer.uint32(9).double(message.lowEdge); + } + if (message.increment !== undefined) { + writer.uint32(17).double(message.increment); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PriceIncrement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePriceIncrement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.lowEdge = reader.double(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.increment = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PriceIncrement { + return { + lowEdge: isSet(object.lowEdge) ? globalThis.Number(object.lowEdge) : undefined, + increment: isSet(object.increment) ? globalThis.Number(object.increment) : undefined, + }; + }, + + toJSON(message: PriceIncrement): unknown { + const obj: any = {}; + if (message.lowEdge !== undefined) { + obj.lowEdge = message.lowEdge; + } + if (message.increment !== undefined) { + obj.increment = message.increment; + } + return obj; + }, + + create(base?: DeepPartial): PriceIncrement { + return PriceIncrement.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PriceIncrement { + const message = createBasePriceIncrement(); + message.lowEdge = object.lowEdge ?? undefined; + message.increment = object.increment ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/QueryDisplayGroupsRequest.ts b/packages/ibkr/src/protobuf/QueryDisplayGroupsRequest.ts new file mode 100644 index 00000000..6a69e9a0 --- /dev/null +++ b/packages/ibkr/src/protobuf/QueryDisplayGroupsRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: QueryDisplayGroupsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface QueryDisplayGroupsRequest { + reqId?: number | undefined; +} + +function createBaseQueryDisplayGroupsRequest(): QueryDisplayGroupsRequest { + return { reqId: undefined }; +} + +export const QueryDisplayGroupsRequest: MessageFns = { + encode(message: QueryDisplayGroupsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): QueryDisplayGroupsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDisplayGroupsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): QueryDisplayGroupsRequest { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: QueryDisplayGroupsRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): QueryDisplayGroupsRequest { + return QueryDisplayGroupsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): QueryDisplayGroupsRequest { + const message = createBaseQueryDisplayGroupsRequest(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/RealTimeBarTick.ts b/packages/ibkr/src/protobuf/RealTimeBarTick.ts new file mode 100644 index 00000000..3e065353 --- /dev/null +++ b/packages/ibkr/src/protobuf/RealTimeBarTick.ts @@ -0,0 +1,252 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: RealTimeBarTick.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface RealTimeBarTick { + reqId?: number | undefined; + time?: number | undefined; + open?: number | undefined; + high?: number | undefined; + low?: number | undefined; + close?: number | undefined; + volume?: string | undefined; + WAP?: string | undefined; + count?: number | undefined; +} + +function createBaseRealTimeBarTick(): RealTimeBarTick { + return { + reqId: undefined, + time: undefined, + open: undefined, + high: undefined, + low: undefined, + close: undefined, + volume: undefined, + WAP: undefined, + count: undefined, + }; +} + +export const RealTimeBarTick: MessageFns = { + encode(message: RealTimeBarTick, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.time !== undefined) { + writer.uint32(16).int64(message.time); + } + if (message.open !== undefined) { + writer.uint32(25).double(message.open); + } + if (message.high !== undefined) { + writer.uint32(33).double(message.high); + } + if (message.low !== undefined) { + writer.uint32(41).double(message.low); + } + if (message.close !== undefined) { + writer.uint32(49).double(message.close); + } + if (message.volume !== undefined) { + writer.uint32(58).string(message.volume); + } + if (message.WAP !== undefined) { + writer.uint32(66).string(message.WAP); + } + if (message.count !== undefined) { + writer.uint32(72).int32(message.count); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RealTimeBarTick { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRealTimeBarTick(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.time = longToNumber(reader.int64()); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.open = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.high = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.low = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.close = reader.double(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.volume = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.WAP = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.count = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RealTimeBarTick { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + time: isSet(object.time) ? globalThis.Number(object.time) : undefined, + open: isSet(object.open) ? globalThis.Number(object.open) : undefined, + high: isSet(object.high) ? globalThis.Number(object.high) : undefined, + low: isSet(object.low) ? globalThis.Number(object.low) : undefined, + close: isSet(object.close) ? globalThis.Number(object.close) : undefined, + volume: isSet(object.volume) ? globalThis.String(object.volume) : undefined, + WAP: isSet(object.WAP) ? globalThis.String(object.WAP) : undefined, + count: isSet(object.count) ? globalThis.Number(object.count) : undefined, + }; + }, + + toJSON(message: RealTimeBarTick): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.time !== undefined) { + obj.time = Math.round(message.time); + } + if (message.open !== undefined) { + obj.open = message.open; + } + if (message.high !== undefined) { + obj.high = message.high; + } + if (message.low !== undefined) { + obj.low = message.low; + } + if (message.close !== undefined) { + obj.close = message.close; + } + if (message.volume !== undefined) { + obj.volume = message.volume; + } + if (message.WAP !== undefined) { + obj.WAP = message.WAP; + } + if (message.count !== undefined) { + obj.count = Math.round(message.count); + } + return obj; + }, + + create(base?: DeepPartial): RealTimeBarTick { + return RealTimeBarTick.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RealTimeBarTick { + const message = createBaseRealTimeBarTick(); + message.reqId = object.reqId ?? undefined; + message.time = object.time ?? undefined; + message.open = object.open ?? undefined; + message.high = object.high ?? undefined; + message.low = object.low ?? undefined; + message.close = object.close ?? undefined; + message.volume = object.volume ?? undefined; + message.WAP = object.WAP ?? undefined; + message.count = object.count ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/RealTimeBarsRequest.ts b/packages/ibkr/src/protobuf/RealTimeBarsRequest.ts new file mode 100644 index 00000000..e33197cd --- /dev/null +++ b/packages/ibkr/src/protobuf/RealTimeBarsRequest.ts @@ -0,0 +1,305 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: RealTimeBarsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface RealTimeBarsRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + barSize?: number | undefined; + whatToShow?: string | undefined; + useRTH?: boolean | undefined; + realTimeBarsOptions: { [key: string]: string }; +} + +export interface RealTimeBarsRequest_RealTimeBarsOptionsEntry { + key: string; + value: string; +} + +function createBaseRealTimeBarsRequest(): RealTimeBarsRequest { + return { + reqId: undefined, + contract: undefined, + barSize: undefined, + whatToShow: undefined, + useRTH: undefined, + realTimeBarsOptions: {}, + }; +} + +export const RealTimeBarsRequest: MessageFns = { + encode(message: RealTimeBarsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.barSize !== undefined) { + writer.uint32(24).int32(message.barSize); + } + if (message.whatToShow !== undefined) { + writer.uint32(34).string(message.whatToShow); + } + if (message.useRTH !== undefined) { + writer.uint32(40).bool(message.useRTH); + } + globalThis.Object.entries(message.realTimeBarsOptions).forEach(([key, value]: [string, string]) => { + RealTimeBarsRequest_RealTimeBarsOptionsEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RealTimeBarsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRealTimeBarsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.barSize = reader.int32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.whatToShow = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.useRTH = reader.bool(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + const entry6 = RealTimeBarsRequest_RealTimeBarsOptionsEntry.decode(reader, reader.uint32()); + if (entry6.value !== undefined) { + message.realTimeBarsOptions[entry6.key] = entry6.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RealTimeBarsRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + barSize: isSet(object.barSize) ? globalThis.Number(object.barSize) : undefined, + whatToShow: isSet(object.whatToShow) ? globalThis.String(object.whatToShow) : undefined, + useRTH: isSet(object.useRTH) ? globalThis.Boolean(object.useRTH) : undefined, + realTimeBarsOptions: isObject(object.realTimeBarsOptions) + ? (globalThis.Object.entries(object.realTimeBarsOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: RealTimeBarsRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.barSize !== undefined) { + obj.barSize = Math.round(message.barSize); + } + if (message.whatToShow !== undefined) { + obj.whatToShow = message.whatToShow; + } + if (message.useRTH !== undefined) { + obj.useRTH = message.useRTH; + } + if (message.realTimeBarsOptions) { + const entries = globalThis.Object.entries(message.realTimeBarsOptions) as [string, string][]; + if (entries.length > 0) { + obj.realTimeBarsOptions = {}; + entries.forEach(([k, v]) => { + obj.realTimeBarsOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): RealTimeBarsRequest { + return RealTimeBarsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RealTimeBarsRequest { + const message = createBaseRealTimeBarsRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.barSize = object.barSize ?? undefined; + message.whatToShow = object.whatToShow ?? undefined; + message.useRTH = object.useRTH ?? undefined; + message.realTimeBarsOptions = (globalThis.Object.entries(object.realTimeBarsOptions ?? {}) as [string, string][]) + .reduce((acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseRealTimeBarsRequest_RealTimeBarsOptionsEntry(): RealTimeBarsRequest_RealTimeBarsOptionsEntry { + return { key: "", value: "" }; +} + +export const RealTimeBarsRequest_RealTimeBarsOptionsEntry: MessageFns = { + encode( + message: RealTimeBarsRequest_RealTimeBarsOptionsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RealTimeBarsRequest_RealTimeBarsOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRealTimeBarsRequest_RealTimeBarsOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RealTimeBarsRequest_RealTimeBarsOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: RealTimeBarsRequest_RealTimeBarsOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create( + base?: DeepPartial, + ): RealTimeBarsRequest_RealTimeBarsOptionsEntry { + return RealTimeBarsRequest_RealTimeBarsOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): RealTimeBarsRequest_RealTimeBarsOptionsEntry { + const message = createBaseRealTimeBarsRequest_RealTimeBarsOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ReceiveFA.ts b/packages/ibkr/src/protobuf/ReceiveFA.ts new file mode 100644 index 00000000..35487721 --- /dev/null +++ b/packages/ibkr/src/protobuf/ReceiveFA.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ReceiveFA.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ReceiveFA { + faDataType?: number | undefined; + xml?: string | undefined; +} + +function createBaseReceiveFA(): ReceiveFA { + return { faDataType: undefined, xml: undefined }; +} + +export const ReceiveFA: MessageFns = { + encode(message: ReceiveFA, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.faDataType !== undefined) { + writer.uint32(8).int32(message.faDataType); + } + if (message.xml !== undefined) { + writer.uint32(18).string(message.xml); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ReceiveFA { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReceiveFA(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.faDataType = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.xml = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ReceiveFA { + return { + faDataType: isSet(object.faDataType) ? globalThis.Number(object.faDataType) : undefined, + xml: isSet(object.xml) ? globalThis.String(object.xml) : undefined, + }; + }, + + toJSON(message: ReceiveFA): unknown { + const obj: any = {}; + if (message.faDataType !== undefined) { + obj.faDataType = Math.round(message.faDataType); + } + if (message.xml !== undefined) { + obj.xml = message.xml; + } + return obj; + }, + + create(base?: DeepPartial): ReceiveFA { + return ReceiveFA.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ReceiveFA { + const message = createBaseReceiveFA(); + message.faDataType = object.faDataType ?? undefined; + message.xml = object.xml ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ReplaceFAEnd.ts b/packages/ibkr/src/protobuf/ReplaceFAEnd.ts new file mode 100644 index 00000000..0204a246 --- /dev/null +++ b/packages/ibkr/src/protobuf/ReplaceFAEnd.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ReplaceFAEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ReplaceFAEnd { + reqId?: number | undefined; + text?: string | undefined; +} + +function createBaseReplaceFAEnd(): ReplaceFAEnd { + return { reqId: undefined, text: undefined }; +} + +export const ReplaceFAEnd: MessageFns = { + encode(message: ReplaceFAEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.text !== undefined) { + writer.uint32(18).string(message.text); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ReplaceFAEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReplaceFAEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.text = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ReplaceFAEnd { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + text: isSet(object.text) ? globalThis.String(object.text) : undefined, + }; + }, + + toJSON(message: ReplaceFAEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.text !== undefined) { + obj.text = message.text; + } + return obj; + }, + + create(base?: DeepPartial): ReplaceFAEnd { + return ReplaceFAEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ReplaceFAEnd { + const message = createBaseReplaceFAEnd(); + message.reqId = object.reqId ?? undefined; + message.text = object.text ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/RerouteMarketDataRequest.ts b/packages/ibkr/src/protobuf/RerouteMarketDataRequest.ts new file mode 100644 index 00000000..7dba1e5f --- /dev/null +++ b/packages/ibkr/src/protobuf/RerouteMarketDataRequest.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: RerouteMarketDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface RerouteMarketDataRequest { + reqId?: number | undefined; + conId?: number | undefined; + exchange?: string | undefined; +} + +function createBaseRerouteMarketDataRequest(): RerouteMarketDataRequest { + return { reqId: undefined, conId: undefined, exchange: undefined }; +} + +export const RerouteMarketDataRequest: MessageFns = { + encode(message: RerouteMarketDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.conId !== undefined) { + writer.uint32(16).int32(message.conId); + } + if (message.exchange !== undefined) { + writer.uint32(26).string(message.exchange); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RerouteMarketDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRerouteMarketDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.conId = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.exchange = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RerouteMarketDataRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + }; + }, + + toJSON(message: RerouteMarketDataRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + return obj; + }, + + create(base?: DeepPartial): RerouteMarketDataRequest { + return RerouteMarketDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RerouteMarketDataRequest { + const message = createBaseRerouteMarketDataRequest(); + message.reqId = object.reqId ?? undefined; + message.conId = object.conId ?? undefined; + message.exchange = object.exchange ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/RerouteMarketDepthRequest.ts b/packages/ibkr/src/protobuf/RerouteMarketDepthRequest.ts new file mode 100644 index 00000000..3c2602d6 --- /dev/null +++ b/packages/ibkr/src/protobuf/RerouteMarketDepthRequest.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: RerouteMarketDepthRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface RerouteMarketDepthRequest { + reqId?: number | undefined; + conId?: number | undefined; + exchange?: string | undefined; +} + +function createBaseRerouteMarketDepthRequest(): RerouteMarketDepthRequest { + return { reqId: undefined, conId: undefined, exchange: undefined }; +} + +export const RerouteMarketDepthRequest: MessageFns = { + encode(message: RerouteMarketDepthRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.conId !== undefined) { + writer.uint32(16).int32(message.conId); + } + if (message.exchange !== undefined) { + writer.uint32(26).string(message.exchange); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RerouteMarketDepthRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRerouteMarketDepthRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.conId = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.exchange = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RerouteMarketDepthRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + }; + }, + + toJSON(message: RerouteMarketDepthRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + return obj; + }, + + create(base?: DeepPartial): RerouteMarketDepthRequest { + return RerouteMarketDepthRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RerouteMarketDepthRequest { + const message = createBaseRerouteMarketDepthRequest(); + message.reqId = object.reqId ?? undefined; + message.conId = object.conId ?? undefined; + message.exchange = object.exchange ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ScannerData.ts b/packages/ibkr/src/protobuf/ScannerData.ts new file mode 100644 index 00000000..f0abfce3 --- /dev/null +++ b/packages/ibkr/src/protobuf/ScannerData.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ScannerData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { ScannerDataElement } from "./ScannerDataElement"; + +export const protobufPackage = "protobuf"; + +export interface ScannerData { + reqId?: number | undefined; + scannerDataElement: ScannerDataElement[]; +} + +function createBaseScannerData(): ScannerData { + return { reqId: undefined, scannerDataElement: [] }; +} + +export const ScannerData: MessageFns = { + encode(message: ScannerData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.scannerDataElement) { + ScannerDataElement.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ScannerData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScannerData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.scannerDataElement.push(ScannerDataElement.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ScannerData { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + scannerDataElement: globalThis.Array.isArray(object?.scannerDataElement) + ? object.scannerDataElement.map((e: any) => ScannerDataElement.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ScannerData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.scannerDataElement?.length) { + obj.scannerDataElement = message.scannerDataElement.map((e) => ScannerDataElement.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ScannerData { + return ScannerData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ScannerData { + const message = createBaseScannerData(); + message.reqId = object.reqId ?? undefined; + message.scannerDataElement = object.scannerDataElement?.map((e) => ScannerDataElement.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ScannerDataElement.ts b/packages/ibkr/src/protobuf/ScannerDataElement.ts new file mode 100644 index 00000000..17987e2b --- /dev/null +++ b/packages/ibkr/src/protobuf/ScannerDataElement.ts @@ -0,0 +1,208 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ScannerDataElement.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface ScannerDataElement { + rank?: number | undefined; + contract?: Contract | undefined; + marketName?: string | undefined; + distance?: string | undefined; + benchmark?: string | undefined; + projection?: string | undefined; + comboKey?: string | undefined; +} + +function createBaseScannerDataElement(): ScannerDataElement { + return { + rank: undefined, + contract: undefined, + marketName: undefined, + distance: undefined, + benchmark: undefined, + projection: undefined, + comboKey: undefined, + }; +} + +export const ScannerDataElement: MessageFns = { + encode(message: ScannerDataElement, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.rank !== undefined) { + writer.uint32(8).int32(message.rank); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.marketName !== undefined) { + writer.uint32(26).string(message.marketName); + } + if (message.distance !== undefined) { + writer.uint32(34).string(message.distance); + } + if (message.benchmark !== undefined) { + writer.uint32(42).string(message.benchmark); + } + if (message.projection !== undefined) { + writer.uint32(50).string(message.projection); + } + if (message.comboKey !== undefined) { + writer.uint32(58).string(message.comboKey); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ScannerDataElement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScannerDataElement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.rank = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.marketName = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.distance = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.benchmark = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.projection = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.comboKey = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ScannerDataElement { + return { + rank: isSet(object.rank) ? globalThis.Number(object.rank) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + marketName: isSet(object.marketName) ? globalThis.String(object.marketName) : undefined, + distance: isSet(object.distance) ? globalThis.String(object.distance) : undefined, + benchmark: isSet(object.benchmark) ? globalThis.String(object.benchmark) : undefined, + projection: isSet(object.projection) ? globalThis.String(object.projection) : undefined, + comboKey: isSet(object.comboKey) ? globalThis.String(object.comboKey) : undefined, + }; + }, + + toJSON(message: ScannerDataElement): unknown { + const obj: any = {}; + if (message.rank !== undefined) { + obj.rank = Math.round(message.rank); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.marketName !== undefined) { + obj.marketName = message.marketName; + } + if (message.distance !== undefined) { + obj.distance = message.distance; + } + if (message.benchmark !== undefined) { + obj.benchmark = message.benchmark; + } + if (message.projection !== undefined) { + obj.projection = message.projection; + } + if (message.comboKey !== undefined) { + obj.comboKey = message.comboKey; + } + return obj; + }, + + create(base?: DeepPartial): ScannerDataElement { + return ScannerDataElement.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ScannerDataElement { + const message = createBaseScannerDataElement(); + message.rank = object.rank ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.marketName = object.marketName ?? undefined; + message.distance = object.distance ?? undefined; + message.benchmark = object.benchmark ?? undefined; + message.projection = object.projection ?? undefined; + message.comboKey = object.comboKey ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ScannerParameters.ts b/packages/ibkr/src/protobuf/ScannerParameters.ts new file mode 100644 index 00000000..78ee0381 --- /dev/null +++ b/packages/ibkr/src/protobuf/ScannerParameters.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ScannerParameters.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ScannerParameters { + xml?: string | undefined; +} + +function createBaseScannerParameters(): ScannerParameters { + return { xml: undefined }; +} + +export const ScannerParameters: MessageFns = { + encode(message: ScannerParameters, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.xml !== undefined) { + writer.uint32(10).string(message.xml); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ScannerParameters { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScannerParameters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.xml = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ScannerParameters { + return { xml: isSet(object.xml) ? globalThis.String(object.xml) : undefined }; + }, + + toJSON(message: ScannerParameters): unknown { + const obj: any = {}; + if (message.xml !== undefined) { + obj.xml = message.xml; + } + return obj; + }, + + create(base?: DeepPartial): ScannerParameters { + return ScannerParameters.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ScannerParameters { + const message = createBaseScannerParameters(); + message.xml = object.xml ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ScannerParametersRequest.ts b/packages/ibkr/src/protobuf/ScannerParametersRequest.ts new file mode 100644 index 00000000..540eb609 --- /dev/null +++ b/packages/ibkr/src/protobuf/ScannerParametersRequest.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ScannerParametersRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +/** empty */ +export interface ScannerParametersRequest { +} + +function createBaseScannerParametersRequest(): ScannerParametersRequest { + return {}; +} + +export const ScannerParametersRequest: MessageFns = { + encode(_: ScannerParametersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ScannerParametersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScannerParametersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): ScannerParametersRequest { + return {}; + }, + + toJSON(_: ScannerParametersRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): ScannerParametersRequest { + return ScannerParametersRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): ScannerParametersRequest { + const message = createBaseScannerParametersRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ScannerSubscription.ts b/packages/ibkr/src/protobuf/ScannerSubscription.ts new file mode 100644 index 00000000..179d096a --- /dev/null +++ b/packages/ibkr/src/protobuf/ScannerSubscription.ts @@ -0,0 +1,748 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ScannerSubscription.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface ScannerSubscription { + numberOfRows?: number | undefined; + instrument?: string | undefined; + locationCode?: string | undefined; + scanCode?: string | undefined; + abovePrice?: number | undefined; + belowPrice?: number | undefined; + aboveVolume?: number | undefined; + marketCapAbove?: number | undefined; + marketCapBelow?: number | undefined; + moodyRatingAbove?: string | undefined; + moodyRatingBelow?: string | undefined; + spRatingAbove?: string | undefined; + spRatingBelow?: string | undefined; + maturityDateAbove?: string | undefined; + maturityDateBelow?: string | undefined; + couponRateAbove?: number | undefined; + couponRateBelow?: number | undefined; + excludeConvertible?: boolean | undefined; + averageOptionVolumeAbove?: number | undefined; + scannerSettingPairs?: string | undefined; + stockTypeFilter?: string | undefined; + scannerSubscriptionFilterOptions: { [key: string]: string }; + scannerSubscriptionOptions: { [key: string]: string }; +} + +export interface ScannerSubscription_ScannerSubscriptionFilterOptionsEntry { + key: string; + value: string; +} + +export interface ScannerSubscription_ScannerSubscriptionOptionsEntry { + key: string; + value: string; +} + +function createBaseScannerSubscription(): ScannerSubscription { + return { + numberOfRows: undefined, + instrument: undefined, + locationCode: undefined, + scanCode: undefined, + abovePrice: undefined, + belowPrice: undefined, + aboveVolume: undefined, + marketCapAbove: undefined, + marketCapBelow: undefined, + moodyRatingAbove: undefined, + moodyRatingBelow: undefined, + spRatingAbove: undefined, + spRatingBelow: undefined, + maturityDateAbove: undefined, + maturityDateBelow: undefined, + couponRateAbove: undefined, + couponRateBelow: undefined, + excludeConvertible: undefined, + averageOptionVolumeAbove: undefined, + scannerSettingPairs: undefined, + stockTypeFilter: undefined, + scannerSubscriptionFilterOptions: {}, + scannerSubscriptionOptions: {}, + }; +} + +export const ScannerSubscription: MessageFns = { + encode(message: ScannerSubscription, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.numberOfRows !== undefined) { + writer.uint32(8).int32(message.numberOfRows); + } + if (message.instrument !== undefined) { + writer.uint32(18).string(message.instrument); + } + if (message.locationCode !== undefined) { + writer.uint32(26).string(message.locationCode); + } + if (message.scanCode !== undefined) { + writer.uint32(34).string(message.scanCode); + } + if (message.abovePrice !== undefined) { + writer.uint32(41).double(message.abovePrice); + } + if (message.belowPrice !== undefined) { + writer.uint32(49).double(message.belowPrice); + } + if (message.aboveVolume !== undefined) { + writer.uint32(56).int64(message.aboveVolume); + } + if (message.marketCapAbove !== undefined) { + writer.uint32(65).double(message.marketCapAbove); + } + if (message.marketCapBelow !== undefined) { + writer.uint32(73).double(message.marketCapBelow); + } + if (message.moodyRatingAbove !== undefined) { + writer.uint32(82).string(message.moodyRatingAbove); + } + if (message.moodyRatingBelow !== undefined) { + writer.uint32(90).string(message.moodyRatingBelow); + } + if (message.spRatingAbove !== undefined) { + writer.uint32(98).string(message.spRatingAbove); + } + if (message.spRatingBelow !== undefined) { + writer.uint32(106).string(message.spRatingBelow); + } + if (message.maturityDateAbove !== undefined) { + writer.uint32(114).string(message.maturityDateAbove); + } + if (message.maturityDateBelow !== undefined) { + writer.uint32(122).string(message.maturityDateBelow); + } + if (message.couponRateAbove !== undefined) { + writer.uint32(129).double(message.couponRateAbove); + } + if (message.couponRateBelow !== undefined) { + writer.uint32(137).double(message.couponRateBelow); + } + if (message.excludeConvertible !== undefined) { + writer.uint32(144).bool(message.excludeConvertible); + } + if (message.averageOptionVolumeAbove !== undefined) { + writer.uint32(152).int64(message.averageOptionVolumeAbove); + } + if (message.scannerSettingPairs !== undefined) { + writer.uint32(162).string(message.scannerSettingPairs); + } + if (message.stockTypeFilter !== undefined) { + writer.uint32(170).string(message.stockTypeFilter); + } + globalThis.Object.entries(message.scannerSubscriptionFilterOptions).forEach(([key, value]: [string, string]) => { + ScannerSubscription_ScannerSubscriptionFilterOptionsEntry.encode( + { key: key as any, value }, + writer.uint32(178).fork(), + ).join(); + }); + globalThis.Object.entries(message.scannerSubscriptionOptions).forEach(([key, value]: [string, string]) => { + ScannerSubscription_ScannerSubscriptionOptionsEntry.encode({ key: key as any, value }, writer.uint32(186).fork()) + .join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ScannerSubscription { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScannerSubscription(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.numberOfRows = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.instrument = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.locationCode = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.scanCode = reader.string(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.abovePrice = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.belowPrice = reader.double(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.aboveVolume = longToNumber(reader.int64()); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.marketCapAbove = reader.double(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.marketCapBelow = reader.double(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.moodyRatingAbove = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.moodyRatingBelow = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.spRatingAbove = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.spRatingBelow = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.maturityDateAbove = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.maturityDateBelow = reader.string(); + continue; + } + case 16: { + if (tag !== 129) { + break; + } + + message.couponRateAbove = reader.double(); + continue; + } + case 17: { + if (tag !== 137) { + break; + } + + message.couponRateBelow = reader.double(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.excludeConvertible = reader.bool(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.averageOptionVolumeAbove = longToNumber(reader.int64()); + continue; + } + case 20: { + if (tag !== 162) { + break; + } + + message.scannerSettingPairs = reader.string(); + continue; + } + case 21: { + if (tag !== 170) { + break; + } + + message.stockTypeFilter = reader.string(); + continue; + } + case 22: { + if (tag !== 178) { + break; + } + + const entry22 = ScannerSubscription_ScannerSubscriptionFilterOptionsEntry.decode(reader, reader.uint32()); + if (entry22.value !== undefined) { + message.scannerSubscriptionFilterOptions[entry22.key] = entry22.value; + } + continue; + } + case 23: { + if (tag !== 186) { + break; + } + + const entry23 = ScannerSubscription_ScannerSubscriptionOptionsEntry.decode(reader, reader.uint32()); + if (entry23.value !== undefined) { + message.scannerSubscriptionOptions[entry23.key] = entry23.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ScannerSubscription { + return { + numberOfRows: isSet(object.numberOfRows) ? globalThis.Number(object.numberOfRows) : undefined, + instrument: isSet(object.instrument) ? globalThis.String(object.instrument) : undefined, + locationCode: isSet(object.locationCode) ? globalThis.String(object.locationCode) : undefined, + scanCode: isSet(object.scanCode) ? globalThis.String(object.scanCode) : undefined, + abovePrice: isSet(object.abovePrice) ? globalThis.Number(object.abovePrice) : undefined, + belowPrice: isSet(object.belowPrice) ? globalThis.Number(object.belowPrice) : undefined, + aboveVolume: isSet(object.aboveVolume) ? globalThis.Number(object.aboveVolume) : undefined, + marketCapAbove: isSet(object.marketCapAbove) ? globalThis.Number(object.marketCapAbove) : undefined, + marketCapBelow: isSet(object.marketCapBelow) ? globalThis.Number(object.marketCapBelow) : undefined, + moodyRatingAbove: isSet(object.moodyRatingAbove) ? globalThis.String(object.moodyRatingAbove) : undefined, + moodyRatingBelow: isSet(object.moodyRatingBelow) ? globalThis.String(object.moodyRatingBelow) : undefined, + spRatingAbove: isSet(object.spRatingAbove) ? globalThis.String(object.spRatingAbove) : undefined, + spRatingBelow: isSet(object.spRatingBelow) ? globalThis.String(object.spRatingBelow) : undefined, + maturityDateAbove: isSet(object.maturityDateAbove) ? globalThis.String(object.maturityDateAbove) : undefined, + maturityDateBelow: isSet(object.maturityDateBelow) ? globalThis.String(object.maturityDateBelow) : undefined, + couponRateAbove: isSet(object.couponRateAbove) ? globalThis.Number(object.couponRateAbove) : undefined, + couponRateBelow: isSet(object.couponRateBelow) ? globalThis.Number(object.couponRateBelow) : undefined, + excludeConvertible: isSet(object.excludeConvertible) ? globalThis.Boolean(object.excludeConvertible) : undefined, + averageOptionVolumeAbove: isSet(object.averageOptionVolumeAbove) + ? globalThis.Number(object.averageOptionVolumeAbove) + : undefined, + scannerSettingPairs: isSet(object.scannerSettingPairs) + ? globalThis.String(object.scannerSettingPairs) + : undefined, + stockTypeFilter: isSet(object.stockTypeFilter) ? globalThis.String(object.stockTypeFilter) : undefined, + scannerSubscriptionFilterOptions: isObject(object.scannerSubscriptionFilterOptions) + ? (globalThis.Object.entries(object.scannerSubscriptionFilterOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + scannerSubscriptionOptions: isObject(object.scannerSubscriptionOptions) + ? (globalThis.Object.entries(object.scannerSubscriptionOptions) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: ScannerSubscription): unknown { + const obj: any = {}; + if (message.numberOfRows !== undefined) { + obj.numberOfRows = Math.round(message.numberOfRows); + } + if (message.instrument !== undefined) { + obj.instrument = message.instrument; + } + if (message.locationCode !== undefined) { + obj.locationCode = message.locationCode; + } + if (message.scanCode !== undefined) { + obj.scanCode = message.scanCode; + } + if (message.abovePrice !== undefined) { + obj.abovePrice = message.abovePrice; + } + if (message.belowPrice !== undefined) { + obj.belowPrice = message.belowPrice; + } + if (message.aboveVolume !== undefined) { + obj.aboveVolume = Math.round(message.aboveVolume); + } + if (message.marketCapAbove !== undefined) { + obj.marketCapAbove = message.marketCapAbove; + } + if (message.marketCapBelow !== undefined) { + obj.marketCapBelow = message.marketCapBelow; + } + if (message.moodyRatingAbove !== undefined) { + obj.moodyRatingAbove = message.moodyRatingAbove; + } + if (message.moodyRatingBelow !== undefined) { + obj.moodyRatingBelow = message.moodyRatingBelow; + } + if (message.spRatingAbove !== undefined) { + obj.spRatingAbove = message.spRatingAbove; + } + if (message.spRatingBelow !== undefined) { + obj.spRatingBelow = message.spRatingBelow; + } + if (message.maturityDateAbove !== undefined) { + obj.maturityDateAbove = message.maturityDateAbove; + } + if (message.maturityDateBelow !== undefined) { + obj.maturityDateBelow = message.maturityDateBelow; + } + if (message.couponRateAbove !== undefined) { + obj.couponRateAbove = message.couponRateAbove; + } + if (message.couponRateBelow !== undefined) { + obj.couponRateBelow = message.couponRateBelow; + } + if (message.excludeConvertible !== undefined) { + obj.excludeConvertible = message.excludeConvertible; + } + if (message.averageOptionVolumeAbove !== undefined) { + obj.averageOptionVolumeAbove = Math.round(message.averageOptionVolumeAbove); + } + if (message.scannerSettingPairs !== undefined) { + obj.scannerSettingPairs = message.scannerSettingPairs; + } + if (message.stockTypeFilter !== undefined) { + obj.stockTypeFilter = message.stockTypeFilter; + } + if (message.scannerSubscriptionFilterOptions) { + const entries = globalThis.Object.entries(message.scannerSubscriptionFilterOptions) as [string, string][]; + if (entries.length > 0) { + obj.scannerSubscriptionFilterOptions = {}; + entries.forEach(([k, v]) => { + obj.scannerSubscriptionFilterOptions[k] = v; + }); + } + } + if (message.scannerSubscriptionOptions) { + const entries = globalThis.Object.entries(message.scannerSubscriptionOptions) as [string, string][]; + if (entries.length > 0) { + obj.scannerSubscriptionOptions = {}; + entries.forEach(([k, v]) => { + obj.scannerSubscriptionOptions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): ScannerSubscription { + return ScannerSubscription.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ScannerSubscription { + const message = createBaseScannerSubscription(); + message.numberOfRows = object.numberOfRows ?? undefined; + message.instrument = object.instrument ?? undefined; + message.locationCode = object.locationCode ?? undefined; + message.scanCode = object.scanCode ?? undefined; + message.abovePrice = object.abovePrice ?? undefined; + message.belowPrice = object.belowPrice ?? undefined; + message.aboveVolume = object.aboveVolume ?? undefined; + message.marketCapAbove = object.marketCapAbove ?? undefined; + message.marketCapBelow = object.marketCapBelow ?? undefined; + message.moodyRatingAbove = object.moodyRatingAbove ?? undefined; + message.moodyRatingBelow = object.moodyRatingBelow ?? undefined; + message.spRatingAbove = object.spRatingAbove ?? undefined; + message.spRatingBelow = object.spRatingBelow ?? undefined; + message.maturityDateAbove = object.maturityDateAbove ?? undefined; + message.maturityDateBelow = object.maturityDateBelow ?? undefined; + message.couponRateAbove = object.couponRateAbove ?? undefined; + message.couponRateBelow = object.couponRateBelow ?? undefined; + message.excludeConvertible = object.excludeConvertible ?? undefined; + message.averageOptionVolumeAbove = object.averageOptionVolumeAbove ?? undefined; + message.scannerSettingPairs = object.scannerSettingPairs ?? undefined; + message.stockTypeFilter = object.stockTypeFilter ?? undefined; + message.scannerSubscriptionFilterOptions = + (globalThis.Object.entries(object.scannerSubscriptionFilterOptions ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + message.scannerSubscriptionOptions = + (globalThis.Object.entries(object.scannerSubscriptionOptions ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseScannerSubscription_ScannerSubscriptionFilterOptionsEntry(): ScannerSubscription_ScannerSubscriptionFilterOptionsEntry { + return { key: "", value: "" }; +} + +export const ScannerSubscription_ScannerSubscriptionFilterOptionsEntry: MessageFns< + ScannerSubscription_ScannerSubscriptionFilterOptionsEntry +> = { + encode( + message: ScannerSubscription_ScannerSubscriptionFilterOptionsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ScannerSubscription_ScannerSubscriptionFilterOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScannerSubscription_ScannerSubscriptionFilterOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ScannerSubscription_ScannerSubscriptionFilterOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: ScannerSubscription_ScannerSubscriptionFilterOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create( + base?: DeepPartial, + ): ScannerSubscription_ScannerSubscriptionFilterOptionsEntry { + return ScannerSubscription_ScannerSubscriptionFilterOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): ScannerSubscription_ScannerSubscriptionFilterOptionsEntry { + const message = createBaseScannerSubscription_ScannerSubscriptionFilterOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseScannerSubscription_ScannerSubscriptionOptionsEntry(): ScannerSubscription_ScannerSubscriptionOptionsEntry { + return { key: "", value: "" }; +} + +export const ScannerSubscription_ScannerSubscriptionOptionsEntry: MessageFns< + ScannerSubscription_ScannerSubscriptionOptionsEntry +> = { + encode( + message: ScannerSubscription_ScannerSubscriptionOptionsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ScannerSubscription_ScannerSubscriptionOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScannerSubscription_ScannerSubscriptionOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ScannerSubscription_ScannerSubscriptionOptionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: ScannerSubscription_ScannerSubscriptionOptionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create( + base?: DeepPartial, + ): ScannerSubscription_ScannerSubscriptionOptionsEntry { + return ScannerSubscription_ScannerSubscriptionOptionsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): ScannerSubscription_ScannerSubscriptionOptionsEntry { + const message = createBaseScannerSubscription_ScannerSubscriptionOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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 isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/ScannerSubscriptionRequest.ts b/packages/ibkr/src/protobuf/ScannerSubscriptionRequest.ts new file mode 100644 index 00000000..bbc86181 --- /dev/null +++ b/packages/ibkr/src/protobuf/ScannerSubscriptionRequest.ts @@ -0,0 +1,117 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: ScannerSubscriptionRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { ScannerSubscription } from "./ScannerSubscription"; + +export const protobufPackage = "protobuf"; + +export interface ScannerSubscriptionRequest { + reqId?: number | undefined; + scannerSubscription?: ScannerSubscription | undefined; +} + +function createBaseScannerSubscriptionRequest(): ScannerSubscriptionRequest { + return { reqId: undefined, scannerSubscription: undefined }; +} + +export const ScannerSubscriptionRequest: MessageFns = { + encode(message: ScannerSubscriptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.scannerSubscription !== undefined) { + ScannerSubscription.encode(message.scannerSubscription, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ScannerSubscriptionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScannerSubscriptionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.scannerSubscription = ScannerSubscription.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ScannerSubscriptionRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + scannerSubscription: isSet(object.scannerSubscription) + ? ScannerSubscription.fromJSON(object.scannerSubscription) + : undefined, + }; + }, + + toJSON(message: ScannerSubscriptionRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.scannerSubscription !== undefined) { + obj.scannerSubscription = ScannerSubscription.toJSON(message.scannerSubscription); + } + return obj; + }, + + create(base?: DeepPartial): ScannerSubscriptionRequest { + return ScannerSubscriptionRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ScannerSubscriptionRequest { + const message = createBaseScannerSubscriptionRequest(); + message.reqId = object.reqId ?? undefined; + message.scannerSubscription = (object.scannerSubscription !== undefined && object.scannerSubscription !== null) + ? ScannerSubscription.fromPartial(object.scannerSubscription) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SecDefOptParameter.ts b/packages/ibkr/src/protobuf/SecDefOptParameter.ts new file mode 100644 index 00000000..a2878815 --- /dev/null +++ b/packages/ibkr/src/protobuf/SecDefOptParameter.ts @@ -0,0 +1,219 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SecDefOptParameter.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SecDefOptParameter { + reqId?: number | undefined; + exchange?: string | undefined; + underlyingConId?: number | undefined; + tradingClass?: string | undefined; + multiplier?: string | undefined; + expirations: string[]; + strikes: number[]; +} + +function createBaseSecDefOptParameter(): SecDefOptParameter { + return { + reqId: undefined, + exchange: undefined, + underlyingConId: undefined, + tradingClass: undefined, + multiplier: undefined, + expirations: [], + strikes: [], + }; +} + +export const SecDefOptParameter: MessageFns = { + encode(message: SecDefOptParameter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.exchange !== undefined) { + writer.uint32(18).string(message.exchange); + } + if (message.underlyingConId !== undefined) { + writer.uint32(24).int32(message.underlyingConId); + } + if (message.tradingClass !== undefined) { + writer.uint32(34).string(message.tradingClass); + } + if (message.multiplier !== undefined) { + writer.uint32(42).string(message.multiplier); + } + for (const v of message.expirations) { + writer.uint32(50).string(v!); + } + writer.uint32(58).fork(); + for (const v of message.strikes) { + writer.double(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecDefOptParameter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecDefOptParameter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.underlyingConId = reader.int32(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.tradingClass = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.multiplier = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.expirations.push(reader.string()); + continue; + } + case 7: { + if (tag === 57) { + message.strikes.push(reader.double()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.strikes.push(reader.double()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecDefOptParameter { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + underlyingConId: isSet(object.underlyingConId) ? globalThis.Number(object.underlyingConId) : undefined, + tradingClass: isSet(object.tradingClass) ? globalThis.String(object.tradingClass) : undefined, + multiplier: isSet(object.multiplier) ? globalThis.String(object.multiplier) : undefined, + expirations: globalThis.Array.isArray(object?.expirations) + ? object.expirations.map((e: any) => globalThis.String(e)) + : [], + strikes: globalThis.Array.isArray(object?.strikes) ? object.strikes.map((e: any) => globalThis.Number(e)) : [], + }; + }, + + toJSON(message: SecDefOptParameter): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.underlyingConId !== undefined) { + obj.underlyingConId = Math.round(message.underlyingConId); + } + if (message.tradingClass !== undefined) { + obj.tradingClass = message.tradingClass; + } + if (message.multiplier !== undefined) { + obj.multiplier = message.multiplier; + } + if (message.expirations?.length) { + obj.expirations = message.expirations; + } + if (message.strikes?.length) { + obj.strikes = message.strikes; + } + return obj; + }, + + create(base?: DeepPartial): SecDefOptParameter { + return SecDefOptParameter.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SecDefOptParameter { + const message = createBaseSecDefOptParameter(); + message.reqId = object.reqId ?? undefined; + message.exchange = object.exchange ?? undefined; + message.underlyingConId = object.underlyingConId ?? undefined; + message.tradingClass = object.tradingClass ?? undefined; + message.multiplier = object.multiplier ?? undefined; + message.expirations = object.expirations?.map((e) => e) || []; + message.strikes = object.strikes?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SecDefOptParameterEnd.ts b/packages/ibkr/src/protobuf/SecDefOptParameterEnd.ts new file mode 100644 index 00000000..42f4ea26 --- /dev/null +++ b/packages/ibkr/src/protobuf/SecDefOptParameterEnd.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SecDefOptParameterEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SecDefOptParameterEnd { + reqId?: number | undefined; +} + +function createBaseSecDefOptParameterEnd(): SecDefOptParameterEnd { + return { reqId: undefined }; +} + +export const SecDefOptParameterEnd: MessageFns = { + encode(message: SecDefOptParameterEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecDefOptParameterEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecDefOptParameterEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecDefOptParameterEnd { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: SecDefOptParameterEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): SecDefOptParameterEnd { + return SecDefOptParameterEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SecDefOptParameterEnd { + const message = createBaseSecDefOptParameterEnd(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SecDefOptParamsRequest.ts b/packages/ibkr/src/protobuf/SecDefOptParamsRequest.ts new file mode 100644 index 00000000..5410bdf9 --- /dev/null +++ b/packages/ibkr/src/protobuf/SecDefOptParamsRequest.ts @@ -0,0 +1,169 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SecDefOptParamsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SecDefOptParamsRequest { + reqId?: number | undefined; + underlyingSymbol?: string | undefined; + futFopExchange?: string | undefined; + underlyingSecType?: string | undefined; + underlyingConId?: number | undefined; +} + +function createBaseSecDefOptParamsRequest(): SecDefOptParamsRequest { + return { + reqId: undefined, + underlyingSymbol: undefined, + futFopExchange: undefined, + underlyingSecType: undefined, + underlyingConId: undefined, + }; +} + +export const SecDefOptParamsRequest: MessageFns = { + encode(message: SecDefOptParamsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.underlyingSymbol !== undefined) { + writer.uint32(18).string(message.underlyingSymbol); + } + if (message.futFopExchange !== undefined) { + writer.uint32(26).string(message.futFopExchange); + } + if (message.underlyingSecType !== undefined) { + writer.uint32(34).string(message.underlyingSecType); + } + if (message.underlyingConId !== undefined) { + writer.uint32(40).int32(message.underlyingConId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecDefOptParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecDefOptParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.underlyingSymbol = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.futFopExchange = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.underlyingSecType = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.underlyingConId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecDefOptParamsRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + underlyingSymbol: isSet(object.underlyingSymbol) ? globalThis.String(object.underlyingSymbol) : undefined, + futFopExchange: isSet(object.futFopExchange) ? globalThis.String(object.futFopExchange) : undefined, + underlyingSecType: isSet(object.underlyingSecType) ? globalThis.String(object.underlyingSecType) : undefined, + underlyingConId: isSet(object.underlyingConId) ? globalThis.Number(object.underlyingConId) : undefined, + }; + }, + + toJSON(message: SecDefOptParamsRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.underlyingSymbol !== undefined) { + obj.underlyingSymbol = message.underlyingSymbol; + } + if (message.futFopExchange !== undefined) { + obj.futFopExchange = message.futFopExchange; + } + if (message.underlyingSecType !== undefined) { + obj.underlyingSecType = message.underlyingSecType; + } + if (message.underlyingConId !== undefined) { + obj.underlyingConId = Math.round(message.underlyingConId); + } + return obj; + }, + + create(base?: DeepPartial): SecDefOptParamsRequest { + return SecDefOptParamsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SecDefOptParamsRequest { + const message = createBaseSecDefOptParamsRequest(); + message.reqId = object.reqId ?? undefined; + message.underlyingSymbol = object.underlyingSymbol ?? undefined; + message.futFopExchange = object.futFopExchange ?? undefined; + message.underlyingSecType = object.underlyingSecType ?? undefined; + message.underlyingConId = object.underlyingConId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SetServerLogLevelRequest.ts b/packages/ibkr/src/protobuf/SetServerLogLevelRequest.ts new file mode 100644 index 00000000..ea93185e --- /dev/null +++ b/packages/ibkr/src/protobuf/SetServerLogLevelRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SetServerLogLevelRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SetServerLogLevelRequest { + logLevel?: number | undefined; +} + +function createBaseSetServerLogLevelRequest(): SetServerLogLevelRequest { + return { logLevel: undefined }; +} + +export const SetServerLogLevelRequest: MessageFns = { + encode(message: SetServerLogLevelRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.logLevel !== undefined) { + writer.uint32(8).int32(message.logLevel); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SetServerLogLevelRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetServerLogLevelRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.logLevel = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SetServerLogLevelRequest { + return { logLevel: isSet(object.logLevel) ? globalThis.Number(object.logLevel) : undefined }; + }, + + toJSON(message: SetServerLogLevelRequest): unknown { + const obj: any = {}; + if (message.logLevel !== undefined) { + obj.logLevel = Math.round(message.logLevel); + } + return obj; + }, + + create(base?: DeepPartial): SetServerLogLevelRequest { + return SetServerLogLevelRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SetServerLogLevelRequest { + const message = createBaseSetServerLogLevelRequest(); + message.logLevel = object.logLevel ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SmartComponent.ts b/packages/ibkr/src/protobuf/SmartComponent.ts new file mode 100644 index 00000000..db381e0e --- /dev/null +++ b/packages/ibkr/src/protobuf/SmartComponent.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SmartComponent.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SmartComponent { + bitNumber?: number | undefined; + exchange?: string | undefined; + exchangeLetter?: string | undefined; +} + +function createBaseSmartComponent(): SmartComponent { + return { bitNumber: undefined, exchange: undefined, exchangeLetter: undefined }; +} + +export const SmartComponent: MessageFns = { + encode(message: SmartComponent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bitNumber !== undefined) { + writer.uint32(8).int32(message.bitNumber); + } + if (message.exchange !== undefined) { + writer.uint32(18).string(message.exchange); + } + if (message.exchangeLetter !== undefined) { + writer.uint32(26).string(message.exchangeLetter); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SmartComponent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSmartComponent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.bitNumber = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.exchange = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.exchangeLetter = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SmartComponent { + return { + bitNumber: isSet(object.bitNumber) ? globalThis.Number(object.bitNumber) : undefined, + exchange: isSet(object.exchange) ? globalThis.String(object.exchange) : undefined, + exchangeLetter: isSet(object.exchangeLetter) ? globalThis.String(object.exchangeLetter) : undefined, + }; + }, + + toJSON(message: SmartComponent): unknown { + const obj: any = {}; + if (message.bitNumber !== undefined) { + obj.bitNumber = Math.round(message.bitNumber); + } + if (message.exchange !== undefined) { + obj.exchange = message.exchange; + } + if (message.exchangeLetter !== undefined) { + obj.exchangeLetter = message.exchangeLetter; + } + return obj; + }, + + create(base?: DeepPartial): SmartComponent { + return SmartComponent.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SmartComponent { + const message = createBaseSmartComponent(); + message.bitNumber = object.bitNumber ?? undefined; + message.exchange = object.exchange ?? undefined; + message.exchangeLetter = object.exchangeLetter ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SmartComponents.ts b/packages/ibkr/src/protobuf/SmartComponents.ts new file mode 100644 index 00000000..ab619b37 --- /dev/null +++ b/packages/ibkr/src/protobuf/SmartComponents.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SmartComponents.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { SmartComponent } from "./SmartComponent"; + +export const protobufPackage = "protobuf"; + +export interface SmartComponents { + reqId?: number | undefined; + smartComponents: SmartComponent[]; +} + +function createBaseSmartComponents(): SmartComponents { + return { reqId: undefined, smartComponents: [] }; +} + +export const SmartComponents: MessageFns = { + encode(message: SmartComponents, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.smartComponents) { + SmartComponent.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SmartComponents { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSmartComponents(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.smartComponents.push(SmartComponent.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SmartComponents { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + smartComponents: globalThis.Array.isArray(object?.smartComponents) + ? object.smartComponents.map((e: any) => SmartComponent.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SmartComponents): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.smartComponents?.length) { + obj.smartComponents = message.smartComponents.map((e) => SmartComponent.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): SmartComponents { + return SmartComponents.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SmartComponents { + const message = createBaseSmartComponents(); + message.reqId = object.reqId ?? undefined; + message.smartComponents = object.smartComponents?.map((e) => SmartComponent.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SmartComponentsRequest.ts b/packages/ibkr/src/protobuf/SmartComponentsRequest.ts new file mode 100644 index 00000000..528f4f04 --- /dev/null +++ b/packages/ibkr/src/protobuf/SmartComponentsRequest.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SmartComponentsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SmartComponentsRequest { + reqId?: number | undefined; + bboExchange?: string | undefined; +} + +function createBaseSmartComponentsRequest(): SmartComponentsRequest { + return { reqId: undefined, bboExchange: undefined }; +} + +export const SmartComponentsRequest: MessageFns = { + encode(message: SmartComponentsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.bboExchange !== undefined) { + writer.uint32(18).string(message.bboExchange); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SmartComponentsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSmartComponentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bboExchange = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SmartComponentsRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + bboExchange: isSet(object.bboExchange) ? globalThis.String(object.bboExchange) : undefined, + }; + }, + + toJSON(message: SmartComponentsRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.bboExchange !== undefined) { + obj.bboExchange = message.bboExchange; + } + return obj; + }, + + create(base?: DeepPartial): SmartComponentsRequest { + return SmartComponentsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SmartComponentsRequest { + const message = createBaseSmartComponentsRequest(); + message.reqId = object.reqId ?? undefined; + message.bboExchange = object.bboExchange ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SoftDollarTier.ts b/packages/ibkr/src/protobuf/SoftDollarTier.ts new file mode 100644 index 00000000..5566d076 --- /dev/null +++ b/packages/ibkr/src/protobuf/SoftDollarTier.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SoftDollarTier.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SoftDollarTier { + name?: string | undefined; + value?: string | undefined; + displayName?: string | undefined; +} + +function createBaseSoftDollarTier(): SoftDollarTier { + return { name: undefined, value: undefined, displayName: undefined }; +} + +export const SoftDollarTier: MessageFns = { + encode(message: SoftDollarTier, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined) { + writer.uint32(10).string(message.name); + } + if (message.value !== undefined) { + writer.uint32(18).string(message.value); + } + if (message.displayName !== undefined) { + writer.uint32(26).string(message.displayName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SoftDollarTier { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftDollarTier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.displayName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SoftDollarTier { + return { + name: isSet(object.name) ? globalThis.String(object.name) : undefined, + value: isSet(object.value) ? globalThis.String(object.value) : undefined, + displayName: isSet(object.displayName) ? globalThis.String(object.displayName) : undefined, + }; + }, + + toJSON(message: SoftDollarTier): unknown { + const obj: any = {}; + if (message.name !== undefined) { + obj.name = message.name; + } + if (message.value !== undefined) { + obj.value = message.value; + } + if (message.displayName !== undefined) { + obj.displayName = message.displayName; + } + return obj; + }, + + create(base?: DeepPartial): SoftDollarTier { + return SoftDollarTier.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SoftDollarTier { + const message = createBaseSoftDollarTier(); + message.name = object.name ?? undefined; + message.value = object.value ?? undefined; + message.displayName = object.displayName ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SoftDollarTiers.ts b/packages/ibkr/src/protobuf/SoftDollarTiers.ts new file mode 100644 index 00000000..e8339dc6 --- /dev/null +++ b/packages/ibkr/src/protobuf/SoftDollarTiers.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SoftDollarTiers.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { SoftDollarTier } from "./SoftDollarTier"; + +export const protobufPackage = "protobuf"; + +export interface SoftDollarTiers { + reqId?: number | undefined; + softDollarTiers: SoftDollarTier[]; +} + +function createBaseSoftDollarTiers(): SoftDollarTiers { + return { reqId: undefined, softDollarTiers: [] }; +} + +export const SoftDollarTiers: MessageFns = { + encode(message: SoftDollarTiers, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.softDollarTiers) { + SoftDollarTier.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SoftDollarTiers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftDollarTiers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.softDollarTiers.push(SoftDollarTier.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SoftDollarTiers { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + softDollarTiers: globalThis.Array.isArray(object?.softDollarTiers) + ? object.softDollarTiers.map((e: any) => SoftDollarTier.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SoftDollarTiers): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.softDollarTiers?.length) { + obj.softDollarTiers = message.softDollarTiers.map((e) => SoftDollarTier.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): SoftDollarTiers { + return SoftDollarTiers.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SoftDollarTiers { + const message = createBaseSoftDollarTiers(); + message.reqId = object.reqId ?? undefined; + message.softDollarTiers = object.softDollarTiers?.map((e) => SoftDollarTier.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SoftDollarTiersRequest.ts b/packages/ibkr/src/protobuf/SoftDollarTiersRequest.ts new file mode 100644 index 00000000..abf8b8bd --- /dev/null +++ b/packages/ibkr/src/protobuf/SoftDollarTiersRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SoftDollarTiersRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SoftDollarTiersRequest { + reqId?: number | undefined; +} + +function createBaseSoftDollarTiersRequest(): SoftDollarTiersRequest { + return { reqId: undefined }; +} + +export const SoftDollarTiersRequest: MessageFns = { + encode(message: SoftDollarTiersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SoftDollarTiersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftDollarTiersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SoftDollarTiersRequest { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: SoftDollarTiersRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): SoftDollarTiersRequest { + return SoftDollarTiersRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SoftDollarTiersRequest { + const message = createBaseSoftDollarTiersRequest(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/StartApiRequest.ts b/packages/ibkr/src/protobuf/StartApiRequest.ts new file mode 100644 index 00000000..770d9b49 --- /dev/null +++ b/packages/ibkr/src/protobuf/StartApiRequest.ts @@ -0,0 +1,114 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: StartApiRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface StartApiRequest { + clientId?: number | undefined; + optionalCapabilities?: string | undefined; +} + +function createBaseStartApiRequest(): StartApiRequest { + return { clientId: undefined, optionalCapabilities: undefined }; +} + +export const StartApiRequest: MessageFns = { + encode(message: StartApiRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.clientId !== undefined) { + writer.uint32(8).int32(message.clientId); + } + if (message.optionalCapabilities !== undefined) { + writer.uint32(18).string(message.optionalCapabilities); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StartApiRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStartApiRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.clientId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.optionalCapabilities = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StartApiRequest { + return { + clientId: isSet(object.clientId) ? globalThis.Number(object.clientId) : undefined, + optionalCapabilities: isSet(object.optionalCapabilities) + ? globalThis.String(object.optionalCapabilities) + : undefined, + }; + }, + + toJSON(message: StartApiRequest): unknown { + const obj: any = {}; + if (message.clientId !== undefined) { + obj.clientId = Math.round(message.clientId); + } + if (message.optionalCapabilities !== undefined) { + obj.optionalCapabilities = message.optionalCapabilities; + } + return obj; + }, + + create(base?: DeepPartial): StartApiRequest { + return StartApiRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): StartApiRequest { + const message = createBaseStartApiRequest(); + message.clientId = object.clientId ?? undefined; + message.optionalCapabilities = object.optionalCapabilities ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SubscribeToGroupEventsRequest.ts b/packages/ibkr/src/protobuf/SubscribeToGroupEventsRequest.ts new file mode 100644 index 00000000..2d25601b --- /dev/null +++ b/packages/ibkr/src/protobuf/SubscribeToGroupEventsRequest.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SubscribeToGroupEventsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface SubscribeToGroupEventsRequest { + reqId?: number | undefined; + groupId?: number | undefined; +} + +function createBaseSubscribeToGroupEventsRequest(): SubscribeToGroupEventsRequest { + return { reqId: undefined, groupId: undefined }; +} + +export const SubscribeToGroupEventsRequest: MessageFns = { + encode(message: SubscribeToGroupEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.groupId !== undefined) { + writer.uint32(16).int32(message.groupId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SubscribeToGroupEventsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeToGroupEventsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.groupId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SubscribeToGroupEventsRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + groupId: isSet(object.groupId) ? globalThis.Number(object.groupId) : undefined, + }; + }, + + toJSON(message: SubscribeToGroupEventsRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.groupId !== undefined) { + obj.groupId = Math.round(message.groupId); + } + return obj; + }, + + create(base?: DeepPartial): SubscribeToGroupEventsRequest { + return SubscribeToGroupEventsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SubscribeToGroupEventsRequest { + const message = createBaseSubscribeToGroupEventsRequest(); + message.reqId = object.reqId ?? undefined; + message.groupId = object.groupId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/SymbolSamples.ts b/packages/ibkr/src/protobuf/SymbolSamples.ts new file mode 100644 index 00000000..7ec3fdf5 --- /dev/null +++ b/packages/ibkr/src/protobuf/SymbolSamples.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: SymbolSamples.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { ContractDescription } from "./ContractDescription"; + +export const protobufPackage = "protobuf"; + +export interface SymbolSamples { + reqId?: number | undefined; + contractDescriptions: ContractDescription[]; +} + +function createBaseSymbolSamples(): SymbolSamples { + return { reqId: undefined, contractDescriptions: [] }; +} + +export const SymbolSamples: MessageFns = { + encode(message: SymbolSamples, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + for (const v of message.contractDescriptions) { + ContractDescription.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SymbolSamples { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSymbolSamples(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contractDescriptions.push(ContractDescription.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SymbolSamples { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contractDescriptions: globalThis.Array.isArray(object?.contractDescriptions) + ? object.contractDescriptions.map((e: any) => ContractDescription.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SymbolSamples): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contractDescriptions?.length) { + obj.contractDescriptions = message.contractDescriptions.map((e) => ContractDescription.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): SymbolSamples { + return SymbolSamples.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SymbolSamples { + const message = createBaseSymbolSamples(); + message.reqId = object.reqId ?? undefined; + message.contractDescriptions = object.contractDescriptions?.map((e) => ContractDescription.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickAttribBidAsk.ts b/packages/ibkr/src/protobuf/TickAttribBidAsk.ts new file mode 100644 index 00000000..e4b1e471 --- /dev/null +++ b/packages/ibkr/src/protobuf/TickAttribBidAsk.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickAttribBidAsk.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickAttribBidAsk { + bidPastLow?: boolean | undefined; + askPastHigh?: boolean | undefined; +} + +function createBaseTickAttribBidAsk(): TickAttribBidAsk { + return { bidPastLow: undefined, askPastHigh: undefined }; +} + +export const TickAttribBidAsk: MessageFns = { + encode(message: TickAttribBidAsk, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bidPastLow !== undefined) { + writer.uint32(8).bool(message.bidPastLow); + } + if (message.askPastHigh !== undefined) { + writer.uint32(16).bool(message.askPastHigh); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickAttribBidAsk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickAttribBidAsk(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.bidPastLow = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.askPastHigh = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickAttribBidAsk { + return { + bidPastLow: isSet(object.bidPastLow) ? globalThis.Boolean(object.bidPastLow) : undefined, + askPastHigh: isSet(object.askPastHigh) ? globalThis.Boolean(object.askPastHigh) : undefined, + }; + }, + + toJSON(message: TickAttribBidAsk): unknown { + const obj: any = {}; + if (message.bidPastLow !== undefined) { + obj.bidPastLow = message.bidPastLow; + } + if (message.askPastHigh !== undefined) { + obj.askPastHigh = message.askPastHigh; + } + return obj; + }, + + create(base?: DeepPartial): TickAttribBidAsk { + return TickAttribBidAsk.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickAttribBidAsk { + const message = createBaseTickAttribBidAsk(); + message.bidPastLow = object.bidPastLow ?? undefined; + message.askPastHigh = object.askPastHigh ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickAttribLast.ts b/packages/ibkr/src/protobuf/TickAttribLast.ts new file mode 100644 index 00000000..119c795a --- /dev/null +++ b/packages/ibkr/src/protobuf/TickAttribLast.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickAttribLast.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickAttribLast { + pastLimit?: boolean | undefined; + unreported?: boolean | undefined; +} + +function createBaseTickAttribLast(): TickAttribLast { + return { pastLimit: undefined, unreported: undefined }; +} + +export const TickAttribLast: MessageFns = { + encode(message: TickAttribLast, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pastLimit !== undefined) { + writer.uint32(8).bool(message.pastLimit); + } + if (message.unreported !== undefined) { + writer.uint32(16).bool(message.unreported); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickAttribLast { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickAttribLast(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pastLimit = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.unreported = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickAttribLast { + return { + pastLimit: isSet(object.pastLimit) ? globalThis.Boolean(object.pastLimit) : undefined, + unreported: isSet(object.unreported) ? globalThis.Boolean(object.unreported) : undefined, + }; + }, + + toJSON(message: TickAttribLast): unknown { + const obj: any = {}; + if (message.pastLimit !== undefined) { + obj.pastLimit = message.pastLimit; + } + if (message.unreported !== undefined) { + obj.unreported = message.unreported; + } + return obj; + }, + + create(base?: DeepPartial): TickAttribLast { + return TickAttribLast.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickAttribLast { + const message = createBaseTickAttribLast(); + message.pastLimit = object.pastLimit ?? undefined; + message.unreported = object.unreported ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickByTickData.ts b/packages/ibkr/src/protobuf/TickByTickData.ts new file mode 100644 index 00000000..579b50a6 --- /dev/null +++ b/packages/ibkr/src/protobuf/TickByTickData.ts @@ -0,0 +1,185 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickByTickData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { HistoricalTick } from "./HistoricalTick"; +import { HistoricalTickBidAsk } from "./HistoricalTickBidAsk"; +import { HistoricalTickLast } from "./HistoricalTickLast"; + +export const protobufPackage = "protobuf"; + +export interface TickByTickData { + reqId?: number | undefined; + tickType?: number | undefined; + historicalTickLast?: HistoricalTickLast | undefined; + historicalTickBidAsk?: HistoricalTickBidAsk | undefined; + historicalTickMidPoint?: HistoricalTick | undefined; +} + +function createBaseTickByTickData(): TickByTickData { + return { + reqId: undefined, + tickType: undefined, + historicalTickLast: undefined, + historicalTickBidAsk: undefined, + historicalTickMidPoint: undefined, + }; +} + +export const TickByTickData: MessageFns = { + encode(message: TickByTickData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.tickType !== undefined) { + writer.uint32(16).int32(message.tickType); + } + if (message.historicalTickLast !== undefined) { + HistoricalTickLast.encode(message.historicalTickLast, writer.uint32(26).fork()).join(); + } + if (message.historicalTickBidAsk !== undefined) { + HistoricalTickBidAsk.encode(message.historicalTickBidAsk, writer.uint32(34).fork()).join(); + } + if (message.historicalTickMidPoint !== undefined) { + HistoricalTick.encode(message.historicalTickMidPoint, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickByTickData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickByTickData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.tickType = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.historicalTickLast = HistoricalTickLast.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.historicalTickBidAsk = HistoricalTickBidAsk.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.historicalTickMidPoint = HistoricalTick.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickByTickData { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + tickType: isSet(object.tickType) ? globalThis.Number(object.tickType) : undefined, + historicalTickLast: isSet(object.historicalTickLast) + ? HistoricalTickLast.fromJSON(object.historicalTickLast) + : undefined, + historicalTickBidAsk: isSet(object.historicalTickBidAsk) + ? HistoricalTickBidAsk.fromJSON(object.historicalTickBidAsk) + : undefined, + historicalTickMidPoint: isSet(object.historicalTickMidPoint) + ? HistoricalTick.fromJSON(object.historicalTickMidPoint) + : undefined, + }; + }, + + toJSON(message: TickByTickData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.tickType !== undefined) { + obj.tickType = Math.round(message.tickType); + } + if (message.historicalTickLast !== undefined) { + obj.historicalTickLast = HistoricalTickLast.toJSON(message.historicalTickLast); + } + if (message.historicalTickBidAsk !== undefined) { + obj.historicalTickBidAsk = HistoricalTickBidAsk.toJSON(message.historicalTickBidAsk); + } + if (message.historicalTickMidPoint !== undefined) { + obj.historicalTickMidPoint = HistoricalTick.toJSON(message.historicalTickMidPoint); + } + return obj; + }, + + create(base?: DeepPartial): TickByTickData { + return TickByTickData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickByTickData { + const message = createBaseTickByTickData(); + message.reqId = object.reqId ?? undefined; + message.tickType = object.tickType ?? undefined; + message.historicalTickLast = (object.historicalTickLast !== undefined && object.historicalTickLast !== null) + ? HistoricalTickLast.fromPartial(object.historicalTickLast) + : undefined; + message.historicalTickBidAsk = (object.historicalTickBidAsk !== undefined && object.historicalTickBidAsk !== null) + ? HistoricalTickBidAsk.fromPartial(object.historicalTickBidAsk) + : undefined; + message.historicalTickMidPoint = + (object.historicalTickMidPoint !== undefined && object.historicalTickMidPoint !== null) + ? HistoricalTick.fromPartial(object.historicalTickMidPoint) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickByTickRequest.ts b/packages/ibkr/src/protobuf/TickByTickRequest.ts new file mode 100644 index 00000000..d3bb45ec --- /dev/null +++ b/packages/ibkr/src/protobuf/TickByTickRequest.ts @@ -0,0 +1,172 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickByTickRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Contract } from "./Contract"; + +export const protobufPackage = "protobuf"; + +export interface TickByTickRequest { + reqId?: number | undefined; + contract?: Contract | undefined; + tickType?: string | undefined; + numberOfTicks?: number | undefined; + ignoreSize?: boolean | undefined; +} + +function createBaseTickByTickRequest(): TickByTickRequest { + return { + reqId: undefined, + contract: undefined, + tickType: undefined, + numberOfTicks: undefined, + ignoreSize: undefined, + }; +} + +export const TickByTickRequest: MessageFns = { + encode(message: TickByTickRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contract !== undefined) { + Contract.encode(message.contract, writer.uint32(18).fork()).join(); + } + if (message.tickType !== undefined) { + writer.uint32(26).string(message.tickType); + } + if (message.numberOfTicks !== undefined) { + writer.uint32(32).int32(message.numberOfTicks); + } + if (message.ignoreSize !== undefined) { + writer.uint32(40).bool(message.ignoreSize); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickByTickRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickByTickRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contract = Contract.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.tickType = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.numberOfTicks = reader.int32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.ignoreSize = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickByTickRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contract: isSet(object.contract) ? Contract.fromJSON(object.contract) : undefined, + tickType: isSet(object.tickType) ? globalThis.String(object.tickType) : undefined, + numberOfTicks: isSet(object.numberOfTicks) ? globalThis.Number(object.numberOfTicks) : undefined, + ignoreSize: isSet(object.ignoreSize) ? globalThis.Boolean(object.ignoreSize) : undefined, + }; + }, + + toJSON(message: TickByTickRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contract !== undefined) { + obj.contract = Contract.toJSON(message.contract); + } + if (message.tickType !== undefined) { + obj.tickType = message.tickType; + } + if (message.numberOfTicks !== undefined) { + obj.numberOfTicks = Math.round(message.numberOfTicks); + } + if (message.ignoreSize !== undefined) { + obj.ignoreSize = message.ignoreSize; + } + return obj; + }, + + create(base?: DeepPartial): TickByTickRequest { + return TickByTickRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickByTickRequest { + const message = createBaseTickByTickRequest(); + message.reqId = object.reqId ?? undefined; + message.contract = (object.contract !== undefined && object.contract !== null) + ? Contract.fromPartial(object.contract) + : undefined; + message.tickType = object.tickType ?? undefined; + message.numberOfTicks = object.numberOfTicks ?? undefined; + message.ignoreSize = object.ignoreSize ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickGeneric.ts b/packages/ibkr/src/protobuf/TickGeneric.ts new file mode 100644 index 00000000..28832bd4 --- /dev/null +++ b/packages/ibkr/src/protobuf/TickGeneric.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickGeneric.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickGeneric { + reqId?: number | undefined; + tickType?: number | undefined; + value?: number | undefined; +} + +function createBaseTickGeneric(): TickGeneric { + return { reqId: undefined, tickType: undefined, value: undefined }; +} + +export const TickGeneric: MessageFns = { + encode(message: TickGeneric, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.tickType !== undefined) { + writer.uint32(16).int32(message.tickType); + } + if (message.value !== undefined) { + writer.uint32(25).double(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickGeneric { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickGeneric(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.tickType = reader.int32(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.value = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickGeneric { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + tickType: isSet(object.tickType) ? globalThis.Number(object.tickType) : undefined, + value: isSet(object.value) ? globalThis.Number(object.value) : undefined, + }; + }, + + toJSON(message: TickGeneric): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.tickType !== undefined) { + obj.tickType = Math.round(message.tickType); + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): TickGeneric { + return TickGeneric.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickGeneric { + const message = createBaseTickGeneric(); + message.reqId = object.reqId ?? undefined; + message.tickType = object.tickType ?? undefined; + message.value = object.value ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickNews.ts b/packages/ibkr/src/protobuf/TickNews.ts new file mode 100644 index 00000000..473668aa --- /dev/null +++ b/packages/ibkr/src/protobuf/TickNews.ts @@ -0,0 +1,198 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickNews.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickNews { + reqId?: number | undefined; + timestamp?: number | undefined; + providerCode?: string | undefined; + articleId?: string | undefined; + headline?: string | undefined; + extraData?: string | undefined; +} + +function createBaseTickNews(): TickNews { + return { + reqId: undefined, + timestamp: undefined, + providerCode: undefined, + articleId: undefined, + headline: undefined, + extraData: undefined, + }; +} + +export const TickNews: MessageFns = { + encode(message: TickNews, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.timestamp !== undefined) { + writer.uint32(16).int64(message.timestamp); + } + if (message.providerCode !== undefined) { + writer.uint32(26).string(message.providerCode); + } + if (message.articleId !== undefined) { + writer.uint32(34).string(message.articleId); + } + if (message.headline !== undefined) { + writer.uint32(42).string(message.headline); + } + if (message.extraData !== undefined) { + writer.uint32(50).string(message.extraData); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickNews { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickNews(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.timestamp = longToNumber(reader.int64()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.providerCode = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.articleId = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.headline = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.extraData = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickNews { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + timestamp: isSet(object.timestamp) ? globalThis.Number(object.timestamp) : undefined, + providerCode: isSet(object.providerCode) ? globalThis.String(object.providerCode) : undefined, + articleId: isSet(object.articleId) ? globalThis.String(object.articleId) : undefined, + headline: isSet(object.headline) ? globalThis.String(object.headline) : undefined, + extraData: isSet(object.extraData) ? globalThis.String(object.extraData) : undefined, + }; + }, + + toJSON(message: TickNews): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.timestamp !== undefined) { + obj.timestamp = Math.round(message.timestamp); + } + if (message.providerCode !== undefined) { + obj.providerCode = message.providerCode; + } + if (message.articleId !== undefined) { + obj.articleId = message.articleId; + } + if (message.headline !== undefined) { + obj.headline = message.headline; + } + if (message.extraData !== undefined) { + obj.extraData = message.extraData; + } + return obj; + }, + + create(base?: DeepPartial): TickNews { + return TickNews.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickNews { + const message = createBaseTickNews(); + message.reqId = object.reqId ?? undefined; + message.timestamp = object.timestamp ?? undefined; + message.providerCode = object.providerCode ?? undefined; + message.articleId = object.articleId ?? undefined; + message.headline = object.headline ?? undefined; + message.extraData = object.extraData ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + 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: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickOptionComputation.ts b/packages/ibkr/src/protobuf/TickOptionComputation.ts new file mode 100644 index 00000000..db5d9715 --- /dev/null +++ b/packages/ibkr/src/protobuf/TickOptionComputation.ts @@ -0,0 +1,277 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickOptionComputation.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickOptionComputation { + reqId?: number | undefined; + tickType?: number | undefined; + tickAttrib?: number | undefined; + impliedVol?: number | undefined; + delta?: number | undefined; + optPrice?: number | undefined; + pvDividend?: number | undefined; + gamma?: number | undefined; + vega?: number | undefined; + theta?: number | undefined; + undPrice?: number | undefined; +} + +function createBaseTickOptionComputation(): TickOptionComputation { + return { + reqId: undefined, + tickType: undefined, + tickAttrib: undefined, + impliedVol: undefined, + delta: undefined, + optPrice: undefined, + pvDividend: undefined, + gamma: undefined, + vega: undefined, + theta: undefined, + undPrice: undefined, + }; +} + +export const TickOptionComputation: MessageFns = { + encode(message: TickOptionComputation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.tickType !== undefined) { + writer.uint32(16).int32(message.tickType); + } + if (message.tickAttrib !== undefined) { + writer.uint32(24).int32(message.tickAttrib); + } + if (message.impliedVol !== undefined) { + writer.uint32(33).double(message.impliedVol); + } + if (message.delta !== undefined) { + writer.uint32(41).double(message.delta); + } + if (message.optPrice !== undefined) { + writer.uint32(49).double(message.optPrice); + } + if (message.pvDividend !== undefined) { + writer.uint32(57).double(message.pvDividend); + } + if (message.gamma !== undefined) { + writer.uint32(65).double(message.gamma); + } + if (message.vega !== undefined) { + writer.uint32(73).double(message.vega); + } + if (message.theta !== undefined) { + writer.uint32(81).double(message.theta); + } + if (message.undPrice !== undefined) { + writer.uint32(89).double(message.undPrice); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickOptionComputation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickOptionComputation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.tickType = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.tickAttrib = reader.int32(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.impliedVol = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.delta = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.optPrice = reader.double(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.pvDividend = reader.double(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.gamma = reader.double(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.vega = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.theta = reader.double(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.undPrice = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickOptionComputation { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + tickType: isSet(object.tickType) ? globalThis.Number(object.tickType) : undefined, + tickAttrib: isSet(object.tickAttrib) ? globalThis.Number(object.tickAttrib) : undefined, + impliedVol: isSet(object.impliedVol) ? globalThis.Number(object.impliedVol) : undefined, + delta: isSet(object.delta) ? globalThis.Number(object.delta) : undefined, + optPrice: isSet(object.optPrice) ? globalThis.Number(object.optPrice) : undefined, + pvDividend: isSet(object.pvDividend) ? globalThis.Number(object.pvDividend) : undefined, + gamma: isSet(object.gamma) ? globalThis.Number(object.gamma) : undefined, + vega: isSet(object.vega) ? globalThis.Number(object.vega) : undefined, + theta: isSet(object.theta) ? globalThis.Number(object.theta) : undefined, + undPrice: isSet(object.undPrice) ? globalThis.Number(object.undPrice) : undefined, + }; + }, + + toJSON(message: TickOptionComputation): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.tickType !== undefined) { + obj.tickType = Math.round(message.tickType); + } + if (message.tickAttrib !== undefined) { + obj.tickAttrib = Math.round(message.tickAttrib); + } + if (message.impliedVol !== undefined) { + obj.impliedVol = message.impliedVol; + } + if (message.delta !== undefined) { + obj.delta = message.delta; + } + if (message.optPrice !== undefined) { + obj.optPrice = message.optPrice; + } + if (message.pvDividend !== undefined) { + obj.pvDividend = message.pvDividend; + } + if (message.gamma !== undefined) { + obj.gamma = message.gamma; + } + if (message.vega !== undefined) { + obj.vega = message.vega; + } + if (message.theta !== undefined) { + obj.theta = message.theta; + } + if (message.undPrice !== undefined) { + obj.undPrice = message.undPrice; + } + return obj; + }, + + create(base?: DeepPartial): TickOptionComputation { + return TickOptionComputation.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickOptionComputation { + const message = createBaseTickOptionComputation(); + message.reqId = object.reqId ?? undefined; + message.tickType = object.tickType ?? undefined; + message.tickAttrib = object.tickAttrib ?? undefined; + message.impliedVol = object.impliedVol ?? undefined; + message.delta = object.delta ?? undefined; + message.optPrice = object.optPrice ?? undefined; + message.pvDividend = object.pvDividend ?? undefined; + message.gamma = object.gamma ?? undefined; + message.vega = object.vega ?? undefined; + message.theta = object.theta ?? undefined; + message.undPrice = object.undPrice ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickPrice.ts b/packages/ibkr/src/protobuf/TickPrice.ts new file mode 100644 index 00000000..46067cbc --- /dev/null +++ b/packages/ibkr/src/protobuf/TickPrice.ts @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickPrice.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickPrice { + reqId?: number | undefined; + tickType?: number | undefined; + price?: number | undefined; + size?: string | undefined; + attrMask?: number | undefined; +} + +function createBaseTickPrice(): TickPrice { + return { reqId: undefined, tickType: undefined, price: undefined, size: undefined, attrMask: undefined }; +} + +export const TickPrice: MessageFns = { + encode(message: TickPrice, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.tickType !== undefined) { + writer.uint32(16).int32(message.tickType); + } + if (message.price !== undefined) { + writer.uint32(25).double(message.price); + } + if (message.size !== undefined) { + writer.uint32(34).string(message.size); + } + if (message.attrMask !== undefined) { + writer.uint32(40).int32(message.attrMask); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickPrice { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickPrice(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.tickType = reader.int32(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.price = reader.double(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.size = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.attrMask = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickPrice { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + tickType: isSet(object.tickType) ? globalThis.Number(object.tickType) : undefined, + price: isSet(object.price) ? globalThis.Number(object.price) : undefined, + size: isSet(object.size) ? globalThis.String(object.size) : undefined, + attrMask: isSet(object.attrMask) ? globalThis.Number(object.attrMask) : undefined, + }; + }, + + toJSON(message: TickPrice): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.tickType !== undefined) { + obj.tickType = Math.round(message.tickType); + } + if (message.price !== undefined) { + obj.price = message.price; + } + if (message.size !== undefined) { + obj.size = message.size; + } + if (message.attrMask !== undefined) { + obj.attrMask = Math.round(message.attrMask); + } + return obj; + }, + + create(base?: DeepPartial): TickPrice { + return TickPrice.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickPrice { + const message = createBaseTickPrice(); + message.reqId = object.reqId ?? undefined; + message.tickType = object.tickType ?? undefined; + message.price = object.price ?? undefined; + message.size = object.size ?? undefined; + message.attrMask = object.attrMask ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickReqParams.ts b/packages/ibkr/src/protobuf/TickReqParams.ts new file mode 100644 index 00000000..1475a181 --- /dev/null +++ b/packages/ibkr/src/protobuf/TickReqParams.ts @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickReqParams.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickReqParams { + reqId?: number | undefined; + minTick?: string | undefined; + bboExchange?: string | undefined; + snapshotPermissions?: number | undefined; + lastPricePrecision?: string | undefined; + lastSizePrecision?: string | undefined; +} + +function createBaseTickReqParams(): TickReqParams { + return { + reqId: undefined, + minTick: undefined, + bboExchange: undefined, + snapshotPermissions: undefined, + lastPricePrecision: undefined, + lastSizePrecision: undefined, + }; +} + +export const TickReqParams: MessageFns = { + encode(message: TickReqParams, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.minTick !== undefined) { + writer.uint32(18).string(message.minTick); + } + if (message.bboExchange !== undefined) { + writer.uint32(26).string(message.bboExchange); + } + if (message.snapshotPermissions !== undefined) { + writer.uint32(32).int32(message.snapshotPermissions); + } + if (message.lastPricePrecision !== undefined) { + writer.uint32(42).string(message.lastPricePrecision); + } + if (message.lastSizePrecision !== undefined) { + writer.uint32(50).string(message.lastSizePrecision); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickReqParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickReqParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.minTick = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.bboExchange = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.snapshotPermissions = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.lastPricePrecision = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.lastSizePrecision = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickReqParams { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + minTick: isSet(object.minTick) ? globalThis.String(object.minTick) : undefined, + bboExchange: isSet(object.bboExchange) ? globalThis.String(object.bboExchange) : undefined, + snapshotPermissions: isSet(object.snapshotPermissions) + ? globalThis.Number(object.snapshotPermissions) + : undefined, + lastPricePrecision: isSet(object.lastPricePrecision) ? globalThis.String(object.lastPricePrecision) : undefined, + lastSizePrecision: isSet(object.lastSizePrecision) ? globalThis.String(object.lastSizePrecision) : undefined, + }; + }, + + toJSON(message: TickReqParams): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.minTick !== undefined) { + obj.minTick = message.minTick; + } + if (message.bboExchange !== undefined) { + obj.bboExchange = message.bboExchange; + } + if (message.snapshotPermissions !== undefined) { + obj.snapshotPermissions = Math.round(message.snapshotPermissions); + } + if (message.lastPricePrecision !== undefined) { + obj.lastPricePrecision = message.lastPricePrecision; + } + if (message.lastSizePrecision !== undefined) { + obj.lastSizePrecision = message.lastSizePrecision; + } + return obj; + }, + + create(base?: DeepPartial): TickReqParams { + return TickReqParams.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickReqParams { + const message = createBaseTickReqParams(); + message.reqId = object.reqId ?? undefined; + message.minTick = object.minTick ?? undefined; + message.bboExchange = object.bboExchange ?? undefined; + message.snapshotPermissions = object.snapshotPermissions ?? undefined; + message.lastPricePrecision = object.lastPricePrecision ?? undefined; + message.lastSizePrecision = object.lastSizePrecision ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickSize.ts b/packages/ibkr/src/protobuf/TickSize.ts new file mode 100644 index 00000000..17b1e6d5 --- /dev/null +++ b/packages/ibkr/src/protobuf/TickSize.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickSize.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickSize { + reqId?: number | undefined; + tickType?: number | undefined; + size?: string | undefined; +} + +function createBaseTickSize(): TickSize { + return { reqId: undefined, tickType: undefined, size: undefined }; +} + +export const TickSize: MessageFns = { + encode(message: TickSize, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.tickType !== undefined) { + writer.uint32(16).int32(message.tickType); + } + if (message.size !== undefined) { + writer.uint32(26).string(message.size); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickSize { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickSize(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.tickType = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.size = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickSize { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + tickType: isSet(object.tickType) ? globalThis.Number(object.tickType) : undefined, + size: isSet(object.size) ? globalThis.String(object.size) : undefined, + }; + }, + + toJSON(message: TickSize): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.tickType !== undefined) { + obj.tickType = Math.round(message.tickType); + } + if (message.size !== undefined) { + obj.size = message.size; + } + return obj; + }, + + create(base?: DeepPartial): TickSize { + return TickSize.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickSize { + const message = createBaseTickSize(); + message.reqId = object.reqId ?? undefined; + message.tickType = object.tickType ?? undefined; + message.size = object.size ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickSnapshotEnd.ts b/packages/ibkr/src/protobuf/TickSnapshotEnd.ts new file mode 100644 index 00000000..034a7b9e --- /dev/null +++ b/packages/ibkr/src/protobuf/TickSnapshotEnd.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickSnapshotEnd.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickSnapshotEnd { + reqId?: number | undefined; +} + +function createBaseTickSnapshotEnd(): TickSnapshotEnd { + return { reqId: undefined }; +} + +export const TickSnapshotEnd: MessageFns = { + encode(message: TickSnapshotEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickSnapshotEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickSnapshotEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickSnapshotEnd { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: TickSnapshotEnd): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): TickSnapshotEnd { + return TickSnapshotEnd.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickSnapshotEnd { + const message = createBaseTickSnapshotEnd(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/TickString.ts b/packages/ibkr/src/protobuf/TickString.ts new file mode 100644 index 00000000..f5a76eaa --- /dev/null +++ b/packages/ibkr/src/protobuf/TickString.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: TickString.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface TickString { + reqId?: number | undefined; + tickType?: number | undefined; + value?: string | undefined; +} + +function createBaseTickString(): TickString { + return { reqId: undefined, tickType: undefined, value: undefined }; +} + +export const TickString: MessageFns = { + encode(message: TickString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.tickType !== undefined) { + writer.uint32(16).int32(message.tickType); + } + if (message.value !== undefined) { + writer.uint32(26).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TickString { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTickString(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.tickType = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TickString { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + tickType: isSet(object.tickType) ? globalThis.Number(object.tickType) : undefined, + value: isSet(object.value) ? globalThis.String(object.value) : undefined, + }; + }, + + toJSON(message: TickString): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.tickType !== undefined) { + obj.tickType = Math.round(message.tickType); + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): TickString { + return TickString.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TickString { + const message = createBaseTickString(); + message.reqId = object.reqId ?? undefined; + message.tickType = object.tickType ?? undefined; + message.value = object.value ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/UnsubscribeFromGroupEventsRequest.ts b/packages/ibkr/src/protobuf/UnsubscribeFromGroupEventsRequest.ts new file mode 100644 index 00000000..f6c587a2 --- /dev/null +++ b/packages/ibkr/src/protobuf/UnsubscribeFromGroupEventsRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: UnsubscribeFromGroupEventsRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface UnsubscribeFromGroupEventsRequest { + reqId?: number | undefined; +} + +function createBaseUnsubscribeFromGroupEventsRequest(): UnsubscribeFromGroupEventsRequest { + return { reqId: undefined }; +} + +export const UnsubscribeFromGroupEventsRequest: MessageFns = { + encode(message: UnsubscribeFromGroupEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UnsubscribeFromGroupEventsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnsubscribeFromGroupEventsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UnsubscribeFromGroupEventsRequest { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: UnsubscribeFromGroupEventsRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): UnsubscribeFromGroupEventsRequest { + return UnsubscribeFromGroupEventsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UnsubscribeFromGroupEventsRequest { + const message = createBaseUnsubscribeFromGroupEventsRequest(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/UpdateConfigRequest.ts b/packages/ibkr/src/protobuf/UpdateConfigRequest.ts new file mode 100644 index 00000000..38b7696c --- /dev/null +++ b/packages/ibkr/src/protobuf/UpdateConfigRequest.ts @@ -0,0 +1,220 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: UpdateConfigRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { ApiConfig } from "./ApiConfig"; +import { LockAndExitConfig } from "./LockAndExitConfig"; +import { MessageConfig } from "./MessageConfig"; +import { OrdersConfig } from "./OrdersConfig"; +import { UpdateConfigWarning } from "./UpdateConfigWarning"; + +export const protobufPackage = "protobuf"; + +export interface UpdateConfigRequest { + reqId?: number | undefined; + lockAndExit?: LockAndExitConfig | undefined; + messages: MessageConfig[]; + api?: ApiConfig | undefined; + orders?: OrdersConfig | undefined; + acceptedWarnings: UpdateConfigWarning[]; + resetAPIOrderSequence?: boolean | undefined; +} + +function createBaseUpdateConfigRequest(): UpdateConfigRequest { + return { + reqId: undefined, + lockAndExit: undefined, + messages: [], + api: undefined, + orders: undefined, + acceptedWarnings: [], + resetAPIOrderSequence: undefined, + }; +} + +export const UpdateConfigRequest: MessageFns = { + encode(message: UpdateConfigRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.lockAndExit !== undefined) { + LockAndExitConfig.encode(message.lockAndExit, writer.uint32(18).fork()).join(); + } + for (const v of message.messages) { + MessageConfig.encode(v!, writer.uint32(26).fork()).join(); + } + if (message.api !== undefined) { + ApiConfig.encode(message.api, writer.uint32(34).fork()).join(); + } + if (message.orders !== undefined) { + OrdersConfig.encode(message.orders, writer.uint32(42).fork()).join(); + } + for (const v of message.acceptedWarnings) { + UpdateConfigWarning.encode(v!, writer.uint32(50).fork()).join(); + } + if (message.resetAPIOrderSequence !== undefined) { + writer.uint32(56).bool(message.resetAPIOrderSequence); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.lockAndExit = LockAndExitConfig.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.messages.push(MessageConfig.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.api = ApiConfig.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.orders = OrdersConfig.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.acceptedWarnings.push(UpdateConfigWarning.decode(reader, reader.uint32())); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.resetAPIOrderSequence = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateConfigRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + lockAndExit: isSet(object.lockAndExit) ? LockAndExitConfig.fromJSON(object.lockAndExit) : undefined, + messages: globalThis.Array.isArray(object?.messages) + ? object.messages.map((e: any) => MessageConfig.fromJSON(e)) + : [], + api: isSet(object.api) ? ApiConfig.fromJSON(object.api) : undefined, + orders: isSet(object.orders) ? OrdersConfig.fromJSON(object.orders) : undefined, + acceptedWarnings: globalThis.Array.isArray(object?.acceptedWarnings) + ? object.acceptedWarnings.map((e: any) => UpdateConfigWarning.fromJSON(e)) + : [], + resetAPIOrderSequence: isSet(object.resetAPIOrderSequence) + ? globalThis.Boolean(object.resetAPIOrderSequence) + : undefined, + }; + }, + + toJSON(message: UpdateConfigRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.lockAndExit !== undefined) { + obj.lockAndExit = LockAndExitConfig.toJSON(message.lockAndExit); + } + if (message.messages?.length) { + obj.messages = message.messages.map((e) => MessageConfig.toJSON(e)); + } + if (message.api !== undefined) { + obj.api = ApiConfig.toJSON(message.api); + } + if (message.orders !== undefined) { + obj.orders = OrdersConfig.toJSON(message.orders); + } + if (message.acceptedWarnings?.length) { + obj.acceptedWarnings = message.acceptedWarnings.map((e) => UpdateConfigWarning.toJSON(e)); + } + if (message.resetAPIOrderSequence !== undefined) { + obj.resetAPIOrderSequence = message.resetAPIOrderSequence; + } + return obj; + }, + + create(base?: DeepPartial): UpdateConfigRequest { + return UpdateConfigRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateConfigRequest { + const message = createBaseUpdateConfigRequest(); + message.reqId = object.reqId ?? undefined; + message.lockAndExit = (object.lockAndExit !== undefined && object.lockAndExit !== null) + ? LockAndExitConfig.fromPartial(object.lockAndExit) + : undefined; + message.messages = object.messages?.map((e) => MessageConfig.fromPartial(e)) || []; + message.api = (object.api !== undefined && object.api !== null) ? ApiConfig.fromPartial(object.api) : undefined; + message.orders = (object.orders !== undefined && object.orders !== null) + ? OrdersConfig.fromPartial(object.orders) + : undefined; + message.acceptedWarnings = object.acceptedWarnings?.map((e) => UpdateConfigWarning.fromPartial(e)) || []; + message.resetAPIOrderSequence = object.resetAPIOrderSequence ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/UpdateConfigResponse.ts b/packages/ibkr/src/protobuf/UpdateConfigResponse.ts new file mode 100644 index 00000000..6ce1fb48 --- /dev/null +++ b/packages/ibkr/src/protobuf/UpdateConfigResponse.ts @@ -0,0 +1,185 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: UpdateConfigResponse.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { UpdateConfigWarning } from "./UpdateConfigWarning"; + +export const protobufPackage = "protobuf"; + +export interface UpdateConfigResponse { + reqId?: number | undefined; + status?: string | undefined; + message?: string | undefined; + changedFields: string[]; + errors: string[]; + warnings: UpdateConfigWarning[]; +} + +function createBaseUpdateConfigResponse(): UpdateConfigResponse { + return { reqId: undefined, status: undefined, message: undefined, changedFields: [], errors: [], warnings: [] }; +} + +export const UpdateConfigResponse: MessageFns = { + encode(message: UpdateConfigResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.status !== undefined) { + writer.uint32(18).string(message.status); + } + if (message.message !== undefined) { + writer.uint32(26).string(message.message); + } + for (const v of message.changedFields) { + writer.uint32(34).string(v!); + } + for (const v of message.errors) { + writer.uint32(42).string(v!); + } + for (const v of message.warnings) { + UpdateConfigWarning.encode(v!, writer.uint32(50).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.status = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.message = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.changedFields.push(reader.string()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.errors.push(reader.string()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.warnings.push(UpdateConfigWarning.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateConfigResponse { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + status: isSet(object.status) ? globalThis.String(object.status) : undefined, + message: isSet(object.message) ? globalThis.String(object.message) : undefined, + changedFields: globalThis.Array.isArray(object?.changedFields) + ? object.changedFields.map((e: any) => globalThis.String(e)) + : [], + errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => globalThis.String(e)) : [], + warnings: globalThis.Array.isArray(object?.warnings) + ? object.warnings.map((e: any) => UpdateConfigWarning.fromJSON(e)) + : [], + }; + }, + + toJSON(message: UpdateConfigResponse): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.status !== undefined) { + obj.status = message.status; + } + if (message.message !== undefined) { + obj.message = message.message; + } + if (message.changedFields?.length) { + obj.changedFields = message.changedFields; + } + if (message.errors?.length) { + obj.errors = message.errors; + } + if (message.warnings?.length) { + obj.warnings = message.warnings.map((e) => UpdateConfigWarning.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): UpdateConfigResponse { + return UpdateConfigResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateConfigResponse { + const message = createBaseUpdateConfigResponse(); + message.reqId = object.reqId ?? undefined; + message.status = object.status ?? undefined; + message.message = object.message ?? undefined; + message.changedFields = object.changedFields?.map((e) => e) || []; + message.errors = object.errors?.map((e) => e) || []; + message.warnings = object.warnings?.map((e) => UpdateConfigWarning.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/UpdateConfigWarning.ts b/packages/ibkr/src/protobuf/UpdateConfigWarning.ts new file mode 100644 index 00000000..8cf9a989 --- /dev/null +++ b/packages/ibkr/src/protobuf/UpdateConfigWarning.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: UpdateConfigWarning.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface UpdateConfigWarning { + messageId?: number | undefined; + title?: string | undefined; + message?: string | undefined; +} + +function createBaseUpdateConfigWarning(): UpdateConfigWarning { + return { messageId: undefined, title: undefined, message: undefined }; +} + +export const UpdateConfigWarning: MessageFns = { + encode(message: UpdateConfigWarning, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.messageId !== undefined) { + writer.uint32(8).int32(message.messageId); + } + if (message.title !== undefined) { + writer.uint32(18).string(message.title); + } + if (message.message !== undefined) { + writer.uint32(26).string(message.message); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateConfigWarning { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateConfigWarning(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.messageId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.title = 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: any): UpdateConfigWarning { + return { + messageId: isSet(object.messageId) ? globalThis.Number(object.messageId) : undefined, + title: isSet(object.title) ? globalThis.String(object.title) : undefined, + message: isSet(object.message) ? globalThis.String(object.message) : undefined, + }; + }, + + toJSON(message: UpdateConfigWarning): unknown { + const obj: any = {}; + if (message.messageId !== undefined) { + obj.messageId = Math.round(message.messageId); + } + if (message.title !== undefined) { + obj.title = message.title; + } + if (message.message !== undefined) { + obj.message = message.message; + } + return obj; + }, + + create(base?: DeepPartial): UpdateConfigWarning { + return UpdateConfigWarning.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateConfigWarning { + const message = createBaseUpdateConfigWarning(); + message.messageId = object.messageId ?? undefined; + message.title = object.title ?? undefined; + message.message = object.message ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/UpdateDisplayGroupRequest.ts b/packages/ibkr/src/protobuf/UpdateDisplayGroupRequest.ts new file mode 100644 index 00000000..3765321f --- /dev/null +++ b/packages/ibkr/src/protobuf/UpdateDisplayGroupRequest.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: UpdateDisplayGroupRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface UpdateDisplayGroupRequest { + reqId?: number | undefined; + contractInfo?: string | undefined; +} + +function createBaseUpdateDisplayGroupRequest(): UpdateDisplayGroupRequest { + return { reqId: undefined, contractInfo: undefined }; +} + +export const UpdateDisplayGroupRequest: MessageFns = { + encode(message: UpdateDisplayGroupRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.contractInfo !== undefined) { + writer.uint32(18).string(message.contractInfo); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateDisplayGroupRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateDisplayGroupRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.contractInfo = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateDisplayGroupRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + contractInfo: isSet(object.contractInfo) ? globalThis.String(object.contractInfo) : undefined, + }; + }, + + toJSON(message: UpdateDisplayGroupRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.contractInfo !== undefined) { + obj.contractInfo = message.contractInfo; + } + return obj; + }, + + create(base?: DeepPartial): UpdateDisplayGroupRequest { + return UpdateDisplayGroupRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateDisplayGroupRequest { + const message = createBaseUpdateDisplayGroupRequest(); + message.reqId = object.reqId ?? undefined; + message.contractInfo = object.contractInfo ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/UserInfo.ts b/packages/ibkr/src/protobuf/UserInfo.ts new file mode 100644 index 00000000..1c0b0973 --- /dev/null +++ b/packages/ibkr/src/protobuf/UserInfo.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: UserInfo.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface UserInfo { + reqId?: number | undefined; + whiteBrandingId?: string | undefined; +} + +function createBaseUserInfo(): UserInfo { + return { reqId: undefined, whiteBrandingId: undefined }; +} + +export const UserInfo: MessageFns = { + encode(message: UserInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.whiteBrandingId !== undefined) { + writer.uint32(18).string(message.whiteBrandingId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UserInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.whiteBrandingId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UserInfo { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + whiteBrandingId: isSet(object.whiteBrandingId) ? globalThis.String(object.whiteBrandingId) : undefined, + }; + }, + + toJSON(message: UserInfo): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.whiteBrandingId !== undefined) { + obj.whiteBrandingId = message.whiteBrandingId; + } + return obj; + }, + + create(base?: DeepPartial): UserInfo { + return UserInfo.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UserInfo { + const message = createBaseUserInfo(); + message.reqId = object.reqId ?? undefined; + message.whiteBrandingId = object.whiteBrandingId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/UserInfoRequest.ts b/packages/ibkr/src/protobuf/UserInfoRequest.ts new file mode 100644 index 00000000..205bf2e2 --- /dev/null +++ b/packages/ibkr/src/protobuf/UserInfoRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: UserInfoRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface UserInfoRequest { + reqId?: number | undefined; +} + +function createBaseUserInfoRequest(): UserInfoRequest { + return { reqId: undefined }; +} + +export const UserInfoRequest: MessageFns = { + encode(message: UserInfoRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UserInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UserInfoRequest { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: UserInfoRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): UserInfoRequest { + return UserInfoRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UserInfoRequest { + const message = createBaseUserInfoRequest(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/VerifyCompleted.ts b/packages/ibkr/src/protobuf/VerifyCompleted.ts new file mode 100644 index 00000000..a638f9b4 --- /dev/null +++ b/packages/ibkr/src/protobuf/VerifyCompleted.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: VerifyCompleted.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface VerifyCompleted { + isSuccessful?: boolean | undefined; + errorText?: string | undefined; +} + +function createBaseVerifyCompleted(): VerifyCompleted { + return { isSuccessful: undefined, errorText: undefined }; +} + +export const VerifyCompleted: MessageFns = { + encode(message: VerifyCompleted, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.isSuccessful !== undefined) { + writer.uint32(8).bool(message.isSuccessful); + } + if (message.errorText !== undefined) { + writer.uint32(18).string(message.errorText); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): VerifyCompleted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVerifyCompleted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.isSuccessful = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.errorText = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): VerifyCompleted { + return { + isSuccessful: isSet(object.isSuccessful) ? globalThis.Boolean(object.isSuccessful) : undefined, + errorText: isSet(object.errorText) ? globalThis.String(object.errorText) : undefined, + }; + }, + + toJSON(message: VerifyCompleted): unknown { + const obj: any = {}; + if (message.isSuccessful !== undefined) { + obj.isSuccessful = message.isSuccessful; + } + if (message.errorText !== undefined) { + obj.errorText = message.errorText; + } + return obj; + }, + + create(base?: DeepPartial): VerifyCompleted { + return VerifyCompleted.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): VerifyCompleted { + const message = createBaseVerifyCompleted(); + message.isSuccessful = object.isSuccessful ?? undefined; + message.errorText = object.errorText ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/VerifyMessageApi.ts b/packages/ibkr/src/protobuf/VerifyMessageApi.ts new file mode 100644 index 00000000..66c8d9ba --- /dev/null +++ b/packages/ibkr/src/protobuf/VerifyMessageApi.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: VerifyMessageApi.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface VerifyMessageApi { + apiData?: string | undefined; +} + +function createBaseVerifyMessageApi(): VerifyMessageApi { + return { apiData: undefined }; +} + +export const VerifyMessageApi: MessageFns = { + encode(message: VerifyMessageApi, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.apiData !== undefined) { + writer.uint32(10).string(message.apiData); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): VerifyMessageApi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVerifyMessageApi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.apiData = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): VerifyMessageApi { + return { apiData: isSet(object.apiData) ? globalThis.String(object.apiData) : undefined }; + }, + + toJSON(message: VerifyMessageApi): unknown { + const obj: any = {}; + if (message.apiData !== undefined) { + obj.apiData = message.apiData; + } + return obj; + }, + + create(base?: DeepPartial): VerifyMessageApi { + return VerifyMessageApi.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): VerifyMessageApi { + const message = createBaseVerifyMessageApi(); + message.apiData = object.apiData ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/VerifyMessageRequest.ts b/packages/ibkr/src/protobuf/VerifyMessageRequest.ts new file mode 100644 index 00000000..f4eaf0ff --- /dev/null +++ b/packages/ibkr/src/protobuf/VerifyMessageRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: VerifyMessageRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface VerifyMessageRequest { + apiData?: string | undefined; +} + +function createBaseVerifyMessageRequest(): VerifyMessageRequest { + return { apiData: undefined }; +} + +export const VerifyMessageRequest: MessageFns = { + encode(message: VerifyMessageRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.apiData !== undefined) { + writer.uint32(10).string(message.apiData); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): VerifyMessageRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVerifyMessageRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.apiData = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): VerifyMessageRequest { + return { apiData: isSet(object.apiData) ? globalThis.String(object.apiData) : undefined }; + }, + + toJSON(message: VerifyMessageRequest): unknown { + const obj: any = {}; + if (message.apiData !== undefined) { + obj.apiData = message.apiData; + } + return obj; + }, + + create(base?: DeepPartial): VerifyMessageRequest { + return VerifyMessageRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): VerifyMessageRequest { + const message = createBaseVerifyMessageRequest(); + message.apiData = object.apiData ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/VerifyRequest.ts b/packages/ibkr/src/protobuf/VerifyRequest.ts new file mode 100644 index 00000000..5e97bb95 --- /dev/null +++ b/packages/ibkr/src/protobuf/VerifyRequest.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: VerifyRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface VerifyRequest { + apiName?: string | undefined; + apiVersion?: string | undefined; +} + +function createBaseVerifyRequest(): VerifyRequest { + return { apiName: undefined, apiVersion: undefined }; +} + +export const VerifyRequest: MessageFns = { + encode(message: VerifyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.apiName !== undefined) { + writer.uint32(10).string(message.apiName); + } + if (message.apiVersion !== undefined) { + writer.uint32(18).string(message.apiVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): VerifyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVerifyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.apiName = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.apiVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): VerifyRequest { + return { + apiName: isSet(object.apiName) ? globalThis.String(object.apiName) : undefined, + apiVersion: isSet(object.apiVersion) ? globalThis.String(object.apiVersion) : undefined, + }; + }, + + toJSON(message: VerifyRequest): unknown { + const obj: any = {}; + if (message.apiName !== undefined) { + obj.apiName = message.apiName; + } + if (message.apiVersion !== undefined) { + obj.apiVersion = message.apiVersion; + } + return obj; + }, + + create(base?: DeepPartial): VerifyRequest { + return VerifyRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): VerifyRequest { + const message = createBaseVerifyRequest(); + message.apiName = object.apiName ?? undefined; + message.apiVersion = object.apiVersion ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/WshEventData.ts b/packages/ibkr/src/protobuf/WshEventData.ts new file mode 100644 index 00000000..cfa5f7f9 --- /dev/null +++ b/packages/ibkr/src/protobuf/WshEventData.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: WshEventData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface WshEventData { + reqId?: number | undefined; + dataJson?: string | undefined; +} + +function createBaseWshEventData(): WshEventData { + return { reqId: undefined, dataJson: undefined }; +} + +export const WshEventData: MessageFns = { + encode(message: WshEventData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.dataJson !== undefined) { + writer.uint32(18).string(message.dataJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): WshEventData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWshEventData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.dataJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): WshEventData { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + dataJson: isSet(object.dataJson) ? globalThis.String(object.dataJson) : undefined, + }; + }, + + toJSON(message: WshEventData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.dataJson !== undefined) { + obj.dataJson = message.dataJson; + } + return obj; + }, + + create(base?: DeepPartial): WshEventData { + return WshEventData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): WshEventData { + const message = createBaseWshEventData(); + message.reqId = object.reqId ?? undefined; + message.dataJson = object.dataJson ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/WshEventDataRequest.ts b/packages/ibkr/src/protobuf/WshEventDataRequest.ts new file mode 100644 index 00000000..73bf4284 --- /dev/null +++ b/packages/ibkr/src/protobuf/WshEventDataRequest.ts @@ -0,0 +1,241 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: WshEventDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface WshEventDataRequest { + reqId?: number | undefined; + conId?: number | undefined; + filter?: string | undefined; + fillWatchlist?: boolean | undefined; + fillPortfolio?: boolean | undefined; + fillCompetitors?: boolean | undefined; + startDate?: string | undefined; + endDate?: string | undefined; + totalLimit?: number | undefined; +} + +function createBaseWshEventDataRequest(): WshEventDataRequest { + return { + reqId: undefined, + conId: undefined, + filter: undefined, + fillWatchlist: undefined, + fillPortfolio: undefined, + fillCompetitors: undefined, + startDate: undefined, + endDate: undefined, + totalLimit: undefined, + }; +} + +export const WshEventDataRequest: MessageFns = { + encode(message: WshEventDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.conId !== undefined) { + writer.uint32(16).int32(message.conId); + } + if (message.filter !== undefined) { + writer.uint32(26).string(message.filter); + } + if (message.fillWatchlist !== undefined) { + writer.uint32(32).bool(message.fillWatchlist); + } + if (message.fillPortfolio !== undefined) { + writer.uint32(40).bool(message.fillPortfolio); + } + if (message.fillCompetitors !== undefined) { + writer.uint32(48).bool(message.fillCompetitors); + } + if (message.startDate !== undefined) { + writer.uint32(58).string(message.startDate); + } + if (message.endDate !== undefined) { + writer.uint32(66).string(message.endDate); + } + if (message.totalLimit !== undefined) { + writer.uint32(72).int32(message.totalLimit); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): WshEventDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWshEventDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.conId = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.filter = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.fillWatchlist = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.fillPortfolio = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.fillCompetitors = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.startDate = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.endDate = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.totalLimit = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): WshEventDataRequest { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined, + filter: isSet(object.filter) ? globalThis.String(object.filter) : undefined, + fillWatchlist: isSet(object.fillWatchlist) ? globalThis.Boolean(object.fillWatchlist) : undefined, + fillPortfolio: isSet(object.fillPortfolio) ? globalThis.Boolean(object.fillPortfolio) : undefined, + fillCompetitors: isSet(object.fillCompetitors) ? globalThis.Boolean(object.fillCompetitors) : undefined, + startDate: isSet(object.startDate) ? globalThis.String(object.startDate) : undefined, + endDate: isSet(object.endDate) ? globalThis.String(object.endDate) : undefined, + totalLimit: isSet(object.totalLimit) ? globalThis.Number(object.totalLimit) : undefined, + }; + }, + + toJSON(message: WshEventDataRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.conId !== undefined) { + obj.conId = Math.round(message.conId); + } + if (message.filter !== undefined) { + obj.filter = message.filter; + } + if (message.fillWatchlist !== undefined) { + obj.fillWatchlist = message.fillWatchlist; + } + if (message.fillPortfolio !== undefined) { + obj.fillPortfolio = message.fillPortfolio; + } + if (message.fillCompetitors !== undefined) { + obj.fillCompetitors = message.fillCompetitors; + } + if (message.startDate !== undefined) { + obj.startDate = message.startDate; + } + if (message.endDate !== undefined) { + obj.endDate = message.endDate; + } + if (message.totalLimit !== undefined) { + obj.totalLimit = Math.round(message.totalLimit); + } + return obj; + }, + + create(base?: DeepPartial): WshEventDataRequest { + return WshEventDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): WshEventDataRequest { + const message = createBaseWshEventDataRequest(); + message.reqId = object.reqId ?? undefined; + message.conId = object.conId ?? undefined; + message.filter = object.filter ?? undefined; + message.fillWatchlist = object.fillWatchlist ?? undefined; + message.fillPortfolio = object.fillPortfolio ?? undefined; + message.fillCompetitors = object.fillCompetitors ?? undefined; + message.startDate = object.startDate ?? undefined; + message.endDate = object.endDate ?? undefined; + message.totalLimit = object.totalLimit ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/WshMetaData.ts b/packages/ibkr/src/protobuf/WshMetaData.ts new file mode 100644 index 00000000..69307e09 --- /dev/null +++ b/packages/ibkr/src/protobuf/WshMetaData.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: WshMetaData.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface WshMetaData { + reqId?: number | undefined; + dataJson?: string | undefined; +} + +function createBaseWshMetaData(): WshMetaData { + return { reqId: undefined, dataJson: undefined }; +} + +export const WshMetaData: MessageFns = { + encode(message: WshMetaData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + if (message.dataJson !== undefined) { + writer.uint32(18).string(message.dataJson); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): WshMetaData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWshMetaData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.dataJson = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): WshMetaData { + return { + reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined, + dataJson: isSet(object.dataJson) ? globalThis.String(object.dataJson) : undefined, + }; + }, + + toJSON(message: WshMetaData): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + if (message.dataJson !== undefined) { + obj.dataJson = message.dataJson; + } + return obj; + }, + + create(base?: DeepPartial): WshMetaData { + return WshMetaData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): WshMetaData { + const message = createBaseWshMetaData(); + message.reqId = object.reqId ?? undefined; + message.dataJson = object.dataJson ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/packages/ibkr/src/protobuf/WshMetaDataRequest.ts b/packages/ibkr/src/protobuf/WshMetaDataRequest.ts new file mode 100644 index 00000000..30b8426e --- /dev/null +++ b/packages/ibkr/src/protobuf/WshMetaDataRequest.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.11.5 +// protoc v7.34.0 +// source: WshMetaDataRequest.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "protobuf"; + +export interface WshMetaDataRequest { + reqId?: number | undefined; +} + +function createBaseWshMetaDataRequest(): WshMetaDataRequest { + return { reqId: undefined }; +} + +export const WshMetaDataRequest: MessageFns = { + encode(message: WshMetaDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.reqId !== undefined) { + writer.uint32(8).int32(message.reqId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): WshMetaDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWshMetaDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.reqId = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): WshMetaDataRequest { + return { reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined }; + }, + + toJSON(message: WshMetaDataRequest): unknown { + const obj: any = {}; + if (message.reqId !== undefined) { + obj.reqId = Math.round(message.reqId); + } + return obj; + }, + + create(base?: DeepPartial): WshMetaDataRequest { + return WshMetaDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): WshMetaDataRequest { + const message = createBaseWshMetaDataRequest(); + message.reqId = object.reqId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +}