@longdotxyz/shared 0.0.83 → 0.0.96
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/contracts/asset.contract.d.ts +887 -187
- package/dist/contracts/asset.contract.js +49 -20
- package/dist/contracts/asset.contract.js.map +1 -1
- package/dist/contracts/auction-template.contract.d.ts +30 -30
- package/dist/contracts/auction-template.contract.js +16 -16
- package/dist/contracts/auction-template.contract.js.map +1 -1
- package/dist/contracts/auction.contract.d.ts +1 -1
- package/dist/contracts/auction.contract.js +1 -1
- package/dist/contracts/auction.contract.js.map +1 -1
- package/dist/contracts/charts.contract.d.ts +214 -0
- package/dist/contracts/charts.contract.js +61 -0
- package/dist/contracts/charts.contract.js.map +1 -0
- package/dist/contracts/index.d.ts +2233 -174
- package/dist/contracts/index.js +6 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/market.contract.d.ts +2060 -0
- package/dist/contracts/market.contract.js +195 -0
- package/dist/contracts/market.contract.js.map +1 -0
- package/dist/contracts/pathfinding.contract.d.ts +14 -14
- package/dist/contracts/pathfinding.contract.js +2 -2
- package/dist/contracts/pathfinding.contract.js.map +1 -1
- package/dist/contracts/sponsorship.contract.d.ts +2 -2
- package/dist/contracts/sponsorship.contract.js +2 -2
- package/dist/contracts/sponsorship.contract.js.map +1 -1
- package/dist/graphql/generated.d.ts +1103 -645
- package/dist/graphql/generated.js +139 -47
- package/dist/graphql/generated.js.map +1 -1
- package/dist/types/constants.d.ts +3 -1
- package/dist/types/constants.js +2 -0
- package/dist/types/constants.js.map +1 -1
- package/dist/types/hex.type.d.ts +1 -1
- package/dist/types/hex.type.js +2 -2
- package/dist/types/hex.type.js.map +1 -1
- package/dist/types/pool-key.type.d.ts +3 -3
- package/package.json +8 -8
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
declare const ChartResolution: z.ZodEnum<["1S", "5S", "15S", "30S", "1", "5", "15", "30", "60", "240", "720", "1D", "7D"]>;
|
|
3
|
+
type ChartResolution = z.infer<typeof ChartResolution>;
|
|
4
|
+
declare const ChartCurrency: z.ZodEnum<["USD", "TOKEN"]>;
|
|
5
|
+
type ChartCurrency = z.infer<typeof ChartCurrency>;
|
|
6
|
+
declare const BarSchema: z.ZodObject<{
|
|
7
|
+
timestamp: z.ZodNumber;
|
|
8
|
+
open: z.ZodNumber;
|
|
9
|
+
high: z.ZodNumber;
|
|
10
|
+
low: z.ZodNumber;
|
|
11
|
+
close: z.ZodNumber;
|
|
12
|
+
volume: z.ZodNumber;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
timestamp: number;
|
|
15
|
+
open: number;
|
|
16
|
+
high: number;
|
|
17
|
+
low: number;
|
|
18
|
+
close: number;
|
|
19
|
+
volume: number;
|
|
20
|
+
}, {
|
|
21
|
+
timestamp: number;
|
|
22
|
+
open: number;
|
|
23
|
+
high: number;
|
|
24
|
+
low: number;
|
|
25
|
+
close: number;
|
|
26
|
+
volume: number;
|
|
27
|
+
}>;
|
|
28
|
+
type Bar = z.infer<typeof BarSchema>;
|
|
29
|
+
declare const ChartBarsResponseSchema: z.ZodObject<{
|
|
30
|
+
bars: z.ZodArray<z.ZodObject<{
|
|
31
|
+
timestamp: z.ZodNumber;
|
|
32
|
+
open: z.ZodNumber;
|
|
33
|
+
high: z.ZodNumber;
|
|
34
|
+
low: z.ZodNumber;
|
|
35
|
+
close: z.ZodNumber;
|
|
36
|
+
volume: z.ZodNumber;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
timestamp: number;
|
|
39
|
+
open: number;
|
|
40
|
+
high: number;
|
|
41
|
+
low: number;
|
|
42
|
+
close: number;
|
|
43
|
+
volume: number;
|
|
44
|
+
}, {
|
|
45
|
+
timestamp: number;
|
|
46
|
+
open: number;
|
|
47
|
+
high: number;
|
|
48
|
+
low: number;
|
|
49
|
+
close: number;
|
|
50
|
+
volume: number;
|
|
51
|
+
}>, "many">;
|
|
52
|
+
symbol: z.ZodString;
|
|
53
|
+
resolution: z.ZodEnum<["1S", "5S", "15S", "30S", "1", "5", "15", "30", "60", "240", "720", "1D", "7D"]>;
|
|
54
|
+
currency: z.ZodEnum<["USD", "TOKEN"]>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
symbol: string;
|
|
57
|
+
bars: {
|
|
58
|
+
timestamp: number;
|
|
59
|
+
open: number;
|
|
60
|
+
high: number;
|
|
61
|
+
low: number;
|
|
62
|
+
close: number;
|
|
63
|
+
volume: number;
|
|
64
|
+
}[];
|
|
65
|
+
resolution: "1" | "1S" | "5S" | "15S" | "30S" | "5" | "15" | "30" | "60" | "240" | "720" | "1D" | "7D";
|
|
66
|
+
currency: "USD" | "TOKEN";
|
|
67
|
+
}, {
|
|
68
|
+
symbol: string;
|
|
69
|
+
bars: {
|
|
70
|
+
timestamp: number;
|
|
71
|
+
open: number;
|
|
72
|
+
high: number;
|
|
73
|
+
low: number;
|
|
74
|
+
close: number;
|
|
75
|
+
volume: number;
|
|
76
|
+
}[];
|
|
77
|
+
resolution: "1" | "1S" | "5S" | "15S" | "30S" | "5" | "15" | "30" | "60" | "240" | "720" | "1D" | "7D";
|
|
78
|
+
currency: "USD" | "TOKEN";
|
|
79
|
+
}>;
|
|
80
|
+
type ChartBarsResponse = z.infer<typeof ChartBarsResponseSchema>;
|
|
81
|
+
declare const chartsContract: {
|
|
82
|
+
getBars: {
|
|
83
|
+
description: "Get OHLCV chart bars for a token or trading pair";
|
|
84
|
+
query: z.ZodObject<{
|
|
85
|
+
symbol: z.ZodString;
|
|
86
|
+
from: z.ZodNumber;
|
|
87
|
+
to: z.ZodNumber;
|
|
88
|
+
resolution: z.ZodEnum<["1S", "5S", "15S", "30S", "1", "5", "15", "30", "60", "240", "720", "1D", "7D"]>;
|
|
89
|
+
currency: z.ZodDefault<z.ZodOptional<z.ZodEnum<["USD", "TOKEN"]>>>;
|
|
90
|
+
countback: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
symbol: string;
|
|
93
|
+
resolution: "1" | "1S" | "5S" | "15S" | "30S" | "5" | "15" | "30" | "60" | "240" | "720" | "1D" | "7D";
|
|
94
|
+
currency: "USD" | "TOKEN";
|
|
95
|
+
from: number;
|
|
96
|
+
to: number;
|
|
97
|
+
countback?: number | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
symbol: string;
|
|
100
|
+
resolution: "1" | "1S" | "5S" | "15S" | "30S" | "5" | "15" | "30" | "60" | "240" | "720" | "1D" | "7D";
|
|
101
|
+
from: number;
|
|
102
|
+
to: number;
|
|
103
|
+
currency?: "USD" | "TOKEN" | undefined;
|
|
104
|
+
countback?: number | undefined;
|
|
105
|
+
}>;
|
|
106
|
+
method: "GET";
|
|
107
|
+
path: "/charts/bars";
|
|
108
|
+
responses: {
|
|
109
|
+
200: z.ZodObject<{
|
|
110
|
+
result: z.ZodObject<{
|
|
111
|
+
bars: z.ZodArray<z.ZodObject<{
|
|
112
|
+
timestamp: z.ZodNumber;
|
|
113
|
+
open: z.ZodNumber;
|
|
114
|
+
high: z.ZodNumber;
|
|
115
|
+
low: z.ZodNumber;
|
|
116
|
+
close: z.ZodNumber;
|
|
117
|
+
volume: z.ZodNumber;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
timestamp: number;
|
|
120
|
+
open: number;
|
|
121
|
+
high: number;
|
|
122
|
+
low: number;
|
|
123
|
+
close: number;
|
|
124
|
+
volume: number;
|
|
125
|
+
}, {
|
|
126
|
+
timestamp: number;
|
|
127
|
+
open: number;
|
|
128
|
+
high: number;
|
|
129
|
+
low: number;
|
|
130
|
+
close: number;
|
|
131
|
+
volume: number;
|
|
132
|
+
}>, "many">;
|
|
133
|
+
symbol: z.ZodString;
|
|
134
|
+
resolution: z.ZodEnum<["1S", "5S", "15S", "30S", "1", "5", "15", "30", "60", "240", "720", "1D", "7D"]>;
|
|
135
|
+
currency: z.ZodEnum<["USD", "TOKEN"]>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
symbol: string;
|
|
138
|
+
bars: {
|
|
139
|
+
timestamp: number;
|
|
140
|
+
open: number;
|
|
141
|
+
high: number;
|
|
142
|
+
low: number;
|
|
143
|
+
close: number;
|
|
144
|
+
volume: number;
|
|
145
|
+
}[];
|
|
146
|
+
resolution: "1" | "1S" | "5S" | "15S" | "30S" | "5" | "15" | "30" | "60" | "240" | "720" | "1D" | "7D";
|
|
147
|
+
currency: "USD" | "TOKEN";
|
|
148
|
+
}, {
|
|
149
|
+
symbol: string;
|
|
150
|
+
bars: {
|
|
151
|
+
timestamp: number;
|
|
152
|
+
open: number;
|
|
153
|
+
high: number;
|
|
154
|
+
low: number;
|
|
155
|
+
close: number;
|
|
156
|
+
volume: number;
|
|
157
|
+
}[];
|
|
158
|
+
resolution: "1" | "1S" | "5S" | "15S" | "30S" | "5" | "15" | "30" | "60" | "240" | "720" | "1D" | "7D";
|
|
159
|
+
currency: "USD" | "TOKEN";
|
|
160
|
+
}>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
result: {
|
|
163
|
+
symbol: string;
|
|
164
|
+
bars: {
|
|
165
|
+
timestamp: number;
|
|
166
|
+
open: number;
|
|
167
|
+
high: number;
|
|
168
|
+
low: number;
|
|
169
|
+
close: number;
|
|
170
|
+
volume: number;
|
|
171
|
+
}[];
|
|
172
|
+
resolution: "1" | "1S" | "5S" | "15S" | "30S" | "5" | "15" | "30" | "60" | "240" | "720" | "1D" | "7D";
|
|
173
|
+
currency: "USD" | "TOKEN";
|
|
174
|
+
};
|
|
175
|
+
}, {
|
|
176
|
+
result: {
|
|
177
|
+
symbol: string;
|
|
178
|
+
bars: {
|
|
179
|
+
timestamp: number;
|
|
180
|
+
open: number;
|
|
181
|
+
high: number;
|
|
182
|
+
low: number;
|
|
183
|
+
close: number;
|
|
184
|
+
volume: number;
|
|
185
|
+
}[];
|
|
186
|
+
resolution: "1" | "1S" | "5S" | "15S" | "30S" | "5" | "15" | "30" | "60" | "240" | "720" | "1D" | "7D";
|
|
187
|
+
currency: "USD" | "TOKEN";
|
|
188
|
+
};
|
|
189
|
+
}>;
|
|
190
|
+
400: z.ZodObject<{
|
|
191
|
+
code: z.ZodLiteral<"BAD_REQUEST">;
|
|
192
|
+
message: z.ZodString;
|
|
193
|
+
}, "strip", z.ZodTypeAny, {
|
|
194
|
+
code: "BAD_REQUEST";
|
|
195
|
+
message: string;
|
|
196
|
+
}, {
|
|
197
|
+
code: "BAD_REQUEST";
|
|
198
|
+
message: string;
|
|
199
|
+
}>;
|
|
200
|
+
500: z.ZodObject<{
|
|
201
|
+
code: z.ZodLiteral<"INTERNAL_SERVER_ERROR">;
|
|
202
|
+
message: z.ZodString;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
205
|
+
message: string;
|
|
206
|
+
}, {
|
|
207
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
208
|
+
message: string;
|
|
209
|
+
}>;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
export { chartsContract, ChartBarsResponseSchema, BarSchema, ChartResolution, ChartCurrency };
|
|
214
|
+
export type { ChartBarsResponse, Bar };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChartCurrency = exports.ChartResolution = exports.BarSchema = exports.ChartBarsResponseSchema = exports.chartsContract = void 0;
|
|
7
|
+
const core_1 = require("@ts-rest/core");
|
|
8
|
+
const zod_1 = __importDefault(require("zod"));
|
|
9
|
+
const contract = (0, core_1.initContract)();
|
|
10
|
+
const ChartResolution = zod_1.default.enum(["1S", "5S", "15S", "30S", "1", "5", "15", "30", "60", "240", "720", "1D", "7D"]);
|
|
11
|
+
exports.ChartResolution = ChartResolution;
|
|
12
|
+
const ChartCurrency = zod_1.default.enum(["USD", "TOKEN"]);
|
|
13
|
+
exports.ChartCurrency = ChartCurrency;
|
|
14
|
+
const BarSchema = zod_1.default.object({
|
|
15
|
+
timestamp: zod_1.default.number().int(),
|
|
16
|
+
open: zod_1.default.number(),
|
|
17
|
+
high: zod_1.default.number(),
|
|
18
|
+
low: zod_1.default.number(),
|
|
19
|
+
close: zod_1.default.number(),
|
|
20
|
+
volume: zod_1.default.number(),
|
|
21
|
+
});
|
|
22
|
+
exports.BarSchema = BarSchema;
|
|
23
|
+
const ChartBarsResponseSchema = zod_1.default.object({
|
|
24
|
+
bars: zod_1.default.array(BarSchema),
|
|
25
|
+
symbol: zod_1.default.string(),
|
|
26
|
+
resolution: ChartResolution,
|
|
27
|
+
currency: ChartCurrency,
|
|
28
|
+
});
|
|
29
|
+
exports.ChartBarsResponseSchema = ChartBarsResponseSchema;
|
|
30
|
+
const chartsContract = contract.router({
|
|
31
|
+
getBars: {
|
|
32
|
+
method: "GET",
|
|
33
|
+
path: "/bars",
|
|
34
|
+
query: zod_1.default.object({
|
|
35
|
+
symbol: zod_1.default.string().describe("Token or pair identifier. Format: `address:networkId` (e.g., `0x123...abc:8453`)"),
|
|
36
|
+
from: zod_1.default.coerce.number().int().describe("Start of time range as Unix timestamp in seconds"),
|
|
37
|
+
to: zod_1.default.coerce.number().int().describe("End of time range as Unix timestamp in seconds"),
|
|
38
|
+
resolution: ChartResolution.describe("Candle timeframe. Seconds: 1S, 5S, 15S, 30S. Minutes: 1, 5, 15, 30, 60, 240, 720. Days: 1D, 7D"),
|
|
39
|
+
currency: ChartCurrency.optional().default("USD").describe("Currency for pricing: USD (default) or TOKEN for native token"),
|
|
40
|
+
countback: zod_1.default.coerce.number().int().min(1).max(1500).optional().describe("Maximum number of bars to return (max 1500). Overrides `from` when provided."),
|
|
41
|
+
}),
|
|
42
|
+
responses: {
|
|
43
|
+
200: zod_1.default.object({
|
|
44
|
+
result: ChartBarsResponseSchema,
|
|
45
|
+
}),
|
|
46
|
+
400: zod_1.default.object({
|
|
47
|
+
code: zod_1.default.literal("BAD_REQUEST"),
|
|
48
|
+
message: zod_1.default.string(),
|
|
49
|
+
}),
|
|
50
|
+
500: zod_1.default.object({
|
|
51
|
+
code: zod_1.default.literal("INTERNAL_SERVER_ERROR"),
|
|
52
|
+
message: zod_1.default.string(),
|
|
53
|
+
}),
|
|
54
|
+
},
|
|
55
|
+
description: "Get OHLCV chart bars for a token or trading pair",
|
|
56
|
+
},
|
|
57
|
+
}, {
|
|
58
|
+
pathPrefix: "/charts",
|
|
59
|
+
});
|
|
60
|
+
exports.chartsContract = chartsContract;
|
|
61
|
+
//# sourceMappingURL=charts.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charts.contract.js","sourceRoot":"","sources":["../../src/contracts/charts.contract.ts"],"names":[],"mappings":";;;;;;AAAA,wCAA6C;AAC7C,8CAAoB;AAEpB,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AAQhC,MAAM,eAAe,GAAG,aAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAqFpD,0CAAe;AA5E5E,MAAM,aAAa,GAAG,aAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AA4E+B,sCAAa;AApE3F,MAAM,SAAS,GAAG,aAAC,CAAC,MAAM,CAAC;IAEvB,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAE3B,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE;IAEhB,IA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