Module

x/jucid/mod.ts>C.MultiAsset

jucid is JSHy's fork of Lucid (jshy + lucid = jucid)
Latest
class C.MultiAsset
import { C } from "https://dotland.deno.dev/x/jucid@1.0.0-alpha.1/mod.ts";
const { MultiAsset } = C;

Methods

get(policy_id)

all assets under {policy_id}, if any exist, or else None (undefined in JS)

get_asset(policy_id, asset_name)

returns the amount of asset {asset_name} under policy {policy_id} If such an asset does not exist, 0 is returned.

insert(policy_id, assets)

set (and replace if it exists) all assets with policy {policy_id} to a copy of {assets}

returns all policy IDs used by assets in this multiasset

len()

the number of unique policy IDs in the multiasset

set_asset(
policy_id,
asset_name,
value,
)

sets the asset {asset_name} to {value} under policy {policy_id} returns the previous amount if it was set, or else None (undefined in JS)

sub(rhs_ma)

removes an asset from the list if the result is 0 or less does not modify this object, instead the result is returned