@elizaos/plugin-auto-trader 2.0.0-alpha.4 → 2.0.0-alpha.6
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/chunk-KOZTD5EO.js +58 -0
- package/dist/chunk-KOZTD5EO.js.map +1 -0
- package/dist/index.js +4 -54
- package/dist/index.js.map +1 -1
- package/dist/{index.node-ZNB67OM6.js → index.node-RHTYUVJS.js} +8 -63
- package/dist/index.node-RHTYUVJS.js.map +1 -0
- package/package.json +125 -1
- package/dist/index.node-ZNB67OM6.js.map +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// node_modules/uuid/dist-node/native.js
|
|
2
|
+
import { randomUUID } from "crypto";
|
|
3
|
+
var native_default = { randomUUID };
|
|
4
|
+
|
|
5
|
+
// node_modules/uuid/dist-node/rng.js
|
|
6
|
+
import { randomFillSync } from "crypto";
|
|
7
|
+
var rnds8Pool = new Uint8Array(256);
|
|
8
|
+
var poolPtr = rnds8Pool.length;
|
|
9
|
+
function rng() {
|
|
10
|
+
if (poolPtr > rnds8Pool.length - 16) {
|
|
11
|
+
randomFillSync(rnds8Pool);
|
|
12
|
+
poolPtr = 0;
|
|
13
|
+
}
|
|
14
|
+
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// node_modules/uuid/dist-node/stringify.js
|
|
18
|
+
var byteToHex = [];
|
|
19
|
+
for (let i = 0; i < 256; ++i) {
|
|
20
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
21
|
+
}
|
|
22
|
+
function unsafeStringify(arr, offset = 0) {
|
|
23
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// node_modules/uuid/dist-node/v4.js
|
|
27
|
+
function _v4(options, buf, offset) {
|
|
28
|
+
options = options || {};
|
|
29
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
30
|
+
if (rnds.length < 16) {
|
|
31
|
+
throw new Error("Random bytes length must be >= 16");
|
|
32
|
+
}
|
|
33
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
34
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
35
|
+
if (buf) {
|
|
36
|
+
offset = offset || 0;
|
|
37
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
38
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
39
|
+
}
|
|
40
|
+
for (let i = 0; i < 16; ++i) {
|
|
41
|
+
buf[offset + i] = rnds[i];
|
|
42
|
+
}
|
|
43
|
+
return buf;
|
|
44
|
+
}
|
|
45
|
+
return unsafeStringify(rnds);
|
|
46
|
+
}
|
|
47
|
+
function v4(options, buf, offset) {
|
|
48
|
+
if (native_default.randomUUID && !buf && !options) {
|
|
49
|
+
return native_default.randomUUID();
|
|
50
|
+
}
|
|
51
|
+
return _v4(options, buf, offset);
|
|
52
|
+
}
|
|
53
|
+
var v4_default = v4;
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
v4_default
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=chunk-KOZTD5EO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/uuid/dist-node/native.js","../node_modules/uuid/dist-node/rng.js","../node_modules/uuid/dist-node/stringify.js","../node_modules/uuid/dist-node/v4.js"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nexport default { randomUUID };\n","import { randomFillSync } from 'node:crypto';\nconst rnds8Pool = new Uint8Array(256);\nlet poolPtr = rnds8Pool.length;\nexport default function rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n randomFillSync(rnds8Pool);\n poolPtr = 0;\n }\n return rnds8Pool.slice(poolPtr, (poolPtr += 16));\n}\n","import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction _v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n return _v4(options, buf, offset);\n}\nexport default v4;\n"],"mappings":";AAAA,SAAS,kBAAkB;AAC3B,IAAO,iBAAQ,EAAE,WAAW;;;ACD5B,SAAS,sBAAsB;AAC/B,IAAM,YAAY,IAAI,WAAW,GAAG;AACpC,IAAI,UAAU,UAAU;AACT,SAAR,MAAuB;AAC1B,MAAI,UAAU,UAAU,SAAS,IAAI;AACjC,mBAAe,SAAS;AACxB,cAAU;AAAA,EACd;AACA,SAAO,UAAU,MAAM,SAAU,WAAW,EAAG;AACnD;;;ACRA,IAAM,YAAY,CAAC;AACnB,SAAS,IAAI,GAAG,IAAI,KAAK,EAAE,GAAG;AAC1B,YAAU,MAAM,IAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;AACpD;AACO,SAAS,gBAAgB,KAAK,SAAS,GAAG;AAC7C,UAAQ,UAAU,IAAI,SAAS,CAAC,CAAC,IAC7B,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,MACA,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,MACA,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,MACA,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,UAAU,IAAI,SAAS,CAAC,CAAC,IACzB,MACA,UAAU,IAAI,SAAS,EAAE,CAAC,IAC1B,UAAU,IAAI,SAAS,EAAE,CAAC,IAC1B,UAAU,IAAI,SAAS,EAAE,CAAC,IAC1B,UAAU,IAAI,SAAS,EAAE,CAAC,IAC1B,UAAU,IAAI,SAAS,EAAE,CAAC,IAC1B,UAAU,IAAI,SAAS,EAAE,CAAC,GAAG,YAAY;AACjD;;;ACvBA,SAAS,IAAI,SAAS,KAAK,QAAQ;AAC/B,YAAU,WAAW,CAAC;AACtB,QAAM,OAAO,QAAQ,UAAU,QAAQ,MAAM,KAAK,IAAI;AACtD,MAAI,KAAK,SAAS,IAAI;AAClB,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACvD;AACA,OAAK,CAAC,IAAK,KAAK,CAAC,IAAI,KAAQ;AAC7B,OAAK,CAAC,IAAK,KAAK,CAAC,IAAI,KAAQ;AAC7B,MAAI,KAAK;AACL,aAAS,UAAU;AACnB,QAAI,SAAS,KAAK,SAAS,KAAK,IAAI,QAAQ;AACxC,YAAM,IAAI,WAAW,mBAAmB,MAAM,IAAI,SAAS,EAAE,0BAA0B;AAAA,IAC3F;AACA,aAAS,IAAI,GAAG,IAAI,IAAI,EAAE,GAAG;AACzB,UAAI,SAAS,CAAC,IAAI,KAAK,CAAC;AAAA,IAC5B;AACA,WAAO;AAAA,EACX;AACA,SAAO,gBAAgB,IAAI;AAC/B;AACA,SAAS,GAAG,SAAS,KAAK,QAAQ;AAC9B,MAAI,eAAO,cAAc,CAAC,OAAO,CAAC,SAAS;AACvC,WAAO,eAAO,WAAW;AAAA,EAC7B;AACA,SAAO,IAAI,SAAS,KAAK,MAAM;AACnC;AACA,IAAO,aAAQ;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,9 @@ import {
|
|
|
14
14
|
OrderType,
|
|
15
15
|
TradeType
|
|
16
16
|
} from "./chunk-AS6N6A3H.js";
|
|
17
|
+
import {
|
|
18
|
+
v4_default
|
|
19
|
+
} from "./chunk-KOZTD5EO.js";
|
|
17
20
|
import {
|
|
18
21
|
__export
|
|
19
22
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -27,59 +30,6 @@ import {
|
|
|
27
30
|
EventType,
|
|
28
31
|
elizaLogger
|
|
29
32
|
} from "@elizaos/core";
|
|
30
|
-
|
|
31
|
-
// ../../../../node_modules/uuid/dist/esm/stringify.js
|
|
32
|
-
var byteToHex = [];
|
|
33
|
-
for (let i = 0; i < 256; ++i) {
|
|
34
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
|
35
|
-
}
|
|
36
|
-
function unsafeStringify(arr, offset = 0) {
|
|
37
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// ../../../../node_modules/uuid/dist/esm/rng.js
|
|
41
|
-
import { randomFillSync } from "crypto";
|
|
42
|
-
var rnds8Pool = new Uint8Array(256);
|
|
43
|
-
var poolPtr = rnds8Pool.length;
|
|
44
|
-
function rng() {
|
|
45
|
-
if (poolPtr > rnds8Pool.length - 16) {
|
|
46
|
-
randomFillSync(rnds8Pool);
|
|
47
|
-
poolPtr = 0;
|
|
48
|
-
}
|
|
49
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// ../../../../node_modules/uuid/dist/esm/native.js
|
|
53
|
-
import { randomUUID } from "crypto";
|
|
54
|
-
var native_default = { randomUUID };
|
|
55
|
-
|
|
56
|
-
// ../../../../node_modules/uuid/dist/esm/v4.js
|
|
57
|
-
function v4(options, buf, offset) {
|
|
58
|
-
if (native_default.randomUUID && !buf && !options) {
|
|
59
|
-
return native_default.randomUUID();
|
|
60
|
-
}
|
|
61
|
-
options = options || {};
|
|
62
|
-
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
63
|
-
if (rnds.length < 16) {
|
|
64
|
-
throw new Error("Random bytes length must be >= 16");
|
|
65
|
-
}
|
|
66
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
67
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
68
|
-
if (buf) {
|
|
69
|
-
offset = offset || 0;
|
|
70
|
-
if (offset < 0 || offset + 16 > buf.length) {
|
|
71
|
-
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
72
|
-
}
|
|
73
|
-
for (let i = 0; i < 16; ++i) {
|
|
74
|
-
buf[offset + i] = rnds[i];
|
|
75
|
-
}
|
|
76
|
-
return buf;
|
|
77
|
-
}
|
|
78
|
-
return unsafeStringify(rnds);
|
|
79
|
-
}
|
|
80
|
-
var v4_default = v4;
|
|
81
|
-
|
|
82
|
-
// src/__tests__/e2e/test-utils.ts
|
|
83
33
|
async function waitForTrading(runtime, maxWaitMs = 3e4) {
|
|
84
34
|
const tradingManager = runtime.getService("AutoTradingManager");
|
|
85
35
|
const startTime = Date.now();
|
|
@@ -7656,7 +7606,7 @@ var TradingTrajectoryService = class _TradingTrajectoryService extends Service5
|
|
|
7656
7606
|
}
|
|
7657
7607
|
async initialize() {
|
|
7658
7608
|
try {
|
|
7659
|
-
const { TrajectoryLoggerService } = await import("./index.node-
|
|
7609
|
+
const { TrajectoryLoggerService } = await import("./index.node-RHTYUVJS.js");
|
|
7660
7610
|
this.trajectoryLogger = new TrajectoryLoggerService();
|
|
7661
7611
|
this.enabled = true;
|
|
7662
7612
|
logger10.info("[TradingTrajectoryService] Trajectory logging enabled");
|