@hashgraphonline/standards-agent-kit 0.2.152 → 0.2.154
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/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/es/standards-agent-kit.es24.js +1 -1
- package/dist/es/standards-agent-kit.es25.js +1 -1
- package/dist/es/standards-agent-kit.es26.js +1 -1
- package/dist/es/standards-agent-kit.es27.js +1 -1
- package/dist/es/standards-agent-kit.es28.js +1 -1
- package/dist/es/standards-agent-kit.es31.js +1 -1
- package/dist/es/standards-agent-kit.es32.js +1 -1
- package/dist/es/standards-agent-kit.es33.js +1 -1
- package/dist/es/standards-agent-kit.es36.js +1 -1
- package/dist/es/standards-agent-kit.es37.js +1 -1
- package/dist/es/standards-agent-kit.es38.js +3 -3
- package/dist/es/standards-agent-kit.es39.js +8 -8
- package/dist/es/standards-agent-kit.es39.js.map +1 -1
- package/dist/es/standards-agent-kit.es48.js +7 -3
- package/dist/es/standards-agent-kit.es48.js.map +1 -1
- package/dist/es/standards-agent-kit.es49.js +3 -7
- package/dist/es/standards-agent-kit.es49.js.map +1 -1
- package/dist/es/standards-agent-kit.es50.js +3 -20
- package/dist/es/standards-agent-kit.es50.js.map +1 -1
- package/dist/es/standards-agent-kit.es51.js +17 -50
- package/dist/es/standards-agent-kit.es51.js.map +1 -1
- package/dist/es/standards-agent-kit.es52.js +54 -3
- package/dist/es/standards-agent-kit.es52.js.map +1 -1
- package/dist/es/standards-agent-kit.es53.js +2 -39
- package/dist/es/standards-agent-kit.es53.js.map +1 -1
- package/dist/es/standards-agent-kit.es54.js +38 -17
- package/dist/es/standards-agent-kit.es54.js.map +1 -1
- package/dist/es/standards-agent-kit.es55.js +16 -71
- package/dist/es/standards-agent-kit.es55.js.map +1 -1
- package/dist/es/standards-agent-kit.es56.js +73 -3
- package/dist/es/standards-agent-kit.es56.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +1 -1
- package/dist/es/standards-agent-kit.es7.js +1 -1
- package/dist/es/standards-agent-kit.es9.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/tools/inscriber/InscribeHashinalTool.ts +9 -3
|
@@ -1,43 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
const
|
|
3
|
-
uri: z.string().describe("URI of the file"),
|
|
4
|
-
checksum: z.string().optional().describe("SHA-256 checksum of the file"),
|
|
5
|
-
is_default_file: z.boolean().optional().describe("Whether this is the default file"),
|
|
6
|
-
type: z.string().describe("MIME type of the file")
|
|
7
|
-
});
|
|
8
|
-
const hip412AttributeSchema = z.object({
|
|
9
|
-
trait_type: z.string().describe("The trait type"),
|
|
10
|
-
value: z.union([z.string(), z.number()]).describe("The trait value"),
|
|
11
|
-
display_type: z.string().optional().describe("Display type for the attribute")
|
|
12
|
-
});
|
|
13
|
-
const hip412MetadataSchema = z.object({
|
|
14
|
-
name: z.string().describe("Token name (required by HIP-412)"),
|
|
15
|
-
description: z.string().describe("Human readable description (required by HIP-412)"),
|
|
16
|
-
image: z.string().describe("Preview image URI (required by HIP-412)"),
|
|
17
|
-
type: z.string().describe("MIME type (required by HIP-412)"),
|
|
18
|
-
creator: z.string().optional().describe("Creator name or comma-separated names"),
|
|
19
|
-
creatorDID: z.string().optional().describe("Decentralized identifier for creator"),
|
|
20
|
-
checksum: z.string().optional().describe("SHA-256 checksum of the image"),
|
|
21
|
-
format: z.string().optional().default("HIP412@2.0.0").describe("Metadata format version"),
|
|
22
|
-
files: z.array(hip412FileSchema).optional().describe("Array of files for multi-file NFTs"),
|
|
23
|
-
attributes: z.array(hip412AttributeSchema).optional().describe("NFT attributes/traits"),
|
|
24
|
-
properties: z.record(z.unknown()).optional().describe("Additional properties")
|
|
25
|
-
});
|
|
26
|
-
function validateHIP412Metadata(metadata) {
|
|
27
|
-
try {
|
|
28
|
-
return hip412MetadataSchema.parse(metadata);
|
|
29
|
-
} catch (error) {
|
|
30
|
-
if (error instanceof z.ZodError) {
|
|
31
|
-
const issues = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
|
|
32
|
-
throw new Error(`HIP-412 metadata validation failed: ${issues}`);
|
|
33
|
-
}
|
|
34
|
-
throw error;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
2
|
+
const contentRefSchema = z.string().regex(/^content-ref:[a-zA-Z0-9_-]+$/, 'Content reference must be in format "content-ref:[alphanumeric-id]"').describe('Content reference in format "content-ref:[id]"');
|
|
37
3
|
export {
|
|
38
|
-
|
|
39
|
-
hip412FileSchema,
|
|
40
|
-
hip412MetadataSchema,
|
|
41
|
-
validateHIP412Metadata
|
|
4
|
+
contentRefSchema
|
|
42
5
|
};
|
|
43
6
|
//# sourceMappingURL=standards-agent-kit.es53.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es53.js","sources":["../../src/validation/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es53.js","sources":["../../src/validation/content-ref-schemas.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Validates content reference format\n */\nexport const contentRefSchema = z\n .string()\n .regex(/^content-ref:[a-zA-Z0-9_-]+$/, 'Content reference must be in format \"content-ref:[alphanumeric-id]\"')\n .describe('Content reference in format \"content-ref:[id]\"');\n\n/**\n * Validates content reference or returns error for dumber models\n */\nexport function validateContentRef(input: string): string {\n try {\n return contentRefSchema.parse(input);\n } catch (error) {\n throw new Error(`Invalid content reference format. Expected \"content-ref:[alphanumeric-id]\" but got \"${input}\"`);\n }\n}"],"names":[],"mappings":";AAKO,MAAM,mBAAmB,EAC7B,SACA,MAAM,gCAAgC,qEAAqE,EAC3G,SAAS,gDAAgD;"}
|
|
@@ -1,22 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const hip412FileSchema = z.object({
|
|
3
|
+
uri: z.string().describe("URI of the file"),
|
|
4
|
+
checksum: z.string().optional().describe("SHA-256 checksum of the file"),
|
|
5
|
+
is_default_file: z.boolean().optional().describe("Whether this is the default file"),
|
|
6
|
+
type: z.string().describe("MIME type of the file")
|
|
7
|
+
});
|
|
8
|
+
const hip412AttributeSchema = z.object({
|
|
9
|
+
trait_type: z.string().describe("The trait type"),
|
|
10
|
+
value: z.union([z.string(), z.number()]).describe("The trait value"),
|
|
11
|
+
display_type: z.string().optional().describe("Display type for the attribute")
|
|
12
|
+
});
|
|
13
|
+
const hip412MetadataSchema = z.object({
|
|
14
|
+
name: z.string().describe("Token name (required by HIP-412)"),
|
|
15
|
+
description: z.string().describe("Human readable description (required by HIP-412)"),
|
|
16
|
+
image: z.string().describe("Preview image URI (required by HIP-412)"),
|
|
17
|
+
type: z.string().describe("MIME type (required by HIP-412)"),
|
|
18
|
+
creator: z.string().optional().describe("Creator name or comma-separated names"),
|
|
19
|
+
creatorDID: z.string().optional().describe("Decentralized identifier for creator"),
|
|
20
|
+
checksum: z.string().optional().describe("SHA-256 checksum of the image"),
|
|
21
|
+
format: z.string().optional().default("HIP412@2.0.0").describe("Metadata format version"),
|
|
22
|
+
files: z.array(hip412FileSchema).optional().describe("Array of files for multi-file NFTs"),
|
|
23
|
+
attributes: z.array(hip412AttributeSchema).optional().describe("NFT attributes/traits"),
|
|
24
|
+
properties: z.record(z.unknown()).optional().describe("Additional properties")
|
|
25
|
+
});
|
|
26
|
+
function validateHIP412Metadata(metadata) {
|
|
27
|
+
try {
|
|
28
|
+
return hip412MetadataSchema.parse(metadata);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (error instanceof z.ZodError) {
|
|
31
|
+
const issues = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
|
|
32
|
+
throw new Error(`HIP-412 metadata validation failed: ${issues}`);
|
|
33
|
+
}
|
|
34
|
+
throw error;
|
|
10
35
|
}
|
|
11
|
-
return {
|
|
12
|
-
name: params.name || defaultName,
|
|
13
|
-
creator: params.creator || params.operatorAccount,
|
|
14
|
-
description: params.description || `${defaultType.charAt(0).toUpperCase() + defaultType.slice(1)} NFT inscribed as Hashinal`,
|
|
15
|
-
type: params.type || defaultType,
|
|
16
|
-
image: ""
|
|
17
|
-
};
|
|
18
36
|
}
|
|
19
37
|
export {
|
|
20
|
-
|
|
38
|
+
hip412AttributeSchema,
|
|
39
|
+
hip412FileSchema,
|
|
40
|
+
hip412MetadataSchema,
|
|
41
|
+
validateHIP412Metadata
|
|
21
42
|
};
|
|
22
43
|
//# sourceMappingURL=standards-agent-kit.es54.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es54.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es54.js","sources":["../../src/validation/hip412-schemas.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * HIP-412 file schema for multi-file NFTs\n */\nexport const hip412FileSchema = z.object({\n uri: z.string().describe('URI of the file'),\n checksum: z.string().optional().describe('SHA-256 checksum of the file'),\n is_default_file: z.boolean().optional().describe('Whether this is the default file'),\n type: z.string().describe('MIME type of the file'),\n});\n\n/**\n * HIP-412 attribute schema for NFT traits\n */\nexport const hip412AttributeSchema = z.object({\n trait_type: z.string().describe('The trait type'),\n value: z.union([z.string(), z.number()]).describe('The trait value'),\n display_type: z.string().optional().describe('Display type for the attribute'),\n});\n\n/**\n * HIP-412 compliant metadata schema for Hedera NFTs\n */\nexport const hip412MetadataSchema = z.object({\n name: z.string().describe('Token name (required by HIP-412)'),\n description: z.string().describe('Human readable description (required by HIP-412)'),\n image: z.string().describe('Preview image URI (required by HIP-412)'),\n type: z.string().describe('MIME type (required by HIP-412)'),\n creator: z.string().optional().describe('Creator name or comma-separated names'),\n creatorDID: z.string().optional().describe('Decentralized identifier for creator'),\n checksum: z.string().optional().describe('SHA-256 checksum of the image'),\n format: z.string().optional().default('HIP412@2.0.0').describe('Metadata format version'),\n files: z.array(hip412FileSchema).optional().describe('Array of files for multi-file NFTs'),\n attributes: z.array(hip412AttributeSchema).optional().describe('NFT attributes/traits'),\n properties: z.record(z.unknown()).optional().describe('Additional properties'),\n});\n\n/**\n * Validates metadata against HIP-412 standard\n */\nexport function validateHIP412Metadata(metadata: unknown): z.infer<typeof hip412MetadataSchema> {\n try {\n return hip412MetadataSchema.parse(metadata);\n } catch (error) {\n if (error instanceof z.ZodError) {\n const issues = error.errors.map(err => `${err.path.join('.')}: ${err.message}`).join('; ');\n throw new Error(`HIP-412 metadata validation failed: ${issues}`);\n }\n throw error;\n }\n}"],"names":[],"mappings":";AAKO,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,KAAK,EAAE,SAAS,SAAS,iBAAiB;AAAA,EAC1C,UAAU,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,8BAA8B;AAAA,EACvE,iBAAiB,EAAE,QAAA,EAAU,SAAA,EAAW,SAAS,kCAAkC;AAAA,EACnF,MAAM,EAAE,OAAA,EAAS,SAAS,uBAAuB;AACnD,CAAC;AAKM,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,YAAY,EAAE,SAAS,SAAS,gBAAgB;AAAA,EAChD,OAAO,EAAE,MAAM,CAAC,EAAE,OAAA,GAAU,EAAE,OAAA,CAAQ,CAAC,EAAE,SAAS,iBAAiB;AAAA,EACnE,cAAc,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,gCAAgC;AAC/E,CAAC;AAKM,MAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,MAAM,EAAE,SAAS,SAAS,kCAAkC;AAAA,EAC5D,aAAa,EAAE,SAAS,SAAS,kDAAkD;AAAA,EACnF,OAAO,EAAE,SAAS,SAAS,yCAAyC;AAAA,EACpE,MAAM,EAAE,SAAS,SAAS,iCAAiC;AAAA,EAC3D,SAAS,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,uCAAuC;AAAA,EAC/E,YAAY,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,sCAAsC;AAAA,EACjF,UAAU,EAAE,OAAA,EAAS,SAAA,EAAW,SAAS,+BAA+B;AAAA,EACxE,QAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,QAAQ,cAAc,EAAE,SAAS,yBAAyB;AAAA,EACxF,OAAO,EAAE,MAAM,gBAAgB,EAAE,SAAA,EAAW,SAAS,oCAAoC;AAAA,EACzF,YAAY,EAAE,MAAM,qBAAqB,EAAE,SAAA,EAAW,SAAS,uBAAuB;AAAA,EACtF,YAAY,EAAE,OAAO,EAAE,QAAA,CAAS,EAAE,WAAW,SAAS,uBAAuB;AAC/E,CAAC;AAKM,SAAS,uBAAuB,UAAyD;AAC9F,MAAI;AACF,WAAO,qBAAqB,MAAM,QAAQ;AAAA,EAC5C,SAAS,OAAO;AACd,QAAI,iBAAiB,EAAE,UAAU;AAC/B,YAAM,SAAS,MAAM,OAAO,IAAI,CAAA,QAAO,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,KAAK,IAAI,OAAO,EAAE,EAAE,KAAK,IAAI;AACzF,YAAM,IAAI,MAAM,uCAAuC,MAAM,EAAE;AAAA,IACjE;AACA,UAAM;AAAA,EACR;AACF;"}
|
|
@@ -1,77 +1,22 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
1
|
+
function generateDefaultMetadata(params) {
|
|
2
|
+
const defaultName = params.fileName?.replace(/\.[^/.]+$/, "") || "Hashinal NFT";
|
|
3
|
+
let defaultType = "media";
|
|
4
|
+
if (params.mimeType?.startsWith("image/")) {
|
|
5
|
+
defaultType = "image";
|
|
6
|
+
} else if (params.mimeType?.startsWith("video/")) {
|
|
7
|
+
defaultType = "video";
|
|
8
|
+
} else if (params.mimeType?.startsWith("audio/")) {
|
|
9
|
+
defaultType = "audio";
|
|
10
|
+
}
|
|
3
11
|
return {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
hrl,
|
|
10
|
-
topicId,
|
|
11
|
-
standard,
|
|
12
|
-
cdnUrl,
|
|
13
|
-
transactionId
|
|
14
|
-
},
|
|
15
|
-
metadata,
|
|
16
|
-
nextSteps: {
|
|
17
|
-
primary: "CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.",
|
|
18
|
-
context: 'The metadata parameter for minting should be exactly: ["' + hrl + '"] - just the HRL string in an array, nothing else.',
|
|
19
|
-
mintingMetadata: hrl
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function createInscriptionQuote(params) {
|
|
24
|
-
const { totalCostHbar, validUntil, breakdown, content } = params;
|
|
25
|
-
return {
|
|
26
|
-
success: true,
|
|
27
|
-
type: "quote",
|
|
28
|
-
title: "Inscription Cost Quote",
|
|
29
|
-
message: `Estimated cost to inscribe "${content.name || "your content"}" is ${totalCostHbar} HBAR.`,
|
|
30
|
-
quote: {
|
|
31
|
-
totalCostHbar,
|
|
32
|
-
validUntil,
|
|
33
|
-
breakdown
|
|
34
|
-
},
|
|
35
|
-
content
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function createInscriptionError(params) {
|
|
39
|
-
const { code, details, suggestions } = params;
|
|
40
|
-
return {
|
|
41
|
-
success: false,
|
|
42
|
-
type: "error",
|
|
43
|
-
title: "Inscription Failed",
|
|
44
|
-
message: `Unable to complete inscription: ${details}`,
|
|
45
|
-
error: {
|
|
46
|
-
code,
|
|
47
|
-
details,
|
|
48
|
-
suggestions
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function createInscriptionPending(params) {
|
|
53
|
-
const { transactionId, details, suggestions } = params;
|
|
54
|
-
const d = details || `Inscription submitted but not yet confirmed. Transaction ID: ${transactionId}`;
|
|
55
|
-
return {
|
|
56
|
-
success: false,
|
|
57
|
-
type: "error",
|
|
58
|
-
title: "Inscription Submitted (Pending)",
|
|
59
|
-
message: d,
|
|
60
|
-
error: {
|
|
61
|
-
code: "INSCRIPTION_PENDING",
|
|
62
|
-
details: d,
|
|
63
|
-
suggestions: suggestions || [
|
|
64
|
-
"Wait a few moments for confirmation",
|
|
65
|
-
"Check the transaction status on a Hedera explorer",
|
|
66
|
-
"Try the inscription again if it doesn't confirm within 5 minutes"
|
|
67
|
-
]
|
|
68
|
-
}
|
|
12
|
+
name: params.name || defaultName,
|
|
13
|
+
creator: params.creator || params.operatorAccount,
|
|
14
|
+
description: params.description || `${defaultType.charAt(0).toUpperCase() + defaultType.slice(1)} NFT inscribed as Hashinal`,
|
|
15
|
+
type: params.type || defaultType,
|
|
16
|
+
image: ""
|
|
69
17
|
};
|
|
70
18
|
}
|
|
71
19
|
export {
|
|
72
|
-
|
|
73
|
-
createInscriptionPending,
|
|
74
|
-
createInscriptionQuote,
|
|
75
|
-
createInscriptionSuccess
|
|
20
|
+
generateDefaultMetadata
|
|
76
21
|
};
|
|
77
22
|
//# sourceMappingURL=standards-agent-kit.es55.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es55.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es55.js","sources":["../../src/utils/metadata-defaults.ts"],"sourcesContent":["/**\n * Generates default metadata for NFT inscription\n */\nexport function generateDefaultMetadata(params: {\n name?: string;\n creator?: string;\n description?: string;\n type?: string;\n fileName?: string;\n mimeType?: string;\n operatorAccount: string;\n}): {\n name: string;\n creator: string;\n description: string;\n type: string;\n image: string;\n} {\n const defaultName = params.fileName?.replace(/\\.[^/.]+$/, '') || 'Hashinal NFT';\n let defaultType = 'media';\n if (params.mimeType?.startsWith('image/')) {\n defaultType = 'image';\n } else if (params.mimeType?.startsWith('video/')) {\n defaultType = 'video';\n } else if (params.mimeType?.startsWith('audio/')) {\n defaultType = 'audio';\n }\n\n return {\n name: params.name || defaultName,\n creator: params.creator || params.operatorAccount,\n description: params.description || `${defaultType.charAt(0).toUpperCase() + defaultType.slice(1)} NFT inscribed as Hashinal`,\n type: params.type || defaultType,\n image: '',\n };\n}"],"names":[],"mappings":"AAGO,SAAS,wBAAwB,QActC;AACA,QAAM,cAAc,OAAO,UAAU,QAAQ,aAAa,EAAE,KAAK;AACjE,MAAI,cAAc;AAClB,MAAI,OAAO,UAAU,WAAW,QAAQ,GAAG;AACzC,kBAAc;AAAA,EAChB,WAAW,OAAO,UAAU,WAAW,QAAQ,GAAG;AAChD,kBAAc;AAAA,EAChB,WAAW,OAAO,UAAU,WAAW,QAAQ,GAAG;AAChD,kBAAc;AAAA,EAChB;AAEA,SAAO;AAAA,IACL,MAAM,OAAO,QAAQ;AAAA,IACrB,SAAS,OAAO,WAAW,OAAO;AAAA,IAClC,aAAa,OAAO,eAAe,GAAG,YAAY,OAAO,CAAC,EAAE,YAAA,IAAgB,YAAY,MAAM,CAAC,CAAC;AAAA,IAChG,MAAM,OAAO,QAAQ;AAAA,IACrB,OAAO;AAAA,EAAA;AAEX;"}
|
|
@@ -1,7 +1,77 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function createInscriptionSuccess(params) {
|
|
2
|
+
const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;
|
|
3
|
+
return {
|
|
4
|
+
success: true,
|
|
5
|
+
type: "inscription",
|
|
6
|
+
title: `${standard} Hashinal Inscription Complete`,
|
|
7
|
+
message: `Successfully inscribed "${metadata.name || "your content"}" as a ${standard} Hashinal. The content is now ready for NFT minting.`,
|
|
8
|
+
inscription: {
|
|
9
|
+
hrl,
|
|
10
|
+
topicId,
|
|
11
|
+
standard,
|
|
12
|
+
cdnUrl,
|
|
13
|
+
transactionId
|
|
14
|
+
},
|
|
15
|
+
metadata,
|
|
16
|
+
nextSteps: {
|
|
17
|
+
primary: "CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.",
|
|
18
|
+
context: 'The metadata parameter for minting should be exactly: ["' + hrl + '"] - just the HRL string in an array, nothing else.',
|
|
19
|
+
mintingMetadata: hrl
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function createInscriptionQuote(params) {
|
|
24
|
+
const { totalCostHbar, validUntil, breakdown, content } = params;
|
|
25
|
+
return {
|
|
26
|
+
success: true,
|
|
27
|
+
type: "quote",
|
|
28
|
+
title: "Inscription Cost Quote",
|
|
29
|
+
message: `Estimated cost to inscribe "${content.name || "your content"}" is ${totalCostHbar} HBAR.`,
|
|
30
|
+
quote: {
|
|
31
|
+
totalCostHbar,
|
|
32
|
+
validUntil,
|
|
33
|
+
breakdown
|
|
34
|
+
},
|
|
35
|
+
content
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function createInscriptionError(params) {
|
|
39
|
+
const { code, details, suggestions } = params;
|
|
40
|
+
return {
|
|
41
|
+
success: false,
|
|
42
|
+
type: "error",
|
|
43
|
+
title: "Inscription Failed",
|
|
44
|
+
message: `Unable to complete inscription: ${details}`,
|
|
45
|
+
error: {
|
|
46
|
+
code,
|
|
47
|
+
details,
|
|
48
|
+
suggestions
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function createInscriptionPending(params) {
|
|
53
|
+
const { transactionId, details, suggestions } = params;
|
|
54
|
+
const d = details || `Inscription submitted but not yet confirmed. Transaction ID: ${transactionId}`;
|
|
55
|
+
return {
|
|
56
|
+
success: false,
|
|
57
|
+
type: "error",
|
|
58
|
+
title: "Inscription Submitted (Pending)",
|
|
59
|
+
message: d,
|
|
60
|
+
error: {
|
|
61
|
+
code: "INSCRIPTION_PENDING",
|
|
62
|
+
details: d,
|
|
63
|
+
suggestions: suggestions || [
|
|
64
|
+
"Wait a few moments for confirmation",
|
|
65
|
+
"Check the transaction status on a Hedera explorer",
|
|
66
|
+
"Try the inscription again if it doesn't confirm within 5 minutes"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
};
|
|
3
70
|
}
|
|
4
71
|
export {
|
|
5
|
-
|
|
72
|
+
createInscriptionError,
|
|
73
|
+
createInscriptionPending,
|
|
74
|
+
createInscriptionQuote,
|
|
75
|
+
createInscriptionSuccess
|
|
6
76
|
};
|
|
7
77
|
//# sourceMappingURL=standards-agent-kit.es56.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es56.js","sources":["../../src/types/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es56.js","sources":["../../src/types/inscription-response.ts"],"sourcesContent":["/**\n * Structured response interface for inscription tools\n * Provides a consistent, user-friendly format for inscription results\n */\n\nexport interface InscriptionSuccessResponse {\n success: true;\n type: 'inscription';\n title: string;\n message: string;\n inscription: {\n /** The HRL (Hashinal Reference Link) for minting - e.g., \"hcs://1/0.0.123456\" */\n hrl: string;\n /** Topic ID where the inscription was stored */\n topicId: string;\n /** Type of Hashinal - Static (HCS-5) or Dynamic (HCS-6) */\n standard: 'Static' | 'Dynamic';\n /** CDN URL for direct access to the inscribed content */\n cdnUrl?: string;\n /** Transaction ID of the inscription */\n transactionId?: string;\n };\n metadata: {\n /** Name/title of the inscribed content */\n name?: string;\n /** Creator of the content */\n creator?: string;\n /** Description of the content */\n description?: string;\n /** Content type (image, text, etc.) */\n type?: string;\n /** Additional attributes */\n attributes?: Array<{ trait_type: string; value: string | number }>;\n };\n nextSteps: {\n /** Primary action the user should take next */\n primary: string;\n /** Additional context or options */\n context?: string;\n /** Specific metadata value to use for minting */\n mintingMetadata: string;\n };\n /** HashLink block data (only present when withHashLinkBlocks=true) */\n hashLinkBlock?: {\n /** Block topic ID on HCS */\n blockId: string;\n /** HashLink reference to the block */\n hashLink: string;\n /** Template topic ID */\n template: string;\n /** Block attributes for rendering */\n attributes: BlockAttributes;\n };\n}\n\nexport interface InscriptionQuoteResponse {\n success: true;\n type: 'quote';\n title: string;\n message: string;\n quote: {\n /** Total cost in HBAR */\n totalCostHbar: string;\n /** When the quote expires */\n validUntil: string;\n /** Cost breakdown details */\n breakdown?: CostBreakdown;\n };\n content: {\n /** Name of the content to be inscribed */\n name?: string;\n /** Creator of the content */\n creator?: string;\n /** Type of content */\n type?: string;\n };\n}\n\nexport interface InscriptionErrorResponse {\n success: false;\n type: 'error';\n title: string;\n message: string;\n error: {\n /** Error code for programmatic handling */\n code: string;\n /** Detailed error message */\n details: string;\n /** Suggestions for fixing the error */\n suggestions?: string[];\n };\n}\n\nexport type InscriptionResponse =\n | InscriptionSuccessResponse\n | InscriptionQuoteResponse\n | InscriptionErrorResponse;\n\n/**\n * Helper function to create a successful inscription response\n */\nexport function createInscriptionSuccess(params: {\n hrl: string;\n topicId: string;\n standard: 'Static' | 'Dynamic';\n cdnUrl?: string;\n transactionId?: string;\n metadata: {\n name?: string;\n creator?: string;\n description?: string;\n type?: string;\n attributes?: Array<{ trait_type: string; value: string | number }>;\n };\n}): InscriptionSuccessResponse {\n const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;\n\n return {\n success: true,\n type: 'inscription',\n title: `${standard} Hashinal Inscription Complete`,\n message: `Successfully inscribed \"${\n metadata.name || 'your content'\n }\" as a ${standard} Hashinal. The content is now ready for NFT minting.`,\n inscription: {\n hrl,\n topicId,\n standard,\n cdnUrl,\n transactionId,\n },\n metadata,\n nextSteps: {\n primary: 'CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.',\n context:\n 'The metadata parameter for minting should be exactly: [\"' + hrl + '\"] - just the HRL string in an array, nothing else.',\n mintingMetadata: hrl,\n },\n };\n}\n\n/**\n * Block attributes for HashLink rendering\n */\ninterface BlockAttributes {\n /** Display name */\n name?: string;\n /** Description text */\n description?: string;\n /** Image URL */\n image?: string;\n /** Content type */\n contentType?: string;\n /** Size in bytes */\n size?: number;\n /** Custom metadata */\n metadata?: Record<string, string | number | boolean>;\n}\n\n/**\n * Transfer details in cost breakdown\n */\ninterface TransferDetails {\n to: string;\n amount: string;\n description: string;\n}\n\n/**\n * Cost breakdown details for inscription quote\n */\ninterface CostBreakdown {\n transfers: TransferDetails[];\n baseFee?: number;\n sizeFee?: number;\n networkFee?: number;\n serviceFee?: number;\n totalFee?: number;\n currency?: string;\n}\n\n/**\n * Helper function to create a quote response\n */\nexport function createInscriptionQuote(params: {\n totalCostHbar: string;\n validUntil: string;\n breakdown?: CostBreakdown;\n content: {\n name?: string;\n creator?: string;\n type?: string;\n };\n}): InscriptionQuoteResponse {\n const { totalCostHbar, validUntil, breakdown, content } = params;\n\n return {\n success: true,\n type: 'quote',\n title: 'Inscription Cost Quote',\n message: `Estimated cost to inscribe \"${\n content.name || 'your content'\n }\" is ${totalCostHbar} HBAR.`,\n quote: {\n totalCostHbar,\n validUntil,\n breakdown,\n },\n content,\n };\n}\n\n/**\n * Helper function to create an error response\n */\nexport function createInscriptionError(params: {\n code: string;\n details: string;\n suggestions?: string[];\n}): InscriptionErrorResponse {\n const { code, details, suggestions } = params;\n\n return {\n success: false,\n type: 'error',\n title: 'Inscription Failed',\n message: `Unable to complete inscription: ${details}`,\n error: {\n code,\n details,\n suggestions,\n },\n };\n}\n\n/**\n * Helper for pending inscription state (submitted but not yet confirmed)\n */\nexport function createInscriptionPending(params: {\n transactionId: string;\n details?: string;\n suggestions?: string[];\n}): InscriptionErrorResponse {\n const { transactionId, details, suggestions } = params;\n const d = details || `Inscription submitted but not yet confirmed. Transaction ID: ${transactionId}`;\n return {\n success: false,\n type: 'error',\n title: 'Inscription Submitted (Pending)',\n message: d,\n error: {\n code: 'INSCRIPTION_PENDING',\n details: d,\n suggestions: suggestions || [\n 'Wait a few moments for confirmation',\n 'Check the transaction status on a Hedera explorer',\n \"Try the inscription again if it doesn't confirm within 5 minutes\",\n ],\n },\n };\n}\n"],"names":[],"mappings":"AAqGO,SAAS,yBAAyB,QAaV;AAC7B,QAAM,EAAE,KAAK,SAAS,UAAU,QAAQ,eAAe,aAAa;AAEpE,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO,GAAG,QAAQ;AAAA,IAClB,SAAS,2BACP,SAAS,QAAQ,cACnB,UAAU,QAAQ;AAAA,IAClB,aAAa;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF;AAAA,IACA,WAAW;AAAA,MACT,SAAS;AAAA,MACT,SACE,6DAA6D,MAAM;AAAA,MACrE,iBAAiB;AAAA,IAAA;AAAA,EACnB;AAEJ;AA6CO,SAAS,uBAAuB,QASV;AAC3B,QAAM,EAAE,eAAe,YAAY,WAAW,YAAY;AAE1D,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS,+BACP,QAAQ,QAAQ,cAClB,QAAQ,aAAa;AAAA,IACrB,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF;AAAA,EAAA;AAEJ;AAKO,SAAS,uBAAuB,QAIV;AAC3B,QAAM,EAAE,MAAM,SAAS,YAAA,IAAgB;AAEvC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS,mCAAmC,OAAO;AAAA,IACnD,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EACF;AAEJ;AAKO,SAAS,yBAAyB,QAIZ;AAC3B,QAAM,EAAE,eAAe,SAAS,YAAA,IAAgB;AAChD,QAAM,IAAI,WAAW,gEAAgE,aAAa;AAClG,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa,eAAe;AAAA,QAC1B;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseServiceBuilder } from "hedera-agent-kit";
|
|
2
2
|
import { HederaMirrorNode, HCS2Client } from "@hashgraphonline/standards-sdk";
|
|
3
3
|
import { SignerProviderRegistry } from "./standards-agent-kit.es3.js";
|
|
4
|
-
import { CodedError } from "./standards-agent-kit.
|
|
4
|
+
import { CodedError } from "./standards-agent-kit.es48.js";
|
|
5
5
|
class HCS2Builder extends BaseServiceBuilder {
|
|
6
6
|
constructor(hederaKit) {
|
|
7
7
|
super(hederaKit);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseServiceBuilder } from "hedera-agent-kit";
|
|
2
2
|
import { HCS6Client, HederaMirrorNode } from "@hashgraphonline/standards-sdk";
|
|
3
3
|
import { SignerProviderRegistry } from "./standards-agent-kit.es3.js";
|
|
4
|
-
import { CodedError } from "./standards-agent-kit.
|
|
4
|
+
import { CodedError } from "./standards-agent-kit.es48.js";
|
|
5
5
|
class HCS6Builder extends BaseServiceBuilder {
|
|
6
6
|
constructor(hederaKit) {
|
|
7
7
|
super(hederaKit);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HCS10Client as HCS10Client$1, Logger, AgentBuilder, AIAgentCapability, InboundTopicType } from "@hashgraphonline/standards-sdk";
|
|
2
|
-
import { encryptMessage } from "./standards-agent-kit.
|
|
2
|
+
import { encryptMessage } from "./standards-agent-kit.es49.js";
|
|
3
3
|
class HCS10Client {
|
|
4
4
|
constructor(operatorId, operatorPrivateKey, network, options) {
|
|
5
5
|
this.standardClient = new HCS10Client$1({
|