BSV.Tokens.Scheme (bsv_sdk v1.1.0)

Copy Markdown View Source

Token scheme defining the properties of a token.

Summary

Functions

Deserialize a token scheme from a JSON string.

Serialize the token scheme to a JSON string.

Types

t()

@type t() :: %BSV.Tokens.Scheme{
  authority: BSV.Tokens.Authority.t(),
  confiscation: boolean(),
  freeze: boolean(),
  is_divisible: boolean(),
  name: String.t(),
  satoshis_per_token: non_neg_integer(),
  symbol: String.t(),
  token_id: BSV.Tokens.TokenId.t()
}

Functions

from_json(json)

@spec from_json(binary()) :: {:ok, t()} | {:error, term()}

Deserialize a token scheme from a JSON string.

to_json(scheme)

@spec to_json(t()) :: {:ok, binary()} | {:error, term()}

Serialize the token scheme to a JSON string.