Skip to main content

@iroha/core@0.3.1
Built and signed on GitHub Actions

Core components of Iroha JavaScript SDK.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 weeks ago (0.3.1)
class GenCodec

Generic codec.

Unlike RawScaleCodec, provides higher-level encode/decode functions, as well as some composition utilities.

Constructors

new
GenCodec(raw: RawScaleCodec<T>)

Type Parameters

Properties

readonly
raw: RawScaleCodec<T>

Access lower-level SCALE codec

Methods

decode(data: string | ArrayBufferView): T
wrap<U>(unnamed 0: { toBase: (value: U) => T; fromBase: (value: T) => U; }): GenCodec<U>

Static Methods

lazy<T>(f: () => GenCodec<T>): GenCodec<T>

Create a lazy codec, by only having a getter to the actual codec.

The getter is called for each codec access and is not cached.

Add Package

deno add jsr:@iroha/core

Import symbol

import { GenCodec } from "@iroha/core/codec";

---- OR ----

Import directly with a jsr specifier

import { GenCodec } from "jsr:@iroha/core/codec";

Add Package

npx jsr add @iroha/core

Import symbol

import { GenCodec } from "@iroha/core/codec";

Add Package

yarn dlx jsr add @iroha/core

Import symbol

import { GenCodec } from "@iroha/core/codec";

Add Package

pnpm dlx jsr add @iroha/core

Import symbol

import { GenCodec } from "@iroha/core/codec";

Add Package

bunx jsr add @iroha/core

Import symbol

import { GenCodec } from "@iroha/core/codec";