Skip to content

Commit b317be5

Browse files
authored
Merge pull request #678 from IntersectMBO/add-mnemonic-support
Add mnemonic support
2 parents bbe1cb5 + bc7c5f0 commit b317be5

File tree

5 files changed

+520
-3
lines changed

5 files changed

+520
-3
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repository cardano-haskell-packages
1313
-- See CONTRIBUTING for information about these, including some Nix commands
1414
-- you need to run if you change them
1515
index-state:
16-
, hackage.haskell.org 2025-03-03T01:12:46Z
16+
, hackage.haskell.org 2025-03-17T12:01:29Z
1717
, cardano-haskell-packages 2025-03-03T04:46:42Z
1818

1919
packages:

cardano-api/cardano-api.cabal

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ library
110110
base16-bytestring >=1.0,
111111
base58-bytestring,
112112
base64-bytestring,
113+
basement,
113114
bech32 >=1.1.0,
114115
bytestring,
116+
bytestring-trie,
117+
cardano-addresses ^>=4.0.0,
115118
cardano-binary,
116119
cardano-crypto,
117120
cardano-crypto-class ^>=2.1.2,
@@ -139,6 +142,7 @@ library
139142
directory,
140143
either,
141144
errors,
145+
extra,
142146
filepath,
143147
formatting,
144148
groups,
@@ -161,7 +165,7 @@ library
161165
ouroboros-network-framework,
162166
ouroboros-network-protocols,
163167
parsec,
164-
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.37,
168+
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.40,
165169
prettyprinter,
166170
prettyprinter-ansi-terminal,
167171
prettyprinter-configurable ^>=1.36,
@@ -222,6 +226,7 @@ library
222226
Cardano.Api.Internal.Json
223227
Cardano.Api.Internal.Keys.Byron
224228
Cardano.Api.Internal.Keys.Class
229+
Cardano.Api.Internal.Keys.Mnemonics
225230
Cardano.Api.Internal.Keys.Praos
226231
Cardano.Api.Internal.Keys.Read
227232
Cardano.Api.Internal.Keys.Shelley
@@ -404,7 +409,7 @@ test-suite cardano-api-golden
404409
hedgehog-extras ^>=0.7,
405410
microlens,
406411
parsec,
407-
plutus-core ^>=1.37,
412+
plutus-core ^>=1.40,
408413
plutus-ledger-api,
409414
tasty,
410415
tasty-hedgehog,

cardano-api/src/Cardano/Api.hs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,22 @@ module Cardano.Api
179179
, castHash
180180
, renderSafeHashAsHex
181181

182+
-- * Mnemonics
183+
184+
-- | Functions for working with mnemonics
185+
-- ** Mnemonics generation
186+
, MnemonicSize (..)
187+
, generateMnemonic
188+
189+
-- ** Key derivation from mnemonics
190+
, MnemonicToSigningKeyError (..)
191+
, signingKeyFromMnemonic
192+
, signingKeyFromMnemonicWithPaymentKeyIndex
193+
194+
-- ** Mnemonic word queries
195+
, findMnemonicWordsWithPrefix
196+
, autocompleteMnemonicPrefix
197+
182198
-- * Payment addresses
183199

184200
-- | Constructing and inspecting normal payment addresses
@@ -1124,6 +1140,7 @@ import Cardano.Api.Internal.IPC.Monad
11241140
import Cardano.Api.Internal.InMode
11251141
import Cardano.Api.Internal.Keys.Byron
11261142
import Cardano.Api.Internal.Keys.Class
1143+
import Cardano.Api.Internal.Keys.Mnemonics
11271144
import Cardano.Api.Internal.Keys.Read
11281145
import Cardano.Api.Internal.Keys.Shelley
11291146
import Cardano.Api.Internal.LedgerState

0 commit comments

Comments
 (0)