Skip to content

Add mnemonic support #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025
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 cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository cardano-haskell-packages
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state:
, hackage.haskell.org 2025-03-03T01:12:46Z
, hackage.haskell.org 2025-03-17T12:01:29Z
, cardano-haskell-packages 2025-03-03T04:46:42Z

packages:
Expand Down
9 changes: 7 additions & 2 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ library
base16-bytestring >=1.0,
base58-bytestring,
base64-bytestring,
basement,
bech32 >=1.1.0,
bytestring,
bytestring-trie,
cardano-addresses ^>=4.0.0,
cardano-binary,
cardano-crypto,
cardano-crypto-class ^>=2.1.2,
Expand Down Expand Up @@ -139,6 +142,7 @@ library
directory,
either,
errors,
extra,
filepath,
formatting,
groups,
Expand All @@ -160,7 +164,7 @@ library
ouroboros-network-framework,
ouroboros-network-protocols,
parsec,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.37,
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.40,
prettyprinter,
prettyprinter-ansi-terminal,
prettyprinter-configurable ^>=1.36,
Expand Down Expand Up @@ -221,6 +225,7 @@ library
Cardano.Api.Internal.Json
Cardano.Api.Internal.Keys.Byron
Cardano.Api.Internal.Keys.Class
Cardano.Api.Internal.Keys.Mnemonics
Cardano.Api.Internal.Keys.Praos
Cardano.Api.Internal.Keys.Read
Cardano.Api.Internal.Keys.Shelley
Expand Down Expand Up @@ -403,7 +408,7 @@ test-suite cardano-api-golden
hedgehog-extras ^>=0.7,
microlens,
parsec,
plutus-core ^>=1.37,
plutus-core ^>=1.40,
plutus-ledger-api,
tasty,
tasty-hedgehog,
Expand Down
17 changes: 17 additions & 0 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,22 @@ module Cardano.Api
, castHash
, renderSafeHashAsHex

-- * Mnemonics

-- | Functions for working with mnemonics
-- ** Mnemonics generation
, MnemonicSize (..)
, generateMnemonic

-- ** Key derivation from mnemonics
, MnemonicToSigningKeyError (..)
, signingKeyFromMnemonic
, signingKeyFromMnemonicWithPaymentKeyIndex

-- ** Mnemonic word queries
, findMnemonicWordsWithPrefix
, autocompleteMnemonicPrefix

-- * Payment addresses

-- | Constructing and inspecting normal payment addresses
Expand Down Expand Up @@ -1119,6 +1135,7 @@ import Cardano.Api.Internal.IPC.Monad
import Cardano.Api.Internal.InMode
import Cardano.Api.Internal.Keys.Byron
import Cardano.Api.Internal.Keys.Class
import Cardano.Api.Internal.Keys.Mnemonics
import Cardano.Api.Internal.Keys.Read
import Cardano.Api.Internal.Keys.Shelley
import Cardano.Api.Internal.LedgerState
Expand Down
Loading
Loading