You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Reaziii I'm not sure if this is an issue for cardano-serialization-lib. This library is client-side entirely and has no wallet information. It is used by quite a few wallets internally though. Are you talking about the CIP-30 for dApps (webpages) connecting to wallets? If so the API is here. As you can see there is no endpoint. It's possible some wallets will put it in the api.experimental, but that should not be depended on. From what I understand, it's a bit of a wallet-specific concept so a wallet might not necessarily have a single collateral address, and it might depend on what kind of transaction you'd trying to construct, how much it needs, etc. See cardano-foundation/CIPs/pull/104 which is an attempt to standardize it for light wallets. It looks like there are going to be some changes (collateral outputs) in Babbage so I don't expect there to be any standardization on a possible CIP-0030 endpoint before that and maybe make this no longer needed. I did notice that recently (8 days ago) however a api.getCollateral(amont: cbor<Coin>) -> TransactionUnspentOutput[] endpoint was added, which gives you a list of inputs which it would pick for a transaction that needs amount covered. Since it's so recent it might not be available on all wallets. If you're asking about how to decode that information using cardano-serialization-lib, then just use let inputs = TransactionUnspentOutputs.from_bytes(hexBytes) where hexBytes is the decoded hex string returned by that function. See the struct here to see what info that provides. i.e. inputs.get(index).output.address
How to get the collateral address of a connect wallet?
The text was updated successfully, but these errors were encountered: