Skip to content

Commit c177ea0

Browse files
author
gege251
committed
Update docs
1 parent e037bc2 commit c177ea0

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ data MyContracts
3939
2. Define a HasDefinitions instance for the endpoints
4040

4141
```haskell
42+
import BotPlutusInterface.Types (HasDefinitions (..), SomeBuiltin (..), endpointsToSchemas)
43+
import Playground.Types (FunctionSchema)
44+
import Schema (FormSchema)
45+
4246
instance HasDefinitions MyContracts where
4347
getDefinitions :: [MyContract]
4448
getDefinitions = []
@@ -61,6 +65,13 @@ instance HasDefinitions MyContracts where
6165
3. Write your main entrypoint for the application, with the preferred configurations
6266

6367
```haskell
68+
import BotPlutusInterface.Types (CLILocation (Local), LogLevel (Debug), PABConfig (..))
69+
import Cardano.Api (NetworkId (Testnet), NetworkMagic (..))
70+
import Data.Aeson qualified as JSON
71+
import Data.ByteString.Lazy qualified as LazyByteString
72+
import Data.Default (def)
73+
import Servant.Client.Core (BaseUrl (BaseUrl), Scheme (Http))
74+
6475
main :: IO ()
6576
main = do
6677
protocolParams <- JSON.decode <$> LazyByteString.readFile "protocol.json"
@@ -72,6 +83,8 @@ main = do
7283
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
7384
, pcPort = 9080
7485
, pcProtocolParams = protocolParams
86+
, -- | Slot configuration of the network, the default value can be used for the mainnet
87+
pcSlotConfig = def
7588
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
7689
, -- Directory name of the script and data files
7790
pcScriptFileDir = "./scripts"

examples/plutus-transfer/app/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import Cardano.PlutusExample.Transfer (
2121
import Data.Aeson qualified as JSON
2222
import Data.Aeson.TH (defaultOptions, deriveJSON)
2323
import Data.ByteString.Lazy qualified as LazyByteString
24+
import Data.Default (def)
2425
import Data.Maybe (fromMaybe)
2526
import Playground.Types (FunctionSchema)
2627
import Schema (FormSchema)
27-
import Data.Default (def)
2828
import Servant.Client.Core (BaseUrl (BaseUrl), Scheme (Http))
2929
import Prelude
3030

src/BotPlutusInterface/Types.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ data PABConfig = PABConfig
4444
, pcChainIndexUrl :: !BaseUrl
4545
, pcNetwork :: !NetworkId
4646
, pcProtocolParams :: !ProtocolParameters
47-
, pcSlotConfig :: !SlotConfig
47+
, -- | Slot configuration of the network, the default value can be used for the mainnet
48+
pcSlotConfig :: !SlotConfig
4849
, -- | Directory name of the script and data files
4950
pcScriptFileDir :: !Text
5051
, -- | Directory name of the signing key files
@@ -56,7 +57,7 @@ data PABConfig = PABConfig
5657
, -- | Dry run mode will build the tx, but skip the submit step
5758
pcDryRun :: !Bool
5859
, pcLogLevel :: !LogLevel
59-
, pcOwnPubKeyHash :: PubKeyHash
60+
, pcOwnPubKeyHash :: !PubKeyHash
6061
, pcPort :: !Port
6162
}
6263
deriving stock (Show, Eq)

0 commit comments

Comments
 (0)