@longdotxyz/shared 0.0.23 → 0.0.24

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,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssetResponse = exports.assetContract = 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 AssetResponse = zod_1.default.object({
9
+ asset_address: zod_1.default.string().pipe(types_1.hex),
10
+ asset_numeraire_address: zod_1.default.string().pipe(types_1.hex),
11
+ asset_creation_timestamp: zod_1.default.number(),
12
+ asset_migration_timestamp: zod_1.default.number().nullable(),
13
+ auction_pool: zod_1.default.object({
14
+ pool_current_price: zod_1.default.string(),
15
+ pool_current_sqrt_price: zod_1.default.string(),
16
+ pool_current_fdv: zod_1.default.string(),
17
+ pool_current_liquidity: zod_1.default.string(),
18
+ pool_current_tick: zod_1.default.number(),
19
+ pool_last_epoch: zod_1.default.number(),
20
+ pool_current_market_cap: zod_1.default.string(),
21
+ pool_current_fees_accrued: zod_1.default.string(),
22
+ pool_current_total_proceeds: zod_1.default.string(),
23
+ pool_current_total_tokens_sold: zod_1.default.string(),
24
+ pool_last_epoch_total_tokens_sold: zod_1.default.string(),
25
+ pool_current_sale_progress_percentage: zod_1.default.coerce.number(),
26
+ pool_config_max_proceeds: zod_1.default.string(),
27
+ pool_config_min_proceeds: zod_1.default.string(),
28
+ pool_id: zod_1.default.string(),
29
+ pool_address: zod_1.default.string().pipe(types_1.hex),
30
+ pool_config_starting_time: zod_1.default.string(),
31
+ pool_config_ending_time: zod_1.default.string(),
32
+ pool_migration_timestamp: zod_1.default.number().nullable(),
33
+ pool_type: zod_1.default.string(),
34
+ base_token: zod_1.default.object({
35
+ token_address: zod_1.default.string().pipe(types_1.hex),
36
+ token_name: zod_1.default.string(),
37
+ token_symbol: zod_1.default.string(),
38
+ token_uri_data: zod_1.default.any().nullable(),
39
+ token_image_public_url: zod_1.default.string().nullable(),
40
+ token_creator_address: zod_1.default.string().pipe(types_1.hex),
41
+ token_fee_receiver_address: zod_1.default.string().pipe(types_1.hex),
42
+ token_vesting_recipient_addresses: zod_1.default.array(zod_1.default.string().pipe(types_1.hex)),
43
+ }),
44
+ }),
45
+ graduation_pool: zod_1.default.object({
46
+ pool_current_price: zod_1.default.string(),
47
+ pool_current_sqrt_price: zod_1.default.string(),
48
+ pool_current_fdv: zod_1.default.string(),
49
+ pool_current_liquidity: zod_1.default.string(),
50
+ pool_current_tick: zod_1.default.number(),
51
+ pool_current_market_cap: zod_1.default.string(),
52
+ pool_address: zod_1.default.string().pipe(types_1.hex),
53
+ pool_migration_timestamp: zod_1.default.number().nullable(),
54
+ pool_type: zod_1.default.string(),
55
+ base_token: zod_1.default.object({
56
+ token_address: zod_1.default.string().pipe(types_1.hex),
57
+ token_name: zod_1.default.string(),
58
+ token_symbol: zod_1.default.string(),
59
+ token_uri_data: zod_1.default.any().nullable(),
60
+ token_image_public_url: zod_1.default.string().nullable(),
61
+ token_creator_address: zod_1.default.string().pipe(types_1.hex),
62
+ token_fee_receiver_address: zod_1.default.string().pipe(types_1.hex),
63
+ token_vesting_recipient_addresses: zod_1.default.array(zod_1.default.string().pipe(types_1.hex)),
64
+ integrator_address: zod_1.default.string(),
65
+ }),
66
+ }),
67
+ });
68
+ exports.AssetResponse = AssetResponse;
69
+ const assetContract = contract.router({
70
+ listAssets: {
71
+ method: "GET",
72
+ path: "/",
73
+ query: zod_1.default.object({
74
+ status: zod_1.default.nativeEnum(types_1.AssetStatus).optional().default(types_1.AssetStatus.ALL),
75
+ limit: zod_1.default.coerce.number().int().min(0).max(50).optional().default(10),
76
+ offset: zod_1.default.coerce.number().int().min(0).optional().default(0),
77
+ }),
78
+ responses: {
79
+ 200: zod_1.default.object({
80
+ result: zod_1.default.array(AssetResponse),
81
+ }),
82
+ },
83
+ description: "List all assets for an integrator, with optional status filtering, pagination and default ordering by creation timestamp",
84
+ },
85
+ searchAssets: {
86
+ method: "GET",
87
+ path: "/search",
88
+ query: zod_1.default.object({
89
+ term: zod_1.default.string(),
90
+ limit: zod_1.default.coerce.number().int().min(0).max(50).optional().default(50),
91
+ }),
92
+ responses: {
93
+ 200: zod_1.default.object({
94
+ result: zod_1.default.array(AssetResponse),
95
+ }),
96
+ },
97
+ description: "Search through all assets for an integrator by providing a term to match against an address, symbol or name",
98
+ },
99
+ getAsset: {
100
+ method: "GET",
101
+ path: "/:assetAddress",
102
+ pathParams: zod_1.default.object({
103
+ assetAddress: zod_1.default.string().pipe(types_1.hex),
104
+ }),
105
+ responses: {
106
+ 200: zod_1.default.object({
107
+ result: AssetResponse,
108
+ }),
109
+ },
110
+ description: "Get an asset by its address",
111
+ },
112
+ }, {
113
+ pathPrefix: "/assets",
114
+ });
115
+ exports.assetContract = assetContract;
116
+ //# sourceMappingURL=asset.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.contract.js","sourceRoot":"","sources":["../../src/contracts/asset.contract.ts"],"names":[],"mappings":";;;AAAA,wCAA6C;AAC7C,6BAAoB;AAEpB,oCAA4C;AAE5C,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AAEhC,MAAM,aAAa,GAAG,aAAC,CAAC,MAAM,CAAC;IAC3B,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,WAAG,CAAC;IACnC,uBAAuB,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,WAAG,CAAC;IAC7C,wBAAwB,EAAE,aAAC,CAAC,MAAM,EAAE;IACpC,yBAAyB,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChD,YAAY,EAAE,aAAC,CAAC,MAAM,CAAC;QACnB,kBAAkB,EAAE,aAAC,CAAC,MAAM,EAAE;QAC9B,uBAAuB,EAAE,aAAC,CAAC,MAAM,EAAE;QACnC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AQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;SACvE,CAAC;QACF,SAAS,EAAE;YACP,GAAG,EAAE,aAAC,CAAC,MAAM,CAAC;gBACV,MAAM,EAAE,aAAC,CAAC,KAAK,CAAC,aAAa,CAAC;aACjC,CAAC;SACL;QACD,WAAW,EAAE,6GAA6G;KAC7H;IACD,QAAQ,EAAE;QACN,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,gBAAgB;QACtB,UAAU,EAAE,aAAC,CAAC,MAAM,CAAC;YACjB,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,WAAG,CAAC;SACrC,CAAC;QACF,SAAS,EAAE;YACP,GAAG,EAAE,aAAC,CAAC,MAAM,CAAC;gBACV,MAAM,EAAE,aAAa;aACxB,CAAC;SACL;QACD,WAAW,EAAE,6BAA6B;KAC7C;CACJ,EACD;IACI,UAAU,EAAE,SAAS;CACxB,CACJ,CAAC;AAEO,sCAAa"}
@@ -4,13 +4,13 @@ declare const AuctionTemplateResponse: z.ZodObject<{
4
4
  name: z.ZodString;
5
5
  description: z.ZodNullable<z.ZodString>;
6
6
  }, "strip", z.ZodTypeAny, {
7
+ description: string | null;
7
8
  id: string;
8
9
  name: string;
9
- description: string | null;
10
10
  }, {
11
+ description: string | null;
11
12
  id: string;
12
13
  name: string;
13
- description: string | null;
14
14
  }>;
15
15
  declare const auctionTemplateContract: {
16
16
  listAuctionTemplates: {
@@ -23,25 +23,25 @@ declare const auctionTemplateContract: {
23
23
  name: z.ZodString;
24
24
  description: z.ZodNullable<z.ZodString>;
25
25
  }, "strip", z.ZodTypeAny, {
26
+ description: string | null;
26
27
  id: string;
27
28
  name: string;
28
- description: string | null;
29
29
  }, {
30
+ description: string | null;
30
31
  id: string;
31
32
  name: string;
32
- description: string | null;
33
33
  }>, "many">;
34
34
  }, "strip", z.ZodTypeAny, {
35
35
  result: {
36
+ description: string | null;
36
37
  id: string;
37
38
  name: string;
38
- description: string | null;
39
39
  }[];
40
40
  }, {
41
41
  result: {
42
+ description: string | null;
42
43
  id: string;
43
44
  name: string;
44
- description: string | null;
45
45
  }[];
46
46
  }>;
47
47
  };
@@ -91,8 +91,8 @@ declare const CreateDynamicAuctionResponse: z.ZodObject<{
91
91
  token_factory: `0x${string}`;
92
92
  token_factory_data: `0x${string}`;
93
93
  } | undefined;
94
- hook_address?: `0x${string}` | undefined;
95
94
  token_address?: `0x${string}` | undefined;
95
+ hook_address?: `0x${string}` | undefined;
96
96
  }, {
97
97
  encoded_payload: string;
98
98
  params?: {
@@ -110,8 +110,8 @@ declare const CreateDynamicAuctionResponse: z.ZodObject<{
110
110
  token_factory: string;
111
111
  token_factory_data: string;
112
112
  } | undefined;
113
- hook_address?: string | undefined;
114
113
  token_address?: string | undefined;
114
+ hook_address?: string | undefined;
115
115
  }>;
116
116
  declare const auctionContract: {
117
117
  listAuctions: {
@@ -378,8 +378,8 @@ declare const auctionContract: {
378
378
  token_factory: `0x${string}`;
379
379
  token_factory_data: `0x${string}`;
380
380
  } | undefined;
381
- hook_address?: `0x${string}` | undefined;
382
381
  token_address?: `0x${string}` | undefined;
382
+ hook_address?: `0x${string}` | undefined;
383
383
  }, {
384
384
  encoded_payload: string;
385
385
  params?: {
@@ -397,8 +397,8 @@ declare const auctionContract: {
397
397
  token_factory: string;
398
398
  token_factory_data: string;
399
399
  } | undefined;
400
- hook_address?: string | undefined;
401
400
  token_address?: string | undefined;
401
+ hook_address?: string | undefined;
402
402
  }>;
403
403
  }, "strip", z.ZodTypeAny, {
404
404
  result: {
@@ -418,8 +418,8 @@ declare const auctionContract: {
418
418
  token_factory: `0x${string}`;
419
419
  token_factory_data: `0x${string}`;
420
420
  } | undefined;
421
- hook_address?: `0x${string}` | undefined;
422
421
  token_address?: `0x${string}` | undefined;
422
+ hook_address?: `0x${string}` | undefined;
423
423
  };
424
424
  }, {
425
425
  result: {
@@ -439,8 +439,8 @@ declare const auctionContract: {
439
439
  token_factory: string;
440
440
  token_factory_data: string;
441
441
  } | undefined;
442
- hook_address?: string | undefined;
443
442
  token_address?: string | undefined;
443
+ hook_address?: string | undefined;
444
444
  };
445
445
  }>;
446
446
  };
@@ -6,14 +6,14 @@ declare const CommunityResponse: z.ZodObject<{
6
6
  funding_amount: z.ZodNumber;
7
7
  image_url: z.ZodNullable<z.ZodString>;
8
8
  }, "strip", z.ZodTypeAny, {
9
- id: number;
10
9
  description: string | null;
10
+ id: number;
11
11
  label: string;
12
12
  funding_amount: number;
13
13
  image_url: string | null;
14
14
  }, {
15
- id: number;
16
15
  description: string | null;
16
+ id: number;
17
17
  label: string;
18
18
  funding_amount: number;
19
19
  image_url: string | null;
@@ -31,30 +31,30 @@ declare const communityContract: {
31
31
  funding_amount: z.ZodNumber;
32
32
  image_url: z.ZodNullable<z.ZodString>;
33
33
  }, "strip", z.ZodTypeAny, {
34
- id: number;
35
34
  description: string | null;
35
+ id: number;
36
36
  label: string;
37
37
  funding_amount: number;
38
38
  image_url: string | null;
39
39
  }, {
40
- id: number;
41
40
  description: string | null;
41
+ id: number;
42
42
  label: string;
43
43
  funding_amount: number;
44
44
  image_url: string | null;
45
45
  }>, "many">;
46
46
  }, "strip", z.ZodTypeAny, {
47
47
  result: {
48
- id: number;
49
48
  description: string | null;
49
+ id: number;
50
50
  label: string;
51
51
  funding_amount: number;
52
52
  image_url: string | null;
53
53
  }[];
54
54
  }, {
55
55
  result: {
56
- id: number;
57
56
  description: string | null;
57
+ id: number;
58
58
  label: string;
59
59
  funding_amount: number;
60
60
  image_url: string | null;
@@ -81,30 +81,30 @@ declare const communityContract: {
81
81
  funding_amount: z.ZodNumber;
82
82
  image_url: z.ZodNullable<z.ZodString>;
83
83
  }, "strip", z.ZodTypeAny, {
84
- id: number;
85
84
  description: string | null;
85
+ id: number;
86
86
  label: string;
87
87
  funding_amount: number;
88
88
  image_url: string | null;
89
89
  }, {
90
- id: number;
91
90
  description: string | null;
91
+ id: number;
92
92
  label: string;
93
93
  funding_amount: number;
94
94
  image_url: string | null;
95
95
  }>;
96
96
  }, "strip", z.ZodTypeAny, {
97
97
  result: {
98
- id: number;
99
98
  description: string | null;
99
+ id: number;
100
100
  label: string;
101
101
  funding_amount: number;
102
102
  image_url: string | null;
103
103
  };
104
104
  }, {
105
105
  result: {
106
- id: number;
107
106
  description: string | null;
107
+ id: number;
108
108
  label: string;
109
109
  funding_amount: number;
110
110
  image_url: string | null;