RGB assets are allocated to colorable UTXOs. One UTXO can support more than one allocation, depending on the value of max_allocations_per_utxo (in WalletData) provided at wallet instantiation time.
It would be useful to be able to query how many available allocations slots the wallet has. An example use case would be to know if new colorable UTXOs need to be created, in advance rather in response to an error when e.g. calling blind_receive.
- name:
allocations
- parameters: none
- response: a new
Allocations struct containing
total_available: the number of total available allocations
map: a map of UTXOs and the respective allocations (given the current value of max_allocations_per_utxo)
- key:
utxo
- value:
used: the number of currently used allocations
available: the number of currently available allocations
With this data, the user can easily know:
- if there is at least one available allocation
- the total number of possible new allocations, before having to create more UTXOs
- the number of UTXOs that can support a new allocation
Notes:
- the number of used allocations can be obtained via
get_rgb_allocations
- the number of available allocations corresponds to the value of
max_allocations_per_utxo minus the currently used allocations
RGB assets are allocated to colorable UTXOs. One UTXO can support more than one allocation, depending on the value of
max_allocations_per_utxo(inWalletData) provided at wallet instantiation time.It would be useful to be able to query how many available allocations slots the wallet has. An example use case would be to know if new colorable UTXOs need to be created, in advance rather in response to an error when e.g. calling
blind_receive.allocationsAllocationsstruct containingtotal_available: the number of total available allocationsmap: a map of UTXOs and the respective allocations (given the current value ofmax_allocations_per_utxo)utxoused: the number of currently used allocationsavailable: the number of currently available allocationsWith this data, the user can easily know:
Notes:
get_rgb_allocationsmax_allocations_per_utxominus the currently used allocations