I am trying to attach 2 payments to transaction, but don’t understand how to do it, and couldn’t find any related info.
Here is my following questions:
Is it possible to attach 2 token, with calParams you can attach one, but what abt 2?
I can help with some of this, but will need some more details on what you’re trying to do to address all of your points.
You can only forward tokens of 1 asset ID with a call. However, you can use a sway script to atomically perform multiple contract calls in a single transaction.
I’m not quite sure what you mean by “access tokens” on a contract, but if you tell me a bit more detail I can help with that. If you mean how do you query a contract for its token balance, , it would be the get_contract_asset_balance method on the provider: Provider in fuels::signers::provider - Rust
Sorry, I only have this ts example of how we forward multiple assets. Here is the corresponding section in rust. I HAVEN’T COMPILED THIS RUST CODE but try something like this
As @furnic mentioned you can only forward 1 asset with a single call so you have use an sdk for a multicall or a sway script to call a contract function multiple times.