@hashgraphonline/standards-sdk 0.1.141-canary.20 → 0.1.141-canary.22
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/hcs-20/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-20/types.d.ts +1 -0
- package/dist/cjs/hcs-20/types.d.ts.map +1 -1
- package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +1 -1
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/es/hcs-20/sdk.d.ts.map +1 -1
- package/dist/es/hcs-20/types.d.ts +1 -0
- package/dist/es/hcs-20/types.d.ts.map +1 -1
- package/dist/es/inscribe/inscriber.d.ts.map +1 -1
- package/dist/es/standards-sdk.es100.js +1 -1
- package/dist/es/standards-sdk.es102.js +1 -1
- package/dist/es/standards-sdk.es104.js +1 -1
- package/dist/es/standards-sdk.es110.js +1 -1
- package/dist/es/standards-sdk.es12.js +1 -1
- package/dist/es/standards-sdk.es125.js +5 -4
- package/dist/es/standards-sdk.es125.js.map +1 -1
- package/dist/es/standards-sdk.es126.js +1 -1
- package/dist/es/standards-sdk.es128.js +1 -1
- package/dist/es/standards-sdk.es13.js +1 -1
- package/dist/es/standards-sdk.es137.js +766 -17
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +12241 -105
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +138 -766
- package/dist/es/standards-sdk.es139.js.map +1 -1
- package/dist/es/standards-sdk.es140.js +34 -12266
- package/dist/es/standards-sdk.es140.js.map +1 -1
- package/dist/es/standards-sdk.es141.js +50 -36
- package/dist/es/standards-sdk.es141.js.map +1 -1
- package/dist/es/standards-sdk.es142.js +15 -54
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es17.js +1 -1
- package/dist/es/standards-sdk.es19.js +4 -4
- package/dist/es/standards-sdk.es20.js +2 -2
- package/dist/es/standards-sdk.es23.js +1 -1
- package/dist/es/standards-sdk.es28.js +3 -3
- package/dist/es/standards-sdk.es31.js +1 -1
- package/dist/es/standards-sdk.es32.js +1 -1
- package/dist/es/standards-sdk.es36.js +2 -2
- package/dist/es/standards-sdk.es37.js +3 -3
- package/dist/es/standards-sdk.es38.js +1 -1
- package/dist/es/standards-sdk.es5.js +1 -1
- package/dist/es/standards-sdk.es54.js +1 -1
- package/dist/es/standards-sdk.es57.js +1 -1
- package/dist/es/standards-sdk.es59.js +1 -1
- package/dist/es/standards-sdk.es61.js +2 -2
- package/dist/es/standards-sdk.es65.js +1 -1
- package/dist/es/standards-sdk.es66.js +2 -2
- package/dist/es/standards-sdk.es69.js +2 -2
- package/dist/es/standards-sdk.es70.js +1 -1
- package/dist/es/standards-sdk.es72.js +1 -1
- package/dist/es/standards-sdk.es73.js.map +1 -1
- package/dist/es/standards-sdk.es77.js +4 -2
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +1 -1
- package/dist/es/standards-sdk.es79.js +1 -1
- package/dist/es/standards-sdk.es8.js +1 -1
- package/dist/es/standards-sdk.es82.js +1 -1
- package/dist/es/standards-sdk.es84.js +1 -1
- package/dist/es/standards-sdk.es88.js +1 -1
- package/dist/es/standards-sdk.es92.js +1 -1
- package/dist/es/standards-sdk.es93.js +1 -1
- package/dist/es/standards-sdk.es98.js +1 -1
- package/package.json +1 -1
|
@@ -1,45 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
2
|
+
const BASE = 58;
|
|
3
|
+
function base58Encode(bytes) {
|
|
4
|
+
if (bytes.length === 0) return "";
|
|
5
|
+
let zeros = 0;
|
|
6
|
+
while (zeros < bytes.length && bytes[zeros] === 0) zeros++;
|
|
7
|
+
if (zeros === bytes.length) return "1".repeat(zeros);
|
|
8
|
+
const digits = [0];
|
|
9
|
+
for (let i = zeros; i < bytes.length; i++) {
|
|
10
|
+
let carry = bytes[i];
|
|
11
|
+
for (let j = 0; j < digits.length; j++) {
|
|
12
|
+
const val = (digits[j] << 8) + carry;
|
|
13
|
+
digits[j] = val % BASE;
|
|
14
|
+
carry = val / BASE | 0;
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} catch {
|
|
18
|
-
return void 0;
|
|
19
|
-
}
|
|
16
|
+
while (carry > 0) {
|
|
17
|
+
digits.push(carry % BASE);
|
|
18
|
+
carry = carry / BASE | 0;
|
|
20
19
|
}
|
|
21
|
-
return void 0;
|
|
22
|
-
};
|
|
23
|
-
const admin = coerceKey(adminKey);
|
|
24
|
-
if (admin) {
|
|
25
|
-
tx.setAdminKey(admin);
|
|
26
|
-
}
|
|
27
|
-
const submit = coerceKey(submitKey);
|
|
28
|
-
if (submit) {
|
|
29
|
-
tx.setSubmitKey(submit);
|
|
30
20
|
}
|
|
31
|
-
|
|
21
|
+
let result = "";
|
|
22
|
+
for (let i = 0; i < zeros; i++) result += "1";
|
|
23
|
+
for (let i = digits.length - 1; i >= 0; i--) result += ALPHABET[digits[i]];
|
|
24
|
+
return result;
|
|
32
25
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
function base58Decode(text) {
|
|
27
|
+
if (text.length === 0) return new Uint8Array(0);
|
|
28
|
+
let zeros = 0;
|
|
29
|
+
while (zeros < text.length && text[zeros] === "1") zeros++;
|
|
30
|
+
const b256 = [];
|
|
31
|
+
for (let i = zeros; i < text.length; i++) {
|
|
32
|
+
const ch = text[i];
|
|
33
|
+
const val = ALPHABET.indexOf(ch);
|
|
34
|
+
if (val === -1) throw new Error("Invalid Base58 character");
|
|
35
|
+
let carry = val;
|
|
36
|
+
for (let j = 0; j < b256.length; j++) {
|
|
37
|
+
const x = b256[j] * BASE + carry;
|
|
38
|
+
b256[j] = x & 255;
|
|
39
|
+
carry = x >> 8;
|
|
40
|
+
}
|
|
41
|
+
while (carry > 0) {
|
|
42
|
+
b256.push(carry & 255);
|
|
43
|
+
carry >>= 8;
|
|
44
|
+
}
|
|
37
45
|
}
|
|
38
|
-
|
|
46
|
+
for (let i = 0; i < zeros; i++) b256.push(0);
|
|
47
|
+
b256.reverse();
|
|
48
|
+
return Uint8Array.from(b256);
|
|
49
|
+
}
|
|
50
|
+
function multibaseB58btcDecode(zText) {
|
|
51
|
+
if (!zText.startsWith("z")) throw new Error("Invalid multibase base58btc");
|
|
52
|
+
return base58Decode(zText.slice(1));
|
|
39
53
|
}
|
|
40
54
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
base58Decode,
|
|
56
|
+
base58Encode,
|
|
57
|
+
multibaseB58btcDecode
|
|
44
58
|
};
|
|
45
59
|
//# sourceMappingURL=standards-sdk.es141.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es141.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es141.js","sources":["../../src/hcs-14/base58.ts"],"sourcesContent":["/**\n * Minimal Base58 encoder/decoder (Bitcoin alphabet) with no external dependencies.\n */\n\nconst ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\nconst BASE = 58;\n\nfunction countLeadingZeros(bytes: Uint8Array): number {\n let zeros = 0;\n for (let i = 0; i < bytes.length && bytes[i] === 0; i++) {\n zeros++;\n }\n return zeros;\n}\n\nexport function base58Encode(bytes: Uint8Array): string {\n if (bytes.length === 0) return '';\n\n let zeros = 0;\n while (zeros < bytes.length && bytes[zeros] === 0) zeros++;\n\n if (zeros === bytes.length) return '1'.repeat(zeros);\n\n const digits: number[] = [0];\n for (let i = zeros; i < bytes.length; i++) {\n let carry = bytes[i];\n for (let j = 0; j < digits.length; j++) {\n const val = (digits[j] << 8) + carry;\n digits[j] = val % BASE;\n carry = (val / BASE) | 0;\n }\n while (carry > 0) {\n digits.push(carry % BASE);\n carry = (carry / BASE) | 0;\n }\n }\n\n let result = '';\n for (let i = 0; i < zeros; i++) result += '1';\n for (let i = digits.length - 1; i >= 0; i--) result += ALPHABET[digits[i]];\n return result;\n}\n\nexport function base58Decode(text: string): Uint8Array {\n if (text.length === 0) return new Uint8Array(0);\n\n let zeros = 0;\n while (zeros < text.length && text[zeros] === '1') zeros++;\n\n const b256: number[] = [];\n for (let i = zeros; i < text.length; i++) {\n const ch = text[i];\n const val = ALPHABET.indexOf(ch);\n if (val === -1) throw new Error('Invalid Base58 character');\n\n let carry = val;\n for (let j = 0; j < b256.length; j++) {\n const x = b256[j] * BASE + carry;\n b256[j] = x & 0xff;\n carry = x >> 8;\n }\n while (carry > 0) {\n b256.push(carry & 0xff);\n carry >>= 8;\n }\n }\n\n for (let i = 0; i < zeros; i++) b256.push(0);\n b256.reverse();\n return Uint8Array.from(b256);\n}\n\nexport function multibaseB58btcDecode(zText: string): Uint8Array {\n if (!zText.startsWith('z')) throw new Error('Invalid multibase base58btc');\n return base58Decode(zText.slice(1));\n}\n"],"names":[],"mappings":"AAIA,MAAM,WAAW;AACjB,MAAM,OAAO;AAUN,SAAS,aAAa,OAA2B;AACtD,MAAI,MAAM,WAAW,EAAG,QAAO;AAE/B,MAAI,QAAQ;AACZ,SAAO,QAAQ,MAAM,UAAU,MAAM,KAAK,MAAM,EAAG;AAEnD,MAAI,UAAU,MAAM,OAAQ,QAAO,IAAI,OAAO,KAAK;AAEnD,QAAM,SAAmB,CAAC,CAAC;AAC3B,WAAS,IAAI,OAAO,IAAI,MAAM,QAAQ,KAAK;AACzC,QAAI,QAAQ,MAAM,CAAC;AACnB,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,YAAM,OAAO,OAAO,CAAC,KAAK,KAAK;AAC/B,aAAO,CAAC,IAAI,MAAM;AAClB,cAAS,MAAM,OAAQ;AAAA,IACzB;AACA,WAAO,QAAQ,GAAG;AAChB,aAAO,KAAK,QAAQ,IAAI;AACxB,cAAS,QAAQ,OAAQ;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,OAAO,IAAK,WAAU;AAC1C,WAAS,IAAI,OAAO,SAAS,GAAG,KAAK,GAAG,IAAK,WAAU,SAAS,OAAO,CAAC,CAAC;AACzE,SAAO;AACT;AAEO,SAAS,aAAa,MAA0B;AACrD,MAAI,KAAK,WAAW,EAAG,QAAO,IAAI,WAAW,CAAC;AAE9C,MAAI,QAAQ;AACZ,SAAO,QAAQ,KAAK,UAAU,KAAK,KAAK,MAAM,IAAK;AAEnD,QAAM,OAAiB,CAAA;AACvB,WAAS,IAAI,OAAO,IAAI,KAAK,QAAQ,KAAK;AACxC,UAAM,KAAK,KAAK,CAAC;AACjB,UAAM,MAAM,SAAS,QAAQ,EAAE;AAC/B,QAAI,QAAQ,GAAI,OAAM,IAAI,MAAM,0BAA0B;AAE1D,QAAI,QAAQ;AACZ,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,IAAI,KAAK,CAAC,IAAI,OAAO;AAC3B,WAAK,CAAC,IAAI,IAAI;AACd,cAAQ,KAAK;AAAA,IACf;AACA,WAAO,QAAQ,GAAG;AAChB,WAAK,KAAK,QAAQ,GAAI;AACtB,gBAAU;AAAA,IACZ;AAAA,EACF;AAEA,WAAS,IAAI,GAAG,IAAI,OAAO,IAAK,MAAK,KAAK,CAAC;AAC3C,OAAK,QAAA;AACL,SAAO,WAAW,KAAK,IAAI;AAC7B;AAEO,SAAS,sBAAsB,OAA2B;AAC/D,MAAI,CAAC,MAAM,WAAW,GAAG,EAAG,OAAM,IAAI,MAAM,6BAA6B;AACzE,SAAO,aAAa,MAAM,MAAM,CAAC,CAAC;AACpC;"}
|
|
@@ -1,59 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
while (carry > 0) {
|
|
17
|
-
digits.push(carry % BASE);
|
|
18
|
-
carry = carry / BASE | 0;
|
|
19
|
-
}
|
|
1
|
+
import { Logger } from "./standards-sdk.es106.js";
|
|
2
|
+
import { HederaMirrorNode } from "./standards-sdk.es127.js";
|
|
3
|
+
class HCS5BaseClient {
|
|
4
|
+
/**
|
|
5
|
+
* Create a new HCS-5 base client
|
|
6
|
+
*/
|
|
7
|
+
constructor(config) {
|
|
8
|
+
this.network = config.network;
|
|
9
|
+
this.logger = config.logger || Logger.getInstance({
|
|
10
|
+
level: config.logLevel || "info",
|
|
11
|
+
module: "HCS5Client",
|
|
12
|
+
silent: config.silent
|
|
13
|
+
});
|
|
14
|
+
this.mirrorNode = new HederaMirrorNode(this.network, this.logger);
|
|
20
15
|
}
|
|
21
|
-
let result = "";
|
|
22
|
-
for (let i = 0; i < zeros; i++) result += "1";
|
|
23
|
-
for (let i = digits.length - 1; i >= 0; i--) result += ALPHABET[digits[i]];
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
function base58Decode(text) {
|
|
27
|
-
if (text.length === 0) return new Uint8Array(0);
|
|
28
|
-
let zeros = 0;
|
|
29
|
-
while (zeros < text.length && text[zeros] === "1") zeros++;
|
|
30
|
-
const b256 = [];
|
|
31
|
-
for (let i = zeros; i < text.length; i++) {
|
|
32
|
-
const ch = text[i];
|
|
33
|
-
const val = ALPHABET.indexOf(ch);
|
|
34
|
-
if (val === -1) throw new Error("Invalid Base58 character");
|
|
35
|
-
let carry = val;
|
|
36
|
-
for (let j = 0; j < b256.length; j++) {
|
|
37
|
-
const x = b256[j] * BASE + carry;
|
|
38
|
-
b256[j] = x & 255;
|
|
39
|
-
carry = x >> 8;
|
|
40
|
-
}
|
|
41
|
-
while (carry > 0) {
|
|
42
|
-
b256.push(carry & 255);
|
|
43
|
-
carry >>= 8;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
for (let i = 0; i < zeros; i++) b256.push(0);
|
|
47
|
-
b256.reverse();
|
|
48
|
-
return Uint8Array.from(b256);
|
|
49
|
-
}
|
|
50
|
-
function multibaseB58btcDecode(zText) {
|
|
51
|
-
if (!zText.startsWith("z")) throw new Error("Invalid multibase base58btc");
|
|
52
|
-
return base58Decode(zText.slice(1));
|
|
53
16
|
}
|
|
54
17
|
export {
|
|
55
|
-
|
|
56
|
-
base58Encode,
|
|
57
|
-
multibaseB58btcDecode
|
|
18
|
+
HCS5BaseClient
|
|
58
19
|
};
|
|
59
20
|
//# sourceMappingURL=standards-sdk.es142.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es142.js","sources":["../../src/hcs-
|
|
1
|
+
{"version":3,"file":"standards-sdk.es142.js","sources":["../../src/hcs-5/base-client.ts"],"sourcesContent":["import { Logger, ILogger } from '../utils/logger';\nimport { HederaMirrorNode } from '../services/mirror-node';\nimport { HCS5ClientConfig } from './types';\nimport { NetworkType } from '../utils/types';\n\n/**\n * Base client for HCS-5 operations\n */\nexport abstract class HCS5BaseClient {\n protected logger: ILogger;\n protected mirrorNode: HederaMirrorNode;\n protected network: NetworkType;\n\n /**\n * Create a new HCS-5 base client\n */\n constructor(config: HCS5ClientConfig) {\n this.network = config.network;\n this.logger =\n config.logger ||\n Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS5Client',\n silent: config.silent,\n });\n\n this.mirrorNode = new HederaMirrorNode(this.network, this.logger);\n }\n}\n"],"names":[],"mappings":";;AAQO,MAAe,eAAe;AAAA;AAAA;AAAA;AAAA,EAQnC,YAAY,QAA0B;AACpC,SAAK,UAAU,OAAO;AACtB,SAAK,SACH,OAAO,UACP,OAAO,YAAY;AAAA,MACjB,OAAO,OAAO,YAAY;AAAA,MAC1B,QAAQ;AAAA,MACR,QAAQ,OAAO;AAAA,IAAA,CAChB;AAEH,SAAK,aAAa,IAAI,iBAAiB,KAAK,SAAS,KAAK,MAAM;AAAA,EAClE;AACF;"}
|
|
@@ -8,7 +8,7 @@ import "node:buffer";
|
|
|
8
8
|
import "node:crypto";
|
|
9
9
|
import "@noble/curves/secp256k1.js";
|
|
10
10
|
import "./standards-sdk.es130.js";
|
|
11
|
-
import "./standards-sdk.
|
|
11
|
+
import "./standards-sdk.es137.js";
|
|
12
12
|
import "zod";
|
|
13
13
|
import { buildHcs10SubmitConnectionRequestTx, buildHcs10OutboundConnectionRequestRecordTx, buildHcs10OutboundConnectionCreatedRecordTx } from "./standards-sdk.es23.js";
|
|
14
14
|
import { HRLResolver } from "./standards-sdk.es110.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./standards-sdk.es2.js";
|
|
2
2
|
import { Client, PrivateKey, AccountCreateTransaction, Hbar, CustomFixedFee, AccountId, TokenId, KeyList, TopicMessageSubmitTransaction, Transaction, ScheduleCreateTransaction, Timestamp } from "@hashgraph/sdk";
|
|
3
3
|
import { AccountCreationError, TopicCreationError, ConnectionConfirmationError, PayloadSizeError } from "./standards-sdk.es18.js";
|
|
4
|
-
import { InscriptionSDK } from "./standards-sdk.
|
|
4
|
+
import { InscriptionSDK } from "./standards-sdk.es138.js";
|
|
5
5
|
import { Logger } from "./standards-sdk.es106.js";
|
|
6
6
|
import { accountIdsToExemptKeys } from "./standards-sdk.es108.js";
|
|
7
7
|
import { ProgressReporter } from "./standards-sdk.es109.js";
|
|
@@ -12,14 +12,14 @@ import "node:buffer";
|
|
|
12
12
|
import "node:crypto";
|
|
13
13
|
import "@noble/curves/secp256k1.js";
|
|
14
14
|
import "./standards-sdk.es130.js";
|
|
15
|
-
import "./standards-sdk.
|
|
15
|
+
import "./standards-sdk.es137.js";
|
|
16
16
|
import "zod";
|
|
17
17
|
import "buffer";
|
|
18
18
|
import "ethers";
|
|
19
19
|
import "./standards-sdk.es123.js";
|
|
20
20
|
import { detectKeyTypeFromString } from "./standards-sdk.es114.js";
|
|
21
21
|
import { getTopicId } from "./standards-sdk.es115.js";
|
|
22
|
-
import { createNodeOperatorContext, NodeOperatorResolver } from "./standards-sdk.
|
|
22
|
+
import { createNodeOperatorContext, NodeOperatorResolver } from "./standards-sdk.es139.js";
|
|
23
23
|
import { HCS10BaseClient, Hcs10MemoType } from "./standards-sdk.es17.js";
|
|
24
24
|
import * as mime from "mime-types";
|
|
25
25
|
import { AgentBuilder } from "./standards-sdk.es24.js";
|
|
@@ -27,7 +27,7 @@ import { InboundTopicType } from "./standards-sdk.es29.js";
|
|
|
27
27
|
import { HCS11Client } from "./standards-sdk.es28.js";
|
|
28
28
|
import { inscribe } from "./standards-sdk.es125.js";
|
|
29
29
|
import { addSeconds } from "date-fns";
|
|
30
|
-
import { buildTopicCreateTx, buildMessageTx } from "./standards-sdk.
|
|
30
|
+
import { buildTopicCreateTx, buildMessageTx } from "./standards-sdk.es140.js";
|
|
31
31
|
import { buildHcs10CreateInboundTopicTx, buildHcs10CreateConnectionTopicTx, buildHcs10ConfirmConnectionTx, buildHcs10SendMessageTx, buildHcs10RegistryRegisterTx, buildHcs10CreateOutboundTopicTx, buildHcs10CreateRegistryTopicTx } from "./standards-sdk.es23.js";
|
|
32
32
|
class HCS10Client extends HCS10BaseClient {
|
|
33
33
|
constructor(config) {
|
|
@@ -8,14 +8,14 @@ import "node:buffer";
|
|
|
8
8
|
import "node:crypto";
|
|
9
9
|
import "@noble/curves/secp256k1.js";
|
|
10
10
|
import "./standards-sdk.es130.js";
|
|
11
|
-
import "./standards-sdk.
|
|
11
|
+
import "./standards-sdk.es137.js";
|
|
12
12
|
import "zod";
|
|
13
13
|
import "buffer";
|
|
14
14
|
import "ethers";
|
|
15
15
|
import "./standards-sdk.es123.js";
|
|
16
16
|
import "./standards-sdk.es114.js";
|
|
17
17
|
import { getTopicId } from "./standards-sdk.es115.js";
|
|
18
|
-
import { InscriptionSDK } from "./standards-sdk.
|
|
18
|
+
import { InscriptionSDK } from "./standards-sdk.es138.js";
|
|
19
19
|
import { HCS10BaseClient, Hcs10MemoType } from "./standards-sdk.es17.js";
|
|
20
20
|
import * as mime from "mime-types";
|
|
21
21
|
import { AgentBuilder } from "./standards-sdk.es24.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client, Status, PrivateKey, AccountUpdateTransaction } from "@hashgraph/sdk";
|
|
2
2
|
import { inscribeWithSigner, inscribe } from "./standards-sdk.es125.js";
|
|
3
|
-
import "./standards-sdk.
|
|
3
|
+
import "./standards-sdk.es138.js";
|
|
4
4
|
import { Logger } from "./standards-sdk.es106.js";
|
|
5
5
|
import { HederaMirrorNode } from "./standards-sdk.es127.js";
|
|
6
6
|
import { ProgressReporter } from "./standards-sdk.es109.js";
|
|
@@ -10,7 +10,7 @@ import "node:buffer";
|
|
|
10
10
|
import "node:crypto";
|
|
11
11
|
import "@noble/curves/secp256k1.js";
|
|
12
12
|
import "./standards-sdk.es130.js";
|
|
13
|
-
import "./standards-sdk.
|
|
13
|
+
import "./standards-sdk.es137.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
import "@hashgraph/proto";
|
|
16
16
|
import "buffer";
|
|
@@ -20,7 +20,7 @@ import "./standards-sdk.es114.js";
|
|
|
20
20
|
import { getTopicId } from "./standards-sdk.es115.js";
|
|
21
21
|
import * as mime from "mime-types";
|
|
22
22
|
import { isHederaNetwork, toHederaCaip10 } from "./standards-sdk.es58.js";
|
|
23
|
-
import { createNodeOperatorContext } from "./standards-sdk.
|
|
23
|
+
import { createNodeOperatorContext } from "./standards-sdk.es139.js";
|
|
24
24
|
import { AIAgentCapability, AIAgentType, VerificationType, MCPServerCapability, ProfileType, capabilityNameToCapabilityMap } from "./standards-sdk.es29.js";
|
|
25
25
|
const SocialLinkSchema = z.object({
|
|
26
26
|
platform: z.string().min(1),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RegistryType } from "./standards-sdk.es30.js";
|
|
2
2
|
import { inscribe, inscribeWithSigner } from "./standards-sdk.es125.js";
|
|
3
|
-
import "./standards-sdk.
|
|
3
|
+
import "./standards-sdk.es138.js";
|
|
4
4
|
class BaseRegistry {
|
|
5
5
|
constructor(networkType, logger, registryType, topicId, client) {
|
|
6
6
|
this.entries = /* @__PURE__ */ new Map();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RegistryType } from "./standards-sdk.es30.js";
|
|
2
2
|
import { BaseRegistry } from "./standards-sdk.es31.js";
|
|
3
3
|
import { retrieveInscription } from "./standards-sdk.es125.js";
|
|
4
|
-
import "./standards-sdk.
|
|
4
|
+
import "./standards-sdk.es138.js";
|
|
5
5
|
import { getCryptoAdapter } from "./standards-sdk.es120.js";
|
|
6
6
|
import { isSSREnvironment } from "./standards-sdk.es118.js";
|
|
7
7
|
import { validateActionRegistration } from "./standards-sdk.es43.js";
|
|
@@ -5,9 +5,9 @@ import "node:buffer";
|
|
|
5
5
|
import "node:crypto";
|
|
6
6
|
import "@noble/curves/secp256k1.js";
|
|
7
7
|
import "./standards-sdk.es130.js";
|
|
8
|
-
import "./standards-sdk.
|
|
8
|
+
import "./standards-sdk.es137.js";
|
|
9
9
|
import "zod";
|
|
10
|
-
import "./standards-sdk.
|
|
10
|
+
import "./standards-sdk.es138.js";
|
|
11
11
|
import "@hashgraph/proto";
|
|
12
12
|
import "buffer";
|
|
13
13
|
import "@hashgraph/sdk";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Client } from "@hashgraph/sdk";
|
|
2
2
|
import { HCS12BaseClient } from "./standards-sdk.es36.js";
|
|
3
|
-
import { createNodeOperatorContext } from "./standards-sdk.
|
|
3
|
+
import { createNodeOperatorContext } from "./standards-sdk.es139.js";
|
|
4
4
|
import { RegistryType } from "./standards-sdk.es30.js";
|
|
5
5
|
import { inscribe } from "./standards-sdk.es125.js";
|
|
6
|
-
import { InscriptionSDK } from "./standards-sdk.
|
|
6
|
+
import { InscriptionSDK } from "./standards-sdk.es138.js";
|
|
7
7
|
import { ActionRegistry } from "./standards-sdk.es32.js";
|
|
8
8
|
import { BlockLoader } from "./standards-sdk.es33.js";
|
|
9
9
|
import { AssemblyRegistry } from "./standards-sdk.es34.js";
|
|
10
10
|
import { HashLinksRegistry } from "./standards-sdk.es35.js";
|
|
11
11
|
import * as mime from "mime-types";
|
|
12
|
-
import { buildTopicCreateTx, buildMessageTx } from "./standards-sdk.
|
|
12
|
+
import { buildTopicCreateTx, buildMessageTx } from "./standards-sdk.es140.js";
|
|
13
13
|
class HCS12Client extends HCS12BaseClient {
|
|
14
14
|
constructor(config) {
|
|
15
15
|
super(config);
|
|
@@ -2,7 +2,7 @@ import { TopicCreateTransaction, TransactionId, AccountId, PublicKey, KeyList, T
|
|
|
2
2
|
import { HCS12BaseClient } from "./standards-sdk.es36.js";
|
|
3
3
|
import { RegistryType } from "./standards-sdk.es30.js";
|
|
4
4
|
import { inscribeWithSigner } from "./standards-sdk.es125.js";
|
|
5
|
-
import { InscriptionSDK } from "./standards-sdk.
|
|
5
|
+
import { InscriptionSDK } from "./standards-sdk.es138.js";
|
|
6
6
|
import { ActionRegistry } from "./standards-sdk.es32.js";
|
|
7
7
|
import { BlockLoader } from "./standards-sdk.es33.js";
|
|
8
8
|
import { AssemblyRegistry } from "./standards-sdk.es34.js";
|
|
@@ -2,7 +2,7 @@ import { HCS6BaseClient } from "./standards-sdk.es7.js";
|
|
|
2
2
|
import { buildHcs6Hrl } from "./standards-sdk.es4.js";
|
|
3
3
|
import { AccountId, Client, TopicMessageSubmitTransaction, TopicId, PrivateKey, PublicKey, TokenMintTransaction, TokenId } from "@hashgraph/sdk";
|
|
4
4
|
import { buildHcs6CreateRegistryTx } from "./standards-sdk.es8.js";
|
|
5
|
-
import { createNodeOperatorContext, NodeOperatorResolver } from "./standards-sdk.
|
|
5
|
+
import { createNodeOperatorContext, NodeOperatorResolver } from "./standards-sdk.es139.js";
|
|
6
6
|
import { inscribe } from "./standards-sdk.es125.js";
|
|
7
7
|
class HCS6Client extends HCS6BaseClient {
|
|
8
8
|
constructor(config) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCryptoAdapter } from "./standards-sdk.es120.js";
|
|
2
|
-
import { base58Encode } from "./standards-sdk.
|
|
2
|
+
import { base58Encode } from "./standards-sdk.es141.js";
|
|
3
3
|
import { canonicalizeAgentData } from "./standards-sdk.es56.js";
|
|
4
4
|
function encodeMultibaseB58btc(input) {
|
|
5
5
|
const bytes = Buffer.from(input, "utf8");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HieroDidResolver } from "./standards-sdk.es60.js";
|
|
2
2
|
import { parseHcs14Did } from "./standards-sdk.es57.js";
|
|
3
|
-
import { multibaseB58btcDecode } from "./standards-sdk.
|
|
3
|
+
import { multibaseB58btcDecode } from "./standards-sdk.es141.js";
|
|
4
4
|
class ResolverRegistry {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.resolvers = [];
|
|
@@ -15,14 +15,14 @@ import "node:buffer";
|
|
|
15
15
|
import "node:crypto";
|
|
16
16
|
import "@noble/curves/secp256k1.js";
|
|
17
17
|
import "./standards-sdk.es130.js";
|
|
18
|
-
import "./standards-sdk.
|
|
18
|
+
import "./standards-sdk.es137.js";
|
|
19
19
|
import "zod";
|
|
20
20
|
import "@hashgraph/proto";
|
|
21
21
|
import "buffer";
|
|
22
22
|
import "ethers";
|
|
23
23
|
import "./standards-sdk.es123.js";
|
|
24
24
|
import "./standards-sdk.es114.js";
|
|
25
|
-
import { createNodeOperatorContext } from "./standards-sdk.
|
|
25
|
+
import { createNodeOperatorContext } from "./standards-sdk.es139.js";
|
|
26
26
|
import { HCS10Client } from "./standards-sdk.es19.js";
|
|
27
27
|
class HCS14Client {
|
|
28
28
|
constructor(options) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HCS5BaseClient } from "./standards-sdk.
|
|
1
|
+
import { HCS5BaseClient } from "./standards-sdk.es142.js";
|
|
2
2
|
import { buildHcs1Hrl } from "./standards-sdk.es64.js";
|
|
3
3
|
import { PrivateKey } from "@hashgraph/sdk";
|
|
4
4
|
import { inscribeWithSigner } from "./standards-sdk.es125.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { HCS5BaseClient } from "./standards-sdk.
|
|
1
|
+
import { HCS5BaseClient } from "./standards-sdk.es142.js";
|
|
2
2
|
import { buildHcs1Hrl } from "./standards-sdk.es64.js";
|
|
3
3
|
import { AccountId } from "@hashgraph/sdk";
|
|
4
4
|
import { inscribe } from "./standards-sdk.es125.js";
|
|
5
5
|
import { buildHcs5MintTx } from "./standards-sdk.es67.js";
|
|
6
|
-
import { createNodeOperatorContext, NodeOperatorResolver } from "./standards-sdk.
|
|
6
|
+
import { createNodeOperatorContext, NodeOperatorResolver } from "./standards-sdk.es139.js";
|
|
7
7
|
class HCS5Client extends HCS5BaseClient {
|
|
8
8
|
constructor(config) {
|
|
9
9
|
super(config);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AccountId, Client, PublicKey } from "@hashgraph/sdk";
|
|
2
2
|
import { HCS2BaseClient } from "./standards-sdk.es71.js";
|
|
3
3
|
import { HCS2Operation, HCS2RegistryType } from "./standards-sdk.es68.js";
|
|
4
|
-
import { createNodeOperatorContext } from "./standards-sdk.
|
|
5
|
-
import { buildMessageTx } from "./standards-sdk.
|
|
4
|
+
import { createNodeOperatorContext } from "./standards-sdk.es139.js";
|
|
5
|
+
import { buildMessageTx } from "./standards-sdk.es140.js";
|
|
6
6
|
import { buildHcs2CreateRegistryTx } from "./standards-sdk.es72.js";
|
|
7
7
|
const _HCS2Client = class _HCS2Client extends HCS2BaseClient {
|
|
8
8
|
/**
|
|
@@ -3,7 +3,7 @@ import { HCS2BaseClient } from "./standards-sdk.es71.js";
|
|
|
3
3
|
import { HCS2RegistryType, HCS2Operation } from "./standards-sdk.es68.js";
|
|
4
4
|
import { isBrowser } from "./standards-sdk.es119.js";
|
|
5
5
|
import { KeyTypeDetector } from "./standards-sdk.es114.js";
|
|
6
|
-
import { buildMessageTx } from "./standards-sdk.
|
|
6
|
+
import { buildMessageTx } from "./standards-sdk.es140.js";
|
|
7
7
|
class BrowserHCS2Client extends HCS2BaseClient {
|
|
8
8
|
/**
|
|
9
9
|
* Create a new browser HCS-2 client
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildTopicCreateTx, buildMessageTx, encodeHcs2RegistryMemo } from "./standards-sdk.
|
|
1
|
+
import { buildTopicCreateTx, buildMessageTx, encodeHcs2RegistryMemo } from "./standards-sdk.es140.js";
|
|
2
2
|
import { HCS2Operation } from "./standards-sdk.es68.js";
|
|
3
3
|
function buildHcs2CreateRegistryTx(params) {
|
|
4
4
|
const memo = params.memoOverride ?? encodeHcs2RegistryMemo(params.registryType, params.ttl);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es73.js","sources":["../../src/hcs-20/types.ts"],"sourcesContent":["/**\n * HCS-20 Auditable Points Standard Types\n */\n\nimport { z } from 'zod';\nimport { AccountId, TopicId, PrivateKey } from '@hashgraph/sdk';\nimport type { ILogger } from '../utils/logger';\n\n/**\n * HCS-20 Constants\n */\nexport const HCS20_CONSTANTS = {\n PROTOCOL: 'hcs-20',\n PUBLIC_TOPIC_ID: '0.0.4350190',\n REGISTRY_TOPIC_ID: '0.0.4362300',\n MAX_NUMBER_LENGTH: 18,\n MAX_NAME_LENGTH: 100,\n MAX_METADATA_LENGTH: 100,\n HEDERA_ACCOUNT_REGEX:\n /^(0|(?:[1-9]\\d*))\\.(0|(?:[1-9]\\d*))\\.(0|(?:[1-9]\\d*))$/,\n} as const;\n\n/**\n * Hedera Account ID validator\n */\nconst HederaAccountIdSchema = z\n .string()\n .regex(\n HCS20_CONSTANTS.HEDERA_ACCOUNT_REGEX,\n 'Invalid Hedera account ID format',\n );\n\n/**\n * Number string validator\n */\nconst NumberStringSchema = z\n .string()\n .regex(/^\\d+$/, 'Must be a valid number')\n .max(\n HCS20_CONSTANTS.MAX_NUMBER_LENGTH,\n `Max ${HCS20_CONSTANTS.MAX_NUMBER_LENGTH} digits`,\n );\n\n/**\n * Tick validator\n */\nconst TickSchema = z\n .string()\n .min(1, 'Tick cannot be empty')\n .transform(val => val.toLowerCase().trim());\n\n/**\n * Base HCS-20 Message Schema\n */\nconst HCS20BaseMessageSchema = z.object({\n p: z.literal('hcs-20'),\n m: z.string().optional(),\n});\n\n/**\n * Deploy Points Operation Schema\n */\nexport const HCS20DeployMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('deploy'),\n name: z.string().min(1).max(HCS20_CONSTANTS.MAX_NAME_LENGTH),\n tick: TickSchema,\n max: NumberStringSchema,\n lim: NumberStringSchema.optional(),\n metadata: z.string().max(HCS20_CONSTANTS.MAX_METADATA_LENGTH).optional(),\n});\n\n/**\n * Mint Points Operation Schema\n */\nexport const HCS20MintMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('mint'),\n tick: TickSchema,\n amt: NumberStringSchema,\n to: HederaAccountIdSchema,\n});\n\n/**\n * Burn Points Operation Schema\n */\nexport const HCS20BurnMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('burn'),\n tick: TickSchema,\n amt: NumberStringSchema,\n from: HederaAccountIdSchema,\n});\n\n/**\n * Transfer Points Operation Schema\n */\nexport const HCS20TransferMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('transfer'),\n tick: TickSchema,\n amt: NumberStringSchema,\n from: HederaAccountIdSchema,\n to: HederaAccountIdSchema,\n});\n\n/**\n * Register Topic Operation Schema\n */\nexport const HCS20RegisterMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('register'),\n name: z.string().min(1).max(HCS20_CONSTANTS.MAX_NAME_LENGTH),\n metadata: z.string().max(HCS20_CONSTANTS.MAX_METADATA_LENGTH).optional(),\n private: z.boolean(),\n t_id: HederaAccountIdSchema,\n});\n\n/**\n * Union schema for all HCS-20 messages\n */\nexport const HCS20MessageSchema = z.discriminatedUnion('op', [\n HCS20DeployMessageSchema,\n HCS20MintMessageSchema,\n HCS20BurnMessageSchema,\n HCS20TransferMessageSchema,\n HCS20RegisterMessageSchema,\n]);\n\n/**\n * Inferred types from schemas\n */\nexport type HCS20BaseMessage = z.infer<typeof HCS20BaseMessageSchema>;\nexport type HCS20DeployMessage = z.infer<typeof HCS20DeployMessageSchema>;\nexport type HCS20MintMessage = z.infer<typeof HCS20MintMessageSchema>;\nexport type HCS20BurnMessage = z.infer<typeof HCS20BurnMessageSchema>;\nexport type HCS20TransferMessage = z.infer<typeof HCS20TransferMessageSchema>;\nexport type HCS20RegisterMessage = z.infer<typeof HCS20RegisterMessageSchema>;\nexport type HCS20Message = z.infer<typeof HCS20MessageSchema>;\nexport type HCS20Operation = HCS20Message['op'];\n\n/**\n * Points Configuration\n */\nexport interface PointsConfig {\n name: string;\n tick: string;\n maxSupply: string;\n limitPerMint?: string;\n metadata?: string;\n}\n\n/**\n * Points Information\n */\nexport interface PointsInfo extends PointsConfig {\n topicId: string;\n deployerAccountId: string;\n currentSupply: string;\n deploymentTimestamp: string;\n isPrivate: boolean;\n}\n\n/**\n * Points Balance\n */\nexport interface PointsBalance {\n tick: string;\n accountId: string;\n balance: string;\n lastUpdated: string;\n}\n\n/**\n * Points Transaction\n */\nexport interface PointsTransaction {\n id: string;\n operation: HCS20Operation;\n tick: string;\n amount?: string;\n from?: string;\n to?: string;\n timestamp: string;\n sequenceNumber: number;\n topicId: string;\n transactionId: string;\n memo?: string;\n}\n\n/**\n * HCS-20 Client Configuration\n */\nexport interface HCS20ClientConfig {\n mirrorNodeUrl?: string;\n logger?: ILogger;\n network?: 'mainnet' | 'testnet';\n registryTopicId?: string;\n publicTopicId?: string;\n}\n\n/**\n * Browser-specific HCS-20 Client Configuration\n */\nexport interface BrowserHCS20ClientConfig extends HCS20ClientConfig {\n walletConnectProjectId?: string;\n hwcMetadata?: {\n name: string;\n description: string;\n icons: string[];\n url: string;\n };\n}\n\n/**\n * SDK-specific HCS-20 Client Configuration\n */\nexport interface SDKHCS20ClientConfig extends HCS20ClientConfig {\n operatorId: string | AccountId;\n operatorKey: string | PrivateKey;\n keyType?: 'ed25519' | 'ecdsa';\n}\n\n/**\n * Deploy Points Progress\n */\nexport interface DeployPointsProgress {\n stage: 'creating-topic' | 'submitting-deploy' | 'confirming' | 'complete';\n percentage: number;\n topicId?: string;\n deployTxId?: string;\n error?: string;\n}\n\n/**\n * Deploy Points Options\n */\nexport interface DeployPointsOptions extends PointsConfig {\n usePrivateTopic?: boolean;\n topicMemo?: string;\n progressCallback?: (data: DeployPointsProgress) => void;\n}\n\n/**\n * Mint Points Progress\n */\nexport interface MintPointsProgress {\n stage: 'validating' | 'submitting' | 'confirming' | 'complete';\n percentage: number;\n mintTxId?: string;\n error?: string;\n}\n\n/**\n * Mint Points Options\n */\nexport interface MintPointsOptions {\n tick: string;\n amount: string;\n to: string | AccountId;\n memo?: string;\n topicId?: string | TopicId;\n progressCallback?: (data: MintPointsProgress) => void;\n}\n\n/**\n * Transfer Points Progress\n */\nexport interface TransferPointsProgress {\n stage: 'validating-balance' | 'submitting' | 'confirming' | 'complete';\n percentage: number;\n transferTxId?: string;\n error?: string;\n}\n\n/**\n * Transfer Points Options\n */\nexport interface TransferPointsOptions {\n tick: string;\n amount: string;\n from: string | AccountId;\n to: string | AccountId;\n memo?: string;\n topicId?: string | TopicId;\n progressCallback?: (data: TransferPointsProgress) => void;\n}\n\n/**\n * Burn Points Progress\n */\nexport interface BurnPointsProgress {\n stage: 'validating-balance' | 'submitting' | 'confirming' | 'complete';\n percentage: number;\n burnTxId?: string;\n error?: string;\n}\n\n/**\n * Burn Points Options\n */\nexport interface BurnPointsOptions {\n tick: string;\n amount: string;\n from: string | AccountId;\n memo?: string;\n topicId?: string | TopicId;\n progressCallback?: (data: BurnPointsProgress) => void;\n}\n\n/**\n * Register Topic Progress\n */\nexport interface RegisterTopicProgress {\n stage: 'validating' | 'submitting' | 'confirming' | 'complete';\n percentage: number;\n registerTxId?: string;\n error?: string;\n}\n\n/**\n * Register Topic Options\n */\nexport interface RegisterTopicOptions {\n topicId: string | TopicId;\n name: string;\n metadata?: string;\n isPrivate: boolean;\n memo?: string;\n progressCallback?: (data: RegisterTopicProgress) => void;\n}\n\n/**\n * Query Points Options\n */\nexport interface QueryPointsOptions {\n tick?: string;\n accountId?: string | AccountId;\n topicId?: string | TopicId;\n limit?: number;\n order?: 'asc' | 'desc';\n}\n\n/**\n * Points Query Result\n */\nexport interface PointsQueryResult {\n points: PointsInfo[];\n balances?: PointsBalance[];\n transactions?: PointsTransaction[];\n totalCount: number;\n hasMore: boolean;\n nextCursor?: string;\n}\n\n/**\n * Points State\n */\nexport interface PointsState {\n deployedPoints: Map<string, PointsInfo>;\n balances: Map<string, Map<string, PointsBalance>>;\n transactions: PointsTransaction[];\n lastProcessedSequence: number;\n lastProcessedTimestamp: string;\n}\n\n/**\n * HCS-20 Registry Entry\n */\nexport interface HCS20RegistryEntry {\n name: string;\n topicId: string;\n metadata?: string;\n isPrivate: boolean;\n registeredAt: string;\n registeredBy: string;\n}\n"],"names":[],"mappings":";AAWO,MAAM,kBAAkB;AAAA,EAC7B,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,sBACE;AACJ;AAKA,MAAM,wBAAwB,EAC3B,OAAA,EACA;AAAA,EACC,gBAAgB;AAAA,EAChB;AACF;AAKF,MAAM,qBAAqB,EACxB,OAAA,EACA,MAAM,SAAS,wBAAwB,EACvC;AAAA,EACC,gBAAgB;AAAA,EAChB,OAAO,gBAAgB,iBAAiB;AAC1C;AAKF,MAAM,aAAa,EAChB,OAAA,EACA,IAAI,GAAG,sBAAsB,EAC7B,UAAU,CAAA,QAAO,IAAI,YAAA,EAAc,MAAM;AAK5C,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,GAAG,EAAE,QAAQ,QAAQ;AAAA,EACrB,GAAG,EAAE,OAAA,EAAS,SAAA;AAChB,CAAC;AAKM,MAAM,2BAA2B,uBAAuB,OAAO;AAAA,EACpE,IAAI,EAAE,QAAQ,QAAQ;AAAA,EACtB,MAAM,EAAE,SAAS,IAAI,CAAC,EAAE,IAAI,gBAAgB,eAAe;AAAA,EAC3D,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK,mBAAmB,SAAA;AAAA,EACxB,UAAU,EAAE,OAAA,EAAS,IAAI,gBAAgB,mBAAmB,EAAE,SAAA;AAChE,CAAC;AAKM,MAAM,yBAAyB,uBAAuB,OAAO;AAAA,EAClE,IAAI,EAAE,QAAQ,MAAM;AAAA,EACpB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,IAAI;AACN,CAAC;AAKM,MAAM,yBAAyB,uBAAuB,OAAO;AAAA,EAClE,IAAI,EAAE,QAAQ,MAAM;AAAA,EACpB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AACR,CAAC;AAKM,MAAM,6BAA6B,uBAAuB,OAAO;AAAA,EACtE,IAAI,EAAE,QAAQ,UAAU;AAAA,EACxB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AACN,CAAC;AAKM,MAAM,6BAA6B,uBAAuB,OAAO;AAAA,EACtE,IAAI,EAAE,QAAQ,UAAU;AAAA,EACxB,MAAM,EAAE,SAAS,IAAI,CAAC,EAAE,IAAI,gBAAgB,eAAe;AAAA,EAC3D,UAAU,EAAE,OAAA,EAAS,IAAI,gBAAgB,mBAAmB,EAAE,SAAA;AAAA,EAC9D,SAAS,EAAE,QAAA;AAAA,EACX,MAAM;AACR,CAAC;AAKM,MAAM,qBAAqB,EAAE,mBAAmB,MAAM;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"standards-sdk.es73.js","sources":["../../src/hcs-20/types.ts"],"sourcesContent":["/**\n * HCS-20 Auditable Points Standard Types\n */\n\nimport { z } from 'zod';\nimport { AccountId, TopicId, PrivateKey } from '@hashgraph/sdk';\nimport type { ILogger } from '../utils/logger';\n\n/**\n * HCS-20 Constants\n */\nexport const HCS20_CONSTANTS = {\n PROTOCOL: 'hcs-20',\n PUBLIC_TOPIC_ID: '0.0.4350190',\n REGISTRY_TOPIC_ID: '0.0.4362300',\n MAX_NUMBER_LENGTH: 18,\n MAX_NAME_LENGTH: 100,\n MAX_METADATA_LENGTH: 100,\n HEDERA_ACCOUNT_REGEX:\n /^(0|(?:[1-9]\\d*))\\.(0|(?:[1-9]\\d*))\\.(0|(?:[1-9]\\d*))$/,\n} as const;\n\n/**\n * Hedera Account ID validator\n */\nconst HederaAccountIdSchema = z\n .string()\n .regex(\n HCS20_CONSTANTS.HEDERA_ACCOUNT_REGEX,\n 'Invalid Hedera account ID format',\n );\n\n/**\n * Number string validator\n */\nconst NumberStringSchema = z\n .string()\n .regex(/^\\d+$/, 'Must be a valid number')\n .max(\n HCS20_CONSTANTS.MAX_NUMBER_LENGTH,\n `Max ${HCS20_CONSTANTS.MAX_NUMBER_LENGTH} digits`,\n );\n\n/**\n * Tick validator\n */\nconst TickSchema = z\n .string()\n .min(1, 'Tick cannot be empty')\n .transform(val => val.toLowerCase().trim());\n\n/**\n * Base HCS-20 Message Schema\n */\nconst HCS20BaseMessageSchema = z.object({\n p: z.literal('hcs-20'),\n m: z.string().optional(),\n});\n\n/**\n * Deploy Points Operation Schema\n */\nexport const HCS20DeployMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('deploy'),\n name: z.string().min(1).max(HCS20_CONSTANTS.MAX_NAME_LENGTH),\n tick: TickSchema,\n max: NumberStringSchema,\n lim: NumberStringSchema.optional(),\n metadata: z.string().max(HCS20_CONSTANTS.MAX_METADATA_LENGTH).optional(),\n});\n\n/**\n * Mint Points Operation Schema\n */\nexport const HCS20MintMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('mint'),\n tick: TickSchema,\n amt: NumberStringSchema,\n to: HederaAccountIdSchema,\n});\n\n/**\n * Burn Points Operation Schema\n */\nexport const HCS20BurnMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('burn'),\n tick: TickSchema,\n amt: NumberStringSchema,\n from: HederaAccountIdSchema,\n});\n\n/**\n * Transfer Points Operation Schema\n */\nexport const HCS20TransferMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('transfer'),\n tick: TickSchema,\n amt: NumberStringSchema,\n from: HederaAccountIdSchema,\n to: HederaAccountIdSchema,\n});\n\n/**\n * Register Topic Operation Schema\n */\nexport const HCS20RegisterMessageSchema = HCS20BaseMessageSchema.extend({\n op: z.literal('register'),\n name: z.string().min(1).max(HCS20_CONSTANTS.MAX_NAME_LENGTH),\n metadata: z.string().max(HCS20_CONSTANTS.MAX_METADATA_LENGTH).optional(),\n private: z.boolean(),\n t_id: HederaAccountIdSchema,\n});\n\n/**\n * Union schema for all HCS-20 messages\n */\nexport const HCS20MessageSchema = z.discriminatedUnion('op', [\n HCS20DeployMessageSchema,\n HCS20MintMessageSchema,\n HCS20BurnMessageSchema,\n HCS20TransferMessageSchema,\n HCS20RegisterMessageSchema,\n]);\n\n/**\n * Inferred types from schemas\n */\nexport type HCS20BaseMessage = z.infer<typeof HCS20BaseMessageSchema>;\nexport type HCS20DeployMessage = z.infer<typeof HCS20DeployMessageSchema>;\nexport type HCS20MintMessage = z.infer<typeof HCS20MintMessageSchema>;\nexport type HCS20BurnMessage = z.infer<typeof HCS20BurnMessageSchema>;\nexport type HCS20TransferMessage = z.infer<typeof HCS20TransferMessageSchema>;\nexport type HCS20RegisterMessage = z.infer<typeof HCS20RegisterMessageSchema>;\nexport type HCS20Message = z.infer<typeof HCS20MessageSchema>;\nexport type HCS20Operation = HCS20Message['op'];\n\n/**\n * Points Configuration\n */\nexport interface PointsConfig {\n name: string;\n tick: string;\n maxSupply: string;\n limitPerMint?: string;\n metadata?: string;\n}\n\n/**\n * Points Information\n */\nexport interface PointsInfo extends PointsConfig {\n topicId: string;\n deployerAccountId: string;\n currentSupply: string;\n deploymentTimestamp: string;\n isPrivate: boolean;\n}\n\n/**\n * Points Balance\n */\nexport interface PointsBalance {\n tick: string;\n accountId: string;\n balance: string;\n lastUpdated: string;\n}\n\n/**\n * Points Transaction\n */\nexport interface PointsTransaction {\n id: string;\n operation: HCS20Operation;\n tick: string;\n amount?: string;\n from?: string;\n to?: string;\n timestamp: string;\n sequenceNumber: number;\n topicId: string;\n transactionId: string;\n memo?: string;\n}\n\n/**\n * HCS-20 Client Configuration\n */\nexport interface HCS20ClientConfig {\n mirrorNodeUrl?: string;\n logger?: ILogger;\n network?: 'mainnet' | 'testnet';\n registryTopicId?: string;\n publicTopicId?: string;\n}\n\n/**\n * Browser-specific HCS-20 Client Configuration\n */\nexport interface BrowserHCS20ClientConfig extends HCS20ClientConfig {\n walletConnectProjectId?: string;\n hwcMetadata?: {\n name: string;\n description: string;\n icons: string[];\n url: string;\n };\n}\n\n/**\n * SDK-specific HCS-20 Client Configuration\n */\nexport interface SDKHCS20ClientConfig extends HCS20ClientConfig {\n operatorId: string | AccountId;\n operatorKey: string | PrivateKey;\n keyType?: 'ed25519' | 'ecdsa';\n}\n\n/**\n * Deploy Points Progress\n */\nexport interface DeployPointsProgress {\n stage: 'creating-topic' | 'submitting-deploy' | 'confirming' | 'complete';\n percentage: number;\n topicId?: string;\n deployTxId?: string;\n error?: string;\n}\n\n/**\n * Deploy Points Options\n */\nexport interface DeployPointsOptions extends PointsConfig {\n usePrivateTopic?: boolean;\n topicMemo?: string;\n progressCallback?: (data: DeployPointsProgress) => void;\n}\n\n/**\n * Mint Points Progress\n */\nexport interface MintPointsProgress {\n stage: 'validating' | 'submitting' | 'confirming' | 'complete';\n percentage: number;\n mintTxId?: string;\n error?: string;\n}\n\n/**\n * Mint Points Options\n */\nexport interface MintPointsOptions {\n tick: string;\n amount: string;\n to: string | AccountId;\n memo?: string;\n topicId?: string | TopicId;\n progressCallback?: (data: MintPointsProgress) => void;\n disableMirrorCheck?: boolean;\n}\n\n/**\n * Transfer Points Progress\n */\nexport interface TransferPointsProgress {\n stage: 'validating-balance' | 'submitting' | 'confirming' | 'complete';\n percentage: number;\n transferTxId?: string;\n error?: string;\n}\n\n/**\n * Transfer Points Options\n */\nexport interface TransferPointsOptions {\n tick: string;\n amount: string;\n from: string | AccountId;\n to: string | AccountId;\n memo?: string;\n topicId?: string | TopicId;\n progressCallback?: (data: TransferPointsProgress) => void;\n}\n\n/**\n * Burn Points Progress\n */\nexport interface BurnPointsProgress {\n stage: 'validating-balance' | 'submitting' | 'confirming' | 'complete';\n percentage: number;\n burnTxId?: string;\n error?: string;\n}\n\n/**\n * Burn Points Options\n */\nexport interface BurnPointsOptions {\n tick: string;\n amount: string;\n from: string | AccountId;\n memo?: string;\n topicId?: string | TopicId;\n progressCallback?: (data: BurnPointsProgress) => void;\n}\n\n/**\n * Register Topic Progress\n */\nexport interface RegisterTopicProgress {\n stage: 'validating' | 'submitting' | 'confirming' | 'complete';\n percentage: number;\n registerTxId?: string;\n error?: string;\n}\n\n/**\n * Register Topic Options\n */\nexport interface RegisterTopicOptions {\n topicId: string | TopicId;\n name: string;\n metadata?: string;\n isPrivate: boolean;\n memo?: string;\n progressCallback?: (data: RegisterTopicProgress) => void;\n}\n\n/**\n * Query Points Options\n */\nexport interface QueryPointsOptions {\n tick?: string;\n accountId?: string | AccountId;\n topicId?: string | TopicId;\n limit?: number;\n order?: 'asc' | 'desc';\n}\n\n/**\n * Points Query Result\n */\nexport interface PointsQueryResult {\n points: PointsInfo[];\n balances?: PointsBalance[];\n transactions?: PointsTransaction[];\n totalCount: number;\n hasMore: boolean;\n nextCursor?: string;\n}\n\n/**\n * Points State\n */\nexport interface PointsState {\n deployedPoints: Map<string, PointsInfo>;\n balances: Map<string, Map<string, PointsBalance>>;\n transactions: PointsTransaction[];\n lastProcessedSequence: number;\n lastProcessedTimestamp: string;\n}\n\n/**\n * HCS-20 Registry Entry\n */\nexport interface HCS20RegistryEntry {\n name: string;\n topicId: string;\n metadata?: string;\n isPrivate: boolean;\n registeredAt: string;\n registeredBy: string;\n}\n"],"names":[],"mappings":";AAWO,MAAM,kBAAkB;AAAA,EAC7B,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,sBACE;AACJ;AAKA,MAAM,wBAAwB,EAC3B,OAAA,EACA;AAAA,EACC,gBAAgB;AAAA,EAChB;AACF;AAKF,MAAM,qBAAqB,EACxB,OAAA,EACA,MAAM,SAAS,wBAAwB,EACvC;AAAA,EACC,gBAAgB;AAAA,EAChB,OAAO,gBAAgB,iBAAiB;AAC1C;AAKF,MAAM,aAAa,EAChB,OAAA,EACA,IAAI,GAAG,sBAAsB,EAC7B,UAAU,CAAA,QAAO,IAAI,YAAA,EAAc,MAAM;AAK5C,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,GAAG,EAAE,QAAQ,QAAQ;AAAA,EACrB,GAAG,EAAE,OAAA,EAAS,SAAA;AAChB,CAAC;AAKM,MAAM,2BAA2B,uBAAuB,OAAO;AAAA,EACpE,IAAI,EAAE,QAAQ,QAAQ;AAAA,EACtB,MAAM,EAAE,SAAS,IAAI,CAAC,EAAE,IAAI,gBAAgB,eAAe;AAAA,EAC3D,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK,mBAAmB,SAAA;AAAA,EACxB,UAAU,EAAE,OAAA,EAAS,IAAI,gBAAgB,mBAAmB,EAAE,SAAA;AAChE,CAAC;AAKM,MAAM,yBAAyB,uBAAuB,OAAO;AAAA,EAClE,IAAI,EAAE,QAAQ,MAAM;AAAA,EACpB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,IAAI;AACN,CAAC;AAKM,MAAM,yBAAyB,uBAAuB,OAAO;AAAA,EAClE,IAAI,EAAE,QAAQ,MAAM;AAAA,EACpB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AACR,CAAC;AAKM,MAAM,6BAA6B,uBAAuB,OAAO;AAAA,EACtE,IAAI,EAAE,QAAQ,UAAU;AAAA,EACxB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AACN,CAAC;AAKM,MAAM,6BAA6B,uBAAuB,OAAO;AAAA,EACtE,IAAI,EAAE,QAAQ,UAAU;AAAA,EACxB,MAAM,EAAE,SAAS,IAAI,CAAC,EAAE,IAAI,gBAAgB,eAAe;AAAA,EAC3D,UAAU,EAAE,OAAA,EAAS,IAAI,gBAAgB,mBAAmB,EAAE,SAAA;AAAA,EAC9D,SAAS,EAAE,QAAA;AAAA,EACX,MAAM;AACR,CAAC;AAKM,MAAM,qBAAqB,EAAE,mBAAmB,MAAM;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;"}
|
|
@@ -2,7 +2,7 @@ import { AccountId, Client, Status, TopicCreateTransaction } from "@hashgraph/sd
|
|
|
2
2
|
import { HCS20BaseClient } from "./standards-sdk.es75.js";
|
|
3
3
|
import { PointsDeploymentError, PointsValidationError, PointsTransferError, PointsBurnError } from "./standards-sdk.es74.js";
|
|
4
4
|
import { sleep } from "./standards-sdk.es116.js";
|
|
5
|
-
import { createNodeOperatorContext } from "./standards-sdk.
|
|
5
|
+
import { createNodeOperatorContext } from "./standards-sdk.es139.js";
|
|
6
6
|
import { HCS2Client } from "./standards-sdk.es69.js";
|
|
7
7
|
import { buildHcs20DeployTx, buildHcs20MintTx, buildHcs20TransferTx, buildHcs20BurnTx, buildHcs20RegisterTx } from "./standards-sdk.es79.js";
|
|
8
8
|
class HCS20Client extends HCS20BaseClient {
|
|
@@ -219,7 +219,9 @@ class HCS20Client extends HCS20BaseClient {
|
|
|
219
219
|
percentage: 80,
|
|
220
220
|
mintTxId
|
|
221
221
|
});
|
|
222
|
-
|
|
222
|
+
if (!options.disableMirrorCheck) {
|
|
223
|
+
await this.waitForMirrorNodeConfirmation(topicId, mintTxId);
|
|
224
|
+
}
|
|
223
225
|
progressCallback?.({
|
|
224
226
|
stage: "complete",
|
|
225
227
|
percentage: 100,
|