Class WalletFactory
Factory for creating wallet info records from secrets (nsec or mnemonic), and watch-only wallets from an account descriptor.
public static class WalletFactory
- Inheritance
-
WalletFactory
- Inherited Members
Methods
CreateWallet(string, string?, ArkServerInfo, CancellationToken)
public static Task<ArkWalletInfo> CreateWallet(string walletSecret, string? destination, ArkServerInfo serverInfo, CancellationToken cancellationToken = default)
Parameters
walletSecretstringdestinationstringserverInfoArkServerInfocancellationTokenCancellationToken
Returns
CreateWatchOnlyWallet(string, string?, ArkServerInfo, IReadOnlyDictionary<string, string>?, CancellationToken)
Creates a watch-only wallet from an account descriptor. The wallet
can derive addresses and observe VTXOs but holds no signing material —
GetSignerAsync(string, CancellationToken) will return null
for it, and signing-dependent operations (batch participation,
unilateral exits) will throw with a descriptive error.
public static Task<ArkWalletInfo> CreateWatchOnlyWallet(string accountDescriptor, string? destination, ArkServerInfo serverInfo, IReadOnlyDictionary<string, string>? metadata = null, CancellationToken cancellationToken = default)
Parameters
accountDescriptorstringThe account descriptor to observe. May be a bare
tr(pubkey)for single-key style, or atr([fingerprint/path]xpub/0/*)for hierarchical-deterministic style; the wallet's address provider is picked accordingly.destinationstringOptional sweep destination address (must be addressed to the same Arkade server as
serverInfo).serverInfoArkServerInfoThe Arkade server the wallet is bound to.
metadataIReadOnlyDictionary<string, string>Optional initial metadata to attach to the wallet.
cancellationTokenCancellationTokenCancellation token.
Returns
GetAlternateWalletIdsFromNsec(string)
public static string[] GetAlternateWalletIdsFromNsec(string nsec)
Parameters
nsecstring
Returns
- string[]
GetOutputDescriptorFromNsec(string)
public static string GetOutputDescriptorFromNsec(string nsec)
Parameters
nsecstring
Returns
ValidateDestination(string, ArkServerInfo)
public static void ValidateDestination(string destination, ArkServerInfo serverInfo)
Parameters
destinationstringserverInfoArkServerInfo