@polkadot/types
Version:
Implementation of the Parity codec
20 lines (19 loc) • 657 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.unwrapStorageType = exports.unwrapStorageSi = void 0;
const index_js_1 = require("../metadata/util/index.js");
/** @internal */
function unwrapStorageSi(type) {
return type.isPlain
? type.asPlain
: type.asMap.value;
}
exports.unwrapStorageSi = unwrapStorageSi;
/** @internal */
function unwrapStorageType(registry, type, isOptional) {
const outputType = (0, index_js_1.getSiName)(registry.lookup, unwrapStorageSi(type));
return isOptional
? `Option<${outputType}>`
: outputType;
}
exports.unwrapStorageType = unwrapStorageType;