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
asset
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
Returns
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
assets
Returns
keys()
keys():
PolicyIdList
Defined in: node_modules/cardano-wasm-libs/src/libs/cardano-multiplatform-lib/nodejs/cardano_multiplatform_lib.d.ts:3818
Returns
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
asset
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