Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/examples/aiken/haskell/aiken-example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ library
Wst.Cli
Wst.Cli.App
Wst.Cli.Command
Wst.Cli.Env

hs-source-dirs: lib
build-depends:
Expand All @@ -80,6 +79,7 @@ library
, convex-coin-selection
, convex-optics
, convex-wallet
, hset
, lens
, mtl
, optparse-applicative
Expand Down
14 changes: 7 additions & 7 deletions src/examples/aiken/haskell/lib/Wst/Cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import PlutusLedgerApi.V1 qualified as PV1
import ProgrammableTokens.OffChain.Endpoints qualified as Endpoints
import ProgrammableTokens.OffChain.Env qualified as Env
import ProgrammableTokens.OffChain.Env.Directory qualified as Directory
import ProgrammableTokens.OffChain.Env.Runtime qualified as Env
import ProgrammableTokens.OffChain.Error qualified as Error
import ProgrammableTokens.OffChain.Query qualified as Query
import ProgrammableTokens.OffChain.Scripts as Scripts
Expand All @@ -38,7 +39,6 @@ import Wst.Aiken.Error qualified as Error
import Wst.Cli.App (runWstApp)
import Wst.Cli.Command (Command (..), PolicyCommand (..), parseCommand)
import Wst.Cli.Command qualified as Command
import Wst.Cli.Env qualified as Env

runMain :: IO ()
runMain = do
Expand Down Expand Up @@ -126,8 +126,8 @@ runCommand com = do
Register operatorConfig submitTx -> do
logInfo "cip-143-cli policy register"
operator <- loadOperator operatorConfig
opEnv <- Env.loadConvexOperatorEnv operator
flip runReaderT (Env.combinedEnv dir opEnv transferPolicy) $ do
opEnv <- Env.loadConvexOperatorEnv @_ @C.ConwayEra operator
flip runReaderT (Env.addEnv dir $ Env.addEnv opEnv $ Env.singleton transferPolicy) $ do
tx <- Endpoints.registerCip143PolicyTransferScripts
polId <- Env.programmableTokenPolicyId
logInfo $ "Created policy stake script registration tx" :#
Expand All @@ -139,8 +139,8 @@ runCommand com = do
Issue operatorConfig assetName quantity redeemer submitTx -> do
logInfo "cip-143-cli policy issue"
operator <- loadOperator operatorConfig
opEnv <- Env.loadConvexOperatorEnv operator
flip runReaderT (Env.combinedEnv dir opEnv transferPolicy) $ do
opEnv <- Env.loadConvexOperatorEnv @_ @C.ConwayEra operator
flip runReaderT (Env.addEnv dir $ Env.addEnv opEnv $ Env.singleton transferPolicy) $ do
let red = PV1.toBuiltin redeemer
tx <- Endpoints.registerCip143PolicyTx assetName quantity red
polId <- Env.programmableTokenPolicyId
Expand All @@ -156,8 +156,8 @@ runCommand com = do
Transfer operatorConfig receiverAddr assetName quantity redeemer submitTx -> do
logInfo "cip-143-cli policy transfer"
operator <- loadOperator operatorConfig
opEnv <- Env.loadConvexOperatorEnv operator
flip runReaderT (Env.combinedEnv dir opEnv transferPolicy) $ do
opEnv <- Env.loadConvexOperatorEnv @_ @C.ConwayEra operator
flip runReaderT (Env.addEnv dir $ Env.addEnv opEnv $ Env.singleton transferPolicy) $ do
let red = PV1.toBuiltin redeemer
receiver <- getReceiverPaymentCredential receiverAddr
tx <- Endpoints.transferTokens assetName quantity receiver red
Expand Down
4 changes: 2 additions & 2 deletions src/examples/aiken/haskell/lib/Wst/Cli/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import Control.Monad.IO.Class (MonadIO (..))
import Control.Monad.Reader (MonadReader, ReaderT, runReaderT)
import Convex.Blockfrost (BlockfrostT (..), evalBlockfrostT)
import Convex.Class (MonadBlockchain, MonadUtxoQuery)
import ProgrammableTokens.OffChain.Env.Runtime (RuntimeEnv (..))
import ProgrammableTokens.OffChain.Env.Runtime qualified as Env
import Wst.Aiken.Error (AikenError (..))
import Wst.Cli.Env (RuntimeEnv (..))
import Wst.Cli.Env qualified as Env

newtype WstApp env era a = WstApp { unWstApp :: ReaderT env (ExceptT (AikenError era) (BlockfrostT IO)) a }
deriving newtype (Monad, Applicative, Functor, MonadIO, MonadReader env, MonadError (AikenError era), MonadUtxoQuery, MonadBlockchain C.ConwayEra)
Expand Down
4 changes: 2 additions & 2 deletions src/examples/aiken/haskell/test/Wst/Aiken/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ registerAikenPolicy :: forall era err m.
registerAikenPolicy step' = do
blueprint <- liftIO loadExample >>= flip Offchain.lookupScripts_ Offchain.blueprintKeys >>= Offchain.extractV3Scripts_
scriptRoot <- runReaderT (Test.deployDirectorySet Test.admin) Production
let runAsAdmin = Env.runAs Test.admin (Env.mkDirectoryEnv scriptRoot) (Offchain.transferLogic blueprint)
let runAsAdmin action = runReaderT (Env.runAs @_ @era Test.admin action) (Env.addEnv (Offchain.transferLogic blueprint) $ Env.singleton $ Env.mkDirectoryEnv scriptRoot)
step = liftIO . step'

step "Registering stake scripts"
Expand Down Expand Up @@ -120,7 +120,7 @@ transferAikenPolicy :: forall era err m.
transferAikenPolicy = do
blueprint <- liftIO loadExample >>= flip Offchain.lookupScripts_ Offchain.blueprintKeys >>= Offchain.extractV3Scripts_
scriptRoot <- runReaderT (Test.deployDirectorySet Test.admin) Production
let runAsAdmin = Env.runAs Test.admin (Env.mkDirectoryEnv scriptRoot) (Offchain.transferLogic blueprint)
let runAsAdmin action = runReaderT (Env.runAs @_ @era Test.admin action) (Env.addEnv (Offchain.transferLogic blueprint) $ Env.singleton $ Env.mkDirectoryEnv scriptRoot)

_ <- runAsAdmin
$ Endpoints.registerCip143PolicyTransferScripts
Expand Down
8 changes: 4 additions & 4 deletions src/examples/regulated-stablecoin/lib/Wst/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import Control.Monad.Reader (MonadReader, ReaderT, runReaderT)
import Convex.Blockfrost (BlockfrostT (..), evalBlockfrostT)
import Convex.Class (MonadBlockchain, MonadUtxoQuery)
import Data.String (IsString (..))
import ProgrammableTokens.OffChain.Env.Runtime (RuntimeEnv (..))
import ProgrammableTokens.OffChain.Env.Runtime qualified as Env
import Servant.Server (Handler (..))
import Servant.Server qualified as S
import Wst.AppError (AppError (..))
import Wst.Offchain.Env (RuntimeEnv (..))
import Wst.Offchain.Env qualified as Env

newtype WstApp env era a = WstApp { unWstApp :: ReaderT env (ExceptT (AppError era) (BlockfrostT IO)) a }
deriving newtype (Monad, Applicative, Functor, MonadIO, MonadReader env, MonadError (AppError era), MonadUtxoQuery, MonadBlockchain C.ConwayEra)
Expand All @@ -29,8 +29,8 @@ newtype WstApp env era a = WstApp { unWstApp :: ReaderT env (ExceptT (AppError e

runWstApp :: forall env era a. (Env.HasRuntimeEnv env) => env -> WstApp env era a -> IO (Either (AppError era) a)
runWstApp env WstApp{unWstApp} = do
let RuntimeEnv{envBlockfrost} = Env.runtimeEnv env
evalBlockfrostT envBlockfrost (runExceptT (runReaderT unWstApp env)) >>= \case
let RuntimeEnv{ceBlockfrost} = Env.runtimeEnv env
evalBlockfrostT ceBlockfrost (runExceptT (runReaderT unWstApp env)) >>= \case
Left e -> pure (Left $ BlockfrostErr e)
Right a -> pure a

Expand Down
9 changes: 5 additions & 4 deletions src/examples/regulated-stablecoin/lib/Wst/Cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ import Convex.Wallet.Operator (Operator (Operator, oPaymentKey),
PaymentExtendedKey (PESigningEx), signTxOperator,
verificationKey)
import Convex.Wallet.Operator qualified as Operator
import Data.Functor.Identity (Identity)
import Data.Maybe (fromMaybe)
import Data.Proxy (Proxy (..))
import Data.String (IsString (..))
import Options.Applicative (customExecParser, disambiguate, helper, idm, info,
prefs, showHelpOnEmpty, showHelpOnError)
import ProgrammableTokens.OffChain.Env.Operator qualified as Env
import ProgrammableTokens.OffChain.Env.Runtime qualified as Env
import ProgrammableTokens.OffChain.Env.Utils qualified as Utils
import SmartTokens.Core.Scripts (ScriptTarget (Production))
import Wst.App (runWstApp)
import Wst.AppError (AppError)
Expand All @@ -42,7 +43,7 @@ runMain = do

runCommand :: Command -> IO ()
runCommand com = do
env <- Env.addRuntimeEnv <$> Env.loadRuntimeEnv <*> pure Env.empty
env <- Env.addRuntimeEnv <$> Env.loadRuntimeEnv <*> pure Utils.empty
result <- case com of
Deploy config -> runWstApp env (deploy config)
Manage txIn issuanceCborHexTxIn com_ -> do
Expand Down Expand Up @@ -76,7 +77,7 @@ deploy config = do
opEnv <- Env.loadOperatorEnv @_ @C.ConwayEra operatorPaymentHash C.NoStakeAddress
runEnv <- asks Env.runtimeEnv

let env = Env.addOperatorEnv opEnv $ Env.addRuntimeEnv runEnv Env.empty
let env = Env.addOperatorEnv opEnv $ Utils.singleton runEnv

-- Use blockfrost backend to run Wst.Offchain.Endpoints.Deployment with the operator's funds
(tx, root) <- liftIO (runWstApp env $ do
Expand All @@ -95,7 +96,7 @@ deploy config = do
logInfo $ "Tx submitted successfully" :# ["txid" .= show txid]
(liftIO $ C.writeFileJSON "deployment-root.json" root) >>= either (error . show) pure

startServer :: (MonadIO m, MonadLogger m) => Env.CombinedEnv Proxy Identity Proxy Identity b w -> Server.ServerArgs -> m ()
startServer :: (Utils.Elem Env.RuntimeEnv els, Utils.Elem Env.DirectoryEnv els, Utils.HMonoModifiable els Env.RuntimeEnv, MonadIO m, MonadLogger m) => Utils.HSet els -> Server.ServerArgs -> m ()
startServer env' serverArgs@ServerArgs{saPort, saStaticFiles} = do
logInfo $ "starting server" :# ["port" .= saPort, "static_files" .= fromMaybe "(no static files)" saStaticFiles]
liftIO (Server.runServer env' serverArgs)
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data BlacklistedTransferPolicy
-}
balanceTxEnvFailing :: forall era env err m. (MonadBlockchain era m, MonadReader env m, HasOperatorEnv era env, MonadError err m, C.IsBabbageBasedEra era, CoinSelection.AsCoinSelectionError err, CoinSelection.AsBalancingError err era, AsRegulatedStablecoinError err) => BlacklistedTransferPolicy -> BuildTxT era m (FindProofResult era) -> m (C.BalancedTxBody era, BalanceChanges)
balanceTxEnvFailing policy btx = do
OperatorEnv{bteOperatorUtxos, bteOperator} <- asks operatorEnv
OperatorEnv{bteOperatorUtxos, bteOperator} <- asks (operatorEnv @era)
params <- queryProtocolParameters
(r, txBuilder) <- BuildTx.runBuildTxT $ btx <* BuildTx.setMinAdaDepositAll params
-- TODO: change returnOutputFor to consider the stake address reference
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
Expand All @@ -14,29 +13,21 @@ where
import Cardano.Api qualified as C
import Cardano.Api.Shelley qualified as C
import Control.Lens ((^.))
import Control.Monad (unless)
import Control.Monad.Reader (MonadReader, asks)
import Convex.BuildTx (MonadBuildTx, addReference, addWithdrawalWithTxBody,
buildScriptWitness, findIndexReference,
findIndexSpending, mintPlutus, prependTxOut,
spendPlutusInlineDatum)
findIndexSpending, prependTxOut, spendPlutusInlineDatum)
import Convex.CardanoApi.Lenses as L
import Convex.Class (MonadBlockchain (queryNetworkId))
import Convex.PlutusLedger.V1 (transPolicyId, transPubKeyHash, transScriptHash)
import Convex.PlutusLedger.V1 (transPolicyId)
import Convex.Utils qualified as Utils
import Data.Foldable (find, traverse_)
import Data.Foldable (find)
import Data.List (partition)
import Data.Maybe (fromJust)
import GHC.Exts (IsList (..))
import PlutusLedgerApi.V3 (CurrencySymbol (..))
import PlutusLedgerApi.V3 qualified as PV3
import ProgrammableTokens.OffChain.BuildTx.Directory (insertDirectoryNode)
import ProgrammableTokens.OffChain.Env (TransferLogicEnv (..))
import ProgrammableTokens.OffChain.Env qualified as Env
import SmartTokens.Contracts.Issuance (SmartTokenMintingAction (..))
import SmartTokens.Contracts.IssuanceCborHex (IssuanceCborHex (..))
import SmartTokens.Contracts.ProgrammableLogicBase (ProgrammableLogicGlobalRedeemer (..),
TokenProof (..))
import SmartTokens.Contracts.ProgrammableLogicBase (ProgrammableLogicGlobalRedeemer (..))
import SmartTokens.Types.ProtocolParams
import SmartTokens.Types.PTokenDirectory (DirectorySetNode (..))
import Wst.Offchain.Query (UTxODat (..))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ initBlacklist = Utils.inBabbage @era $ do
prependTxOut txout

-- add operator signature
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv)
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv @era)
addRequiredSignature opPkh

{-| Reason for adding an address to the blacklist
Expand Down Expand Up @@ -162,12 +162,12 @@ insertBlacklistNode reason cred blacklistNodes = Utils.inBabbage @era $ do
addBlacklistReason reason

-- add operator signature
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv)
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv @era)
addRequiredSignature opPkh

removeBlacklistNode :: forall era env err m. (MonadReader env m, Env.HasOperatorEnv era env, Env.HasBlacklistEnv env, C.IsBabbageBasedEra era, C.HasScriptLanguageInEra C.PlutusScriptV3 era, MonadBuildTx era m, MonadError err m, AsRegulatedStablecoinError err) => C.PaymentCredential -> [UTxODat era BlacklistNode]-> m ()
removeBlacklistNode cred blacklistNodes = Utils.inBabbage @era $ do
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv)
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv @era)
blacklistSpendingScript <- asks (Env.bleSpendingScript . Env.blacklistEnv)
blacklistMintingScript <- asks (Env.bleMintingScript . Env.blacklistEnv)
blacklistPolicyId <- asks (Env.blacklistNodePolicyId . Env.blacklistEnv)
Expand Down Expand Up @@ -217,7 +217,7 @@ issueSmartTokens paramsTxOut issuanceCborHexTxOut (an, q) directoryNode destinat
transferSmartTokens :: forall env era err a m. (MonadReader env m, Env.HasTransferLogicEnv env, Env.HasDirectoryEnv env, C.IsBabbageBasedEra era, MonadBlockchain era m, C.HasScriptLanguageInEra C.PlutusScriptV3 era, MonadBuildTx era m, Env.HasOperatorEnv era env, MonadError err m) => UTxODat era ProgrammableLogicGlobalParams -> [UTxODat era BlacklistNode] -> UTxODat era DirectorySetNode -> [UTxODat era a] -> (C.AssetId, C.Quantity) -> C.PaymentCredential -> m (FindProofResult era)
transferSmartTokens paramsTxIn blacklistNodes directoryNode spendingUserOutputs (assetId, q) destinationCred = Utils.inBabbage @era $ do
nid <- queryNetworkId
userCred <- Env.operatorPaymentCredential
userCred <- Env.operatorPaymentCredential @env @era
progLogicBaseCred <- asks (Env.programmableLogicBaseCredential . Env.directoryEnv)

-- Find sufficient inputs to cover the transfer
Expand Down Expand Up @@ -299,7 +299,7 @@ seizeSmartTokens reason paramsTxIn seizingTxo destinationCred directoryList = Ut

addIssueWitness :: forall era env m. (MonadReader env m, Env.HasOperatorEnv era env, Env.HasTransferLogicEnv env, C.IsBabbageBasedEra era, MonadBlockchain era m, C.HasScriptLanguageInEra C.PlutusScriptV3 era, MonadBuildTx era m) => m ()
addIssueWitness = Utils.inBabbage @era $ do
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv)
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv @era)
mintingScript <- asks (Env.tleMintingScript . Env.transferLogicEnv)
let sh = C.hashScript $ C.PlutusScript C.PlutusScriptV3 mintingScript
addRequiredSignature opPkh
Expand Down Expand Up @@ -351,7 +351,7 @@ Uses the user from 'HasOperatorEnv env'. Fails if the user is blacklisted.
-}
addTransferWitness :: forall env era err m. (MonadError err m, MonadReader env m, Env.HasOperatorEnv era env, Env.HasTransferLogicEnv env, C.IsBabbageBasedEra era, MonadBlockchain era m, C.HasScriptLanguageInEra C.PlutusScriptV3 era, MonadBuildTx era m) => [UTxODat era BlacklistNode] -> m (FindProofResult era)
addTransferWitness blacklistNodes = Utils.inBabbage @era $ do
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv) -- In this case 'operator' is the user
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv @era) -- In this case 'operator' is the user
nid <- queryNetworkId
transferScript <- asks (Env.tleTransferScript . Env.transferLogicEnv)

Expand Down Expand Up @@ -392,7 +392,7 @@ addReferencesWithTxBody f =

addSeizeWitness :: forall env era m. (MonadReader env m, Env.HasOperatorEnv era env, Env.HasTransferLogicEnv env, C.IsBabbageBasedEra era, MonadBlockchain era m, C.HasScriptLanguageInEra C.PlutusScriptV3 era, MonadBuildTx era m) => m ()
addSeizeWitness = Utils.inBabbage @era $ do
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv)
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv @era)
seizeScript <- asks (Env.tleIssuerScript . Env.transferLogicEnv)
let sh = C.hashScript $ C.PlutusScript C.PlutusScriptV3 seizeScript
addRequiredSignature opPkh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ import Wst.Offchain.Query qualified as Query
the relevant stablecoin transfer logic scripts and registrations. Returns the
transaction and the 'TxIn' that was selected for the one-shot NFTs.
-}
deployFullTx :: (MonadReader env m, C.IsConwayBasedEra era, Env.HasOperatorEnv era env, MonadBlockchain era m, MonadError err m, C.HasScriptLanguageInEra C.PlutusScriptV3 era, AsProgrammableTokensError err, AsCoinSelectionError err, AsBalancingError err era) => ScriptTarget -> m (C.Tx era, DirectoryScriptRoot)
deployFullTx :: forall env era err m. (MonadReader env m, C.IsConwayBasedEra era, Env.HasOperatorEnv era env, MonadBlockchain era m, MonadError err m, C.HasScriptLanguageInEra C.PlutusScriptV3 era, AsProgrammableTokensError err, AsCoinSelectionError err, AsBalancingError err era) => ScriptTarget -> m (C.Tx era, DirectoryScriptRoot)
deployFullTx target = do
((txi, _), (issuanceCborHexTxIn, _)) <- Env.selectTwoOperatorOutputs
opEnv <- asks Env.operatorEnv
((txi, _), (issuanceCborHexTxIn, _)) <- Env.selectTwoOperatorOutputs @env @_ @era
opEnv <- asks (Env.operatorEnv @era)
let root = DirectoryScriptRoot txi issuanceCborHexTxIn target
(tx, _) <- Env.withEnv $ Env.withOperator opEnv $ Env.withDirectoryFor root $ Env.withTransferFromOperator
(tx, _) <- Env.withEnv $ Env.withOperator opEnv $ Env.withDirectoryFor root $ Env.withTransferFromOperator @era
$ Env.balanceDeployTxEnv_
$ BuildTx.mintProtocolParams
>> BuildTx.initDirectorySet
Expand Down Expand Up @@ -85,11 +85,11 @@ issueSmartTokensTx assetName quantity destinationCred = do
BuildTx.issueSmartTokens paramsNode cborHexTxIn (assetName, quantity) directory destinationCred
pure (Convex.CoinSelection.signBalancedTxBody [] tx, aid)

deployBlacklistTx :: (MonadReader env m, Env.HasOperatorEnv era env, MonadBlockchain era m, MonadError err m, C.IsBabbageBasedEra era, C.HasScriptLanguageInEra C.PlutusScriptV3 era, Env.HasDirectoryEnv env, AsCoinSelectionError err, AsBalancingError err era) => m (C.Tx era)
deployBlacklistTx :: forall env era err m. (MonadReader env m, Env.HasOperatorEnv era env, MonadBlockchain era m, MonadError err m, C.IsBabbageBasedEra era, C.HasScriptLanguageInEra C.PlutusScriptV3 era, Env.HasDirectoryEnv env, AsCoinSelectionError err, AsBalancingError err era) => m (C.Tx era)
deployBlacklistTx = do
opEnv <- asks Env.operatorEnv
opEnv <- asks (Env.operatorEnv @era)
dirEnv <- asks Env.directoryEnv
(tx, _) <- Env.withEnv $ Env.withOperator opEnv $ Env.withDirectory dirEnv $ Env.withTransferFromOperator
(tx, _) <- Env.withEnv $ Env.withOperator opEnv $ Env.withDirectory dirEnv $ Env.withTransferFromOperator @era
$ Env.balanceTxEnv_ BuildTx.initBlacklist
pure (Convex.CoinSelection.signBalancedTxBody [] tx)

Expand Down Expand Up @@ -132,7 +132,7 @@ transferSmartTokensTx :: forall era env err m.
transferSmartTokensTx policy assetId quantity destCred = do
directory <- Query.registryNodeForReference @era
blacklist <- Query.blacklistNodes @era
userOutputsAtProgrammable <- Env.operatorPaymentCredential >>= Query.userProgrammableOutputs
userOutputsAtProgrammable <- Env.operatorPaymentCredential @_ @era >>= Query.userProgrammableOutputs
paramsTxIn <- Query.globalParamsNode @era
(tx, _) <- balanceTxEnvFailing policy $ do
BuildTx.transferSmartTokens paramsTxIn blacklist directory userOutputsAtProgrammable (assetId, quantity) destCred
Expand All @@ -158,7 +158,7 @@ seizeCredentialAssetsTx :: forall era env err m.
-> C.PaymentCredential -- ^ Source/User credential
-> m (C.Tx era)
seizeCredentialAssetsTx reason sanctionedCred = do
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv)
opPkh <- asks (fst . Env.bteOperator . Env.operatorEnv @era)
directory <- Query.registryNodes @era
let getTxOutValue (C.TxOut _a v _d _r) = v
-- simple fold to choose the UTxO with the most total assets
Expand Down
Loading
Loading