@usherlabs/cex-broker 0.2.52 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/commands/cli.js +364 -71
  2. package/dist/index.js +365 -72
  3. package/dist/index.js.map +14 -13
  4. package/package.json +5 -28
  5. package/dist/commands/cex-canonical-orderbook-export.d.ts +0 -23
  6. package/dist/commands/cex-canonical-orderbook-export.js +0 -34275
  7. package/dist/commands/cex-canonical-orderbook-export.js.map +0 -266
  8. package/dist/commands/market-data-vendor-backfill.d.ts +0 -24
  9. package/dist/commands/market-data-vendor-backfill.js +0 -34930
  10. package/dist/commands/market-data-vendor-backfill.js.map +0 -268
  11. package/dist/handlers/execute-action/context.d.ts +0 -50
  12. package/dist/handlers/execute-action/deposit.d.ts +0 -2
  13. package/dist/handlers/execute-action/handler.d.ts +0 -19
  14. package/dist/handlers/execute-action/index.d.ts +0 -10
  15. package/dist/handlers/execute-action/internal-transfer.d.ts +0 -2
  16. package/dist/handlers/execute-action/order-book-call.d.ts +0 -3
  17. package/dist/handlers/execute-action/orders.d.ts +0 -2
  18. package/dist/handlers/execute-action/pass-through.d.ts +0 -2
  19. package/dist/handlers/execute-action/perp-config.d.ts +0 -2
  20. package/dist/handlers/execute-action/registry.d.ts +0 -5
  21. package/dist/handlers/execute-action/treasury-call.d.ts +0 -2
  22. package/dist/handlers/execute-action/withdraw.d.ts +0 -2
  23. package/dist/handlers/subscribe/broker-lifecycle.d.ts +0 -13
  24. package/dist/handlers/subscribe/handler.d.ts +0 -20
  25. package/dist/handlers/subscribe/index.d.ts +0 -2
  26. package/dist/handlers/types.d.ts +0 -23
  27. package/dist/helpers/account-balance-archive-poller.d.ts +0 -19
  28. package/dist/helpers/auth.d.ts +0 -5
  29. package/dist/helpers/balance-update-archive-consumer.d.ts +0 -16
  30. package/dist/helpers/binance-user-data-normalization.d.ts +0 -3
  31. package/dist/helpers/binance-user-data-stream.d.ts +0 -58
  32. package/dist/helpers/broker-execution-archive/capture.d.ts +0 -41
  33. package/dist/helpers/broker-execution-archive/index.d.ts +0 -7
  34. package/dist/helpers/broker-execution-archive/journal-export.d.ts +0 -20
  35. package/dist/helpers/broker-execution-archive/loss-journal.d.ts +0 -36
  36. package/dist/helpers/broker-execution-archive/redact.d.ts +0 -7
  37. package/dist/helpers/broker-execution-archive/rows.d.ts +0 -134
  38. package/dist/helpers/broker-execution-archive/types.d.ts +0 -26
  39. package/dist/helpers/broker-execution-archive/withdrawal-observation-tracker.d.ts +0 -23
  40. package/dist/helpers/broker-execution-archive/writer.d.ts +0 -105
  41. package/dist/helpers/broker.d.ts +0 -38
  42. package/dist/helpers/canonical-orderbook-export/exact-selection.d.ts +0 -21
  43. package/dist/helpers/canonical-orderbook-export/exporter.d.ts +0 -26
  44. package/dist/helpers/canonical-orderbook-export/parquet-projection.d.ts +0 -19
  45. package/dist/helpers/constants.d.ts +0 -36
  46. package/dist/helpers/deposit-archive-poller.d.ts +0 -66
  47. package/dist/helpers/deposit.d.ts +0 -5
  48. package/dist/helpers/exchange-credentials.d.ts +0 -10
  49. package/dist/helpers/fill-archive-poller.d.ts +0 -42
  50. package/dist/helpers/grpc/broker.d.ts +0 -5
  51. package/dist/helpers/grpc/callbacks.d.ts +0 -9
  52. package/dist/helpers/grpc/payload.d.ts +0 -9
  53. package/dist/helpers/grpc/status.d.ts +0 -8
  54. package/dist/helpers/index.d.ts +0 -44
  55. package/dist/helpers/logger.d.ts +0 -13
  56. package/dist/helpers/market-data-archive/canonical-orderbook.d.ts +0 -20
  57. package/dist/helpers/market-data-archive/capture-context.d.ts +0 -53
  58. package/dist/helpers/market-data-archive/capture-contract.d.ts +0 -30
  59. package/dist/helpers/market-data-archive/capture.d.ts +0 -22
  60. package/dist/helpers/market-data-archive/index.d.ts +0 -13
  61. package/dist/helpers/market-data-archive/legacy-migration.d.ts +0 -37
  62. package/dist/helpers/market-data-archive/ohlcv-bar-tracker.d.ts +0 -11
  63. package/dist/helpers/market-data-archive/ohlcv-bootstrap.d.ts +0 -1
  64. package/dist/helpers/market-data-archive/ohlcv-history.d.ts +0 -8
  65. package/dist/helpers/market-data-archive/orderbook-depth.d.ts +0 -5
  66. package/dist/helpers/market-data-archive/orderbook-sampler.d.ts +0 -12
  67. package/dist/helpers/market-data-archive/parse-stream.d.ts +0 -26
  68. package/dist/helpers/market-data-archive/rows.d.ts +0 -14
  69. package/dist/helpers/market-data-archive/types.d.ts +0 -83
  70. package/dist/helpers/market-data-preparation/conformance-fixtures.d.ts +0 -128
  71. package/dist/helpers/market-data-preparation/contracts.d.ts +0 -2970
  72. package/dist/helpers/market-data-preparation/file-job.d.ts +0 -38
  73. package/dist/helpers/market-data-preparation/required-clock-qualification.d.ts +0 -43
  74. package/dist/helpers/market-data-preparation/source-tape-dependencies.d.ts +0 -19
  75. package/dist/helpers/market-data-preparation/source-tape-operation.d.ts +0 -109
  76. package/dist/helpers/market-data-source-forensics.d.ts +0 -400
  77. package/dist/helpers/market-data-vendor-backfill/archive-reader.d.ts +0 -26
  78. package/dist/helpers/market-data-vendor-backfill/batching.d.ts +0 -10
  79. package/dist/helpers/market-data-vendor-backfill/conformance-fixtures.d.ts +0 -78
  80. package/dist/helpers/market-data-vendor-backfill/contracts.d.ts +0 -358
  81. package/dist/helpers/market-data-vendor-backfill/core.d.ts +0 -101
  82. package/dist/helpers/market-data-vendor-backfill/cryptohftdata.d.ts +0 -118
  83. package/dist/helpers/market-data-vendor-backfill/forwarder-client.d.ts +0 -25
  84. package/dist/helpers/market-data-vendor-backfill/identity.d.ts +0 -10
  85. package/dist/helpers/market-data-vendor-backfill/manifests.d.ts +0 -61
  86. package/dist/helpers/market-data-vendor-backfill/promotion.d.ts +0 -10
  87. package/dist/helpers/market-data-vendor-backfill/qualification.d.ts +0 -20
  88. package/dist/helpers/market-data-vendor-backfill/selection.d.ts +0 -30
  89. package/dist/helpers/market-data-vendor-backfill/semantic-verification.d.ts +0 -25
  90. package/dist/helpers/market-type.d.ts +0 -16
  91. package/dist/helpers/order-activity-tracker.d.ts +0 -22
  92. package/dist/helpers/order-book.d.ts +0 -79
  93. package/dist/helpers/order-telemetry.d.ts +0 -50
  94. package/dist/helpers/otel.d.ts +0 -83
  95. package/dist/helpers/passive-order.d.ts +0 -8
  96. package/dist/helpers/public-market-data-feed/identity.d.ts +0 -12
  97. package/dist/helpers/public-market-data-feed/index.d.ts +0 -5
  98. package/dist/helpers/public-market-data-feed/orderbook-coalescing-evidence.d.ts +0 -79
  99. package/dist/helpers/public-market-data-feed/orderbook-profile.d.ts +0 -54
  100. package/dist/helpers/public-market-data-feed/subscriber-buffer.d.ts +0 -31
  101. package/dist/helpers/public-market-data-feed/supervisor.d.ts +0 -82
  102. package/dist/helpers/shared/errors.d.ts +0 -14
  103. package/dist/helpers/shared/guards.d.ts +0 -2
  104. package/dist/helpers/source-tape-sandbox.d.ts +0 -82
  105. package/dist/helpers/source-tape.d.ts +0 -165
  106. package/dist/helpers/stream-health-publisher.d.ts +0 -41
  107. package/dist/helpers/trace-context.d.ts +0 -8
  108. package/dist/helpers/transfer-network.d.ts +0 -12
  109. package/dist/helpers/travel-rule-deposit-reconciler.d.ts +0 -159
  110. package/dist/helpers/travel-rule.d.ts +0 -75
  111. package/dist/helpers/treasury-discovery.d.ts +0 -17
  112. package/dist/helpers/user-asset-archive-poller.d.ts +0 -19
  113. package/dist/helpers/user-data-stream-supervisor.d.ts +0 -27
  114. package/dist/helpers/verity.d.ts +0 -5
  115. package/dist/index.d.ts +0 -56
  116. package/dist/market-data-preparation/fixtures/conformance-v3.json +0 -621
  117. package/dist/market-data-preparation/policies/capability-policy.json +0 -39
  118. package/dist/market-data-preparation/policies/resource-policy.json +0 -16
  119. package/dist/market-data-preparation/policies/source-tape-capability-v1.json +0 -35
  120. package/dist/market-data-preparation/schema-manifest.json +0 -66
  121. package/dist/market-data-preparation/schemas/archive-selection-v1.schema.json +0 -224
  122. package/dist/market-data-preparation/schemas/backfill-request-v1.schema.json +0 -166
  123. package/dist/market-data-preparation/schemas/backfill-result-v2.schema.json +0 -212
  124. package/dist/market-data-preparation/schemas/canonical-orderbook-export-request-v1.schema.json +0 -61
  125. package/dist/market-data-preparation/schemas/canonical-orderbook-export-result-v2.schema.json +0 -252
  126. package/dist/market-data-preparation/schemas/order-book-depth-summary-parquet-projection-v1.schema.json +0 -256
  127. package/dist/market-data-preparation/schemas/order-book-levels-parquet-projection-v1.schema.json +0 -220
  128. package/dist/market-data-preparation/schemas/preparation-product-pin-v2.schema.json +0 -176
  129. package/dist/market-data-preparation/schemas/promotion-receipt-v1.schema.json +0 -175
  130. package/dist/market-data-preparation/schemas/required-clock-v1.schema.json +0 -47
  131. package/dist/market-data-preparation/schemas/source-forensics-ledger-v1.schema.json +0 -463
  132. package/dist/market-data-preparation/schemas/source-qualification-record-v1.schema.json +0 -394
  133. package/dist/market-data-preparation.d.ts +0 -11
  134. package/dist/market-data-preparation.js +0 -37488
  135. package/dist/market-data-preparation.js.map +0 -277
  136. package/dist/market-data-vendor-backfill.d.ts +0 -21
  137. package/dist/market-data-vendor-backfill.js +0 -22463
  138. package/dist/market-data-vendor-backfill.js.map +0 -199
  139. package/dist/proto/node.descriptor.d.ts +0 -127
  140. package/dist/proto-loader-options.d.ts +0 -7
  141. package/dist/proto-package-definition.d.ts +0 -2
  142. package/dist/schemas/action-payloads.d.ts +0 -88
  143. package/dist/server.d.ts +0 -10
  144. package/dist/types.d.ts +0 -100
@@ -1,127 +0,0 @@
1
- declare const descriptor: {
2
- readonly nested: {
3
- readonly cex_broker: {
4
- readonly nested: {
5
- readonly ActionRequest: {
6
- readonly fields: {
7
- readonly action: {
8
- readonly type: "Action";
9
- readonly id: 1;
10
- };
11
- readonly payload: {
12
- readonly keyType: "string";
13
- readonly type: "string";
14
- readonly id: 2;
15
- };
16
- readonly cex: {
17
- readonly type: "string";
18
- readonly id: 3;
19
- };
20
- readonly symbol: {
21
- readonly type: "string";
22
- readonly id: 4;
23
- };
24
- };
25
- };
26
- readonly ActionResponse: {
27
- readonly fields: {
28
- readonly result: {
29
- readonly type: "string";
30
- readonly id: 1;
31
- };
32
- readonly proof: {
33
- readonly type: "string";
34
- readonly id: 2;
35
- };
36
- };
37
- };
38
- readonly SubscribeRequest: {
39
- readonly fields: {
40
- readonly cex: {
41
- readonly type: "string";
42
- readonly id: 1;
43
- };
44
- readonly symbol: {
45
- readonly type: "string";
46
- readonly id: 2;
47
- };
48
- readonly type: {
49
- readonly type: "SubscriptionType";
50
- readonly id: 3;
51
- };
52
- readonly options: {
53
- readonly keyType: "string";
54
- readonly type: "string";
55
- readonly id: 4;
56
- };
57
- };
58
- };
59
- readonly SubscribeResponse: {
60
- readonly fields: {
61
- readonly data: {
62
- readonly type: "string";
63
- readonly id: 1;
64
- };
65
- readonly timestamp: {
66
- readonly type: "int64";
67
- readonly id: 2;
68
- };
69
- readonly symbol: {
70
- readonly type: "string";
71
- readonly id: 3;
72
- };
73
- readonly type: {
74
- readonly type: "SubscriptionType";
75
- readonly id: 4;
76
- };
77
- };
78
- };
79
- readonly SubscriptionType: {
80
- readonly values: {
81
- readonly NO_ACTION: 0;
82
- readonly ORDERBOOK: 1;
83
- readonly TRADES: 2;
84
- readonly TICKER: 3;
85
- readonly OHLCV: 4;
86
- readonly BALANCE: 5;
87
- readonly ORDERS: 6;
88
- };
89
- };
90
- readonly cex_service: {
91
- readonly methods: {
92
- readonly ExecuteAction: {
93
- readonly requestType: "ActionRequest";
94
- readonly responseType: "ActionResponse";
95
- };
96
- readonly Subscribe: {
97
- readonly requestType: "SubscribeRequest";
98
- readonly responseType: "SubscribeResponse";
99
- readonly responseStream: true;
100
- };
101
- };
102
- };
103
- readonly Action: {
104
- readonly values: {
105
- readonly NoAction: 0;
106
- readonly Deposit: 1;
107
- readonly Withdraw: 2;
108
- readonly CreateOrder: 3;
109
- readonly GetOrderDetails: 4;
110
- readonly CancelOrder: 5;
111
- readonly FetchBalances: 6;
112
- readonly FetchDepositAddresses: 7;
113
- readonly FetchTicker: 8;
114
- readonly FetchCurrency: 9;
115
- readonly Call: 10;
116
- readonly FetchAccountId: 11;
117
- readonly FetchFees: 12;
118
- readonly InternalTransfer: 13;
119
- readonly GetPerpConfigState: 14;
120
- readonly SetPerpConfigState: 15;
121
- };
122
- };
123
- };
124
- };
125
- };
126
- };
127
- export default descriptor;
@@ -1,7 +0,0 @@
1
- export declare const PROTO_LOADER_OPTIONS: {
2
- keepCase: true;
3
- longs: StringConstructor;
4
- enums: StringConstructor;
5
- defaults: true;
6
- oneofs: true;
7
- };
@@ -1,2 +0,0 @@
1
- import * as protoLoader from "@grpc/proto-loader";
2
- export declare const CEX_BROKER_PACKAGE_DEFINITION: protoLoader.PackageDefinition;
@@ -1,88 +0,0 @@
1
- import { z } from "zod";
2
- export declare const DepositPayloadSchema: z.ZodObject<{
3
- recipientAddress: z.ZodString;
4
- amount: z.ZodCoercedNumber<unknown>;
5
- transactionHash: z.ZodString;
6
- since: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
7
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>>;
8
- }, z.core.$strip>;
9
- export declare const CallPayloadSchema: z.ZodObject<{
10
- functionName: z.ZodString;
11
- args: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodUnknown>>>;
12
- orderAuthor: z.ZodOptional<z.ZodString>;
13
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
14
- }, z.core.$strip>;
15
- export declare const FetchDepositAddressesPayloadSchema: z.ZodObject<{
16
- chain: z.ZodString;
17
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodString>>>;
18
- }, z.core.$strip>;
19
- export declare const WithdrawPayloadSchema: z.ZodObject<{
20
- recipientAddress: z.ZodString;
21
- amount: z.ZodCoercedNumber<unknown>;
22
- chain: z.ZodString;
23
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>>;
24
- }, z.core.$strip>;
25
- export declare const InternalTransferPayloadSchema: z.ZodObject<{
26
- amount: z.ZodCoercedNumber<unknown>;
27
- fromAccount: z.ZodOptional<z.ZodString>;
28
- toAccount: z.ZodOptional<z.ZodString>;
29
- }, z.core.$strip>;
30
- export declare const CreateOrderPayloadSchema: z.ZodObject<{
31
- orderType: z.ZodDefault<z.ZodEnum<{
32
- limit: "limit";
33
- market: "market";
34
- }>>;
35
- orderIntent: z.ZodOptional<z.ZodEnum<{
36
- passive_only: "passive_only";
37
- }>>;
38
- amount: z.ZodCoercedNumber<unknown>;
39
- fromToken: z.ZodString;
40
- toToken: z.ZodString;
41
- price: z.ZodCoercedNumber<unknown>;
42
- marketType: z.ZodOptional<z.ZodEnum<{
43
- spot: "spot";
44
- swap: "swap";
45
- future: "future";
46
- perp: "perp";
47
- futures: "futures";
48
- }>>;
49
- clientOrderId: z.ZodOptional<z.ZodString>;
50
- orderAuthor: z.ZodOptional<z.ZodString>;
51
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>>;
52
- }, z.core.$strip>;
53
- export declare const GetPerpConfigStatePayloadSchema: z.ZodObject<{
54
- symbol: z.ZodOptional<z.ZodString>;
55
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
56
- }, z.core.$strip>;
57
- export declare const SetPerpConfigStatePayloadSchema: z.ZodObject<{
58
- symbol: z.ZodString;
59
- leverage: z.ZodCoercedNumber<unknown>;
60
- marginMode: z.ZodOptional<z.ZodEnum<{
61
- cross: "cross";
62
- isolated: "isolated";
63
- }>>;
64
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
65
- }, z.core.$strip>;
66
- export declare const GetOrderDetailsPayloadSchema: z.ZodObject<{
67
- orderId: z.ZodString;
68
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>>;
69
- }, z.core.$strip>;
70
- export declare const CancelOrderPayloadSchema: z.ZodObject<{
71
- orderId: z.ZodString;
72
- params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>>;
73
- }, z.core.$strip>;
74
- export declare const FetchFeesPayloadSchema: z.ZodObject<{
75
- includeAllFees: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>>;
76
- includeFundingFees: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
77
- }, z.core.$strip>;
78
- export type DepositPayload = z.infer<typeof DepositPayloadSchema>;
79
- export type CallPayload = z.infer<typeof CallPayloadSchema>;
80
- export type FetchDepositAddressesPayload = z.infer<typeof FetchDepositAddressesPayloadSchema>;
81
- export type WithdrawPayload = z.infer<typeof WithdrawPayloadSchema>;
82
- export type InternalTransferPayload = z.infer<typeof InternalTransferPayloadSchema>;
83
- export type CreateOrderPayload = z.infer<typeof CreateOrderPayloadSchema>;
84
- export type GetPerpConfigStatePayload = z.infer<typeof GetPerpConfigStatePayloadSchema>;
85
- export type SetPerpConfigStatePayload = z.infer<typeof SetPerpConfigStatePayloadSchema>;
86
- export type GetOrderDetailsPayload = z.infer<typeof GetOrderDetailsPayloadSchema>;
87
- export type CancelOrderPayload = z.infer<typeof CancelOrderPayloadSchema>;
88
- export type FetchFeesPayload = z.infer<typeof FetchFeesPayloadSchema>;
package/dist/server.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import * as grpc from "@grpc/grpc-js";
2
- import type { SubscribeBrokerLifecycle } from "./handlers/subscribe";
3
- import type { BrokerPoolEntry } from "./helpers";
4
- import type { BrokerExecutionArchiver, WithdrawalObservationTracker } from "./helpers/broker-execution-archive";
5
- import type { OrderActivityTracker } from "./helpers/order-activity-tracker";
6
- import type { OtelMetrics } from "./helpers/otel";
7
- import type { PublicMarketDataFeedSupervisor } from "./helpers/public-market-data-feed";
8
- import type { UserDataStreamSupervisor } from "./helpers/user-data-stream-supervisor";
9
- import type { PolicyConfig } from "./types";
10
- export declare function getServer(policy: PolicyConfig, brokers: Record<string, BrokerPoolEntry>, whitelistIps: string[], useVerity: boolean, verityProverUrl: string, otelMetrics?: OtelMetrics, brokerArchiver?: BrokerExecutionArchiver, orderActivityTracker?: OrderActivityTracker, withdrawalObservationTracker?: WithdrawalObservationTracker, subscribeBrokerLifecycle?: SubscribeBrokerLifecycle, userDataStreamSupervisor?: UserDataStreamSupervisor, publicMarketDataFeedSupervisor?: PublicMarketDataFeedSupervisor): grpc.Server;
package/dist/types.d.ts DELETED
@@ -1,100 +0,0 @@
1
- import type ccxt from "@usherlabs/ccxt";
2
- export type WithdrawRuleEntry = {
3
- exchange: string;
4
- network: string;
5
- whitelist: string[];
6
- coins?: string[];
7
- };
8
- export type DepositRuleEntry = {
9
- exchange: string;
10
- network: string;
11
- coins?: string[];
12
- };
13
- export type BrokerAccountRole = "master" | "subaccount";
14
- export type OrderRule = {
15
- markets: string[];
16
- limits?: Array<{
17
- from: string;
18
- to: string;
19
- min: number;
20
- max: number;
21
- }>;
22
- };
23
- export type TravelRuleQuestionnaire = {
24
- isAddressOwner: number;
25
- sendTo: number;
26
- declaration: boolean;
27
- bnfType?: number;
28
- bnfFirstName?: string;
29
- bnfLastName?: string;
30
- country?: string;
31
- city?: string;
32
- bnfCorpName?: string;
33
- bnfCorpCountry?: string;
34
- bnfCorpCity?: string;
35
- vasp?: string;
36
- vaspName?: string;
37
- };
38
- export type TravelRuleAddressEntry = {
39
- questionnaire: TravelRuleQuestionnaire;
40
- };
41
- export type TravelRuleDepositQuestionnaire = {
42
- depositOriginator: number;
43
- receiveFrom: number;
44
- declaration: boolean;
45
- };
46
- export type TravelRuleDepositOriginatorEntry = {
47
- questionnaire: TravelRuleDepositQuestionnaire;
48
- };
49
- export type TravelRuleDepositConfig = {
50
- enabled: boolean;
51
- description?: string;
52
- originators: Record<string, TravelRuleDepositOriginatorEntry>;
53
- };
54
- export type TravelRuleEntry = {
55
- exchange: string;
56
- enabled: boolean;
57
- description?: string;
58
- addresses: Record<string, TravelRuleAddressEntry>;
59
- deposits?: TravelRuleDepositConfig;
60
- };
61
- export type PolicyConfig = {
62
- withdraw: {
63
- rule: WithdrawRuleEntry[];
64
- };
65
- deposit: {
66
- rule?: DepositRuleEntry[];
67
- };
68
- order: {
69
- rule: OrderRule;
70
- };
71
- travelRule?: {
72
- rule: TravelRuleEntry[];
73
- };
74
- };
75
- type BrokerInstanceMap = {
76
- [K in ISupportedBroker]: InstanceType<(typeof ccxt)[K]>;
77
- };
78
- export type BrokerMap = Partial<{
79
- [K in ISupportedBroker]: BrokerInstanceMap[K];
80
- }>;
81
- export declare const BrokerList: readonly ["alpaca", "apex", "ascendex", "bequant", "bigone", "binance", "binancecoinm", "binanceus", "binanceusdm", "bingx", "bit2c", "bitbank", "bitbns", "bitfinex", "bitflyer", "bitget", "bithumb", "bitmart", "bitmex", "bitopro", "bitrue", "bitso", "bitstamp", "bitteam", "bittrade", "bitvavo", "blockchaincom", "blofin", "btcalpha", "btcbox", "btcmarkets", "btcturk", "bybit", "cex", "coinbase", "coinbaseadvanced", "coinbaseexchange", "coinbaseinternational", "coincatch", "coincheck", "coinex", "coinmate", "coinmetro", "coinone", "coinsph", "coinspot", "cryptocom", "cryptomus", "defx", "delta", "deribit", "derive", "digifinex", "ellipx", "exmo", "fmfwio", "gate", "gateio", "gemini", "hashkey", "hitbtc", "hollaex", "htx", "huobi", "hyperliquid", "independentreserve", "indodax", "kraken", "krakenfutures", "kucoin", "kucoinfutures", "latoken", "lbank", "luno", "mercado", "mexc", "modetrade", "myokx", "ndax", "novadax", "oceanex", "okcoin", "okx", "okxus", "onetrading", "oxfun", "p2b", "paradex", "paymium", "phemex", "poloniex", "probit", "timex", "tokocrypto", "tradeogre", "upbit", "vertex", "wavesexchange", "whitebit", "woo", "woofipro", "xt", "yobit", "zaif", "zonda"];
82
- export type brokers = Required<BrokerMap>;
83
- export type ISupportedBroker = (typeof BrokerList)[number];
84
- export type SupportedBrokers = (typeof BrokerList)[number];
85
- export declare const SupportedBroker: Record<"alpaca" | "apex" | "ascendex" | "bequant" | "bigone" | "binance" | "binancecoinm" | "binanceus" | "binanceusdm" | "bingx" | "bit2c" | "bitbank" | "bitbns" | "bitfinex" | "bitflyer" | "bitget" | "bithumb" | "bitmart" | "bitmex" | "bitopro" | "bitrue" | "bitso" | "bitstamp" | "bitteam" | "bittrade" | "bitvavo" | "blockchaincom" | "blofin" | "btcalpha" | "btcbox" | "btcmarkets" | "btcturk" | "bybit" | "cex" | "coinbase" | "coinbaseadvanced" | "coinbaseexchange" | "coinbaseinternational" | "coincatch" | "coincheck" | "coinex" | "coinmate" | "coinmetro" | "coinone" | "coinsph" | "coinspot" | "cryptocom" | "cryptomus" | "defx" | "delta" | "deribit" | "derive" | "digifinex" | "ellipx" | "exmo" | "fmfwio" | "gate" | "gateio" | "gemini" | "hashkey" | "hitbtc" | "hollaex" | "htx" | "huobi" | "hyperliquid" | "independentreserve" | "indodax" | "kraken" | "krakenfutures" | "kucoin" | "kucoinfutures" | "latoken" | "lbank" | "luno" | "mercado" | "mexc" | "modetrade" | "myokx" | "ndax" | "novadax" | "oceanex" | "okcoin" | "okx" | "okxus" | "onetrading" | "oxfun" | "p2b" | "paradex" | "paymium" | "phemex" | "poloniex" | "probit" | "timex" | "tokocrypto" | "tradeogre" | "upbit" | "vertex" | "wavesexchange" | "whitebit" | "woo" | "woofipro" | "xt" | "yobit" | "zaif" | "zonda", string>;
86
- export type BrokerCredentials = {
87
- apiKey: string;
88
- apiSecret: string;
89
- role?: BrokerAccountRole;
90
- email?: string;
91
- subAccountId?: string;
92
- uid?: string;
93
- };
94
- export type SecondaryKeys<T> = {
95
- secondaryKeys: Array<T>;
96
- };
97
- export interface ExchangeCredentials {
98
- [exchange: string]: BrokerCredentials & SecondaryKeys<BrokerCredentials>;
99
- }
100
- export {};