Files
pezkuwi-api/packages/bizinikiwi-bindings/dist/esm/codecs/scale/Self.mjs
T
Kurdistan Tech Ministry 31467f90d4 feat: add PAPI rebrand packages
- @pezkuwi/papi-utils (rebrand of @polkadot-api/utils)
- @pezkuwi/bizinikiwi-bindings (rebrand of @polkadot-api/substrate-bindings)
- @pezkuwi/metadata-builders (rebrand of @polkadot-api/metadata-builders)
- @pezkuwi/merkleize-metadata (rebrand of @polkadot-api/merkleize-metadata)

All @polkadot-api references replaced with @pezkuwi equivalents.
2026-01-22 15:40:12 +03:00

27 lines
579 B
JavaScript

import { createCodec } from 'scale-ts';
const selfEncoder = (value) => {
let cache = (x) => {
const encoder = value();
cache = encoder;
return encoder(x);
};
return (x) => cache(x);
};
const selfDecoder = (value) => {
let cache = (x) => {
const decoder = value();
const result = decoder;
cache = decoder;
return result(x);
};
return (x) => cache(x);
};
const Self = (value) => createCodec(
selfEncoder(() => value().enc),
selfDecoder(() => value().dec)
);
export { Self, selfDecoder, selfEncoder };
//# sourceMappingURL=Self.mjs.map