Skip to content
MarcoDotIO edited this page Apr 25, 2023 · 1 revision

Wallet

Represents an Aptos wallet.

public class Wallet: Hashable 

Inheritance

Hashable

Initializers

init(wordCount:wordList:passphrase:seedMode:)

public init(wordCount: Int, wordList: [String], passphrase: String = "", seedMode: SeedMode = .Ed25519Bip32) throws 

init(mnemonic:passphrase:seedMode:)

public init(mnemonic: Mnemonic, passphrase: String = "", seedMode: SeedMode = .Ed25519Bip32) throws 

init(phrase:passphrase:seedMode:)

public init(phrase: [String], passphrase: String = "", seedMode: SeedMode = .Ed25519Bip32) throws 

init(seed:passphrase:seedMode:)

public init(seed: Data, passphrase: String = "", seedMode: SeedMode = .Ed25519Bip32) throws 

Properties

mnemonic

The mnemonic words.

public var mnemonic: Mnemonic

account

The key pair.

public var account: Account

Methods

hash(into:)

public func hash(into hasher: inout Hasher) 

getAccount(index:)

Get an Aptos Blockchain account at the specified index from an Ed25519 BIP-32-based seed.

public func getAccount(index: Int) throws -> Account 

This function gets an Aptos Blockchain account at the specified index from an Ed25519 BIP-32-based seed, and returns the resulting Account instance.

Parameters

  • index: An integer value representing the index of the account to retrieve from the Ed25519 BIP-32-based seed.
  • Returns: An Account instance representing the account at the specified index.
  • Throws: An error of type AptosError indicating that the seed mode is incompatible with Ed25519 BIP-32-based seeds or that an AccountAddress or PrivateKey instance cannot be created from the retrieved public key or private key bytes, respectively.

deriveMnemonicSeed()

Derives the Mnemonic seed from the Mnemonic object.

public func deriveMnemonicSeed() -> Data 

Returns

Data representing the seed itself

Operators

==

public static func == (lhs: Wallet, rhs: Wallet) -> Bool 
Types
Protocols
Global Variables
Global Functions
Extensions
Clone this wiki locally