@longdotxyz/shared 0.0.4

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.
Files changed (38) hide show
  1. package/dist/contracts/auction.contract.d.ts +294 -0
  2. package/dist/contracts/auction.contract.js +73 -0
  3. package/dist/contracts/auction.contract.js.map +1 -0
  4. package/dist/contracts/community.contract.d.ts +116 -0
  5. package/dist/contracts/community.contract.js +39 -0
  6. package/dist/contracts/community.contract.js.map +1 -0
  7. package/dist/contracts/index.d.ts +525 -0
  8. package/dist/contracts/index.js +34 -0
  9. package/dist/contracts/index.js.map +1 -0
  10. package/dist/contracts/ipfs.contract.d.ts +86 -0
  11. package/dist/contracts/ipfs.contract.js +44 -0
  12. package/dist/contracts/ipfs.contract.js.map +1 -0
  13. package/dist/contracts/quote.contract.d.ts +121 -0
  14. package/dist/contracts/quote.contract.js +54 -0
  15. package/dist/contracts/quote.contract.js.map +1 -0
  16. package/dist/index.d.ts +3 -0
  17. package/dist/index.js +20 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/types/bigint.type.d.ts +2 -0
  20. package/dist/types/bigint.type.js +19 -0
  21. package/dist/types/bigint.type.js.map +1 -0
  22. package/dist/types/hex.type.d.ts +3 -0
  23. package/dist/types/hex.type.js +9 -0
  24. package/dist/types/hex.type.js.map +1 -0
  25. package/dist/types/index.d.ts +3 -0
  26. package/dist/types/index.js +20 -0
  27. package/dist/types/index.js.map +1 -0
  28. package/dist/types/pool-key.type.d.ts +8 -0
  29. package/dist/types/pool-key.type.js +3 -0
  30. package/dist/types/pool-key.type.js.map +1 -0
  31. package/dist/utils/index.d.ts +1 -0
  32. package/dist/utils/index.js +18 -0
  33. package/dist/utils/index.js.map +1 -0
  34. package/dist/utils/native-token.util.d.ts +5 -0
  35. package/dist/utils/native-token.util.js +26 -0
  36. package/dist/utils/native-token.util.js.map +1 -0
  37. package/package.json +47 -0
  38. package/readme.md +1 -0
@@ -0,0 +1,294 @@
1
+ import z from "zod";
2
+ declare const DynamicAuctionResponse: z.ZodObject<{
3
+ auction_pool_address: z.ZodString;
4
+ auction_pool_id: z.ZodString;
5
+ auction_base_token_name: z.ZodString;
6
+ auction_base_token_symbol: z.ZodString;
7
+ auction_base_token_address: z.ZodString;
8
+ auction_quote_token_name: z.ZodString;
9
+ auction_quote_token_symbol: z.ZodString;
10
+ auction_quote_token_address: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ auction_pool_address: string;
13
+ auction_pool_id: string;
14
+ auction_base_token_name: string;
15
+ auction_base_token_symbol: string;
16
+ auction_base_token_address: string;
17
+ auction_quote_token_name: string;
18
+ auction_quote_token_symbol: string;
19
+ auction_quote_token_address: string;
20
+ }, {
21
+ auction_pool_address: string;
22
+ auction_pool_id: string;
23
+ auction_base_token_name: string;
24
+ auction_base_token_symbol: string;
25
+ auction_base_token_address: string;
26
+ auction_quote_token_name: string;
27
+ auction_quote_token_symbol: string;
28
+ auction_quote_token_address: string;
29
+ }>;
30
+ declare const CreateDynamicAuctionResponse: z.ZodObject<{
31
+ governance_factory: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
32
+ governance_factory_data: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
33
+ pool_initializer: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
34
+ pool_initializer_data: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
35
+ liquidity_migrator: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
36
+ liquidity_migrator_data: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
37
+ integrator: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
38
+ salt: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
39
+ initial_supply: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
40
+ numTokensToSell: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
41
+ numeraire: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
42
+ token_factory: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
43
+ token_factory_data: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ governance_factory: `0x${string}`;
46
+ governance_factory_data: `0x${string}`;
47
+ pool_initializer: `0x${string}`;
48
+ pool_initializer_data: `0x${string}`;
49
+ liquidity_migrator: `0x${string}`;
50
+ liquidity_migrator_data: `0x${string}`;
51
+ integrator: `0x${string}`;
52
+ salt: `0x${string}`;
53
+ initial_supply: `0x${string}`;
54
+ numTokensToSell: `0x${string}`;
55
+ numeraire: `0x${string}`;
56
+ token_factory: `0x${string}`;
57
+ token_factory_data: `0x${string}`;
58
+ }, {
59
+ governance_factory: string;
60
+ governance_factory_data: string;
61
+ pool_initializer: string;
62
+ pool_initializer_data: string;
63
+ liquidity_migrator: string;
64
+ liquidity_migrator_data: string;
65
+ integrator: string;
66
+ salt: string;
67
+ initial_supply: string;
68
+ numTokensToSell: string;
69
+ numeraire: string;
70
+ token_factory: string;
71
+ token_factory_data: string;
72
+ }>;
73
+ declare const auctionContract: {
74
+ getDynamicAuction: {
75
+ pathParams: z.ZodObject<{
76
+ chainId: z.ZodPipeline<z.ZodString, z.ZodNumber>;
77
+ address: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ chainId: number;
80
+ address: `0x${string}`;
81
+ }, {
82
+ chainId: string;
83
+ address: string;
84
+ }>;
85
+ method: "GET";
86
+ path: "/:chainId/dynamic/:address";
87
+ responses: {
88
+ 200: z.ZodObject<{
89
+ result: z.ZodObject<{
90
+ auction_pool_address: z.ZodString;
91
+ auction_pool_id: z.ZodString;
92
+ auction_base_token_name: z.ZodString;
93
+ auction_base_token_symbol: z.ZodString;
94
+ auction_base_token_address: z.ZodString;
95
+ auction_quote_token_name: z.ZodString;
96
+ auction_quote_token_symbol: z.ZodString;
97
+ auction_quote_token_address: z.ZodString;
98
+ }, "strip", z.ZodTypeAny, {
99
+ auction_pool_address: string;
100
+ auction_pool_id: string;
101
+ auction_base_token_name: string;
102
+ auction_base_token_symbol: string;
103
+ auction_base_token_address: string;
104
+ auction_quote_token_name: string;
105
+ auction_quote_token_symbol: string;
106
+ auction_quote_token_address: string;
107
+ }, {
108
+ auction_pool_address: string;
109
+ auction_pool_id: string;
110
+ auction_base_token_name: string;
111
+ auction_base_token_symbol: string;
112
+ auction_base_token_address: string;
113
+ auction_quote_token_name: string;
114
+ auction_quote_token_symbol: string;
115
+ auction_quote_token_address: string;
116
+ }>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ result: {
119
+ auction_pool_address: string;
120
+ auction_pool_id: string;
121
+ auction_base_token_name: string;
122
+ auction_base_token_symbol: string;
123
+ auction_base_token_address: string;
124
+ auction_quote_token_name: string;
125
+ auction_quote_token_symbol: string;
126
+ auction_quote_token_address: string;
127
+ };
128
+ }, {
129
+ result: {
130
+ auction_pool_address: string;
131
+ auction_pool_id: string;
132
+ auction_base_token_name: string;
133
+ auction_base_token_symbol: string;
134
+ auction_base_token_address: string;
135
+ auction_quote_token_name: string;
136
+ auction_quote_token_symbol: string;
137
+ auction_quote_token_address: string;
138
+ };
139
+ }>;
140
+ };
141
+ };
142
+ createDynamicAuction: {
143
+ pathParams: z.ZodObject<{
144
+ chainId: z.ZodPipeline<z.ZodString, z.ZodNumber>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ chainId: number;
147
+ }, {
148
+ chainId: string;
149
+ }>;
150
+ method: "POST";
151
+ body: z.ZodObject<{
152
+ templateId: z.ZodString;
153
+ metadata: z.ZodObject<{
154
+ tokenName: z.ZodString;
155
+ tokenSymbol: z.ZodString;
156
+ tokenURI: z.ZodString;
157
+ migrationDuration: z.ZodNumber;
158
+ migrationBeneficiaries: z.ZodArray<z.ZodObject<{
159
+ address: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
160
+ percentage: z.ZodNumber;
161
+ }, "strip", z.ZodTypeAny, {
162
+ address: `0x${string}`;
163
+ percentage: number;
164
+ }, {
165
+ address: string;
166
+ percentage: number;
167
+ }>, "many">;
168
+ }, "strip", z.ZodTypeAny, {
169
+ tokenName: string;
170
+ tokenSymbol: string;
171
+ tokenURI: string;
172
+ migrationDuration: number;
173
+ migrationBeneficiaries: {
174
+ address: `0x${string}`;
175
+ percentage: number;
176
+ }[];
177
+ }, {
178
+ tokenName: string;
179
+ tokenSymbol: string;
180
+ tokenURI: string;
181
+ migrationDuration: number;
182
+ migrationBeneficiaries: {
183
+ address: string;
184
+ percentage: number;
185
+ }[];
186
+ }>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ metadata: {
189
+ tokenName: string;
190
+ tokenSymbol: string;
191
+ tokenURI: string;
192
+ migrationDuration: number;
193
+ migrationBeneficiaries: {
194
+ address: `0x${string}`;
195
+ percentage: number;
196
+ }[];
197
+ };
198
+ templateId: string;
199
+ }, {
200
+ metadata: {
201
+ tokenName: string;
202
+ tokenSymbol: string;
203
+ tokenURI: string;
204
+ migrationDuration: number;
205
+ migrationBeneficiaries: {
206
+ address: string;
207
+ percentage: number;
208
+ }[];
209
+ };
210
+ templateId: string;
211
+ }>;
212
+ path: "/:chainId/dynamic";
213
+ responses: {
214
+ 200: z.ZodObject<{
215
+ result: z.ZodObject<{
216
+ governance_factory: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
217
+ governance_factory_data: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
218
+ pool_initializer: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
219
+ pool_initializer_data: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
220
+ liquidity_migrator: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
221
+ liquidity_migrator_data: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
222
+ integrator: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
223
+ salt: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
224
+ initial_supply: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
225
+ numTokensToSell: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
226
+ numeraire: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
227
+ token_factory: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
228
+ token_factory_data: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ governance_factory: `0x${string}`;
231
+ governance_factory_data: `0x${string}`;
232
+ pool_initializer: `0x${string}`;
233
+ pool_initializer_data: `0x${string}`;
234
+ liquidity_migrator: `0x${string}`;
235
+ liquidity_migrator_data: `0x${string}`;
236
+ integrator: `0x${string}`;
237
+ salt: `0x${string}`;
238
+ initial_supply: `0x${string}`;
239
+ numTokensToSell: `0x${string}`;
240
+ numeraire: `0x${string}`;
241
+ token_factory: `0x${string}`;
242
+ token_factory_data: `0x${string}`;
243
+ }, {
244
+ governance_factory: string;
245
+ governance_factory_data: string;
246
+ pool_initializer: string;
247
+ pool_initializer_data: string;
248
+ liquidity_migrator: string;
249
+ liquidity_migrator_data: string;
250
+ integrator: string;
251
+ salt: string;
252
+ initial_supply: string;
253
+ numTokensToSell: string;
254
+ numeraire: string;
255
+ token_factory: string;
256
+ token_factory_data: string;
257
+ }>;
258
+ }, "strip", z.ZodTypeAny, {
259
+ result: {
260
+ governance_factory: `0x${string}`;
261
+ governance_factory_data: `0x${string}`;
262
+ pool_initializer: `0x${string}`;
263
+ pool_initializer_data: `0x${string}`;
264
+ liquidity_migrator: `0x${string}`;
265
+ liquidity_migrator_data: `0x${string}`;
266
+ integrator: `0x${string}`;
267
+ salt: `0x${string}`;
268
+ initial_supply: `0x${string}`;
269
+ numTokensToSell: `0x${string}`;
270
+ numeraire: `0x${string}`;
271
+ token_factory: `0x${string}`;
272
+ token_factory_data: `0x${string}`;
273
+ };
274
+ }, {
275
+ result: {
276
+ governance_factory: string;
277
+ governance_factory_data: string;
278
+ pool_initializer: string;
279
+ pool_initializer_data: string;
280
+ liquidity_migrator: string;
281
+ liquidity_migrator_data: string;
282
+ integrator: string;
283
+ salt: string;
284
+ initial_supply: string;
285
+ numTokensToSell: string;
286
+ numeraire: string;
287
+ token_factory: string;
288
+ token_factory_data: string;
289
+ };
290
+ }>;
291
+ };
292
+ };
293
+ };
294
+ export { auctionContract, CreateDynamicAuctionResponse, DynamicAuctionResponse };
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DynamicAuctionResponse = exports.CreateDynamicAuctionResponse = exports.auctionContract = void 0;
4
+ const core_1 = require("@ts-rest/core");
5
+ const zod_1 = require("zod");
6
+ const types_1 = require("../types");
7
+ const contract = (0, core_1.initContract)();
8
+ const DynamicAuctionResponse = zod_1.default.object({
9
+ auction_pool_address: zod_1.default.string(),
10
+ auction_pool_id: zod_1.default.string(),
11
+ auction_base_token_name: zod_1.default.string(),
12
+ auction_base_token_symbol: zod_1.default.string(),
13
+ auction_base_token_address: zod_1.default.string(),
14
+ auction_quote_token_name: zod_1.default.string(),
15
+ auction_quote_token_symbol: zod_1.default.string(),
16
+ auction_quote_token_address: zod_1.default.string(),
17
+ });
18
+ exports.DynamicAuctionResponse = DynamicAuctionResponse;
19
+ const CreateDynamicAuctionResponse = zod_1.default.object({
20
+ governance_factory: zod_1.default.string().pipe(types_1.hex),
21
+ governance_factory_data: zod_1.default.string().pipe(types_1.hex),
22
+ pool_initializer: zod_1.default.string().pipe(types_1.hex),
23
+ pool_initializer_data: zod_1.default.string().pipe(types_1.hex),
24
+ liquidity_migrator: zod_1.default.string().pipe(types_1.hex),
25
+ liquidity_migrator_data: zod_1.default.string().pipe(types_1.hex),
26
+ integrator: zod_1.default.string().pipe(types_1.hex),
27
+ salt: zod_1.default.string().pipe(types_1.hex),
28
+ initial_supply: zod_1.default.string().pipe(types_1.hex),
29
+ numTokensToSell: zod_1.default.string().pipe(types_1.hex),
30
+ numeraire: zod_1.default.string().pipe(types_1.hex),
31
+ token_factory: zod_1.default.string().pipe(types_1.hex),
32
+ token_factory_data: zod_1.default.string().pipe(types_1.hex),
33
+ });
34
+ exports.CreateDynamicAuctionResponse = CreateDynamicAuctionResponse;
35
+ const auctionContract = contract.router({
36
+ getDynamicAuction: {
37
+ method: "GET",
38
+ path: "/:chainId/dynamic/:address",
39
+ pathParams: zod_1.default.object({
40
+ chainId: zod_1.default.string().pipe(zod_1.default.coerce.number()),
41
+ address: zod_1.default.string().pipe(types_1.hex),
42
+ }),
43
+ responses: {
44
+ 200: zod_1.default.object({
45
+ result: DynamicAuctionResponse,
46
+ }),
47
+ },
48
+ },
49
+ createDynamicAuction: {
50
+ method: "POST",
51
+ path: "/:chainId/dynamic",
52
+ pathParams: zod_1.default.object({
53
+ chainId: zod_1.default.string().pipe(zod_1.default.coerce.number()),
54
+ }),
55
+ body: zod_1.default.object({
56
+ templateId: zod_1.default.string(),
57
+ metadata: zod_1.default.object({
58
+ tokenName: zod_1.default.string(),
59
+ tokenSymbol: zod_1.default.string(),
60
+ tokenURI: zod_1.default.string(),
61
+ migrationDuration: zod_1.default.number(),
62
+ migrationBeneficiaries: zod_1.default.array(zod_1.default.object({ address: zod_1.default.string().pipe(types_1.hex), percentage: zod_1.default.number() })),
63
+ }),
64
+ }),
65
+ responses: {
66
+ 200: zod_1.default.object({
67
+ result: CreateDynamicAuctionResponse,
68
+ }),
69
+ },
70
+ },
71
+ });
72
+ exports.auctionContract = auctionContract;
73
+ //# sourceMappingURL=auction.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auction.contract.js","sourceRoot":"","sources":["../../src/contracts/auction.contract.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,116 @@
1
+ import z from "zod";
2
+ declare const CommunityResponse: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ label: z.ZodString;
5
+ description: z.ZodNullable<z.ZodString>;
6
+ funding_amount: z.ZodNumber;
7
+ image_url: z.ZodNullable<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ description: string | null;
10
+ id: number;
11
+ label: string;
12
+ funding_amount: number;
13
+ image_url: string | null;
14
+ }, {
15
+ description: string | null;
16
+ id: number;
17
+ label: string;
18
+ funding_amount: number;
19
+ image_url: string | null;
20
+ }>;
21
+ declare const communityContract: {
22
+ fetchCommunities: {
23
+ method: "GET";
24
+ path: "/communities";
25
+ responses: {
26
+ 200: z.ZodObject<{
27
+ result: z.ZodArray<z.ZodObject<{
28
+ id: z.ZodNumber;
29
+ label: z.ZodString;
30
+ description: z.ZodNullable<z.ZodString>;
31
+ funding_amount: z.ZodNumber;
32
+ image_url: z.ZodNullable<z.ZodString>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ description: string | null;
35
+ id: number;
36
+ label: string;
37
+ funding_amount: number;
38
+ image_url: string | null;
39
+ }, {
40
+ description: string | null;
41
+ id: number;
42
+ label: string;
43
+ funding_amount: number;
44
+ image_url: string | null;
45
+ }>, "many">;
46
+ }, "strip", z.ZodTypeAny, {
47
+ result: {
48
+ description: string | null;
49
+ id: number;
50
+ label: string;
51
+ funding_amount: number;
52
+ image_url: string | null;
53
+ }[];
54
+ }, {
55
+ result: {
56
+ description: string | null;
57
+ id: number;
58
+ label: string;
59
+ funding_amount: number;
60
+ image_url: string | null;
61
+ }[];
62
+ }>;
63
+ };
64
+ };
65
+ getCommunity: {
66
+ pathParams: z.ZodObject<{
67
+ id: z.ZodNumber;
68
+ }, "strip", z.ZodTypeAny, {
69
+ id: number;
70
+ }, {
71
+ id: number;
72
+ }>;
73
+ method: "GET";
74
+ path: "/communities/:id";
75
+ responses: {
76
+ 200: z.ZodObject<{
77
+ result: z.ZodObject<{
78
+ id: z.ZodNumber;
79
+ label: z.ZodString;
80
+ description: z.ZodNullable<z.ZodString>;
81
+ funding_amount: z.ZodNumber;
82
+ image_url: z.ZodNullable<z.ZodString>;
83
+ }, "strip", z.ZodTypeAny, {
84
+ description: string | null;
85
+ id: number;
86
+ label: string;
87
+ funding_amount: number;
88
+ image_url: string | null;
89
+ }, {
90
+ description: string | null;
91
+ id: number;
92
+ label: string;
93
+ funding_amount: number;
94
+ image_url: string | null;
95
+ }>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ result: {
98
+ description: string | null;
99
+ id: number;
100
+ label: string;
101
+ funding_amount: number;
102
+ image_url: string | null;
103
+ };
104
+ }, {
105
+ result: {
106
+ description: string | null;
107
+ id: number;
108
+ label: string;
109
+ funding_amount: number;
110
+ image_url: string | null;
111
+ };
112
+ }>;
113
+ };
114
+ };
115
+ };
116
+ export { communityContract, CommunityResponse };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommunityResponse = exports.communityContract = void 0;
4
+ const core_1 = require("@ts-rest/core");
5
+ const zod_1 = require("zod");
6
+ const CommunityResponse = zod_1.default.object({
7
+ id: zod_1.default.number(),
8
+ label: zod_1.default.string(),
9
+ description: zod_1.default.string().nullable(),
10
+ funding_amount: zod_1.default.number(),
11
+ image_url: zod_1.default.string().nullable(),
12
+ });
13
+ exports.CommunityResponse = CommunityResponse;
14
+ const contract = (0, core_1.initContract)();
15
+ const communityContract = contract.router({
16
+ fetchCommunities: {
17
+ method: "GET",
18
+ path: "/communities",
19
+ responses: {
20
+ 200: zod_1.default.object({
21
+ result: zod_1.default.array(CommunityResponse),
22
+ }),
23
+ },
24
+ },
25
+ getCommunity: {
26
+ method: "GET",
27
+ path: "/communities/:id",
28
+ pathParams: zod_1.default.object({
29
+ id: zod_1.default.number(),
30
+ }),
31
+ responses: {
32
+ 200: zod_1.default.object({
33
+ result: CommunityResponse,
34
+ }),
35
+ },
36
+ },
37
+ });
38
+ exports.communityContract = communityContract;
39
+ //# sourceMappingURL=community.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"community.contract.js","sourceRoot":"","sources":["../../src/contracts/community.contract.ts"],"names":[],"mappings":";;;AAAA,wCAA6C;AAC7C,6BAAoB;AAEpB,MAAM,iBAAiB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE,aAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,cAAc,EAAE,aAAC,CAAC,MAAM,EAAE;IAC1B,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AA4ByB,8CAAiB;AA1B7C,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AAEhC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC;IACtC,gBAAgB,EAAE;QACd,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE;YACP,GAAG,EAAE,aAAC,CAAC,MAAM,CAAC;gBACV,MAAM,EAAE,aAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC;aACrC,CAAC;SACL;KACJ;IACD,YAAY,EAAE;QACV,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,aAAC,CAAC,MAAM,CAAC;YACjB,EAAE,EAAE,aAAC,CAAC,MAAM,EAAE;SACjB,CAAC;QACF,SAAS,EAAE;YACP,GAAG,EAAE,aAAC,CAAC,MAAM,CAAC;gBACV,MAAM,EAAE,iBAAiB;aAC5B,CAAC;SACL;KACJ;CACJ,CAAC,CAAC;AAEM,8CAAiB"}