@basedone/core 0.0.1
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.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cloid.d.ts +36 -0
- package/dist/lib/cloid.d.ts.map +1 -0
- package/dist/lib/cloid.js +159 -0
- package/dist/lib/cloid.js.map +1 -0
- package/package.json +30 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare function encodeSlug(slug: string): number;
|
|
2
|
+
export declare function decodeSlug(value: number): string;
|
|
3
|
+
export declare function buildCloid(version: number, slug: string, clientId: number, oid: bigint): `0x${string}`;
|
|
4
|
+
export declare function parseCloid(cloidHex: `0x${string}`): {
|
|
5
|
+
prefix: string;
|
|
6
|
+
version: number;
|
|
7
|
+
slug: string;
|
|
8
|
+
clientId: number;
|
|
9
|
+
oid: bigint;
|
|
10
|
+
clientName: string;
|
|
11
|
+
} | null;
|
|
12
|
+
export declare function isBasedCloid(cloidHex?: `0x${string}` | null): boolean;
|
|
13
|
+
export declare function isTenantCloid(tenantTrackingSlug: string, cloidHex?: `0x${string}` | null): boolean;
|
|
14
|
+
type ClientCode = string;
|
|
15
|
+
export declare const CloidClientCode: {
|
|
16
|
+
readonly Unset: 0;
|
|
17
|
+
readonly Web: 1;
|
|
18
|
+
readonly App: 2;
|
|
19
|
+
readonly TgBot: 3;
|
|
20
|
+
readonly TSL: 4;
|
|
21
|
+
readonly Grid: 5;
|
|
22
|
+
readonly Chase: 6;
|
|
23
|
+
};
|
|
24
|
+
type ClientCodeType = keyof typeof CloidClientCode;
|
|
25
|
+
export type CloidClientCodeId = (typeof CloidClientCode)[ClientCodeType];
|
|
26
|
+
export declare const CloidClientCodeNameById: Record<number, ClientCodeType>;
|
|
27
|
+
export declare function getClientCodeNameById(id: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* @param tenantCode - The tenant code (max 5 characters, truncated if longer) default: "BASED"
|
|
30
|
+
* @param clientCode CloidClientCode - The client code (max 5 characters, truncated if longer) default: "Unset"
|
|
31
|
+
* @param oid - The oid (64 bits) used for identifying unique orders, default: 0xBA5ED10000BA5ED1
|
|
32
|
+
* @returns The cloid
|
|
33
|
+
*/
|
|
34
|
+
export declare function getCloid(tenantCode?: ClientCode | null, clientCode?: ClientCodeType | number, oid?: bigint): `0x${string}`;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=cloid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloid.d.ts","sourceRoot":"","sources":["../../lib/cloid.ts"],"names":[],"mappings":"AAgCA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgB/C;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWhD;AAGD,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GACV,KAAK,MAAM,EAAE,CAkBf;AAGD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,KAAK,MAAM,EAAE;;;;;;;SA0BjD;AAGD,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,KAAK,MAAM,EAAE,GAAG,IAAI,GAAG,OAAO,CAIrE;AAED,wBAAgB,aAAa,CAC3B,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,CAAC,EAAE,KAAK,MAAM,EAAE,GAAG,IAAI,GAC9B,OAAO,CAST;AAED,KAAK,UAAU,GAAG,MAAM,CAAC;AAGzB,eAAO,MAAM,eAAe;;;;;;;;CAQlB,CAAC;AACX,KAAK,cAAc,GAAG,MAAM,OAAO,eAAe,CAAC;AAGnD,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,cAAc,CAAC,CAAC;AACzE,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAQlE,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,EAC9B,UAAU,CAAC,EAAE,cAAc,GAAG,MAAM,EACpC,GAAG,CAAC,EAAE,MAAM,GACX,KAAK,MAAM,EAAE,CAoBf"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// Client Order ID (cloid) is an optional 128 bit hex string
|
|
2
|
+
// 32 hex characters or 16 utf8 characters
|
|
3
|
+
// Bit layout:
|
|
4
|
+
// [ Prefix (24) | Version (4) | Slug (26) | Client ID (10) | OID (64) ]
|
|
5
|
+
const LEGACY_CLOID = "0x62baee7262baee7262baee7262baee72";
|
|
6
|
+
const BASED_VERSION = 1;
|
|
7
|
+
const DEFAULT_TENANT_CODE = "BASED";
|
|
8
|
+
const DEFAULT_OID = 0xba5ed10000ba5ed1n;
|
|
9
|
+
// CloID bit layout (128 bits total):
|
|
10
|
+
// [ Prefix (24) | Version (4) | Slug (26) | Client ID (10) | OID (64) ]
|
|
11
|
+
// Constants
|
|
12
|
+
const BASED_HEX_PREFIX = 0xba5ed1; // 24-bit prefix
|
|
13
|
+
const BASED_HEX_PREFIX_STR = "0xba5ed1"; // 24-bit prefix
|
|
14
|
+
const PREFIX_BITS = 24n;
|
|
15
|
+
const VERSION_BITS = 4n;
|
|
16
|
+
const SLUG_BITS = 26n;
|
|
17
|
+
const CLIENT_BITS = 10n;
|
|
18
|
+
const OID_BITS = 64n;
|
|
19
|
+
const TOTAL_BITS = 128n;
|
|
20
|
+
// Slug alphabet [A-Z0-9] (36 symbols)
|
|
21
|
+
const SLUG_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
22
|
+
const SLUG_BASE = SLUG_ALPHABET.length; // 36
|
|
23
|
+
// Utility: mask for n bits
|
|
24
|
+
const mask = (bits) => (1n << bits) - 1n;
|
|
25
|
+
// Encode a 5-char slug into a 26-bit integer
|
|
26
|
+
export function encodeSlug(slug) {
|
|
27
|
+
if (!slug)
|
|
28
|
+
slug = DEFAULT_TENANT_CODE;
|
|
29
|
+
slug = slug.toUpperCase();
|
|
30
|
+
if (slug.length > 5) {
|
|
31
|
+
slug = slug.slice(0, 5);
|
|
32
|
+
}
|
|
33
|
+
let value = 0;
|
|
34
|
+
for (const ch of slug) {
|
|
35
|
+
const idx = SLUG_ALPHABET.indexOf(ch);
|
|
36
|
+
if (idx === -1)
|
|
37
|
+
throw new Error(`Invalid slug character: ${ch}`);
|
|
38
|
+
value = value * SLUG_BASE + idx;
|
|
39
|
+
}
|
|
40
|
+
if (value > Number(mask(SLUG_BITS))) {
|
|
41
|
+
throw new Error("Encoded slug exceeds 26 bits");
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
// Decode a 26-bit integer back into a 5-char slug
|
|
46
|
+
export function decodeSlug(value) {
|
|
47
|
+
if (value < 0 || value > Number(mask(SLUG_BITS))) {
|
|
48
|
+
throw new Error("Slug value out of range (must fit in 26 bits)");
|
|
49
|
+
}
|
|
50
|
+
let slug = "";
|
|
51
|
+
for (let i = 0; i < 5; i++) {
|
|
52
|
+
const idx = value % SLUG_BASE;
|
|
53
|
+
slug = SLUG_ALPHABET[idx] + slug;
|
|
54
|
+
value = Math.floor(value / SLUG_BASE);
|
|
55
|
+
}
|
|
56
|
+
return slug;
|
|
57
|
+
}
|
|
58
|
+
// Build a CloID as a 0x-prefixed 32-char hex string
|
|
59
|
+
export function buildCloid(version, slug, clientId, oid) {
|
|
60
|
+
if (version > 0xf)
|
|
61
|
+
version = BASED_VERSION;
|
|
62
|
+
if (clientId > Number(mask(CLIENT_BITS))) {
|
|
63
|
+
clientId = CloidClientCode.Unset;
|
|
64
|
+
}
|
|
65
|
+
if (oid > mask(OID_BITS)) {
|
|
66
|
+
oid = DEFAULT_OID;
|
|
67
|
+
}
|
|
68
|
+
const slugVal = encodeSlug(slug);
|
|
69
|
+
let cloid = BigInt(BASED_HEX_PREFIX) << (TOTAL_BITS - PREFIX_BITS);
|
|
70
|
+
cloid |= BigInt(version & 0xf) << (TOTAL_BITS - PREFIX_BITS - VERSION_BITS);
|
|
71
|
+
cloid |= BigInt(slugVal) << (OID_BITS + CLIENT_BITS);
|
|
72
|
+
cloid |= BigInt(clientId) << OID_BITS;
|
|
73
|
+
cloid |= oid & mask(OID_BITS);
|
|
74
|
+
return `0x${cloid.toString(16)}`;
|
|
75
|
+
}
|
|
76
|
+
// Parse a CloID hex string back into fields
|
|
77
|
+
export function parseCloid(cloidHex) {
|
|
78
|
+
try {
|
|
79
|
+
const cloid = BigInt(cloidHex);
|
|
80
|
+
const prefix = Number(cloid >> (TOTAL_BITS - PREFIX_BITS));
|
|
81
|
+
const version = Number((cloid >> (TOTAL_BITS - PREFIX_BITS - VERSION_BITS)) & mask(VERSION_BITS));
|
|
82
|
+
const slugVal = Number((cloid >> (OID_BITS + CLIENT_BITS)) & mask(SLUG_BITS));
|
|
83
|
+
const clientId = Number((cloid >> OID_BITS) & mask(CLIENT_BITS));
|
|
84
|
+
const oid = cloid & mask(OID_BITS);
|
|
85
|
+
return {
|
|
86
|
+
prefix: `0x${prefix.toString(16)}`, // should equal 0xBA5ED1
|
|
87
|
+
version,
|
|
88
|
+
slug: decodeSlug(slugVal),
|
|
89
|
+
clientId,
|
|
90
|
+
oid,
|
|
91
|
+
clientName: getClientCodeNameById(clientId),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error("Invalid cloid", { cloidHex });
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Quick prefix check
|
|
100
|
+
export function isBasedCloid(cloidHex) {
|
|
101
|
+
if (!cloidHex)
|
|
102
|
+
return false;
|
|
103
|
+
if (cloidHex === LEGACY_CLOID)
|
|
104
|
+
return true;
|
|
105
|
+
return cloidHex.startsWith(BASED_HEX_PREFIX_STR);
|
|
106
|
+
}
|
|
107
|
+
export function isTenantCloid(tenantTrackingSlug, cloidHex) {
|
|
108
|
+
if (!cloidHex || !isBasedCloid(cloidHex))
|
|
109
|
+
return false;
|
|
110
|
+
const cloidData = parseCloid(cloidHex);
|
|
111
|
+
if (!cloidData)
|
|
112
|
+
return false;
|
|
113
|
+
const { slug } = cloidData;
|
|
114
|
+
if (tenantTrackingSlug.length > 5) {
|
|
115
|
+
tenantTrackingSlug = tenantTrackingSlug.slice(0, 5);
|
|
116
|
+
}
|
|
117
|
+
return slug === tenantTrackingSlug;
|
|
118
|
+
}
|
|
119
|
+
// Client code type 0 - 10 reserved
|
|
120
|
+
export const CloidClientCode = {
|
|
121
|
+
Unset: 0, // 0x00
|
|
122
|
+
Web: 1,
|
|
123
|
+
App: 2,
|
|
124
|
+
TgBot: 3,
|
|
125
|
+
TSL: 4, // Trailing Stop Loss
|
|
126
|
+
Grid: 5,
|
|
127
|
+
Chase: 6,
|
|
128
|
+
};
|
|
129
|
+
export const CloidClientCodeNameById = {
|
|
130
|
+
[CloidClientCode.Unset]: "Unset",
|
|
131
|
+
[CloidClientCode.Web]: "Web",
|
|
132
|
+
[CloidClientCode.App]: "App",
|
|
133
|
+
[CloidClientCode.TgBot]: "TgBot",
|
|
134
|
+
[CloidClientCode.TSL]: "TSL",
|
|
135
|
+
[CloidClientCode.Grid]: "Grid",
|
|
136
|
+
[CloidClientCode.Chase]: "Chase",
|
|
137
|
+
};
|
|
138
|
+
export function getClientCodeNameById(id) {
|
|
139
|
+
return CloidClientCodeNameById[id] ?? `client_${id}`;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @param tenantCode - The tenant code (max 5 characters, truncated if longer) default: "BASED"
|
|
143
|
+
* @param clientCode CloidClientCode - The client code (max 5 characters, truncated if longer) default: "Unset"
|
|
144
|
+
* @param oid - The oid (64 bits) used for identifying unique orders, default: 0xBA5ED10000BA5ED1
|
|
145
|
+
* @returns The cloid
|
|
146
|
+
*/
|
|
147
|
+
export function getCloid(tenantCode, clientCode, oid) {
|
|
148
|
+
try {
|
|
149
|
+
const clientIdx = typeof clientCode === "number"
|
|
150
|
+
? clientCode
|
|
151
|
+
: CloidClientCode[clientCode ?? "Unset"];
|
|
152
|
+
return buildCloid(BASED_VERSION, tenantCode ?? DEFAULT_TENANT_CODE, clientIdx, oid ?? DEFAULT_OID);
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
console.error("Invalid cloid parameters, defaulting to legacy cloid", error, { tenantCode, clientCode, oid });
|
|
156
|
+
return LEGACY_CLOID;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=cloid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloid.js","sourceRoot":"","sources":["../../lib/cloid.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,0CAA0C;AAC1C,cAAc;AACd,wEAAwE;AAExE,MAAM,YAAY,GAAG,oCAAoC,CAAC;AAC1D,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,MAAM,mBAAmB,GAAG,OAAO,CAAC;AACpC,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAExC,qCAAqC;AACrC,wEAAwE;AAExE,YAAY;AACZ,MAAM,gBAAgB,GAAG,QAAQ,CAAC,CAAC,gBAAgB;AACnD,MAAM,oBAAoB,GAAG,UAAU,CAAC,CAAC,gBAAgB;AACzD,MAAM,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AAE,KAAK;IAC5B,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,OAAO;IAChC,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,KAAK;IAC5B,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM;IAC9B,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,OAAO;CACjC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,EAAU;IAC9C,OAAO,uBAAuB,CAAC,EAAE,CAAC,IAAI,UAAU,EAAE,EAAE,CAAC;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CACtB,UAA8B,EAC9B,UAAoC,EACpC,GAAY;IAEZ,IAAI,CAAC;QACH,MAAM,SAAS,GACb,OAAO,UAAU,KAAK,QAAQ;YAC5B,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,eAAe,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC;QAC7C,OAAO,UAAU,CACf,aAAa,EACb,UAAU,IAAI,mBAAmB,EACjC,SAAS,EACT,GAAG,IAAI,WAAW,CACnB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CACX,sDAAsD,EACtD,KAAK,EACL,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,CAChC,CAAC;QACF,OAAO,YAAY,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@basedone/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Core utilities for Based One",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [],
|
|
18
|
+
"author": "",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"vitest": "^3.2.4"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "^5.0.0"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"test": "vitest"
|
|
29
|
+
}
|
|
30
|
+
}
|