Closed jy14898 closed 2 years ago
I have two ideas:
CollateralizedKeyWallet
, with a smart constructor consisting of sending a collateral Tx. But the problem is that the wallet must be provided before Contract
is interpreted, but sending a Tx is a Contract
action. FAILKeyWallet
s to PlutipM
monad interpreter. It can just request one extra UTXO from plutip-server on initialization and provide a pre-funded KeyWallet
with collateral already set.Closed by #860
As part of #437,
balanceTx
handles adding wallet collateral in an ad-hoc fashion for each wallet. We could investigate modifyingQueryM.getWalletCollateral
to handle those cases by adding the parameters needed byKeyWallet
'sselectCollateral
to it. Alternatively, we makegetWalletCollateral
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 forselectCollateral
inKeyWallet
too. However, it's hard to tell how one can calculate the required collateral before balancing