In the onchain validator I used Integer type for Datum and everything was fine but when I want to use mustPayToOtherScript tx constraint in the offchain code I get the following error:
• Couldn't match expected type ‘Datum’ with actual type ‘Integer’
• In the second argument of ‘mustPayToOtherScript’
Edit: offchain code
start :: AsContractError e => Promise () OwnerSchema e ()
start = endpoint @"start" $ \const -> do
pkh <- pubKeyHash <$> ownPubKey
let
tokenAAmount = 10000000000
tokenBAmount = 1000000000000
lt = 100000000000
value = (V.assetClassValue poolNFT 1) <>
(V.assetClassValue tokenA tokenAAmount) <>
(V.assetClassValue tokenB tokenBAmount)
tx = mustPayToTheScript (lt) value
ledgerTx <- submitTxConstraints poolInst' tx
void $ awaitTxConfirmed $ txId ledgerTx
void $ waitNSlots 1
logInfo @String $ printf "created pool UTXO %s at validator hash %s" (show poolParams) (show $ orderBoxVH')
return ()
mustPayToOtherScript
code you wrote?