@longdotxyz/shared 0.0.126 → 0.0.128

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.
@@ -6375,6 +6375,100 @@ export declare const rootContract: {
6375
6375
  };
6376
6376
  };
6377
6377
  };
6378
+ tokens: {
6379
+ createToken: {
6380
+ description: "Create a token in one call: uploads image to IPFS, uploads metadata to IPFS, encodes the payload, and broadcasts the transaction with gas sponsorship.";
6381
+ query: import("zod").ZodObject<{
6382
+ chainId: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodNumber, number, number>>>;
6383
+ }, "strip", import("zod").ZodTypeAny, {
6384
+ chainId: number;
6385
+ }, {
6386
+ chainId?: number | undefined;
6387
+ }>;
6388
+ method: "POST";
6389
+ contentType: "multipart/form-data";
6390
+ body: import("zod").ZodObject<{
6391
+ token_name: import("zod").ZodString;
6392
+ token_symbol: import("zod").ZodString;
6393
+ description: import("zod").ZodString;
6394
+ social_links: import("zod").ZodOptional<import("zod").ZodString>;
6395
+ agent_address: import("zod").ZodEffects<import("zod").ZodString, `0x${string}`, string>;
6396
+ category: import("zod").ZodEnum<["builder", "product"]>;
6397
+ numeraire: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodString, `0x${string}`, string>>;
6398
+ }, "strip", import("zod").ZodTypeAny, {
6399
+ token_name: string;
6400
+ token_symbol: string;
6401
+ description: string;
6402
+ agent_address: `0x${string}`;
6403
+ category: "builder" | "product";
6404
+ social_links?: string | undefined;
6405
+ numeraire?: `0x${string}` | undefined;
6406
+ }, {
6407
+ token_name: string;
6408
+ token_symbol: string;
6409
+ description: string;
6410
+ agent_address: string;
6411
+ category: "builder" | "product";
6412
+ social_links?: string | undefined;
6413
+ numeraire?: string | undefined;
6414
+ }>;
6415
+ path: "/tokens";
6416
+ responses: {
6417
+ 200: import("zod").ZodObject<{
6418
+ result: import("zod").ZodObject<{
6419
+ transaction_hash: import("zod").ZodEffects<import("zod").ZodString, `0x${string}`, string>;
6420
+ token_address: import("zod").ZodEffects<import("zod").ZodString, `0x${string}`, string>;
6421
+ hook_address: import("zod").ZodEffects<import("zod").ZodString, `0x${string}`, string>;
6422
+ metadata_uri: import("zod").ZodString;
6423
+ }, "strip", import("zod").ZodTypeAny, {
6424
+ token_address: `0x${string}`;
6425
+ hook_address: `0x${string}`;
6426
+ transaction_hash: `0x${string}`;
6427
+ metadata_uri: string;
6428
+ }, {
6429
+ token_address: string;
6430
+ hook_address: string;
6431
+ transaction_hash: string;
6432
+ metadata_uri: string;
6433
+ }>;
6434
+ }, "strip", import("zod").ZodTypeAny, {
6435
+ result: {
6436
+ token_address: `0x${string}`;
6437
+ hook_address: `0x${string}`;
6438
+ transaction_hash: `0x${string}`;
6439
+ metadata_uri: string;
6440
+ };
6441
+ }, {
6442
+ result: {
6443
+ token_address: string;
6444
+ hook_address: string;
6445
+ transaction_hash: string;
6446
+ metadata_uri: string;
6447
+ };
6448
+ }>;
6449
+ 400: import("zod").ZodObject<{
6450
+ step: import("zod").ZodEnum<["validation", "ipfs_image", "ipfs_metadata", "encode", "broadcast"]>;
6451
+ error: import("zod").ZodString;
6452
+ }, "strip", import("zod").ZodTypeAny, {
6453
+ step: "validation" | "ipfs_image" | "ipfs_metadata" | "encode" | "broadcast";
6454
+ error: string;
6455
+ }, {
6456
+ step: "validation" | "ipfs_image" | "ipfs_metadata" | "encode" | "broadcast";
6457
+ error: string;
6458
+ }>;
6459
+ 500: import("zod").ZodObject<{
6460
+ step: import("zod").ZodEnum<["validation", "ipfs_image", "ipfs_metadata", "encode", "broadcast"]>;
6461
+ error: import("zod").ZodString;
6462
+ }, "strip", import("zod").ZodTypeAny, {
6463
+ step: "validation" | "ipfs_image" | "ipfs_metadata" | "encode" | "broadcast";
6464
+ error: string;
6465
+ }, {
6466
+ step: "validation" | "ipfs_image" | "ipfs_metadata" | "encode" | "broadcast";
6467
+ error: string;
6468
+ }>;
6469
+ };
6470
+ };
6471
+ };
6378
6472
  };
6379
6473
  export * from "./asset.contract";
6380
6474
  export * from "./auction.contract";
@@ -6385,3 +6479,4 @@ export * from "./ipfs.contract";
6385
6479
  export * from "./market.contract";
6386
6480
  export * from "./pathfinding.contract";
6387
6481
  export * from "./sponsorship.contract";
6482
+ export * from "./tokens.contract";
@@ -25,6 +25,7 @@ const ipfs_contract_1 = require("./ipfs.contract");
25
25
  const market_contract_1 = require("./market.contract");
26
26
  const pathfinding_contract_1 = require("./pathfinding.contract");
27
27
  const sponsorship_contract_1 = require("./sponsorship.contract");
28
+ const tokens_contract_1 = require("./tokens.contract");
28
29
  const contract = (0, core_1.initContract)();
29
30
  exports.rootContract = contract.router({
30
31
  assets: asset_contract_1.assetContract,
@@ -36,6 +37,7 @@ exports.rootContract = contract.router({
36
37
  market: market_contract_1.marketContract,
37
38
  pathfinding: pathfinding_contract_1.pathfindingContract,
38
39
  sponsorships: sponsorship_contract_1.sponsorshipContract,
40
+ tokens: tokens_contract_1.tokensContract,
39
41
  });
40
42
  __exportStar(require("./asset.contract"), exports);
41
43
  __exportStar(require("./auction.contract"), exports);
@@ -46,4 +48,5 @@ __exportStar(require("./ipfs.contract"), exports);
46
48
  __exportStar(require("./market.contract"), exports);
47
49
  __exportStar(require("./pathfinding.contract"), exports);
48
50
  __exportStar(require("./sponsorship.contract"), exports);
51
+ __exportStar(require("./tokens.contract"), exports);
49
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAA6C;AAE7C,qDAAiD;AACjD,2EAAsE;AACtE,yDAAqD;AACrD,uDAAmD;AACnD,6DAAyD;AACzD,mDAA+C;AAC/C,uDAAmD;AACnD,iEAA6D;AAC7D,iEAA6D;AAE7D,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AACnB,QAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,8BAAa;IACrB,QAAQ,EAAE,kCAAe;IACzB,gBAAgB,EAAE,mDAAuB;IACzC,MAAM,EAAE,gCAAc;IACtB,WAAW,EAAE,sCAAiB;IAC9B,IAAI,EAAE,4BAAY;IAClB,MAAM,EAAE,gCAAc;IACtB,WAAW,EAAE,0CAAmB;IAChC,YAAY,EAAE,0CAAmB;CACpC,CAAC,CAAC;AAEH,mDAAiC;AACjC,qDAAmC;AACnC,8DAA4C;AAC5C,oDAAkC;AAClC,uDAAqC;AACrC,kDAAgC;AAChC,oDAAkC;AAClC,yDAAuC;AACvC,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAA6C;AAE7C,qDAAiD;AACjD,2EAAsE;AACtE,yDAAqD;AACrD,uDAAmD;AACnD,6DAAyD;AACzD,mDAA+C;AAC/C,uDAAmD;AACnD,iEAA6D;AAC7D,iEAA6D;AAC7D,uDAAmD;AAEnD,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AACnB,QAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,8BAAa;IACrB,QAAQ,EAAE,kCAAe;IACzB,gBAAgB,EAAE,mDAAuB;IACzC,MAAM,EAAE,gCAAc;IACtB,WAAW,EAAE,sCAAiB;IAC9B,IAAI,EAAE,4BAAY;IAClB,MAAM,EAAE,gCAAc;IACtB,WAAW,EAAE,0CAAmB;IAChC,YAAY,EAAE,0CAAmB;IACjC,MAAM,EAAE,gCAAc;CACzB,CAAC,CAAC;AAEH,mDAAiC;AACjC,qDAAmC;AACnC,8DAA4C;AAC5C,oDAAkC;AAClC,uDAAqC;AACrC,kDAAgC;AAChC,oDAAkC;AAClC,yDAAuC;AACvC,yDAAuC;AACvC,oDAAkC"}
@@ -0,0 +1,107 @@
1
+ import z from "zod";
2
+ declare const SocialLinkSchema: z.ZodObject<{
3
+ label: z.ZodString;
4
+ url: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ label: string;
7
+ url: string;
8
+ }, {
9
+ label: string;
10
+ url: string;
11
+ }>;
12
+ declare const CreateTokenStepEnum: z.ZodEnum<["validation", "ipfs_image", "ipfs_metadata", "encode", "broadcast"]>;
13
+ export declare const tokensContract: {
14
+ createToken: {
15
+ description: "Create a token in one call: uploads image to IPFS, uploads metadata to IPFS, encodes the payload, and broadcasts the transaction with gas sponsorship.";
16
+ query: z.ZodObject<{
17
+ chainId: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ chainId: number;
20
+ }, {
21
+ chainId?: number | undefined;
22
+ }>;
23
+ method: "POST";
24
+ contentType: "multipart/form-data";
25
+ body: z.ZodObject<{
26
+ token_name: z.ZodString;
27
+ token_symbol: z.ZodString;
28
+ description: z.ZodString;
29
+ social_links: z.ZodOptional<z.ZodString>;
30
+ agent_address: z.ZodEffects<z.ZodString, `0x${string}`, string>;
31
+ category: z.ZodEnum<["builder", "product"]>;
32
+ numeraire: z.ZodOptional<z.ZodEffects<z.ZodString, `0x${string}`, string>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ token_name: string;
35
+ token_symbol: string;
36
+ description: string;
37
+ agent_address: `0x${string}`;
38
+ category: "builder" | "product";
39
+ social_links?: string | undefined;
40
+ numeraire?: `0x${string}` | undefined;
41
+ }, {
42
+ token_name: string;
43
+ token_symbol: string;
44
+ description: string;
45
+ agent_address: string;
46
+ category: "builder" | "product";
47
+ social_links?: string | undefined;
48
+ numeraire?: string | undefined;
49
+ }>;
50
+ path: "/tokens";
51
+ responses: {
52
+ 200: z.ZodObject<{
53
+ result: z.ZodObject<{
54
+ transaction_hash: z.ZodEffects<z.ZodString, `0x${string}`, string>;
55
+ token_address: z.ZodEffects<z.ZodString, `0x${string}`, string>;
56
+ hook_address: z.ZodEffects<z.ZodString, `0x${string}`, string>;
57
+ metadata_uri: z.ZodString;
58
+ }, "strip", z.ZodTypeAny, {
59
+ token_address: `0x${string}`;
60
+ hook_address: `0x${string}`;
61
+ transaction_hash: `0x${string}`;
62
+ metadata_uri: string;
63
+ }, {
64
+ token_address: string;
65
+ hook_address: string;
66
+ transaction_hash: string;
67
+ metadata_uri: string;
68
+ }>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ result: {
71
+ token_address: `0x${string}`;
72
+ hook_address: `0x${string}`;
73
+ transaction_hash: `0x${string}`;
74
+ metadata_uri: string;
75
+ };
76
+ }, {
77
+ result: {
78
+ token_address: string;
79
+ hook_address: string;
80
+ transaction_hash: string;
81
+ metadata_uri: string;
82
+ };
83
+ }>;
84
+ 400: z.ZodObject<{
85
+ step: z.ZodEnum<["validation", "ipfs_image", "ipfs_metadata", "encode", "broadcast"]>;
86
+ error: z.ZodString;
87
+ }, "strip", z.ZodTypeAny, {
88
+ step: "validation" | "ipfs_image" | "ipfs_metadata" | "encode" | "broadcast";
89
+ error: string;
90
+ }, {
91
+ step: "validation" | "ipfs_image" | "ipfs_metadata" | "encode" | "broadcast";
92
+ error: string;
93
+ }>;
94
+ 500: z.ZodObject<{
95
+ step: z.ZodEnum<["validation", "ipfs_image", "ipfs_metadata", "encode", "broadcast"]>;
96
+ error: z.ZodString;
97
+ }, "strip", z.ZodTypeAny, {
98
+ step: "validation" | "ipfs_image" | "ipfs_metadata" | "encode" | "broadcast";
99
+ error: string;
100
+ }, {
101
+ step: "validation" | "ipfs_image" | "ipfs_metadata" | "encode" | "broadcast";
102
+ error: string;
103
+ }>;
104
+ };
105
+ };
106
+ };
107
+ export { SocialLinkSchema, CreateTokenStepEnum };
@@ -0,0 +1,67 @@
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.CreateTokenStepEnum = exports.SocialLinkSchema = exports.tokensContract = void 0;
7
+ const core_1 = require("@ts-rest/core");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const types_1 = require("../types");
10
+ const contract = (0, core_1.initContract)();
11
+ const CoinCategoryEnum = zod_1.default.enum(["builder", "product"]);
12
+ const SocialLinkSchema = zod_1.default.object({
13
+ label: zod_1.default.string(),
14
+ url: zod_1.default.string(),
15
+ });
16
+ exports.SocialLinkSchema = SocialLinkSchema;
17
+ const CreateTokenStepEnum = zod_1.default.enum(["validation", "ipfs_image", "ipfs_metadata", "encode", "broadcast"]);
18
+ exports.CreateTokenStepEnum = CreateTokenStepEnum;
19
+ exports.tokensContract = contract.router({
20
+ createToken: {
21
+ method: "POST",
22
+ path: "",
23
+ contentType: "multipart/form-data",
24
+ query: zod_1.default.object({
25
+ chainId: zod_1.default.coerce
26
+ .number()
27
+ .int()
28
+ .refine((val) => Object.values(types_1.ChainID).includes(val), {
29
+ message: "Invalid chain ID",
30
+ })
31
+ .optional()
32
+ .default(types_1.ChainID.BASE_MAINNET)
33
+ .describe("The chain ID to deploy on"),
34
+ }),
35
+ body: zod_1.default.object({
36
+ token_name: zod_1.default.string().min(1).max(32).describe("Token name (max 32 chars)"),
37
+ token_symbol: zod_1.default.string().min(1).max(10).describe("Token symbol (max 10 chars)"),
38
+ description: zod_1.default.string().min(1).max(1000).describe("Token description (max 1000 chars)"),
39
+ social_links: zod_1.default.string().optional().describe("JSON array of social links [{label, url}]"),
40
+ agent_address: types_1.hex.describe("Address that will receive 50% of fees"),
41
+ category: CoinCategoryEnum.describe("Token category - 'builder' or 'product'"),
42
+ numeraire: types_1.hex.optional().describe("Quote token address. Defaults to USDC for builder, WETH for product"),
43
+ }),
44
+ responses: {
45
+ 200: zod_1.default.object({
46
+ result: zod_1.default.object({
47
+ transaction_hash: types_1.hex.describe("The transaction hash"),
48
+ token_address: types_1.hex.describe("The deployed token address"),
49
+ hook_address: types_1.hex.describe("The hook contract address"),
50
+ metadata_uri: zod_1.default.string().describe("The IPFS URI of the token metadata"),
51
+ }),
52
+ }),
53
+ 400: zod_1.default.object({
54
+ step: CreateTokenStepEnum.describe("The step that failed"),
55
+ error: zod_1.default.string().describe("Error message"),
56
+ }),
57
+ 500: zod_1.default.object({
58
+ step: CreateTokenStepEnum.describe("The step that failed"),
59
+ error: zod_1.default.string().describe("Error message"),
60
+ }),
61
+ },
62
+ description: "Create a token in one call: uploads image to IPFS, uploads metadata to IPFS, encodes the payload, and broadcasts the transaction with gas sponsorship.",
63
+ },
64
+ }, {
65
+ pathPrefix: "/tokens",
66
+ });
67
+ //# sourceMappingURL=tokens.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.contract.js","sourceRoot":"","sources":["../../src/contracts/tokens.contract.ts"],"names":[],"mappings":";;;;;;AAAA,wCAA6C;AAC7C,8CAAoB;AAEpB,oCAAwC;AAExC,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AAEhC,MAAM,gBAAgB,GAAG,aAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAExD,MAAM,gBAAgB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC9B,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE;IACjB,GAAG,EAAE,aAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAwDM,4CAAgB;AAtDzB,MAAM,mBAAmB,GAAG,aAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAsD9E,kDAAmB;AApDjC,QAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,CACzC;IACI,WAAW,EAAE;QACT,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,qBAAqB;QAClC,KAAK,EAAE,aAAC,CAAC,MAAM,CAAC;YACZ,OAAO,EAAE,aAAC,CAAC,MAAM;iBACZ,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,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4B,CAAC;oBACzD,YAAY,EAAE,WAAG,CAAC,QAAQ,CAAC,2BAA2B,CAAC;oBACvD,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;iBAC1E,CAAC;aACL,CAAC;YACF,GAAG,EAAE,aAAC,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,sBAAsB,CAAC;gBAC1D,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;aAC9C,CAAC;YACF,GAAG,EAAE,aAAC,CAAC,MAAM,CAAC;gBACV,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,sBAAsB,CAAC;gBAC1D,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;aAC9C,CAAC;SACL;QACD,WAAW,EAAE,wJAAwJ;KACxK;CACJ,EACD;IACI,UAAU,EAAE,SAAS;CACxB,CACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longdotxyz/shared",
3
- "version": "0.0.126",
3
+ "version": "0.0.128",
4
4
  "description": "Shared types and utilities for Long.xyz API",
5
5
  "files": [
6
6
  "dist"