How to send Bucket or BucketRef through resim

You send Buckets (or BucketRefs) to method/functions with resim by using the following format: [amount],[token_resource_def].

For example, if your component have the following method:

pub fn show_amount(&self, tokens: BucketRef) {
    info!("{}", list.amount());
    list.drop();
}

To create a BucketRef of 1000 XRD and send it to this method, you would use resim like this:

resim call-method [component_address] show_amount 1000,030000000000000000000000000000000000000000000000000004 

When sending NFTs, you also have the possibility to specify which specific ids to send:

"#1,#3,[nft_resource_def]" # Create a bucket containing NFT #1 and #3

Don’t forget to use the quotation marks or you will get an error !

3 Likes