Skip to content

cardano-web3-js / CML / MultiAsset

Class: MultiAsset

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3802

Methods

checked_add()

checked_add(rhs): MultiAsset

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3823

Adds to multiassets together, checking value bounds. Does not modify self, and instead returns the result.

Parameters

rhs

MultiAsset

Returns

MultiAsset


checked_sub()

checked_sub(rhs): MultiAsset

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3832

Subtracts rhs from this multiasset. This does not modify self, and instead returns the result. If this would cause there to be fewer than 0 of a given asset an error will be returned. Use clamped_sub if you need to only try to remove assets when they exist and ignore them when they don't.

Parameters

rhs

MultiAsset

Returns

MultiAsset


clamped_sub()

clamped_sub(rhs): MultiAsset

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3838

Sybtracts rhs from this multiasset. If this would cause there to be 0 or fewer of a given asset it will simply be removed entirely from the result.

Parameters

rhs

MultiAsset

Returns

MultiAsset


free()

free(): void

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3804

Returns

void


get()

get(policy_id, asset): bigint

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3812

Get the value of policy_id:asset_name if it exists.

Parameters

policy_id

ScriptHash

asset

AssetName

Returns

bigint


get_assets()

get_assets(key): MapAssetNameToCoin

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3808

Parameters

key

ScriptHash

Returns

MapAssetNameToCoin


insert_assets()

insert_assets(policy_id, assets): MapAssetNameToCoin

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3807

Parameters

policy_id

ScriptHash

assets

MapAssetNameToCoin

Returns

MapAssetNameToCoin


keys()

keys(): PolicyIdList

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3818

Returns

PolicyIdList


policy_count()

policy_count(): number

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3806

Returns

number


set()

set(policy_id, asset, value): bigint

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3817

Set the value of policy_id:asset_name to value. Returns the previous value, or None if it didn't exist

Parameters

policy_id

ScriptHash

asset

AssetName

value

bigint

Returns

bigint


new()

static new(): MultiAsset

Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3805

Returns

MultiAsset

Released under the MIT License