@cheqd/sdk
Version:
A TypeScript SDK built with CosmJS to interact with the cheqd network ledger
27 lines • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheqdRegistry = void 0;
exports.createDefaultCheqdRegistry = createDefaultCheqdRegistry;
const proto_signing_cjs_1 = require("@cosmjs/proto-signing-cjs");
const stargate_cjs_1 = require("@cosmjs/stargate-cjs");
/**
* Creates a default Cheqd registry with optional custom types.
* The registry is used for encoding and decoding protobuf messages in blockchain transactions.
* It includes all default Stargate types and any additional custom types provided.
*
* @param customTypes - Optional iterable of custom type mappings to add to the registry.
* Each entry should be a tuple of [typeUrl, GeneratedType].
* @returns A configured Registry instance with default and custom types
*/
function createDefaultCheqdRegistry(customTypes) {
if (!customTypes)
customTypes = [];
return new proto_signing_cjs_1.Registry([...stargate_cjs_1.defaultRegistryTypes, ...customTypes]);
}
/**
* Pre-configured Cheqd registry instance with default Stargate types.
* This is a ready-to-use registry for basic blockchain operations that don't require
* custom message types. For applications needing custom types, use createDefaultCheqdRegistry instead.
*/
exports.CheqdRegistry = new proto_signing_cjs_1.Registry(stargate_cjs_1.defaultRegistryTypes);
//# sourceMappingURL=registry.js.map