@usherlabs/cex-broker 0.0.1 → 0.1.3

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.
@@ -0,0 +1,66 @@
1
+ import type ccxt from "@usherlabs/ccxt";
2
+ export type WithdrawRule = {
3
+ networks: string[];
4
+ whitelist: string[];
5
+ amounts: {
6
+ ticker: string;
7
+ max: number;
8
+ min: number;
9
+ }[];
10
+ };
11
+ export type OrderRule = {
12
+ markets: string[];
13
+ limits: Array<{
14
+ from: string;
15
+ to: string;
16
+ min: number;
17
+ max: number;
18
+ }>;
19
+ };
20
+ export type PolicyConfig = {
21
+ withdraw: {
22
+ rule: WithdrawRule;
23
+ };
24
+ deposit: Record<string, null>;
25
+ order: {
26
+ rule: OrderRule;
27
+ };
28
+ };
29
+ export type Policy = {
30
+ isActive: boolean;
31
+ permissions: Array<"withdraw" | "transfer" | "convert">;
32
+ limits: {
33
+ dailyWithdrawLimit?: number;
34
+ dailyTransferredAmount?: number;
35
+ perTxTransferLimit?: number;
36
+ };
37
+ networks: string[];
38
+ conversionLimits: Array<{
39
+ from: string;
40
+ to: string;
41
+ min: number;
42
+ max: number;
43
+ }>;
44
+ };
45
+ type BrokerInstanceMap = {
46
+ [K in ISupportedBroker]: InstanceType<(typeof ccxt)[K]>;
47
+ };
48
+ export type BrokerMap = Partial<{
49
+ [K in ISupportedBroker]: BrokerInstanceMap[K];
50
+ }>;
51
+ 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"];
52
+ export type brokers = Required<BrokerMap>;
53
+ export type ISupportedBroker = (typeof BrokerList)[number];
54
+ export type SupportedBrokers = (typeof BrokerList)[number];
55
+ 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>;
56
+ export type BrokerCredentials = {
57
+ apiKey: string;
58
+ apiSecret: string;
59
+ };
60
+ export type SecondaryKeys<T> = {
61
+ secondaryKeys: Array<T>;
62
+ };
63
+ export interface ExchangeCredentials {
64
+ [exchange: string]: BrokerCredentials & SecondaryKeys<BrokerCredentials>;
65
+ }
66
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usherlabs/cex-broker",
3
- "version": "0.0.1",
3
+ "version": "0.1.3",
4
4
  "description": "Unified gRPC API to CEXs by Usher Labs",
5
5
  "repository": "git@gitlab.com:usherlabs/cex-broker.git",
6
6
  "homepage": "https://usher.so/",
@@ -27,11 +27,14 @@
27
27
  "scripts": {
28
28
  "proto-gen": "./proto-gen.sh",
29
29
  "start": "bun run ./src/index.ts",
30
- "build:ts": "bun run ./src/build.ts",
30
+ "build": "bun run ./build.ts",
31
+ "build:ts": "bunx tsc",
31
32
  "test": "bun test",
32
33
  "format": "bunx biome format --write",
33
- "lint": "bunx biome lint --write",
34
- "check": "bunx biome check --write",
34
+ "lint": "bunx biome lint",
35
+ "lint:fix": "bunx biome lint --write",
36
+ "check": "bunx biome check",
37
+ "check:fix": "bunx biome check --write",
35
38
  "prepare": "bunx husky",
36
39
  "postinstall": "./proto-gen.sh"
37
40
  },