-
Notifications
You must be signed in to change notification settings - Fork 1
Mnemonic
Used for deriving BIP39 Phrases
public class Mnemonic
Equatable
public init(strength: Int = 256, wordlist: [String] = Wordlists.english)
public init(wordcount: Int = 12, wordlist: [String] = Wordlists.english)
public init(phrase: [String], passphrase: String = "") throws
public init(entropy: [UInt8], wordlist: [String] = Wordlists.english, passphrase: String = "") throws
Contains the seed phrases themselves
public let phrase: [String]
Used for deriving the seed when generating the private and public keys
public var seed: Data?
Converts an array of bytes to a list of mnemonic words using a specified wordlist.
public static func toMnemonic(_ bytes: [UInt8], wordlist: [String] = Wordlists.english) throws -> [String]
- bytes: An array of bytes to be converted to a mnemonic phrase.
- wordlist: An optional parameter specifying the wordlist to be used. If not provided, the default English wordlist will be used.
Any error thrown by Mnemonic.deriveChecksumBits() function if there is an issue calculating the checksum bits.
A list of mnemonic words representing the input bytes.
Converts a list of mnemonic words to an array of bytes.
public static func toEntropy(_ phrase: [String], wordlist: [String] = Wordlists.english) throws -> [UInt8]
- phrase: A list of mnemonic words to be converted to an array of bytes.
- wordlist: An optional parameter specifying the wordlist to be used. If not provided, the default English wordlist will be used.
An Error.invalidMnemonic error if the checksum of the input mnemonic phrase does not match the expected checksum.
An array of bytes representing the input mnemonic phrase.
Checks if a given mnemonic phrase is valid based on a specified wordlist.
public static func isValid(phrase: [String], wordlist: [String] = Wordlists.english) -> Bool
- phrase: A list of mnemonic words to be validated.
- wordlist: An optional parameter specifying the wordlist to be used for validation. If not provided, the default English wordlist will be used.
A boolean value indicating whether the input mnemonic phrase is valid according to the specified wordlist.
Calculates the checksum bits for a given array of bytes.
public static func deriveChecksumBits(_ bytes: [UInt8]) -> String
- bytes: An array of bytes for which to calculate the checksum bits.
A string representing the checksum bits.
public static func == (lhs: Mnemonic, rhs: Mnemonic) -> Bool
Generated at 2023-07-20T02:24:43+0000 using swift-doc 1.0.0-rc.1.
Types
- Account
- AccountAddress
- AccountAddressTag
- AccountResponse
- AnyTransactionArgument
- AptosError
- AptosRestClientError
- BoolTag
- ClientConfig
- Collection
- Ed25519Authenticator
- Ed25519BIP32
- EntryFunction
- HTTPMethod
- InfoResponse
- InvalidPropertyType
- Mnemonic
- Mnemonic.Error
- ModuleBundle
- ModuleId
- MultiAgentAuthenticator
- MultiAgentRawTransaction
- MultiEd25519Authenticator
- MultiPublicKey
- MultiSignature
- Object
- PrivateKey
- Property
- PropertyMap
- PublicKey
- RawTransaction
- RotatingProofChallenge
- Royalty
- Script
- ScriptArgument
- SeedMode
- Serializer
- Signature
- SignedTransaction
- StructTag
- StructTagValue
- Token
- TransactionArgument
- U128Tag
- U16Tag
- U256Tag
- U32Tag
- U64Tag
- U8Tag
- UInt128
- UInt128Errors
- Wallet
- Wordlists
Protocols
Global Variables
Global Functions
- _struct(_:)
- account(_:ledgerVersion:)
- accountBalance(_:_:)
- accountResource(_:_:_:)
- accountResources(_:_:)
- accountSequenceNumber(_:_:)
- addTokenProperty(_:_:_:)
- aggregatorValue(_:_:_:)
- asyncData(with:method:headers:body:)
- bcsTransfer(_:_:_:)
- bool()
- burnToken(_:_:)
- claimToken(_:_:_:_:_:_:)
- createBcsSignedTransaction(_:_:)
- createBcsSignedTransaction(_:_:_:)
- createBcsTransaction(_:_:)
- createBcsTransaction(_:_:_:)
- createCollection(_:_:_:_:)
- createCollection(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)
- createCollectionPayload(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:)
- createMultiAgentBcsTransaction(_:_:_:)
- createToken(_:_:_:_:_:_:_:)
- decodeData(_:with:keyDecodingStrategy:dataDecodingStrategy:dateDecodingStrategy:)
- decodeUrl(_:with:)
- decodeUrl(with:_:)
- decodeUrl(with:_:_:)
- deserialize(from:)
- directTransferToken(_:_:_:_:_:_:_:)
- fixedBytes(length:)
- freezeToken(_:_:)
- fundAccount(_:_:)
- getCollection(_:_:)
- getTableItem(_:_:_:_:_:_:)
- getToken(_:_:_:_:_:)
- getTokenBalance(_:_:_:_:_:)
- getTokenData(_:_:_:_:)
- info()
- map(keyDecoder:valueDecoder:)
- mintSoulBoundToken(_:_:_:_:_:_:_:)
- mintToken(_:_:_:_:_:_:)
- mintTokenPayload(_:_:_:_:_:)
- offerToken(_:_:_:_:_:_:_:)
- publishPackage(_:_:_:)
- readObject(address:)
- remaining()
- removeTokenProperty(_:_:_:)
- sequence(valueDecoder:)
- serialize(_:)
- simulateTransaction(_:_:)
- string(_:)
- submitBcsTransaction(_:)
- submitTransaction(_:_:)
- toBytes(_:)
- transactionPending(_:)
- transfer(_:_:_:)
- u128(_:)
- u16(_:)
- u256(_:)
- u32(_:)
- u64(_:)
- u8(_:)
- uleb128()
- unfreezeToken(_:_:)
- updateTokenProperty(_:_:_:)
- verify(_:)
- waitForTransaction(_:)