Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
93 stars 51 forks source link

Rework `getWalletCollateral` to support KeyWallet #510

Closed jy14898 closed 2 years ago

jy14898 commented 2 years ago

As part of #437, balanceTx handles adding wallet collateral in an ad-hoc fashion for each wallet. We could investigate modifying QueryM.getWalletCollateral to handle those cases by adding the parameters needed by KeyWallet's selectCollateral to it. Alternatively, we make getWalletCollateral clear that it's for CIP30 wallets.

Actually, I noticed in CIP30 that it specifies the getCollateral function should take an amount parameter, which would be useful for selectCollateral in KeyWallet too. However, it's hard to tell how one can calculate the required collateral before balancing

klntsky commented 2 years ago

I have two ideas:

ngua commented 2 years ago

Closed by #860