Class WalletAccount
- Namespace
- Concordium.Sdk.Wallets
- Assembly
- Concordium.Sdk.dll
Represents an account imported from one of the supported wallet export formats.
In particular it supports import of the browser and genesis wallet key export formats. The class implements ITransactionSigner so it may be used for signing transactions.
This structure does not have the encryption key for sending encrypted transfers, it only contains keys for signing transactions.
public class WalletAccount : ITransactionSigner
- Inheritance
-
WalletAccount
- Implements
- Inherited Members
Properties
AccountAddress
The address of the imported account.
public AccountAddress AccountAddress { get; init; }
Property Value
Methods
From(IWalletDataSource)
Try to create a new instance from a wallet data source.
public static WalletAccount From(IWalletDataSource walletDataSource)
Parameters
walletDataSource
IWalletDataSourceData source from which to import the wallet.
Returns
Exceptions
FromWalletKeyExportFormat(string)
Create a new instance from a string in the browser or genesis wallet key export format.
public static WalletAccount FromWalletKeyExportFormat(string json)
Parameters
json
stringJSON string in the browser or genesis wallet key export format.
Returns
Exceptions
- JsonException
The specified input is not valid JSON.
- WalletDataSourceException
Either a field is missing or an index or sign key could not be parsed.
GetSignatureCount()
Gets the number of signatures that will be produced when signing a transaction using this signer. This number is based on the signer count.
public byte GetSignatureCount()
Returns
GetSignerEntries()
Gets a dictionary mapping pairs of credential and key indices to their corresponding sign key implementations.
public ImmutableDictionary<AccountCredentialIndex, ImmutableDictionary<AccountKeyIndex, ISigner>> GetSignerEntries()
Returns
- ImmutableDictionary<AccountCredentialIndex, ImmutableDictionary<AccountKeyIndex, ISigner>>
A dictionary mapping pairs of credential and key indices to the sign key implementation.
Sign(byte[])
Sign a transaction hash.
public AccountTransactionSignature Sign(byte[] data)
Parameters
data
byte[]
Returns
- AccountTransactionSignature
A AccountTransactionSignature representing the transaction signature.
Exceptions
- ArgumentException
Unexpected length of a signature returned by the signing.