@usherlabs/cex-broker 0.2.7 → 0.2.9

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.
@@ -19,6 +19,9 @@ export declare const WithdrawPayloadSchema: z.ZodObject<{
19
19
  recipientAddress: z.ZodString;
20
20
  amount: z.ZodCoercedNumber<unknown>;
21
21
  chain: z.ZodString;
22
+ routeViaMaster: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>>;
23
+ sourceAccount: z.ZodOptional<z.ZodString>;
24
+ masterAccount: z.ZodOptional<z.ZodString>;
22
25
  params: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>>;
23
26
  }, z.core.$strip>;
24
27
  export declare const CreateOrderPayloadSchema: z.ZodObject<{
package/dist/server.d.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  import * as grpc from "@grpc/grpc-js";
2
- import type { Exchange } from "@usherlabs/ccxt";
2
+ import { type BrokerPoolEntry } from "./helpers";
3
3
  import type { OtelMetrics } from "./helpers/otel";
4
4
  import type { PolicyConfig } from "./types";
5
- export declare function getServer(policy: PolicyConfig, brokers: Record<string, {
6
- primary: Exchange;
7
- secondaryBrokers: Exchange[];
8
- }>, whitelistIps: string[], useVerity: boolean, verityProverUrl: string, otelMetrics?: OtelMetrics): grpc.Server;
5
+ export declare function getServer(policy: PolicyConfig, brokers: Record<string, BrokerPoolEntry>, whitelistIps: string[], useVerity: boolean, verityProverUrl: string, otelMetrics?: OtelMetrics): grpc.Server;
package/dist/types.d.ts CHANGED
@@ -3,7 +3,14 @@ export type WithdrawRuleEntry = {
3
3
  exchange: string;
4
4
  network: string;
5
5
  whitelist: string[];
6
+ coins?: string[];
6
7
  };
8
+ export type DepositRuleEntry = {
9
+ exchange: string;
10
+ network: string;
11
+ coins?: string[];
12
+ };
13
+ export type BrokerAccountRole = "master" | "subaccount";
7
14
  export type OrderRule = {
8
15
  markets: string[];
9
16
  limits?: Array<{
@@ -17,7 +24,9 @@ export type PolicyConfig = {
17
24
  withdraw: {
18
25
  rule: WithdrawRuleEntry[];
19
26
  };
20
- deposit: Record<string, null>;
27
+ deposit: {
28
+ rule?: DepositRuleEntry[];
29
+ };
21
30
  order: {
22
31
  rule: OrderRule;
23
32
  };
@@ -36,6 +45,10 @@ export declare const SupportedBroker: Record<"alpaca" | "apex" | "ascendex" | "b
36
45
  export type BrokerCredentials = {
37
46
  apiKey: string;
38
47
  apiSecret: string;
48
+ role?: BrokerAccountRole;
49
+ email?: string;
50
+ subAccountId?: string;
51
+ uid?: string;
39
52
  };
40
53
  export type SecondaryKeys<T> = {
41
54
  secondaryKeys: Array<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usherlabs/cex-broker",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Unified gRPC API to CEXs by Usher Labs.",
5
5
  "repository": {
6
6
  "type": "git",