@hashgraphonline/standards-sdk 0.1.189 → 0.1.190
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/browser/hcs-25/adapters/agentverse.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/availability.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/connectivity.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/ethos.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/model-evals.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/simple-evals.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/x402.d.ts.map +1 -1
- package/dist/browser/hcs-25/collectors/acp.d.ts +42 -0
- package/dist/browser/hcs-25/collectors/acp.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/agentverse.d.ts +37 -0
- package/dist/browser/hcs-25/collectors/agentverse.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/availability.d.ts +29 -0
- package/dist/browser/hcs-25/collectors/availability.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/catalog.d.ts +57 -0
- package/dist/browser/hcs-25/collectors/catalog.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/connectivity.d.ts +49 -0
- package/dist/browser/hcs-25/collectors/connectivity.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/endpoints.d.ts +9 -0
- package/dist/browser/hcs-25/collectors/endpoints.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/erc8004.d.ts +104 -0
- package/dist/browser/hcs-25/collectors/erc8004.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/ethos.d.ts +95 -0
- package/dist/browser/hcs-25/collectors/ethos.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/freshness.d.ts +36 -0
- package/dist/browser/hcs-25/collectors/freshness.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/http.d.ts +67 -0
- package/dist/browser/hcs-25/collectors/http.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/index.d.ts +21 -0
- package/dist/browser/hcs-25/collectors/index.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/merge.d.ts +11 -0
- package/dist/browser/hcs-25/collectors/merge.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/model-evals.d.ts +315 -0
- package/dist/browser/hcs-25/collectors/model-evals.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/oss-popularity.d.ts +51 -0
- package/dist/browser/hcs-25/collectors/oss-popularity.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/output-verification.d.ts +37 -0
- package/dist/browser/hcs-25/collectors/output-verification.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/pipeline.d.ts +19 -0
- package/dist/browser/hcs-25/collectors/pipeline.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/runner.d.ts +20 -0
- package/dist/browser/hcs-25/collectors/runner.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/simple-evals.d.ts +91 -0
- package/dist/browser/hcs-25/collectors/simple-evals.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/types.d.ts +113 -0
- package/dist/browser/hcs-25/collectors/types.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/x402-onchain.d.ts +105 -0
- package/dist/browser/hcs-25/collectors/x402-onchain.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/x402.d.ts +48 -0
- package/dist/browser/hcs-25/collectors/x402.d.ts.map +1 -0
- package/dist/browser/hcs-25/index.d.ts +1 -0
- package/dist/browser/hcs-25/index.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/marketplace.d.ts +6 -6
- package/dist/browser/hcs-25/signals/marketplace.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/model-evals.d.ts +12 -12
- package/dist/browser/hcs-25/signals/model-evals.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/operational.d.ts +15 -12
- package/dist/browser/hcs-25/signals/operational.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/simple-evals.d.ts +1 -1
- package/dist/browser/hcs-25/signals/simple-evals.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/agentverse.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/availability.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/connectivity.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/ethos.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/model-evals.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/simple-evals.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/x402.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/collectors/acp.d.ts +42 -0
- package/dist/browser-root/hcs-25/collectors/acp.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/agentverse.d.ts +37 -0
- package/dist/browser-root/hcs-25/collectors/agentverse.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/availability.d.ts +29 -0
- package/dist/browser-root/hcs-25/collectors/availability.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/catalog.d.ts +57 -0
- package/dist/browser-root/hcs-25/collectors/catalog.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/connectivity.d.ts +49 -0
- package/dist/browser-root/hcs-25/collectors/connectivity.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/endpoints.d.ts +9 -0
- package/dist/browser-root/hcs-25/collectors/endpoints.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/erc8004.d.ts +104 -0
- package/dist/browser-root/hcs-25/collectors/erc8004.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/ethos.d.ts +95 -0
- package/dist/browser-root/hcs-25/collectors/ethos.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/freshness.d.ts +36 -0
- package/dist/browser-root/hcs-25/collectors/freshness.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/http.d.ts +67 -0
- package/dist/browser-root/hcs-25/collectors/http.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/index.d.ts +21 -0
- package/dist/browser-root/hcs-25/collectors/index.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/merge.d.ts +11 -0
- package/dist/browser-root/hcs-25/collectors/merge.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/model-evals.d.ts +315 -0
- package/dist/browser-root/hcs-25/collectors/model-evals.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/oss-popularity.d.ts +51 -0
- package/dist/browser-root/hcs-25/collectors/oss-popularity.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/output-verification.d.ts +37 -0
- package/dist/browser-root/hcs-25/collectors/output-verification.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/pipeline.d.ts +19 -0
- package/dist/browser-root/hcs-25/collectors/pipeline.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/runner.d.ts +20 -0
- package/dist/browser-root/hcs-25/collectors/runner.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/simple-evals.d.ts +91 -0
- package/dist/browser-root/hcs-25/collectors/simple-evals.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/types.d.ts +113 -0
- package/dist/browser-root/hcs-25/collectors/types.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/x402-onchain.d.ts +105 -0
- package/dist/browser-root/hcs-25/collectors/x402-onchain.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/x402.d.ts +48 -0
- package/dist/browser-root/hcs-25/collectors/x402.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/index.d.ts +1 -0
- package/dist/browser-root/hcs-25/index.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/marketplace.d.ts +6 -6
- package/dist/browser-root/hcs-25/signals/marketplace.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/model-evals.d.ts +12 -12
- package/dist/browser-root/hcs-25/signals/model-evals.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/operational.d.ts +15 -12
- package/dist/browser-root/hcs-25/signals/operational.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/simple-evals.d.ts +1 -1
- package/dist/browser-root/hcs-25/signals/simple-evals.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/agentverse.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/availability.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/connectivity.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/ethos.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/model-evals.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/simple-evals.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/x402.d.ts.map +1 -1
- package/dist/cjs/hcs-25/collectors/acp.d.ts +42 -0
- package/dist/cjs/hcs-25/collectors/acp.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/agentverse.d.ts +37 -0
- package/dist/cjs/hcs-25/collectors/agentverse.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/availability.d.ts +29 -0
- package/dist/cjs/hcs-25/collectors/availability.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/catalog.d.ts +57 -0
- package/dist/cjs/hcs-25/collectors/catalog.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/connectivity.d.ts +49 -0
- package/dist/cjs/hcs-25/collectors/connectivity.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/endpoints.d.ts +9 -0
- package/dist/cjs/hcs-25/collectors/endpoints.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/erc8004.d.ts +104 -0
- package/dist/cjs/hcs-25/collectors/erc8004.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/ethos.d.ts +95 -0
- package/dist/cjs/hcs-25/collectors/ethos.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/freshness.d.ts +36 -0
- package/dist/cjs/hcs-25/collectors/freshness.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/http.d.ts +67 -0
- package/dist/cjs/hcs-25/collectors/http.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/index.d.ts +21 -0
- package/dist/cjs/hcs-25/collectors/index.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/merge.d.ts +11 -0
- package/dist/cjs/hcs-25/collectors/merge.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/model-evals.d.ts +315 -0
- package/dist/cjs/hcs-25/collectors/model-evals.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/oss-popularity.d.ts +51 -0
- package/dist/cjs/hcs-25/collectors/oss-popularity.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/output-verification.d.ts +37 -0
- package/dist/cjs/hcs-25/collectors/output-verification.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/pipeline.d.ts +19 -0
- package/dist/cjs/hcs-25/collectors/pipeline.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/runner.d.ts +20 -0
- package/dist/cjs/hcs-25/collectors/runner.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/simple-evals.d.ts +91 -0
- package/dist/cjs/hcs-25/collectors/simple-evals.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/types.d.ts +113 -0
- package/dist/cjs/hcs-25/collectors/types.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/x402-onchain.d.ts +105 -0
- package/dist/cjs/hcs-25/collectors/x402-onchain.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/x402.d.ts +48 -0
- package/dist/cjs/hcs-25/collectors/x402.d.ts.map +1 -0
- package/dist/cjs/hcs-25/index.d.ts +1 -0
- package/dist/cjs/hcs-25/index.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/marketplace.d.ts +6 -6
- package/dist/cjs/hcs-25/signals/marketplace.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/model-evals.d.ts +12 -12
- package/dist/cjs/hcs-25/signals/model-evals.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/operational.d.ts +15 -12
- package/dist/cjs/hcs-25/signals/operational.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/simple-evals.d.ts +1 -1
- package/dist/cjs/hcs-25/signals/simple-evals.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-25/adapters/agentverse.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/availability.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/connectivity.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/ethos.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/model-evals.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/simple-evals.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/x402.d.ts.map +1 -1
- package/dist/es/hcs-25/collectors/acp.d.ts +42 -0
- package/dist/es/hcs-25/collectors/acp.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/agentverse.d.ts +37 -0
- package/dist/es/hcs-25/collectors/agentverse.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/availability.d.ts +29 -0
- package/dist/es/hcs-25/collectors/availability.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/catalog.d.ts +57 -0
- package/dist/es/hcs-25/collectors/catalog.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/connectivity.d.ts +49 -0
- package/dist/es/hcs-25/collectors/connectivity.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/endpoints.d.ts +9 -0
- package/dist/es/hcs-25/collectors/endpoints.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/erc8004.d.ts +104 -0
- package/dist/es/hcs-25/collectors/erc8004.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/ethos.d.ts +95 -0
- package/dist/es/hcs-25/collectors/ethos.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/freshness.d.ts +36 -0
- package/dist/es/hcs-25/collectors/freshness.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/http.d.ts +67 -0
- package/dist/es/hcs-25/collectors/http.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/index.d.ts +21 -0
- package/dist/es/hcs-25/collectors/index.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/merge.d.ts +11 -0
- package/dist/es/hcs-25/collectors/merge.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/model-evals.d.ts +315 -0
- package/dist/es/hcs-25/collectors/model-evals.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/oss-popularity.d.ts +51 -0
- package/dist/es/hcs-25/collectors/oss-popularity.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/output-verification.d.ts +37 -0
- package/dist/es/hcs-25/collectors/output-verification.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/pipeline.d.ts +19 -0
- package/dist/es/hcs-25/collectors/pipeline.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/runner.d.ts +20 -0
- package/dist/es/hcs-25/collectors/runner.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/simple-evals.d.ts +91 -0
- package/dist/es/hcs-25/collectors/simple-evals.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/types.d.ts +113 -0
- package/dist/es/hcs-25/collectors/types.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/x402-onchain.d.ts +105 -0
- package/dist/es/hcs-25/collectors/x402-onchain.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/x402.d.ts +48 -0
- package/dist/es/hcs-25/collectors/x402.d.ts.map +1 -0
- package/dist/es/hcs-25/index.d.ts +1 -0
- package/dist/es/hcs-25/index.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/marketplace.d.ts +6 -6
- package/dist/es/hcs-25/signals/marketplace.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/model-evals.d.ts +12 -12
- package/dist/es/hcs-25/signals/model-evals.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/operational.d.ts +15 -12
- package/dist/es/hcs-25/signals/operational.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/simple-evals.d.ts +1 -1
- package/dist/es/hcs-25/signals/simple-evals.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +137 -58
- package/dist/es/standards-sdk.es.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +2 -2
- package/dist/es/standards-sdk.es103.js +2 -2
- package/dist/es/standards-sdk.es104.js +1 -1
- package/dist/es/standards-sdk.es106.js +1 -1
- package/dist/es/standards-sdk.es108.js +2 -2
- package/dist/es/standards-sdk.es11.js +1 -1
- package/dist/es/standards-sdk.es110.js +1 -1
- package/dist/es/standards-sdk.es111.js +2 -2
- package/dist/es/standards-sdk.es115.js +3 -3
- package/dist/es/standards-sdk.es116.js +4 -4
- package/dist/es/standards-sdk.es12.js +1 -1
- package/dist/es/standards-sdk.es120.js +4 -4
- package/dist/es/standards-sdk.es121.js +11 -11
- package/dist/es/standards-sdk.es122.js +176 -240
- package/dist/es/standards-sdk.es122.js.map +1 -1
- package/dist/es/standards-sdk.es123.js +41 -468
- package/dist/es/standards-sdk.es123.js.map +1 -1
- package/dist/es/standards-sdk.es124.js +28 -103
- package/dist/es/standards-sdk.es124.js.map +1 -1
- package/dist/es/standards-sdk.es125.js +185 -145
- package/dist/es/standards-sdk.es125.js.map +1 -1
- package/dist/es/standards-sdk.es126.js +13 -33
- package/dist/es/standards-sdk.es126.js.map +1 -1
- package/dist/es/standards-sdk.es127.js +44 -10
- package/dist/es/standards-sdk.es127.js.map +1 -1
- package/dist/es/standards-sdk.es128.js +150 -172
- package/dist/es/standards-sdk.es128.js.map +1 -1
- package/dist/es/standards-sdk.es129.js +166 -26
- package/dist/es/standards-sdk.es129.js.map +1 -1
- package/dist/es/standards-sdk.es13.js +1 -1
- package/dist/es/standards-sdk.es130.js +375 -18
- package/dist/es/standards-sdk.es130.js.map +1 -1
- package/dist/es/standards-sdk.es131.js +371 -139
- package/dist/es/standards-sdk.es131.js.map +1 -1
- package/dist/es/standards-sdk.es132.js +211 -180
- package/dist/es/standards-sdk.es132.js.map +1 -1
- package/dist/es/standards-sdk.es133.js +210 -770
- package/dist/es/standards-sdk.es133.js.map +1 -1
- package/dist/es/standards-sdk.es134.js +376 -10
- package/dist/es/standards-sdk.es134.js.map +1 -1
- package/dist/es/standards-sdk.es135.js +118 -564
- package/dist/es/standards-sdk.es135.js.map +1 -1
- package/dist/es/standards-sdk.es136.js +233 -608
- package/dist/es/standards-sdk.es136.js.map +1 -1
- package/dist/es/standards-sdk.es137.js +1328 -12
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +133 -2
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +258 -74
- package/dist/es/standards-sdk.es139.js.map +1 -1
- package/dist/es/standards-sdk.es14.js +1 -1
- package/dist/es/standards-sdk.es140.js +104 -38
- package/dist/es/standards-sdk.es140.js.map +1 -1
- package/dist/es/standards-sdk.es141.js +252 -2
- package/dist/es/standards-sdk.es141.js.map +1 -1
- package/dist/es/standards-sdk.es142.js +446 -203
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es143.js +104 -1139
- package/dist/es/standards-sdk.es143.js.map +1 -1
- package/dist/es/standards-sdk.es144.js +144 -290
- package/dist/es/standards-sdk.es144.js.map +1 -1
- package/dist/es/standards-sdk.es145.js +31 -419
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es146.js +10 -353
- package/dist/es/standards-sdk.es146.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +144 -1084
- package/dist/es/standards-sdk.es147.js.map +1 -1
- package/dist/es/standards-sdk.es148.js +25 -204
- package/dist/es/standards-sdk.es148.js.map +1 -1
- package/dist/es/standards-sdk.es149.js +17 -1562
- package/dist/es/standards-sdk.es149.js.map +1 -1
- package/dist/es/standards-sdk.es15.js +1 -1
- package/dist/es/standards-sdk.es150.js +128 -1134
- package/dist/es/standards-sdk.es150.js.map +1 -1
- package/dist/es/standards-sdk.es151.js +199 -14
- package/dist/es/standards-sdk.es151.js.map +1 -1
- package/dist/es/standards-sdk.es152.js +773 -434
- package/dist/es/standards-sdk.es152.js.map +1 -1
- package/dist/es/standards-sdk.es153.js +10 -256
- package/dist/es/standards-sdk.es153.js.map +1 -1
- package/dist/es/standards-sdk.es154.js +567 -4
- package/dist/es/standards-sdk.es154.js.map +1 -1
- package/dist/es/standards-sdk.es155.js +619 -74
- package/dist/es/standards-sdk.es155.js.map +1 -1
- package/dist/es/standards-sdk.es156.js +12 -86
- package/dist/es/standards-sdk.es156.js.map +1 -1
- package/dist/es/standards-sdk.es157.js +2 -60
- package/dist/es/standards-sdk.es157.js.map +1 -1
- package/dist/es/standards-sdk.es158.js +87 -2547
- package/dist/es/standards-sdk.es158.js.map +1 -1
- package/dist/es/standards-sdk.es159.js +36 -155
- package/dist/es/standards-sdk.es159.js.map +1 -1
- package/dist/es/standards-sdk.es16.js +6 -6
- package/dist/es/standards-sdk.es160.js +2 -7
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es161.js +223 -74
- package/dist/es/standards-sdk.es161.js.map +1 -1
- package/dist/es/standards-sdk.es162.js +1122 -47
- package/dist/es/standards-sdk.es162.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +299 -187
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +419 -23
- package/dist/es/standards-sdk.es164.js.map +1 -1
- package/dist/es/standards-sdk.es165.js +352 -55
- package/dist/es/standards-sdk.es165.js.map +1 -1
- package/dist/es/standards-sdk.es166.js +1113 -86
- package/dist/es/standards-sdk.es166.js.map +1 -1
- package/dist/es/standards-sdk.es167.js +200 -41
- package/dist/es/standards-sdk.es167.js.map +1 -1
- package/dist/es/standards-sdk.es168.js +1551 -188
- package/dist/es/standards-sdk.es168.js.map +1 -1
- package/dist/es/standards-sdk.es169.js +1161 -51
- package/dist/es/standards-sdk.es169.js.map +1 -1
- package/dist/es/standards-sdk.es170.js +15 -47
- package/dist/es/standards-sdk.es170.js.map +1 -1
- package/dist/es/standards-sdk.es171.js +445 -50
- package/dist/es/standards-sdk.es171.js.map +1 -1
- package/dist/es/standards-sdk.es172.js +255 -45
- package/dist/es/standards-sdk.es172.js.map +1 -1
- package/dist/es/standards-sdk.es173.js +4 -122
- package/dist/es/standards-sdk.es173.js.map +1 -1
- package/dist/es/standards-sdk.es174.js +77 -50
- package/dist/es/standards-sdk.es174.js.map +1 -1
- package/dist/es/standards-sdk.es175.js +85 -42
- package/dist/es/standards-sdk.es175.js.map +1 -1
- package/dist/es/standards-sdk.es176.js +60 -72
- package/dist/es/standards-sdk.es176.js.map +1 -1
- package/dist/es/standards-sdk.es177.js +2544 -65
- package/dist/es/standards-sdk.es177.js.map +1 -1
- package/dist/es/standards-sdk.es178.js +159 -44
- package/dist/es/standards-sdk.es178.js.map +1 -1
- package/dist/es/standards-sdk.es179.js +7 -36
- package/dist/es/standards-sdk.es179.js.map +1 -1
- package/dist/es/standards-sdk.es18.js +13 -13
- package/dist/es/standards-sdk.es180.js +86 -30
- package/dist/es/standards-sdk.es180.js.map +1 -1
- package/dist/es/standards-sdk.es181.js +65 -34
- package/dist/es/standards-sdk.es181.js.map +1 -1
- package/dist/es/standards-sdk.es182.js +196 -48
- package/dist/es/standards-sdk.es182.js.map +1 -1
- package/dist/es/standards-sdk.es183.js +23 -135
- package/dist/es/standards-sdk.es183.js.map +1 -1
- package/dist/es/standards-sdk.es184.js +54 -38
- package/dist/es/standards-sdk.es184.js.map +1 -1
- package/dist/es/standards-sdk.es185.js +102 -12470
- package/dist/es/standards-sdk.es185.js.map +1 -1
- package/dist/es/standards-sdk.es186.js +53 -52
- package/dist/es/standards-sdk.es186.js.map +1 -1
- package/dist/es/standards-sdk.es187.js +223 -103
- package/dist/es/standards-sdk.es187.js.map +1 -1
- package/dist/es/standards-sdk.es188.js +66 -75
- package/dist/es/standards-sdk.es188.js.map +1 -1
- package/dist/es/standards-sdk.es189.js +46 -197
- package/dist/es/standards-sdk.es189.js.map +1 -1
- package/dist/es/standards-sdk.es19.js +10 -10
- package/dist/es/standards-sdk.es190.js +58 -668
- package/dist/es/standards-sdk.es190.js.map +1 -1
- package/dist/es/standards-sdk.es191.js +45 -168
- package/dist/es/standards-sdk.es191.js.map +1 -1
- package/dist/es/standards-sdk.es192.js +115 -315
- package/dist/es/standards-sdk.es192.js.map +1 -1
- package/dist/es/standards-sdk.es193.js +51 -340
- package/dist/es/standards-sdk.es193.js.map +1 -1
- package/dist/es/standards-sdk.es194.js +54 -448
- package/dist/es/standards-sdk.es194.js.map +1 -1
- package/dist/es/standards-sdk.es195.js +72 -331
- package/dist/es/standards-sdk.es195.js.map +1 -1
- package/dist/es/standards-sdk.es196.js +75 -76
- package/dist/es/standards-sdk.es196.js.map +1 -1
- package/dist/es/standards-sdk.es197.js +44 -73
- package/dist/es/standards-sdk.es197.js.map +1 -1
- package/dist/es/standards-sdk.es198.js +34 -15
- package/dist/es/standards-sdk.es198.js.map +1 -1
- package/dist/es/standards-sdk.es199.js +30 -139
- package/dist/es/standards-sdk.es199.js.map +1 -1
- package/dist/es/standards-sdk.es2.js +2 -2
- package/dist/es/standards-sdk.es20.js +1 -1
- package/dist/es/standards-sdk.es200.js +34 -517
- package/dist/es/standards-sdk.es200.js.map +1 -1
- package/dist/es/standards-sdk.es201.js +48 -259
- package/dist/es/standards-sdk.es201.js.map +1 -1
- package/dist/es/standards-sdk.es202.js +127 -185
- package/dist/es/standards-sdk.es202.js.map +1 -1
- package/dist/es/standards-sdk.es203.js +36 -113
- package/dist/es/standards-sdk.es203.js.map +1 -1
- package/dist/es/standards-sdk.es204.js +12464 -134
- package/dist/es/standards-sdk.es204.js.map +1 -1
- package/dist/es/standards-sdk.es205.js +14 -181
- package/dist/es/standards-sdk.es205.js.map +1 -1
- package/dist/es/standards-sdk.es206.js +55 -683
- package/dist/es/standards-sdk.es206.js.map +1 -1
- package/dist/es/standards-sdk.es207.js +93 -167
- package/dist/es/standards-sdk.es207.js.map +1 -1
- package/dist/es/standards-sdk.es208.js +71 -225
- package/dist/es/standards-sdk.es208.js.map +1 -1
- package/dist/es/standards-sdk.es209.js +176 -215
- package/dist/es/standards-sdk.es209.js.map +1 -1
- package/dist/es/standards-sdk.es21.js +1 -1
- package/dist/es/standards-sdk.es210.js +675 -0
- package/dist/es/standards-sdk.es210.js.map +1 -0
- package/dist/es/standards-sdk.es211.js +76 -0
- package/dist/es/standards-sdk.es211.js.map +1 -0
- package/dist/es/standards-sdk.es212.js +175 -0
- package/dist/es/standards-sdk.es212.js.map +1 -0
- package/dist/es/standards-sdk.es213.js +325 -0
- package/dist/es/standards-sdk.es213.js.map +1 -0
- package/dist/es/standards-sdk.es214.js +349 -0
- package/dist/es/standards-sdk.es214.js.map +1 -0
- package/dist/es/standards-sdk.es215.js +456 -0
- package/dist/es/standards-sdk.es215.js.map +1 -0
- package/dist/es/standards-sdk.es216.js +334 -0
- package/dist/es/standards-sdk.es216.js.map +1 -0
- package/dist/es/standards-sdk.es217.js +79 -0
- package/dist/es/standards-sdk.es217.js.map +1 -0
- package/dist/es/standards-sdk.es218.js +142 -0
- package/dist/es/standards-sdk.es218.js.map +1 -0
- package/dist/es/standards-sdk.es219.js +520 -0
- package/dist/es/standards-sdk.es219.js.map +1 -0
- package/dist/es/standards-sdk.es22.js +1 -1
- package/dist/es/standards-sdk.es220.js +262 -0
- package/dist/es/standards-sdk.es220.js.map +1 -0
- package/dist/es/standards-sdk.es221.js +199 -0
- package/dist/es/standards-sdk.es221.js.map +1 -0
- package/dist/es/standards-sdk.es222.js +122 -0
- package/dist/es/standards-sdk.es222.js.map +1 -0
- package/dist/es/standards-sdk.es223.js +155 -0
- package/dist/es/standards-sdk.es223.js.map +1 -0
- package/dist/es/standards-sdk.es224.js +187 -0
- package/dist/es/standards-sdk.es224.js.map +1 -0
- package/dist/es/standards-sdk.es225.js +687 -0
- package/dist/es/standards-sdk.es225.js.map +1 -0
- package/dist/es/standards-sdk.es226.js +188 -0
- package/dist/es/standards-sdk.es226.js.map +1 -0
- package/dist/es/standards-sdk.es227.js +238 -0
- package/dist/es/standards-sdk.es227.js.map +1 -0
- package/dist/es/standards-sdk.es228.js +242 -0
- package/dist/es/standards-sdk.es228.js.map +1 -0
- package/dist/es/standards-sdk.es23.js +1 -1
- package/dist/es/standards-sdk.es24.js +1 -1
- package/dist/es/standards-sdk.es25.js +1 -1
- package/dist/es/standards-sdk.es26.js +1 -1
- package/dist/es/standards-sdk.es27.js +13 -13
- package/dist/es/standards-sdk.es30.js +2 -2
- package/dist/es/standards-sdk.es31.js +4 -4
- package/dist/es/standards-sdk.es32.js +1 -1
- package/dist/es/standards-sdk.es35.js +7 -7
- package/dist/es/standards-sdk.es36.js +4 -4
- package/dist/es/standards-sdk.es37.js +2 -2
- package/dist/es/standards-sdk.es38.js +2 -2
- package/dist/es/standards-sdk.es39.js +1 -1
- package/dist/es/standards-sdk.es4.js +2 -2
- package/dist/es/standards-sdk.es40.js +1 -1
- package/dist/es/standards-sdk.es41.js +2 -2
- package/dist/es/standards-sdk.es46.js +1 -1
- package/dist/es/standards-sdk.es5.js +2 -2
- package/dist/es/standards-sdk.es51.js +1 -1
- package/dist/es/standards-sdk.es53.js +1 -1
- package/dist/es/standards-sdk.es56.js +2 -2
- package/dist/es/standards-sdk.es59.js +1 -1
- package/dist/es/standards-sdk.es6.js +2 -2
- package/dist/es/standards-sdk.es60.js +1 -1
- package/dist/es/standards-sdk.es62.js +1 -1
- package/dist/es/standards-sdk.es63.js +2 -2
- package/dist/es/standards-sdk.es64.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.es67.js +8 -8
- package/dist/es/standards-sdk.es69.js +1 -1
- package/dist/es/standards-sdk.es7.js +1 -1
- package/dist/es/standards-sdk.es71.js +2 -2
- package/dist/es/standards-sdk.es72.js +3 -3
- package/dist/es/standards-sdk.es75.js +5 -5
- package/dist/es/standards-sdk.es76.js +3 -3
- package/dist/es/standards-sdk.es77.js +2 -2
- package/dist/es/standards-sdk.es78.js +1 -1
- package/dist/es/standards-sdk.es81.js +2 -2
- package/dist/es/standards-sdk.es83.js +2 -2
- package/dist/es/standards-sdk.es84.js +5 -5
- package/dist/es/standards-sdk.es85.js +1 -1
- package/dist/es/standards-sdk.es88.js +1 -1
- package/dist/es/standards-sdk.es89.js +2 -2
- package/dist/es/standards-sdk.es9.js +2 -2
- package/dist/es/standards-sdk.es90.js +4 -4
- package/dist/es/standards-sdk.es94.js +3 -3
- package/dist/es/standards-sdk.es96.js +2 -2
- package/dist/es/standards-sdk.es98.js +1 -1
- package/dist/es/standards-sdk.es99.js +3 -3
- package/package.json +1 -1
|
@@ -1,1125 +1,185 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { optionalImport } from "./standards-sdk.es187.js";
|
|
7
|
-
import { validateQuoteParameters, getCachedQuote, getOrCreateSDK, cacheQuote } from "./standards-sdk.es148.js";
|
|
8
|
-
import { HederaMirrorNode } from "./standards-sdk.es149.js";
|
|
9
|
-
import { sleep } from "./standards-sdk.es138.js";
|
|
10
|
-
import { computeInscriptionCostSummary } from "./standards-sdk.es197.js";
|
|
11
|
-
let nodeModules = {};
|
|
12
|
-
const normalizeTransactionId = (txId) => {
|
|
13
|
-
if (!txId.includes("@")) {
|
|
14
|
-
return txId;
|
|
15
|
-
}
|
|
16
|
-
const txParts = txId?.split("@");
|
|
17
|
-
return `${txParts[0]}-${txParts[1].replace(".", "-")}`;
|
|
18
|
-
};
|
|
19
|
-
async function loadNodeModules() {
|
|
20
|
-
if (isBrowser || nodeModules.readFileSync) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
try {
|
|
24
|
-
const [fsModule, pathModule] = await Promise.all([
|
|
25
|
-
optionalImport("node:fs"),
|
|
26
|
-
optionalImport("node:path")
|
|
27
|
-
]);
|
|
28
|
-
if (!fsModule || !pathModule) {
|
|
29
|
-
throw new Error("Node.js fs or path module not available");
|
|
30
|
-
}
|
|
31
|
-
nodeModules.readFileSync = fsModule.readFileSync;
|
|
32
|
-
nodeModules.basename = pathModule.basename;
|
|
33
|
-
nodeModules.extname = pathModule.extname;
|
|
34
|
-
} catch (error) {
|
|
35
|
-
Logger.getInstance({
|
|
36
|
-
module: "Inscriber",
|
|
37
|
-
level: "warn"
|
|
38
|
-
}).warn(
|
|
39
|
-
"Node.js modules not available, file path operations will be disabled",
|
|
40
|
-
{
|
|
41
|
-
error: error instanceof Error ? error.message : String(error)
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const COST_LOOKUP_ATTEMPTS = 3;
|
|
47
|
-
const COST_LOOKUP_DELAY_MS = 1e3;
|
|
48
|
-
const COST_LOGGER_MODULE = "InscriberCost";
|
|
49
|
-
async function convertFileToBase64(filePath) {
|
|
50
|
-
if (isBrowser) {
|
|
51
|
-
throw new Error(
|
|
52
|
-
"File path operations are not supported in browser environment. Use buffer input type instead."
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
await loadNodeModules();
|
|
56
|
-
if (!nodeModules.readFileSync || !nodeModules.basename || !nodeModules.extname) {
|
|
57
|
-
throw new Error(
|
|
58
|
-
"Node.js file system modules are not available. Cannot read file from path."
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
try {
|
|
62
|
-
const buffer = nodeModules.readFileSync(filePath);
|
|
63
|
-
const base64 = buffer.toString("base64");
|
|
64
|
-
const fileName = nodeModules.basename(filePath);
|
|
65
|
-
let mimeType = "application/octet-stream";
|
|
66
|
-
try {
|
|
67
|
-
const fileTypeModule = await optionalImport("file-type");
|
|
68
|
-
const fileTypeResult = typeof fileTypeModule?.fileTypeFromBuffer === "function" ? await fileTypeModule.fileTypeFromBuffer(buffer) : void 0;
|
|
69
|
-
if (fileTypeResult) {
|
|
70
|
-
mimeType = fileTypeResult.mime;
|
|
71
|
-
}
|
|
72
|
-
} catch (_error) {
|
|
73
|
-
const ext = nodeModules.extname(filePath).toLowerCase();
|
|
74
|
-
const mimeMap = {
|
|
75
|
-
".txt": "text/plain",
|
|
76
|
-
".json": "application/json",
|
|
77
|
-
".html": "text/html",
|
|
78
|
-
".css": "text/css",
|
|
79
|
-
".js": "application/javascript",
|
|
80
|
-
".png": "image/png",
|
|
81
|
-
".jpg": "image/jpeg",
|
|
82
|
-
".jpeg": "image/jpeg",
|
|
83
|
-
".gif": "image/gif",
|
|
84
|
-
".svg": "image/svg+xml",
|
|
85
|
-
".pdf": "application/pdf"
|
|
86
|
-
};
|
|
87
|
-
mimeType = mimeMap[ext] || "application/octet-stream";
|
|
88
|
-
}
|
|
89
|
-
return { base64, fileName, mimeType };
|
|
90
|
-
} catch (error) {
|
|
91
|
-
throw new Error(
|
|
92
|
-
`Failed to read file ${filePath}: ${error.message}`
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function normalizeClientConfig(cfg) {
|
|
97
|
-
return {
|
|
98
|
-
accountId: cfg.accountId,
|
|
99
|
-
privateKey: typeof cfg.privateKey === "string" ? cfg.privateKey : cfg.privateKey.toString(),
|
|
100
|
-
network: cfg.network
|
|
1
|
+
let loggerFactory = null;
|
|
2
|
+
function normalizeErrorData(error) {
|
|
3
|
+
const normalizedData = {
|
|
4
|
+
name: error.name,
|
|
5
|
+
message: error.message
|
|
101
6
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (options.connectionMode) {
|
|
105
|
-
return options.connectionMode;
|
|
7
|
+
if (error.stack) {
|
|
8
|
+
normalizedData.stack = error.stack;
|
|
106
9
|
}
|
|
107
|
-
|
|
108
|
-
|
|
10
|
+
for (const [key, value] of Object.entries(error)) {
|
|
11
|
+
normalizedData[key] = value;
|
|
109
12
|
}
|
|
110
|
-
return
|
|
13
|
+
return normalizedData;
|
|
111
14
|
}
|
|
112
|
-
|
|
113
|
-
const logger = Logger.getInstance({
|
|
114
|
-
module: "Inscriber",
|
|
115
|
-
...options.logging
|
|
116
|
-
});
|
|
117
|
-
const resolvedConnectionMode = resolveConnectionMode(options);
|
|
118
|
-
logger.info("Starting inscription process", {
|
|
119
|
-
type: input.type,
|
|
120
|
-
mode: options.mode || "file",
|
|
121
|
-
quoteOnly: options.quoteOnly || false,
|
|
122
|
-
...input.type === "url" ? { url: input.url } : {},
|
|
123
|
-
...input.type === "file" ? { path: input.path } : {},
|
|
124
|
-
...input.type === "buffer" ? { fileName: input.fileName, bufferSize: input.buffer.byteLength } : {}
|
|
125
|
-
});
|
|
15
|
+
function serializeLogData(data) {
|
|
126
16
|
try {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
validateHashinalMetadata(options.metadata, logger);
|
|
133
|
-
}
|
|
134
|
-
let sdk;
|
|
135
|
-
if (existingSDK) {
|
|
136
|
-
logger.debug("Using existing InscriptionSDK instance");
|
|
137
|
-
sdk = existingSDK;
|
|
138
|
-
} else if (options.apiKey) {
|
|
139
|
-
logger.debug("Initializing InscriptionSDK with API key");
|
|
140
|
-
sdk = new InscriptionSDK({
|
|
141
|
-
apiKey: options.apiKey,
|
|
142
|
-
network: clientConfig.network || "mainnet",
|
|
143
|
-
connectionMode: resolvedConnectionMode,
|
|
144
|
-
baseURL: options.baseURL
|
|
145
|
-
});
|
|
146
|
-
} else {
|
|
147
|
-
logger.debug("Initializing InscriptionSDK with server auth");
|
|
148
|
-
const normalized = normalizeClientConfig(clientConfig);
|
|
149
|
-
sdk = await InscriptionSDK.createWithAuth({
|
|
150
|
-
type: "server",
|
|
151
|
-
accountId: normalized.accountId,
|
|
152
|
-
privateKey: normalized.privateKey,
|
|
153
|
-
network: normalized.network || "mainnet",
|
|
154
|
-
connectionMode: resolvedConnectionMode,
|
|
155
|
-
baseUrl: options.baseURL
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
const baseRequest = {
|
|
159
|
-
holderId: clientConfig.accountId,
|
|
160
|
-
metadata: options.metadata || {},
|
|
161
|
-
tags: options.tags || [],
|
|
162
|
-
mode: options.mode || "file",
|
|
163
|
-
fileStandard: options.fileStandard,
|
|
164
|
-
chunkSize: options.chunkSize
|
|
165
|
-
};
|
|
166
|
-
let request;
|
|
167
|
-
switch (input.type) {
|
|
168
|
-
case "url":
|
|
169
|
-
request = {
|
|
170
|
-
...baseRequest,
|
|
171
|
-
file: {
|
|
172
|
-
type: "url",
|
|
173
|
-
url: input.url
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
break;
|
|
177
|
-
case "file": {
|
|
178
|
-
const fileData = await convertFileToBase64(input.path);
|
|
179
|
-
request = {
|
|
180
|
-
...baseRequest,
|
|
181
|
-
file: {
|
|
182
|
-
type: "base64",
|
|
183
|
-
base64: fileData.base64,
|
|
184
|
-
fileName: fileData.fileName,
|
|
185
|
-
mimeType: fileData.mimeType
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
break;
|
|
189
|
-
}
|
|
190
|
-
case "buffer":
|
|
191
|
-
request = {
|
|
192
|
-
...baseRequest,
|
|
193
|
-
file: {
|
|
194
|
-
type: "base64",
|
|
195
|
-
base64: Buffer.from(
|
|
196
|
-
input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
|
|
197
|
-
).toString("base64"),
|
|
198
|
-
fileName: input.fileName,
|
|
199
|
-
mimeType: input.mimeType
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
break;
|
|
203
|
-
}
|
|
204
|
-
if (options.mode === "hashinal") {
|
|
205
|
-
request.metadataObject = options.metadata;
|
|
206
|
-
request.creator = options.metadata?.creator || clientConfig.accountId;
|
|
207
|
-
request.description = options.metadata?.description;
|
|
208
|
-
if (options.jsonFileURL) {
|
|
209
|
-
request.jsonFileURL = options.jsonFileURL;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
logger.debug("Preparing to inscribe content", {
|
|
213
|
-
type: input.type,
|
|
214
|
-
mode: options.mode || "file",
|
|
215
|
-
holderId: clientConfig.accountId
|
|
216
|
-
});
|
|
217
|
-
const normalizedCfg = normalizeClientConfig(clientConfig);
|
|
218
|
-
const result = await sdk.inscribeAndExecute(
|
|
219
|
-
request,
|
|
220
|
-
normalizedCfg,
|
|
221
|
-
options.progressCallback
|
|
222
|
-
);
|
|
223
|
-
const rawJobId = result.jobId || result.tx_id || result.transactionId || "";
|
|
224
|
-
const rawTxId = result.transactionId || rawJobId || "";
|
|
225
|
-
const normalizedJobId = normalizeTransactionId(rawJobId);
|
|
226
|
-
const normalizedTxId = normalizeTransactionId(rawTxId);
|
|
227
|
-
const waitId = normalizeTransactionId(
|
|
228
|
-
normalizedJobId || normalizedTxId || rawJobId || result.jobId || ""
|
|
229
|
-
);
|
|
230
|
-
logger.info("Starting to inscribe.", {
|
|
231
|
-
type: input.type,
|
|
232
|
-
mode: options.mode || "file",
|
|
233
|
-
transactionId: result.jobId
|
|
234
|
-
});
|
|
235
|
-
if (options.waitForConfirmation) {
|
|
236
|
-
logger.debug("Waiting for inscription confirmation", {
|
|
237
|
-
transactionId: waitId,
|
|
238
|
-
maxAttempts: options.waitMaxAttempts,
|
|
239
|
-
intervalMs: options.waitIntervalMs
|
|
240
|
-
});
|
|
241
|
-
const inscription = await waitForInscriptionConfirmation(
|
|
242
|
-
sdk,
|
|
243
|
-
waitId,
|
|
244
|
-
options.waitMaxAttempts,
|
|
245
|
-
options.waitIntervalMs,
|
|
246
|
-
options.progressCallback
|
|
247
|
-
);
|
|
248
|
-
logger.info("Inscription confirmation received", {
|
|
249
|
-
transactionId: result.jobId
|
|
250
|
-
});
|
|
251
|
-
return {
|
|
252
|
-
confirmed: true,
|
|
253
|
-
result: {
|
|
254
|
-
...result,
|
|
255
|
-
jobId: waitId,
|
|
256
|
-
transactionId: normalizedTxId
|
|
257
|
-
},
|
|
258
|
-
inscription,
|
|
259
|
-
sdk,
|
|
260
|
-
costSummary: await resolveInscriptionCost(
|
|
261
|
-
normalizedTxId,
|
|
262
|
-
clientConfig.network || "mainnet",
|
|
263
|
-
options.logging?.level
|
|
264
|
-
)
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
return {
|
|
268
|
-
confirmed: false,
|
|
269
|
-
result: {
|
|
270
|
-
...result,
|
|
271
|
-
jobId: waitId,
|
|
272
|
-
transactionId: normalizedTxId
|
|
273
|
-
},
|
|
274
|
-
sdk,
|
|
275
|
-
costSummary: await resolveInscriptionCost(
|
|
276
|
-
normalizedTxId,
|
|
277
|
-
clientConfig.network || "mainnet",
|
|
278
|
-
options.logging?.level
|
|
279
|
-
)
|
|
280
|
-
};
|
|
281
|
-
} catch (error) {
|
|
282
|
-
logger.error("Error during inscription process", error);
|
|
283
|
-
throw error;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
async function resolveInscriptionCost(transactionId, network, level) {
|
|
287
|
-
const logger = Logger.getInstance({
|
|
288
|
-
module: COST_LOGGER_MODULE,
|
|
289
|
-
level: level ?? "info"
|
|
290
|
-
});
|
|
291
|
-
const mirrorNode = new HederaMirrorNode(network, logger);
|
|
292
|
-
const normalizedId = normalizeTransactionId(transactionId);
|
|
293
|
-
const payerAccountId = normalizedId.split("-")[0];
|
|
294
|
-
for (let attempt = 0; attempt < COST_LOOKUP_ATTEMPTS; attempt++) {
|
|
295
|
-
try {
|
|
296
|
-
const txn = await mirrorNode.getTransaction(normalizedId);
|
|
297
|
-
if (!txn) {
|
|
298
|
-
if (attempt < COST_LOOKUP_ATTEMPTS - 1) {
|
|
299
|
-
await sleep(COST_LOOKUP_DELAY_MS);
|
|
17
|
+
return JSON.stringify(
|
|
18
|
+
data,
|
|
19
|
+
(_key, value) => {
|
|
20
|
+
if (value instanceof Error) {
|
|
21
|
+
return normalizeErrorData(value);
|
|
300
22
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
const computed = computeInscriptionCostSummary({
|
|
304
|
-
txn,
|
|
305
|
-
payerAccountId
|
|
306
|
-
});
|
|
307
|
-
if (!computed) {
|
|
308
|
-
if (attempt < COST_LOOKUP_ATTEMPTS - 1) {
|
|
309
|
-
await sleep(COST_LOOKUP_DELAY_MS);
|
|
23
|
+
if (typeof value === "bigint") {
|
|
24
|
+
return value.toString();
|
|
310
25
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
26
|
+
if (value instanceof Map) {
|
|
27
|
+
return Object.fromEntries(value);
|
|
28
|
+
}
|
|
29
|
+
if (value instanceof Set) {
|
|
30
|
+
return Array.from(value);
|
|
31
|
+
}
|
|
32
|
+
if (value instanceof Uint8Array) {
|
|
33
|
+
return Array.from(value);
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
},
|
|
37
|
+
2
|
|
38
|
+
);
|
|
39
|
+
} catch {
|
|
40
|
+
return String(data);
|
|
324
41
|
}
|
|
325
|
-
return void 0;
|
|
326
42
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
return await generateQuote(input, clientConfig, options, existingSDK);
|
|
350
|
-
}
|
|
351
|
-
if (options.mode === "hashinal" && options.metadata) {
|
|
352
|
-
validateHashinalMetadata(options.metadata, logger);
|
|
353
|
-
}
|
|
354
|
-
const accountId = signer.getAccountId().toString();
|
|
355
|
-
logger.debug("Using account ID from signer", { accountId });
|
|
356
|
-
let sdk;
|
|
357
|
-
if (existingSDK) {
|
|
358
|
-
logger.debug("Using existing InscriptionSDK instance");
|
|
359
|
-
sdk = existingSDK;
|
|
360
|
-
} else if (options.apiKey) {
|
|
361
|
-
logger.debug("Initializing InscriptionSDK with API key");
|
|
362
|
-
sdk = new InscriptionSDK({
|
|
363
|
-
apiKey: options.apiKey,
|
|
364
|
-
network: options.network || "mainnet",
|
|
365
|
-
connectionMode: resolvedConnectionMode,
|
|
366
|
-
baseURL: options.baseURL
|
|
367
|
-
});
|
|
368
|
-
} else {
|
|
369
|
-
logger.debug("Initializing InscriptionSDK with client auth (websocket)");
|
|
370
|
-
sdk = await InscriptionSDK.createWithAuth({
|
|
371
|
-
type: "client",
|
|
372
|
-
accountId,
|
|
373
|
-
signer,
|
|
374
|
-
network: options.network || "mainnet",
|
|
375
|
-
connectionMode: resolvedConnectionMode,
|
|
376
|
-
baseUrl: options.baseURL
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
const baseRequest = {
|
|
380
|
-
holderId: accountId,
|
|
381
|
-
metadata: options.metadata || {},
|
|
382
|
-
tags: options.tags || [],
|
|
383
|
-
mode: options.mode || "file",
|
|
384
|
-
fileStandard: options.fileStandard,
|
|
385
|
-
chunkSize: options.chunkSize
|
|
386
|
-
};
|
|
387
|
-
let request;
|
|
388
|
-
switch (input.type) {
|
|
389
|
-
case "url":
|
|
390
|
-
request = {
|
|
391
|
-
...baseRequest,
|
|
392
|
-
file: {
|
|
393
|
-
type: "url",
|
|
394
|
-
url: input.url
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
break;
|
|
398
|
-
case "file": {
|
|
399
|
-
const fileData = await convertFileToBase64(input.path);
|
|
400
|
-
request = {
|
|
401
|
-
...baseRequest,
|
|
402
|
-
file: {
|
|
403
|
-
type: "base64",
|
|
404
|
-
base64: fileData.base64,
|
|
405
|
-
fileName: fileData.fileName,
|
|
406
|
-
mimeType: fileData.mimeType
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
break;
|
|
43
|
+
function setLoggerFactory(factory) {
|
|
44
|
+
loggerFactory = factory;
|
|
45
|
+
Logger.clearInstances();
|
|
46
|
+
}
|
|
47
|
+
const _Logger = class _Logger {
|
|
48
|
+
constructor(options = {}) {
|
|
49
|
+
if (loggerFactory) {
|
|
50
|
+
return loggerFactory(options);
|
|
51
|
+
}
|
|
52
|
+
const globalDisable = typeof process !== "undefined" && process.env?.DISABLE_LOGS === "true";
|
|
53
|
+
this.silent = options.silent || globalDisable;
|
|
54
|
+
this.level = this.silent ? "silent" : options.level || "info";
|
|
55
|
+
this.moduleContext = options.module || "app";
|
|
56
|
+
this.prettyPrint = !this.silent && options.prettyPrint !== false;
|
|
57
|
+
}
|
|
58
|
+
static getInstance(options = {}) {
|
|
59
|
+
const moduleKey = options.module || "default";
|
|
60
|
+
const globalDisable = typeof process !== "undefined" && process.env?.DISABLE_LOGS === "true";
|
|
61
|
+
if (globalDisable && _Logger.instances.has(moduleKey)) {
|
|
62
|
+
const existingLogger = _Logger.instances.get(moduleKey);
|
|
63
|
+
if (existingLogger.getLevel() !== "silent") {
|
|
64
|
+
_Logger.instances.delete(moduleKey);
|
|
410
65
|
}
|
|
411
|
-
case "buffer":
|
|
412
|
-
request = {
|
|
413
|
-
...baseRequest,
|
|
414
|
-
file: {
|
|
415
|
-
type: "base64",
|
|
416
|
-
base64: Buffer.from(
|
|
417
|
-
input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
|
|
418
|
-
).toString("base64"),
|
|
419
|
-
fileName: input.fileName,
|
|
420
|
-
mimeType: input.mimeType
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
break;
|
|
424
66
|
}
|
|
425
|
-
if (
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
request.description = options.metadata?.description;
|
|
429
|
-
if (options.jsonFileURL) {
|
|
430
|
-
request.jsonFileURL = options.jsonFileURL;
|
|
431
|
-
}
|
|
67
|
+
if (!_Logger.instances.has(moduleKey)) {
|
|
68
|
+
const logger = loggerFactory ? loggerFactory(options) : new _Logger(options);
|
|
69
|
+
_Logger.instances.set(moduleKey, logger);
|
|
432
70
|
}
|
|
433
|
-
|
|
434
|
-
type: input.type,
|
|
435
|
-
mode: options.mode || "file",
|
|
436
|
-
holderId: accountId,
|
|
437
|
-
usesStartInscription: true
|
|
438
|
-
});
|
|
439
|
-
const startResult = await sdk.startInscription({
|
|
440
|
-
...request,
|
|
441
|
-
holderId: accountId,
|
|
442
|
-
network: options.network || "mainnet"
|
|
443
|
-
});
|
|
444
|
-
const startTransactionIdRaw = typeof startResult?.tx_id === "string" && startResult.tx_id.trim() || typeof startResult?.jobId === "string" && (startResult.jobId || "").trim() || typeof startResult?.id === "string" && (startResult.id || "").trim() || "";
|
|
445
|
-
const waitId = normalizeTransactionId(startTransactionIdRaw);
|
|
446
|
-
if (!waitId) {
|
|
447
|
-
throw new Error("startInscription did not return a transaction id");
|
|
448
|
-
}
|
|
449
|
-
logger.info("about to start inscription", {
|
|
450
|
-
type: input.type,
|
|
451
|
-
mode: options.mode || "file",
|
|
452
|
-
jobId: waitId,
|
|
453
|
-
...startResult
|
|
454
|
-
});
|
|
455
|
-
if (typeof startResult?.transactionBytes === "string") {
|
|
456
|
-
logger.debug("Executing inscription transaction with signer from bytes");
|
|
457
|
-
await sdk.executeTransactionWithSigner(
|
|
458
|
-
startResult.transactionBytes,
|
|
459
|
-
signer
|
|
460
|
-
);
|
|
461
|
-
} else if (startResult?.transactionBytes?.type === "Buffer") {
|
|
462
|
-
logger.debug("Executing inscription transaction with signer from buffer");
|
|
463
|
-
await sdk.executeTransactionWithSigner(
|
|
464
|
-
Buffer.from(startResult.transactionBytes.data).toString("base64"),
|
|
465
|
-
signer
|
|
466
|
-
);
|
|
467
|
-
}
|
|
468
|
-
if (options.waitForConfirmation) {
|
|
469
|
-
logger.debug("Waiting for inscription confirmation (websocket)", {
|
|
470
|
-
jobId: waitId,
|
|
471
|
-
maxAttempts: options.waitMaxAttempts,
|
|
472
|
-
intervalMs: options.waitIntervalMs
|
|
473
|
-
});
|
|
474
|
-
const inscription = await waitForInscriptionConfirmation(
|
|
475
|
-
sdk,
|
|
476
|
-
waitId,
|
|
477
|
-
options.waitMaxAttempts,
|
|
478
|
-
options.waitIntervalMs,
|
|
479
|
-
options.progressCallback
|
|
480
|
-
);
|
|
481
|
-
logger.info("Inscription confirmation received", {
|
|
482
|
-
jobId: waitId
|
|
483
|
-
});
|
|
484
|
-
return {
|
|
485
|
-
confirmed: true,
|
|
486
|
-
result: {
|
|
487
|
-
jobId: waitId,
|
|
488
|
-
transactionId: waitId,
|
|
489
|
-
topic_id: startResult.topic_id,
|
|
490
|
-
status: startResult.status,
|
|
491
|
-
completed: startResult.completed
|
|
492
|
-
},
|
|
493
|
-
inscription,
|
|
494
|
-
sdk,
|
|
495
|
-
costSummary: await resolveInscriptionCost(
|
|
496
|
-
waitId,
|
|
497
|
-
options.network || "mainnet",
|
|
498
|
-
options.logging?.level
|
|
499
|
-
)
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
return {
|
|
503
|
-
confirmed: false,
|
|
504
|
-
result: {
|
|
505
|
-
jobId: waitId,
|
|
506
|
-
transactionId: waitId,
|
|
507
|
-
topic_id: startResult.topic_id,
|
|
508
|
-
status: startResult.status,
|
|
509
|
-
completed: startResult.completed
|
|
510
|
-
},
|
|
511
|
-
sdk,
|
|
512
|
-
costSummary: await resolveInscriptionCost(
|
|
513
|
-
waitId,
|
|
514
|
-
options.network || "mainnet",
|
|
515
|
-
options.logging?.level
|
|
516
|
-
)
|
|
517
|
-
};
|
|
518
|
-
} catch (error) {
|
|
519
|
-
logger.error("Error during inscription process", error);
|
|
520
|
-
throw error;
|
|
71
|
+
return _Logger.instances.get(moduleKey);
|
|
521
72
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
const logger = Logger.getInstance({
|
|
525
|
-
module: "Inscriber",
|
|
526
|
-
...options?.logging || {}
|
|
527
|
-
});
|
|
528
|
-
const formattedTransactionId = transactionId.includes("@") ? `${transactionId.split("@")[0]}-${transactionId.split("@")[1].replace(/\./g, "-")}` : transactionId;
|
|
529
|
-
logger.info("Retrieving inscription", {
|
|
530
|
-
originalTransactionId: transactionId,
|
|
531
|
-
formattedTransactionId
|
|
532
|
-
});
|
|
533
|
-
try {
|
|
534
|
-
let sdk;
|
|
535
|
-
if (options?.apiKey) {
|
|
536
|
-
logger.debug("Initializing InscriptionSDK with API key");
|
|
537
|
-
sdk = new InscriptionSDK({
|
|
538
|
-
apiKey: options.apiKey,
|
|
539
|
-
network: options.network || "mainnet",
|
|
540
|
-
baseURL: options.baseURL
|
|
541
|
-
});
|
|
542
|
-
} else if (options?.accountId && options?.privateKey) {
|
|
543
|
-
logger.debug("Initializing InscriptionSDK with server auth");
|
|
544
|
-
sdk = await InscriptionSDK.createWithAuth({
|
|
545
|
-
type: "server",
|
|
546
|
-
accountId: options.accountId,
|
|
547
|
-
privateKey: options.privateKey,
|
|
548
|
-
network: options.network || "mainnet",
|
|
549
|
-
baseUrl: options.baseURL
|
|
550
|
-
});
|
|
551
|
-
} else {
|
|
552
|
-
const error = new Error(
|
|
553
|
-
"Either API key or account ID and private key are required for retrieving inscriptions"
|
|
554
|
-
);
|
|
555
|
-
logger.error("Missing authentication credentials", {
|
|
556
|
-
hasApiKey: Boolean(options?.apiKey),
|
|
557
|
-
hasAccountId: Boolean(options?.accountId),
|
|
558
|
-
hasPrivateKey: Boolean(options?.privateKey)
|
|
559
|
-
});
|
|
560
|
-
throw error;
|
|
561
|
-
}
|
|
562
|
-
logger.debug("Initialized SDK for inscription retrieval", {
|
|
563
|
-
formattedTransactionId,
|
|
564
|
-
network: options.network || "mainnet"
|
|
565
|
-
});
|
|
566
|
-
const result = await sdk.retrieveInscription(formattedTransactionId);
|
|
567
|
-
logger.info("Successfully retrieved inscription", {
|
|
568
|
-
formattedTransactionId
|
|
569
|
-
});
|
|
570
|
-
return result;
|
|
571
|
-
} catch (error) {
|
|
572
|
-
logger.error("Error retrieving inscription", {
|
|
573
|
-
formattedTransactionId,
|
|
574
|
-
error
|
|
575
|
-
});
|
|
576
|
-
throw error;
|
|
73
|
+
setLogLevel(level) {
|
|
74
|
+
this.level = level;
|
|
577
75
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
const requiredFields = ["name", "creator", "description", "type"];
|
|
581
|
-
const missingFields = requiredFields.filter((field) => !metadata[field]);
|
|
582
|
-
if (missingFields.length > 0) {
|
|
583
|
-
const error = new Error(
|
|
584
|
-
`Missing required Hashinal metadata fields: ${missingFields.join(", ")}`
|
|
585
|
-
);
|
|
586
|
-
logger.error("Hashinal metadata validation failed", { missingFields });
|
|
587
|
-
throw error;
|
|
76
|
+
getLevel() {
|
|
77
|
+
return this.level;
|
|
588
78
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
type: metadata.type,
|
|
594
|
-
hasAttributes: !!metadata.attributes,
|
|
595
|
-
hasProperties: !!metadata.properties
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
async function generateQuote(input, clientConfig, options, existingSDK) {
|
|
599
|
-
const logger = Logger.getInstance({
|
|
600
|
-
module: "Inscriber",
|
|
601
|
-
...options.logging
|
|
602
|
-
});
|
|
603
|
-
logger.info("Generating inscription quote", {
|
|
604
|
-
type: input.type,
|
|
605
|
-
mode: options.mode || "file",
|
|
606
|
-
...input.type === "url" ? { url: input.url } : {},
|
|
607
|
-
...input.type === "file" ? { path: input.path } : {},
|
|
608
|
-
...input.type === "buffer" ? { fileName: input.fileName, bufferSize: input.buffer.byteLength } : {}
|
|
609
|
-
});
|
|
610
|
-
try {
|
|
611
|
-
validateQuoteParameters(input, clientConfig, options);
|
|
612
|
-
const cachedQuote = getCachedQuote(input, clientConfig, options);
|
|
613
|
-
if (cachedQuote) {
|
|
614
|
-
logger.debug("Returning cached quote");
|
|
615
|
-
return {
|
|
616
|
-
confirmed: false,
|
|
617
|
-
quote: true,
|
|
618
|
-
result: cachedQuote
|
|
619
|
-
};
|
|
620
|
-
}
|
|
621
|
-
if (options.mode === "hashinal" && options.metadata) {
|
|
622
|
-
validateHashinalMetadata(options.metadata, logger);
|
|
623
|
-
}
|
|
624
|
-
const sdk = await getOrCreateSDK(clientConfig, options, existingSDK);
|
|
625
|
-
const baseRequest = {
|
|
626
|
-
holderId: clientConfig.accountId,
|
|
627
|
-
metadata: options.metadata || {},
|
|
628
|
-
tags: options.tags || [],
|
|
629
|
-
mode: options.mode || "file",
|
|
630
|
-
fileStandard: options.fileStandard,
|
|
631
|
-
chunkSize: options.chunkSize
|
|
632
|
-
};
|
|
633
|
-
let request;
|
|
634
|
-
switch (input.type) {
|
|
635
|
-
case "url":
|
|
636
|
-
request = {
|
|
637
|
-
...baseRequest,
|
|
638
|
-
file: {
|
|
639
|
-
type: "url",
|
|
640
|
-
url: input.url
|
|
641
|
-
}
|
|
642
|
-
};
|
|
643
|
-
break;
|
|
644
|
-
case "file": {
|
|
645
|
-
const fileData = await convertFileToBase64(input.path);
|
|
646
|
-
request = {
|
|
647
|
-
...baseRequest,
|
|
648
|
-
file: {
|
|
649
|
-
type: "base64",
|
|
650
|
-
base64: fileData.base64,
|
|
651
|
-
fileName: fileData.fileName,
|
|
652
|
-
mimeType: fileData.mimeType
|
|
653
|
-
}
|
|
654
|
-
};
|
|
655
|
-
break;
|
|
656
|
-
}
|
|
657
|
-
case "buffer":
|
|
658
|
-
request = {
|
|
659
|
-
...baseRequest,
|
|
660
|
-
file: {
|
|
661
|
-
type: "base64",
|
|
662
|
-
base64: Buffer.from(
|
|
663
|
-
input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
|
|
664
|
-
).toString("base64"),
|
|
665
|
-
fileName: input.fileName,
|
|
666
|
-
mimeType: input.mimeType
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
break;
|
|
670
|
-
}
|
|
671
|
-
if (options.mode === "hashinal") {
|
|
672
|
-
request.metadataObject = options.metadata;
|
|
673
|
-
request.creator = options.metadata?.creator || clientConfig.accountId;
|
|
674
|
-
request.description = options.metadata?.description;
|
|
675
|
-
if (options.jsonFileURL) {
|
|
676
|
-
request.jsonFileURL = options.jsonFileURL;
|
|
677
|
-
}
|
|
79
|
+
setSilent(silent) {
|
|
80
|
+
this.silent = silent;
|
|
81
|
+
if (silent) {
|
|
82
|
+
this.level = "silent";
|
|
678
83
|
}
|
|
679
|
-
logger.debug("Calling inscription SDK startInscription for quote", {
|
|
680
|
-
type: input.type,
|
|
681
|
-
mode: options.mode || "file",
|
|
682
|
-
holderId: clientConfig.accountId
|
|
683
|
-
});
|
|
684
|
-
const inscriptionResponse = await sdk.startInscription(request);
|
|
685
|
-
logger.debug("Received inscription response for quote parsing", {
|
|
686
|
-
hasTransactionBytes: !!inscriptionResponse.transactionBytes,
|
|
687
|
-
bytesLength: inscriptionResponse.transactionBytes?.length || 0,
|
|
688
|
-
transactionBytesType: typeof inscriptionResponse.transactionBytes,
|
|
689
|
-
totalCost: inscriptionResponse.totalCost
|
|
690
|
-
});
|
|
691
|
-
const quote = await parseTransactionForQuote(
|
|
692
|
-
inscriptionResponse,
|
|
693
|
-
logger
|
|
694
|
-
);
|
|
695
|
-
cacheQuote(input, clientConfig, options, quote);
|
|
696
|
-
logger.info("Successfully generated inscription quote", {
|
|
697
|
-
totalCostHbar: quote.totalCostHbar
|
|
698
|
-
});
|
|
699
|
-
return {
|
|
700
|
-
confirmed: false,
|
|
701
|
-
quote: true,
|
|
702
|
-
result: quote
|
|
703
|
-
};
|
|
704
|
-
} catch (error) {
|
|
705
|
-
logger.error("Error generating inscription quote", error);
|
|
706
|
-
throw error;
|
|
707
84
|
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (
|
|
713
|
-
|
|
714
|
-
totalCostHbar = hbarAmount.toString();
|
|
715
|
-
logger.debug("Using totalCost from inscription response", {
|
|
716
|
-
totalCostTinybars: inscriptionResponse.totalCost,
|
|
717
|
-
totalCostHbar
|
|
718
|
-
});
|
|
719
|
-
} else if (inscriptionResponse.transactionBytes) {
|
|
720
|
-
logger.debug("Parsing transaction bytes for cost information");
|
|
721
|
-
try {
|
|
722
|
-
let transactionBytesString;
|
|
723
|
-
if (typeof inscriptionResponse.transactionBytes === "string") {
|
|
724
|
-
transactionBytesString = inscriptionResponse.transactionBytes;
|
|
725
|
-
} else if (inscriptionResponse.transactionBytes && typeof inscriptionResponse.transactionBytes === "object" && "data" in inscriptionResponse.transactionBytes) {
|
|
726
|
-
const buffer = Buffer.from(inscriptionResponse.transactionBytes.data);
|
|
727
|
-
transactionBytesString = buffer.toString("base64");
|
|
728
|
-
} else {
|
|
729
|
-
throw new Error("Invalid transactionBytes format");
|
|
730
|
-
}
|
|
731
|
-
logger.debug("About to parse transaction bytes", {
|
|
732
|
-
bytesLength: transactionBytesString.length,
|
|
733
|
-
bytesPreview: transactionBytesString.slice(0, 100)
|
|
734
|
-
});
|
|
735
|
-
const parsedTransaction = await TransactionParser.parseTransactionBytes(
|
|
736
|
-
transactionBytesString,
|
|
737
|
-
{ includeRaw: false }
|
|
738
|
-
);
|
|
739
|
-
logger.debug("Parsed transaction for quote", {
|
|
740
|
-
type: parsedTransaction.type,
|
|
741
|
-
hasTransfers: !!parsedTransaction.transfers,
|
|
742
|
-
transferCount: parsedTransaction.transfers?.length || 0,
|
|
743
|
-
transfers: parsedTransaction.transfers
|
|
744
|
-
});
|
|
745
|
-
let totalTransferAmount = 0;
|
|
746
|
-
if (parsedTransaction.transfers && parsedTransaction.transfers.length > 0) {
|
|
747
|
-
for (const transfer of parsedTransaction.transfers) {
|
|
748
|
-
const transferAmount = typeof transfer.amount === "string" ? parseFloat(transfer.amount) : transfer.amount;
|
|
749
|
-
if (transferAmount < 0) {
|
|
750
|
-
const amountHbar = Math.abs(transferAmount);
|
|
751
|
-
totalTransferAmount += amountHbar;
|
|
752
|
-
logger.debug("Found HBAR transfer", {
|
|
753
|
-
from: transfer.accountId,
|
|
754
|
-
to: "service",
|
|
755
|
-
amount: amountHbar
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
if (totalTransferAmount > 0) {
|
|
761
|
-
totalCostHbar = totalTransferAmount.toString();
|
|
762
|
-
logger.debug("Using parsed transaction transfer amount", {
|
|
763
|
-
totalTransferAmount,
|
|
764
|
-
totalCostHbar
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
} catch (parseError) {
|
|
768
|
-
logger.warn(
|
|
769
|
-
"Could not parse transaction bytes, using totalCost fallback",
|
|
770
|
-
{
|
|
771
|
-
error: parseError,
|
|
772
|
-
errorMessage: parseError instanceof Error ? parseError.message : String(parseError)
|
|
773
|
-
}
|
|
774
|
-
);
|
|
775
|
-
}
|
|
85
|
+
setModule(module) {
|
|
86
|
+
this.moduleContext = module;
|
|
87
|
+
}
|
|
88
|
+
formatArgs(args) {
|
|
89
|
+
if (args.length === 0) {
|
|
90
|
+
return { msg: "" };
|
|
776
91
|
}
|
|
777
|
-
|
|
778
|
-
{
|
|
779
|
-
|
|
780
|
-
amount: totalCostHbar,
|
|
781
|
-
description: `Inscription fee (${totalCostHbar} HBAR)`
|
|
92
|
+
if (args.length === 1) {
|
|
93
|
+
if (typeof args[0] === "string") {
|
|
94
|
+
return { msg: args[0] };
|
|
782
95
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
96
|
+
return { msg: "", data: args[0] };
|
|
97
|
+
}
|
|
98
|
+
const stringArgs = [];
|
|
99
|
+
const objectArgs = [];
|
|
100
|
+
args.forEach((arg) => {
|
|
101
|
+
if (typeof arg === "string" || typeof arg === "number" || typeof arg === "boolean") {
|
|
102
|
+
stringArgs.push(String(arg));
|
|
103
|
+
} else {
|
|
104
|
+
objectArgs.push(arg);
|
|
790
105
|
}
|
|
791
|
-
};
|
|
792
|
-
logger.debug("Successfully parsed transaction for quote", {
|
|
793
|
-
totalCostHbar: quote.totalCostHbar,
|
|
794
|
-
transferCount: transfers.length,
|
|
795
|
-
hasTransactionBytes: !!inscriptionResponse.transactionBytes,
|
|
796
|
-
hasTotalCost: !!inscriptionResponse.totalCost
|
|
797
106
|
});
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
logger.error("Error parsing transaction for quote", error);
|
|
801
|
-
throw error;
|
|
107
|
+
const msg = stringArgs.join(" ");
|
|
108
|
+
return objectArgs.length > 0 ? { msg, data: objectArgs } : { msg };
|
|
802
109
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
const normalizedId = normalizeTransactionId(transactionId);
|
|
807
|
-
const progressReporter = new ProgressReporter({
|
|
808
|
-
module: "Inscriber",
|
|
809
|
-
logger,
|
|
810
|
-
callback: progressCallback
|
|
811
|
-
});
|
|
812
|
-
try {
|
|
813
|
-
logger.debug("Waiting for inscription confirmation", {
|
|
814
|
-
transactionId: normalizedId,
|
|
815
|
-
maxAttempts,
|
|
816
|
-
intervalMs
|
|
817
|
-
});
|
|
818
|
-
progressReporter.preparing("Preparing for inscription confirmation", 5, {
|
|
819
|
-
transactionId: normalizedId,
|
|
820
|
-
maxAttempts,
|
|
821
|
-
intervalMs
|
|
822
|
-
});
|
|
823
|
-
try {
|
|
824
|
-
const waitMethod = sdk.waitForInscription.bind(sdk);
|
|
825
|
-
const wrappedCallback = (data) => {
|
|
826
|
-
const stageRaw = data.stage || "confirming";
|
|
827
|
-
const allowedStages = [
|
|
828
|
-
"preparing",
|
|
829
|
-
"submitting",
|
|
830
|
-
"confirming",
|
|
831
|
-
"verifying",
|
|
832
|
-
"completed",
|
|
833
|
-
"failed"
|
|
834
|
-
];
|
|
835
|
-
const stage = allowedStages.includes(stageRaw) ? stageRaw : "confirming";
|
|
836
|
-
const message = data.message || "Processing inscription";
|
|
837
|
-
const percent = data.progressPercent || 50;
|
|
838
|
-
progressReporter.report({
|
|
839
|
-
stage,
|
|
840
|
-
message,
|
|
841
|
-
progressPercent: percent,
|
|
842
|
-
details: data.details
|
|
843
|
-
});
|
|
844
|
-
};
|
|
845
|
-
return await waitMethod(
|
|
846
|
-
normalizedId,
|
|
847
|
-
maxAttempts,
|
|
848
|
-
intervalMs,
|
|
849
|
-
true,
|
|
850
|
-
wrappedCallback
|
|
851
|
-
);
|
|
852
|
-
} catch (e) {
|
|
853
|
-
logger.debug("Falling back to standard waitForInscription method", {
|
|
854
|
-
error: e
|
|
855
|
-
});
|
|
856
|
-
progressReporter.verifying("Verifying inscription status", 50, {
|
|
857
|
-
error: e
|
|
858
|
-
});
|
|
859
|
-
return await sdk.waitForInscription(
|
|
860
|
-
normalizedId,
|
|
861
|
-
maxAttempts,
|
|
862
|
-
intervalMs,
|
|
863
|
-
true
|
|
864
|
-
);
|
|
110
|
+
shouldLog(level) {
|
|
111
|
+
if (this.silent || this.level === "silent") {
|
|
112
|
+
return false;
|
|
865
113
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
intervalMs,
|
|
871
|
-
error
|
|
872
|
-
});
|
|
873
|
-
progressReporter.failed("Inscription confirmation failed", {
|
|
874
|
-
transactionId,
|
|
875
|
-
error
|
|
876
|
-
});
|
|
877
|
-
throw error;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
const DEFAULT_REGISTRY_BROKER_URL = "https://hol.org/registry/api/v1";
|
|
881
|
-
const DEFAULT_POLL_INTERVAL_MS = 2e3;
|
|
882
|
-
const DEFAULT_WAIT_TIMEOUT_MS = 12e4;
|
|
883
|
-
async function fetchRegistryBroker(url, options) {
|
|
884
|
-
const response = await fetch(url, options);
|
|
885
|
-
const body = await response.json().catch(() => ({}));
|
|
886
|
-
if (!response.ok) {
|
|
887
|
-
const errorMessage = typeof body === "object" && body && "error" in body ? String(body.error) : `HTTP ${response.status}`;
|
|
888
|
-
throw new Error(errorMessage);
|
|
889
|
-
}
|
|
890
|
-
return body;
|
|
891
|
-
}
|
|
892
|
-
async function inscribeViaRegistryBroker(input, options = {}) {
|
|
893
|
-
const logger = Logger.getInstance({
|
|
894
|
-
module: "InscribeViaBroker",
|
|
895
|
-
...options.logging
|
|
896
|
-
});
|
|
897
|
-
const baseUrl = options.baseUrl ?? DEFAULT_REGISTRY_BROKER_URL;
|
|
898
|
-
const waitForConfirmation = options.waitForConfirmation ?? true;
|
|
899
|
-
const waitTimeoutMs = options.waitTimeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
|
|
900
|
-
const pollIntervalMs = options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
901
|
-
const headers = {
|
|
902
|
-
"Content-Type": "application/json",
|
|
903
|
-
Accept: "application/json"
|
|
904
|
-
};
|
|
905
|
-
if (options.ledgerApiKey) {
|
|
906
|
-
headers["x-api-key"] = options.ledgerApiKey;
|
|
907
|
-
} else if (options.apiKey) {
|
|
908
|
-
headers["x-api-key"] = options.apiKey;
|
|
909
|
-
} else {
|
|
910
|
-
throw new Error(
|
|
911
|
-
"Either ledgerApiKey or apiKey is required for Registry Broker inscription"
|
|
912
|
-
);
|
|
114
|
+
const levels = ["trace", "debug", "info", "warn", "error", "silent"];
|
|
115
|
+
const currentLevelIndex = levels.indexOf(this.level);
|
|
116
|
+
const targetLevelIndex = levels.indexOf(level);
|
|
117
|
+
return targetLevelIndex >= currentLevelIndex;
|
|
913
118
|
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
mode: options.mode ?? "file"
|
|
918
|
-
});
|
|
919
|
-
let base64Content;
|
|
920
|
-
let fileName;
|
|
921
|
-
let mimeType;
|
|
922
|
-
switch (input.type) {
|
|
923
|
-
case "url":
|
|
924
|
-
logger.debug("Creating job with URL input");
|
|
925
|
-
break;
|
|
926
|
-
case "file": {
|
|
927
|
-
const fileData = await convertFileToBase64(input.path);
|
|
928
|
-
base64Content = fileData.base64;
|
|
929
|
-
fileName = fileData.fileName;
|
|
930
|
-
mimeType = fileData.mimeType;
|
|
931
|
-
break;
|
|
119
|
+
getConsoleMethod(level) {
|
|
120
|
+
if (level === "error") {
|
|
121
|
+
return console.error;
|
|
932
122
|
}
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
|
|
936
|
-
).toString("base64");
|
|
937
|
-
fileName = input.fileName;
|
|
938
|
-
mimeType = input.mimeType;
|
|
939
|
-
break;
|
|
940
|
-
}
|
|
941
|
-
const requestBody = {
|
|
942
|
-
inputType: input.type === "url" ? "url" : "base64",
|
|
943
|
-
mode: options.mode ?? "file"
|
|
944
|
-
};
|
|
945
|
-
if (input.type === "url") {
|
|
946
|
-
requestBody.url = input.url;
|
|
947
|
-
} else {
|
|
948
|
-
requestBody.base64 = base64Content;
|
|
949
|
-
requestBody.fileName = fileName;
|
|
950
|
-
if (mimeType) {
|
|
951
|
-
requestBody.mimeType = mimeType;
|
|
123
|
+
if (level === "warn") {
|
|
124
|
+
return console.warn;
|
|
952
125
|
}
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
requestBody.metadata = options.metadata;
|
|
956
|
-
}
|
|
957
|
-
if (options.tags) {
|
|
958
|
-
requestBody.tags = options.tags;
|
|
959
|
-
}
|
|
960
|
-
if (options.fileStandard) {
|
|
961
|
-
requestBody.fileStandard = options.fileStandard;
|
|
962
|
-
}
|
|
963
|
-
if (options.chunkSize) {
|
|
964
|
-
requestBody.chunkSize = options.chunkSize;
|
|
965
|
-
}
|
|
966
|
-
logger.debug("Creating inscription job");
|
|
967
|
-
const job = await fetchRegistryBroker(
|
|
968
|
-
`${baseUrl}/inscribe/content`,
|
|
969
|
-
{
|
|
970
|
-
method: "POST",
|
|
971
|
-
headers,
|
|
972
|
-
body: JSON.stringify(requestBody)
|
|
126
|
+
if (level === "debug") {
|
|
127
|
+
return console.debug;
|
|
973
128
|
}
|
|
974
|
-
|
|
975
|
-
const jobId = job.jobId ?? job.id ?? "";
|
|
976
|
-
logger.info("Inscription job created", { jobId, status: job.status });
|
|
977
|
-
if (!waitForConfirmation) {
|
|
978
|
-
return {
|
|
979
|
-
confirmed: false,
|
|
980
|
-
jobId,
|
|
981
|
-
status: job.status,
|
|
982
|
-
credits: job.credits ?? job.quoteCredits,
|
|
983
|
-
usdCents: job.usdCents ?? job.quoteUsdCents,
|
|
984
|
-
sizeBytes: job.sizeBytes,
|
|
985
|
-
createdAt: job.createdAt,
|
|
986
|
-
updatedAt: job.updatedAt,
|
|
987
|
-
network: job.network
|
|
988
|
-
};
|
|
129
|
+
return console.log;
|
|
989
130
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
while (Date.now() - startTime < waitTimeoutMs) {
|
|
994
|
-
const currentJob = await fetchRegistryBroker(
|
|
995
|
-
`${baseUrl}/inscribe/content/${jobId}`,
|
|
996
|
-
{ method: "GET", headers }
|
|
997
|
-
);
|
|
998
|
-
if (currentJob.status !== lastStatus) {
|
|
999
|
-
logger.debug("Job status update", { jobId, status: currentJob.status });
|
|
1000
|
-
lastStatus = currentJob.status;
|
|
1001
|
-
}
|
|
1002
|
-
if (currentJob.status === "completed") {
|
|
1003
|
-
logger.info("Inscription completed", {
|
|
1004
|
-
jobId,
|
|
1005
|
-
hrl: currentJob.hrl,
|
|
1006
|
-
topicId: currentJob.topicId
|
|
1007
|
-
});
|
|
1008
|
-
return {
|
|
1009
|
-
confirmed: true,
|
|
1010
|
-
jobId,
|
|
1011
|
-
status: currentJob.status,
|
|
1012
|
-
hrl: currentJob.hrl,
|
|
1013
|
-
topicId: currentJob.topicId,
|
|
1014
|
-
network: currentJob.network,
|
|
1015
|
-
credits: currentJob.credits ?? currentJob.quoteCredits,
|
|
1016
|
-
usdCents: currentJob.usdCents ?? currentJob.quoteUsdCents,
|
|
1017
|
-
sizeBytes: currentJob.sizeBytes,
|
|
1018
|
-
createdAt: currentJob.createdAt,
|
|
1019
|
-
updatedAt: currentJob.updatedAt
|
|
1020
|
-
};
|
|
131
|
+
writeLog(level, ...args) {
|
|
132
|
+
if (!this.shouldLog(level)) {
|
|
133
|
+
return;
|
|
1021
134
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
135
|
+
const { msg, data } = this.formatArgs(args);
|
|
136
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
137
|
+
const consoleMethod = this.getConsoleMethod(level);
|
|
138
|
+
if (this.prettyPrint) {
|
|
139
|
+
const levelFormatted = level.toUpperCase().padEnd(5);
|
|
140
|
+
let output = `${timestamp} ${levelFormatted} [${this.moduleContext}] ${msg}`;
|
|
141
|
+
if (data) {
|
|
142
|
+
output += "\n" + serializeLogData(data);
|
|
143
|
+
}
|
|
144
|
+
consoleMethod(output);
|
|
145
|
+
} else {
|
|
146
|
+
const logObj = {
|
|
147
|
+
timestamp,
|
|
148
|
+
level,
|
|
149
|
+
module: this.moduleContext,
|
|
150
|
+
message: msg,
|
|
151
|
+
...data && { data }
|
|
1032
152
|
};
|
|
153
|
+
consoleMethod(JSON.stringify(logObj));
|
|
1033
154
|
}
|
|
1034
|
-
await sleep(pollIntervalMs);
|
|
1035
155
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
);
|
|
1039
|
-
}
|
|
1040
|
-
async function getRegistryBrokerQuote(input, options = {}) {
|
|
1041
|
-
const logger = Logger.getInstance({
|
|
1042
|
-
module: "InscribeViaBroker",
|
|
1043
|
-
...options.logging
|
|
1044
|
-
});
|
|
1045
|
-
const baseUrl = options.baseUrl ?? DEFAULT_REGISTRY_BROKER_URL;
|
|
1046
|
-
const headers = {
|
|
1047
|
-
"Content-Type": "application/json",
|
|
1048
|
-
Accept: "application/json"
|
|
1049
|
-
};
|
|
1050
|
-
if (options.ledgerApiKey) {
|
|
1051
|
-
headers["x-api-key"] = options.ledgerApiKey;
|
|
1052
|
-
} else if (options.apiKey) {
|
|
1053
|
-
headers["x-api-key"] = options.apiKey;
|
|
1054
|
-
} else {
|
|
1055
|
-
throw new Error(
|
|
1056
|
-
"Either ledgerApiKey or apiKey is required for Registry Broker quotes"
|
|
1057
|
-
);
|
|
156
|
+
debug(...args) {
|
|
157
|
+
this.writeLog("debug", ...args);
|
|
1058
158
|
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
let mimeType;
|
|
1062
|
-
switch (input.type) {
|
|
1063
|
-
case "url":
|
|
1064
|
-
break;
|
|
1065
|
-
case "file": {
|
|
1066
|
-
const fileData = await convertFileToBase64(input.path);
|
|
1067
|
-
base64Content = fileData.base64;
|
|
1068
|
-
fileName = fileData.fileName;
|
|
1069
|
-
mimeType = fileData.mimeType;
|
|
1070
|
-
break;
|
|
1071
|
-
}
|
|
1072
|
-
case "buffer":
|
|
1073
|
-
base64Content = Buffer.from(
|
|
1074
|
-
input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
|
|
1075
|
-
).toString("base64");
|
|
1076
|
-
fileName = input.fileName;
|
|
1077
|
-
mimeType = input.mimeType;
|
|
1078
|
-
break;
|
|
1079
|
-
}
|
|
1080
|
-
const requestBody = {
|
|
1081
|
-
inputType: input.type === "url" ? "url" : "base64",
|
|
1082
|
-
mode: options.mode ?? "file"
|
|
1083
|
-
};
|
|
1084
|
-
if (input.type === "url") {
|
|
1085
|
-
requestBody.url = input.url;
|
|
1086
|
-
} else {
|
|
1087
|
-
requestBody.base64 = base64Content;
|
|
1088
|
-
requestBody.fileName = fileName;
|
|
1089
|
-
if (mimeType) {
|
|
1090
|
-
requestBody.mimeType = mimeType;
|
|
1091
|
-
}
|
|
159
|
+
info(...args) {
|
|
160
|
+
this.writeLog("info", ...args);
|
|
1092
161
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
162
|
+
warn(...args) {
|
|
163
|
+
this.writeLog("warn", ...args);
|
|
1095
164
|
}
|
|
1096
|
-
|
|
1097
|
-
|
|
165
|
+
error(...args) {
|
|
166
|
+
this.writeLog("error", ...args);
|
|
1098
167
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
168
|
+
trace(...args) {
|
|
169
|
+
this.writeLog("trace", ...args);
|
|
1101
170
|
}
|
|
1102
|
-
|
|
1103
|
-
|
|
171
|
+
/**
|
|
172
|
+
* Clear all logger instances
|
|
173
|
+
* Used when switching logger implementations
|
|
174
|
+
*/
|
|
175
|
+
static clearInstances() {
|
|
176
|
+
_Logger.instances.clear();
|
|
1104
177
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
{
|
|
1109
|
-
method: "POST",
|
|
1110
|
-
headers,
|
|
1111
|
-
body: JSON.stringify(requestBody)
|
|
1112
|
-
}
|
|
1113
|
-
);
|
|
1114
|
-
}
|
|
178
|
+
};
|
|
179
|
+
_Logger.instances = /* @__PURE__ */ new Map();
|
|
180
|
+
let Logger = _Logger;
|
|
1115
181
|
export {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
inscribe,
|
|
1119
|
-
inscribeViaRegistryBroker,
|
|
1120
|
-
inscribeWithSigner,
|
|
1121
|
-
normalizeTransactionId,
|
|
1122
|
-
retrieveInscription,
|
|
1123
|
-
waitForInscriptionConfirmation
|
|
182
|
+
Logger,
|
|
183
|
+
setLoggerFactory
|
|
1124
184
|
};
|
|
1125
185
|
//# sourceMappingURL=standards-sdk.es147.js.map
|