Files
api/packages/api-derive/src/test/bytesFactory.ts
T
2024-01-08 15:07:13 +02:00

16 lines
415 B
TypeScript

// Copyright 2017-2024 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Bytes } from '@polkadot/types';
import type { Registry } from '@polkadot/types/types';
export class BytesFactory {
#registry: Registry;
constructor (registry: Registry) {
this.#registry = registry;
}
public bytes = (value: string): Bytes => this.#registry.createType('Bytes', value);
}