Open jusikXL opened 2 months ago
These are not related to the view
method, as you'd get the same errors using other methods.
(CreateOfferReceipt, MessagingFee)
, define a struct with fields create_offer_receipt
and messaging_fee
so that it's clear for the consumers of your API. You can also use unnamed (tuple) structs MyRetunType(CreateOfferReceipt, MessagingFee)
, but I wouldn't recommend it.Could you assist me with that example of wrapping a non-Anchor external type to include it in the IDL?
I don't understand where I should do it. The things happen at lib.rs
of the new-idl
...
Is it available for anchor 0.29.0 - we use that one?
It was somewhat supported in 0.29.0
but it was an experimental feature. Full support was added in https://github.com/coral-xyz/anchor/pull/2824 (v0.30) and the example I shared above is also for 0.30.0
.
Hello there. We are building Bakstag - Omnichain OTC Market protocol. We are using anchor lang as the main framework for developing Solana contracts.
Currently, we are experiencing the following issues: 1. The
.view()
method builder cannot decode the result if the function returns the external type (imported from the other library).Here is an example
If we are to use
.view()
as a read function, it throws the following error:If we are to add
MessagingFee
implicitly so that it appears in IDL, the problem will be gone.2. There is another issue: If we are to use
.view()
for the function which returns tuple type:it again throws with:
no matter that both types are defined implicitly