In the CIP30 spec, we are supposed to be able to get a subset of the user’s UTXOs if we specify an “amount” when calling the method getUtxos()
:
api.getUtxos(amount: cbor\ = undefined, paginate: Paginate = undefined): Promise\
And this “amount” parameter, is supposed to allow a Value
type which further contains MultiAsset
types.
But calling this method like so:
let ScriptHash = csl.ScriptHash.from_bytes( Buffer.from(policyId, "hex") );
let Assets = csl.Assets.new();
Assets.insert(
csl.AssetName.new( Buffer.from(assetName, "hex") ),
csl.BigNum.from_str(amount)
);
let MultiAsset = csl.MultiAsset.new();
MultiAsset.insert(ScriptHash, Assets);
let reqdValue = csl.Value.new_from_assets(MultiAsset);
let inputUtxos = await wallet.activeApi.getUtxos(reqdValue); // CIP30 method call
… always gives me the following errors.
In CCVault/Eternl:
Error: invalid input: amount: TypeError: byteaString.startsWith is not a function
In Nami:
Inputs do not conform to this spec or are otherwise invalid.
In Flint:
An error occurred during execution of this API call.
What am I doing wrong here? What is the correct way of passing a Value
parameter to getUtxos()
?