@hashgraphonline/standards-sdk 0.1.141-canary.0 → 0.1.141
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/README.md +0 -11
- package/dist/cjs/hcs-21/base-client.d.ts +12 -12
- package/dist/cjs/hcs-21/base-client.d.ts.map +1 -1
- package/dist/cjs/hcs-21/browser.d.ts +3 -3
- package/dist/cjs/hcs-21/sdk.d.ts +6 -8
- package/dist/cjs/hcs-21/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-21/tx.d.ts +2 -6
- package/dist/cjs/hcs-21/tx.d.ts.map +1 -1
- package/dist/cjs/hcs-21/types.d.ts +67 -668
- package/dist/cjs/hcs-21/types.d.ts.map +1 -1
- package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
- package/dist/cjs/inscribe/quote-cache.d.ts.map +1 -1
- package/dist/cjs/inscribe/types.d.ts +0 -2
- package/dist/cjs/inscribe/types.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/client.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/schemas.d.ts +1 -25
- package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/cjs/services/registry-broker/types.d.ts +2 -1
- package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +2 -2
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/es/hcs-21/base-client.d.ts +12 -12
- package/dist/es/hcs-21/base-client.d.ts.map +1 -1
- package/dist/es/hcs-21/browser.d.ts +3 -3
- package/dist/es/hcs-21/sdk.d.ts +6 -8
- package/dist/es/hcs-21/sdk.d.ts.map +1 -1
- package/dist/es/hcs-21/tx.d.ts +2 -6
- package/dist/es/hcs-21/tx.d.ts.map +1 -1
- package/dist/es/hcs-21/types.d.ts +67 -668
- package/dist/es/hcs-21/types.d.ts.map +1 -1
- package/dist/es/inscribe/inscriber.d.ts.map +1 -1
- package/dist/es/inscribe/quote-cache.d.ts.map +1 -1
- package/dist/es/inscribe/types.d.ts +0 -2
- package/dist/es/inscribe/types.d.ts.map +1 -1
- package/dist/es/services/registry-broker/client.d.ts.map +1 -1
- package/dist/es/services/registry-broker/schemas.d.ts +1 -25
- package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
- package/dist/es/services/registry-broker/types.d.ts +2 -1
- package/dist/es/services/registry-broker/types.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +4 -9
- package/dist/es/standards-sdk.es109.js +1 -1
- package/dist/es/standards-sdk.es124.js +52 -76
- package/dist/es/standards-sdk.es124.js.map +1 -1
- package/dist/es/standards-sdk.es125.js +4 -8
- package/dist/es/standards-sdk.es125.js.map +1 -1
- package/dist/es/standards-sdk.es127.js +2 -2
- package/dist/es/standards-sdk.es127.js.map +1 -1
- package/dist/es/standards-sdk.es137.js +712 -12254
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +12254 -740
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +15 -54
- package/dist/es/standards-sdk.es139.js.map +1 -1
- package/dist/es/standards-sdk.es140.js +49 -57
- package/dist/es/standards-sdk.es140.js.map +1 -1
- package/dist/es/standards-sdk.es141.js +62 -15
- package/dist/es/standards-sdk.es141.js.map +1 -1
- package/dist/es/standards-sdk.es17.js +1 -1
- package/dist/es/standards-sdk.es19.js +2 -2
- package/dist/es/standards-sdk.es20.js +2 -2
- package/dist/es/standards-sdk.es28.js +2 -2
- 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 +1 -1
- package/dist/es/standards-sdk.es38.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.es60.js +1 -1
- package/dist/es/standards-sdk.es61.js +1 -1
- package/dist/es/standards-sdk.es63.js +1 -1
- package/dist/es/standards-sdk.es65.js +1 -1
- package/dist/es/standards-sdk.es66.js +1 -1
- package/dist/es/standards-sdk.es78.js +1 -1
- package/dist/es/standards-sdk.es80.js +30 -102
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +3 -14
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +10 -10
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +11 -17
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js.map +1 -1
- package/package.json +61 -63
|
@@ -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.es105.js";
|
|
2
|
+
import { HederaMirrorNode } from "./standards-sdk.es126.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.es139.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es139.js","sources":["../../src/hcs-
|
|
1
|
+
{"version":3,"file":"standards-sdk.es139.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;"}
|
|
@@ -1,67 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (lowered.includes("cannot find module") || lowered.includes("module not found") || lowered.includes("cannot find package")) {
|
|
16
|
-
return lowered.includes(specifier.toLowerCase());
|
|
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;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
async function resolveNodeRequire() {
|
|
22
|
-
if (nodeRequire !== void 0) {
|
|
23
|
-
return nodeRequire;
|
|
24
|
-
}
|
|
25
|
-
if (isBrowser) {
|
|
26
|
-
nodeRequire = null;
|
|
27
|
-
return nodeRequire;
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
const globalObject = typeof global !== "undefined" ? global : globalThis;
|
|
31
|
-
const req = globalObject.process?.mainModule?.require ?? globalObject.require;
|
|
32
|
-
nodeRequire = typeof req === "function" && typeof req.resolve === "function" ? req : null;
|
|
33
|
-
} catch {
|
|
34
|
-
nodeRequire = null;
|
|
35
|
-
}
|
|
36
|
-
return nodeRequire;
|
|
37
|
-
}
|
|
38
|
-
async function dynamicImport(specifier) {
|
|
39
|
-
try {
|
|
40
|
-
return await import(specifier);
|
|
41
|
-
} catch (error) {
|
|
42
|
-
if (isModuleNotFound(specifier, error)) {
|
|
43
|
-
return null;
|
|
16
|
+
while (carry > 0) {
|
|
17
|
+
digits.push(carry % BASE);
|
|
18
|
+
carry = carry / BASE | 0;
|
|
44
19
|
}
|
|
45
|
-
throw error;
|
|
46
20
|
}
|
|
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;
|
|
47
25
|
}
|
|
48
|
-
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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;
|
|
60
44
|
}
|
|
61
45
|
}
|
|
62
|
-
|
|
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));
|
|
63
53
|
}
|
|
64
54
|
export {
|
|
65
|
-
|
|
55
|
+
base58Decode,
|
|
56
|
+
base58Encode,
|
|
57
|
+
multibaseB58btcDecode
|
|
66
58
|
};
|
|
67
59
|
//# sourceMappingURL=standards-sdk.es140.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es140.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es140.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;AAEn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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,20 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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);
|
|
1
|
+
import { isBrowser } from "./standards-sdk.es118.js";
|
|
2
|
+
let nodeRequire;
|
|
3
|
+
function isModuleNotFound(specifier, error) {
|
|
4
|
+
if (!error || typeof error !== "object") {
|
|
5
|
+
return false;
|
|
15
6
|
}
|
|
7
|
+
const code = Reflect.get(error, "code");
|
|
8
|
+
const message = Reflect.get(error, "message");
|
|
9
|
+
const messageText = typeof message === "string" ? message : "";
|
|
10
|
+
if (typeof code === "string" && code.includes("MODULE_NOT_FOUND")) {
|
|
11
|
+
return messageText.includes(specifier);
|
|
12
|
+
}
|
|
13
|
+
if (messageText) {
|
|
14
|
+
const lowered = messageText.toLowerCase();
|
|
15
|
+
if (lowered.includes("cannot find module") || lowered.includes("module not found") || lowered.includes("cannot find package")) {
|
|
16
|
+
return lowered.includes(specifier.toLowerCase());
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
async function resolveNodeRequire() {
|
|
22
|
+
if (nodeRequire !== void 0) {
|
|
23
|
+
return nodeRequire;
|
|
24
|
+
}
|
|
25
|
+
if (isBrowser) {
|
|
26
|
+
nodeRequire = null;
|
|
27
|
+
return nodeRequire;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const globalObject = typeof global !== "undefined" ? global : globalThis;
|
|
31
|
+
const req = globalObject.process?.mainModule?.require ?? globalObject.require;
|
|
32
|
+
nodeRequire = typeof req === "function" && typeof req.resolve === "function" ? req : null;
|
|
33
|
+
} catch {
|
|
34
|
+
nodeRequire = null;
|
|
35
|
+
}
|
|
36
|
+
return nodeRequire;
|
|
37
|
+
}
|
|
38
|
+
async function dynamicImport(specifier) {
|
|
39
|
+
try {
|
|
40
|
+
return await import(specifier);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (isModuleNotFound(specifier, error)) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function optionalImport(specifier) {
|
|
49
|
+
if (isBrowser) {
|
|
50
|
+
return dynamicImport(specifier);
|
|
51
|
+
}
|
|
52
|
+
const requireFn = await resolveNodeRequire();
|
|
53
|
+
if (requireFn) {
|
|
54
|
+
try {
|
|
55
|
+
return requireFn(specifier);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
if (!isModuleNotFound(specifier, error)) {
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return dynamicImport(specifier);
|
|
16
63
|
}
|
|
17
64
|
export {
|
|
18
|
-
|
|
65
|
+
optionalImport
|
|
19
66
|
};
|
|
20
67
|
//# 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/utils/dynamic-import.ts"],"sourcesContent":["import { isBrowser } from './is-browser';\n\nlet nodeRequire: NodeRequire | null | undefined;\n\nfunction isModuleNotFound(specifier: string, error: unknown): boolean {\n if (!error || typeof error !== 'object') {\n return false;\n }\n const code = Reflect.get(error, 'code');\n const message = Reflect.get(error, 'message');\n const messageText = typeof message === 'string' ? message : '';\n\n if (typeof code === 'string' && code.includes('MODULE_NOT_FOUND')) {\n return messageText.includes(specifier);\n }\n\n if (messageText) {\n const lowered = messageText.toLowerCase();\n if (\n lowered.includes('cannot find module') ||\n lowered.includes('module not found') ||\n lowered.includes('cannot find package')\n ) {\n return lowered.includes(specifier.toLowerCase());\n }\n }\n\n return false;\n}\n\nasync function resolveNodeRequire(): Promise<NodeRequire | null> {\n if (nodeRequire !== undefined) {\n return nodeRequire;\n }\n\n if (isBrowser) {\n nodeRequire = null;\n return nodeRequire;\n }\n\n try {\n const globalObject =\n typeof global !== 'undefined'\n ? (global as typeof globalThis)\n : globalThis;\n const req =\n globalObject.process?.mainModule?.require ??\n (globalObject as { require?: NodeRequire }).require;\n\n nodeRequire =\n typeof req === 'function' &&\n typeof (req as NodeRequire).resolve === 'function'\n ? (req as NodeRequire)\n : null;\n } catch {\n nodeRequire = null;\n }\n\n return nodeRequire;\n}\n\nasync function dynamicImport<T>(specifier: string): Promise<T | null> {\n try {\n return (await import(specifier)) as T;\n } catch (error) {\n if (isModuleNotFound(specifier, error)) {\n return null;\n }\n throw error as Error;\n }\n}\n\nexport async function optionalImport<T>(specifier: string): Promise<T | null> {\n if (isBrowser) {\n return dynamicImport<T>(specifier);\n }\n\n const requireFn = await resolveNodeRequire();\n if (requireFn) {\n try {\n return requireFn(specifier) as T;\n } catch (error) {\n if (!isModuleNotFound(specifier, error)) {\n throw error as Error;\n }\n }\n }\n\n return dynamicImport<T>(specifier);\n}\n"],"names":[],"mappings":";AAEA,IAAI;AAEJ,SAAS,iBAAiB,WAAmB,OAAyB;AACpE,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,WAAO;AAAA,EACT;AACA,QAAM,OAAO,QAAQ,IAAI,OAAO,MAAM;AACtC,QAAM,UAAU,QAAQ,IAAI,O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 import "viem/accounts";
|
|
|
13
13
|
import "viem/chains";
|
|
14
14
|
import "x402-axios";
|
|
15
15
|
import "x402/types";
|
|
16
|
-
import "./standards-sdk.
|
|
16
|
+
import "./standards-sdk.es137.js";
|
|
17
17
|
import "zod";
|
|
18
18
|
import { buildHcs10SubmitConnectionRequestTx, buildHcs10OutboundConnectionRequestRecordTx, buildHcs10OutboundConnectionCreatedRecordTx } from "./standards-sdk.es23.js";
|
|
19
19
|
import { HRLResolver } from "./standards-sdk.es109.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.es105.js";
|
|
6
6
|
import { accountIdsToExemptKeys } from "./standards-sdk.es107.js";
|
|
7
7
|
import { ProgressReporter } from "./standards-sdk.es108.js";
|
|
@@ -16,7 +16,7 @@ import "viem/accounts";
|
|
|
16
16
|
import "viem/chains";
|
|
17
17
|
import "x402-axios";
|
|
18
18
|
import "x402/types";
|
|
19
|
-
import "./standards-sdk.
|
|
19
|
+
import "./standards-sdk.es137.js";
|
|
20
20
|
import "zod";
|
|
21
21
|
import "buffer";
|
|
22
22
|
import "ethers";
|
|
@@ -12,14 +12,14 @@ import "viem/accounts";
|
|
|
12
12
|
import "viem/chains";
|
|
13
13
|
import "x402-axios";
|
|
14
14
|
import "x402/types";
|
|
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.es122.js";
|
|
20
20
|
import "./standards-sdk.es113.js";
|
|
21
21
|
import { getTopicId } from "./standards-sdk.es114.js";
|
|
22
|
-
import { InscriptionSDK } from "./standards-sdk.
|
|
22
|
+
import { InscriptionSDK } from "./standards-sdk.es138.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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client, Status, PrivateKey, AccountUpdateTransaction } from "@hashgraph/sdk";
|
|
2
2
|
import { inscribeWithSigner, inscribe } from "./standards-sdk.es124.js";
|
|
3
|
-
import "./standards-sdk.
|
|
3
|
+
import "./standards-sdk.es138.js";
|
|
4
4
|
import { Logger } from "./standards-sdk.es105.js";
|
|
5
5
|
import { HederaMirrorNode } from "./standards-sdk.es126.js";
|
|
6
6
|
import { ProgressReporter } from "./standards-sdk.es108.js";
|
|
@@ -14,7 +14,7 @@ import "viem/accounts";
|
|
|
14
14
|
import "viem/chains";
|
|
15
15
|
import "x402-axios";
|
|
16
16
|
import "x402/types";
|
|
17
|
-
import "./standards-sdk.
|
|
17
|
+
import "./standards-sdk.es137.js";
|
|
18
18
|
import { z } from "zod";
|
|
19
19
|
import "@hashgraph/proto";
|
|
20
20
|
import "buffer";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RegistryType } from "./standards-sdk.es30.js";
|
|
2
2
|
import { inscribe, inscribeWithSigner } from "./standards-sdk.es124.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.es124.js";
|
|
4
|
-
import "./standards-sdk.
|
|
4
|
+
import "./standards-sdk.es138.js";
|
|
5
5
|
import { getCryptoAdapter } from "./standards-sdk.es119.js";
|
|
6
6
|
import { isSSREnvironment } from "./standards-sdk.es117.js";
|
|
7
7
|
import { validateActionRegistration } from "./standards-sdk.es43.js";
|
|
@@ -10,10 +10,10 @@ import "viem/accounts";
|
|
|
10
10
|
import "viem/chains";
|
|
11
11
|
import "x402-axios";
|
|
12
12
|
import "x402/types";
|
|
13
|
-
import "./standards-sdk.
|
|
13
|
+
import "./standards-sdk.es137.js";
|
|
14
14
|
import "zod";
|
|
15
15
|
import "@hashgraph/sdk";
|
|
16
|
-
import "./standards-sdk.
|
|
16
|
+
import "./standards-sdk.es138.js";
|
|
17
17
|
import "@hashgraph/proto";
|
|
18
18
|
import "buffer";
|
|
19
19
|
import "ethers";
|
|
@@ -3,7 +3,7 @@ import { HCS12BaseClient } from "./standards-sdk.es36.js";
|
|
|
3
3
|
import { createNodeOperatorContext } from "./standards-sdk.es135.js";
|
|
4
4
|
import { RegistryType } from "./standards-sdk.es30.js";
|
|
5
5
|
import { inscribe } from "./standards-sdk.es124.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";
|
|
@@ -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.es124.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCryptoAdapter } from "./standards-sdk.es119.js";
|
|
2
|
-
import { base58Encode } from "./standards-sdk.
|
|
2
|
+
import { base58Encode } from "./standards-sdk.es140.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.es140.js";
|
|
4
4
|
class ResolverRegistry {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.resolvers = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HCS5BaseClient } from "./standards-sdk.
|
|
1
|
+
import { HCS5BaseClient } from "./standards-sdk.es139.js";
|
|
2
2
|
import { buildHcs1Hrl } from "./standards-sdk.es64.js";
|
|
3
3
|
import { PrivateKey } from "@hashgraph/sdk";
|
|
4
4
|
import { inscribeWithSigner } from "./standards-sdk.es124.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HCS5BaseClient } from "./standards-sdk.
|
|
1
|
+
import { HCS5BaseClient } from "./standards-sdk.es139.js";
|
|
2
2
|
import { buildHcs1Hrl } from "./standards-sdk.es64.js";
|
|
3
3
|
import { AccountId } from "@hashgraph/sdk";
|
|
4
4
|
import { inscribe } from "./standards-sdk.es124.js";
|
|
@@ -10,7 +10,7 @@ import "viem/accounts";
|
|
|
10
10
|
import "viem/chains";
|
|
11
11
|
import "x402-axios";
|
|
12
12
|
import "x402/types";
|
|
13
|
-
import "./standards-sdk.
|
|
13
|
+
import "./standards-sdk.es137.js";
|
|
14
14
|
import "zod";
|
|
15
15
|
import "@hashgraph/sdk";
|
|
16
16
|
import { HCS20_CONSTANTS, HCS20MessageSchema } from "./standards-sdk.es73.js";
|