Class XrplWallet
Inheritance
Namespace: Xrpl.Wallet
Assembly: Xrpl.dll
Syntax
public class XrplWallet : object
Constructors
| Improve this Doc View SourceXrplWallet(String, String, Nullable<String>, Nullable<String>)
Creates a new Wallet.
Declaration
public XrplWallet(string publicKey, string privateKey, string? masterAddress = null, string? seed = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | publicKey | The public key for the account. |
System.String | privateKey | The private key used for signing transactions for the account. |
System.Nullable<System.String> | masterAddress | Include if a Wallet uses a Regular Key Pair. It must be the master address of the account. |
System.Nullable<System.String> | seed | The seed used to derive the account keys. |
Fields
| Improve this Doc View SourceClassicAddress
Declaration
public readonly string ClassicAddress
Field Value
Type | Description |
---|---|
System.String |
DEFAULT_ALGORITHM
Declaration
public static string DEFAULT_ALGORITHM
Field Value
Type | Description |
---|---|
System.String |
PrivateKey
Declaration
public readonly string PrivateKey
Field Value
Type | Description |
---|---|
System.String |
PublicKey
Declaration
public readonly string PublicKey
Field Value
Type | Description |
---|---|
System.String |
Seed
Declaration
public readonly string Seed
Field Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceComputeSignature(Dictionary<String, Object>, String, Nullable<String>)
Declaration
public string ComputeSignature(Dictionary<string, dynamic> transaction, string privateKey, string? signAs = null)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<System.String, System.Object> | transaction | |
System.String | privateKey | |
System.Nullable<System.String> | signAs |
Returns
Type | Description |
---|---|
System.String |
FromEntropy(Byte[], Nullable<String>, Nullable<String>)
An array of random numbers to generate a seed used to derive a wallet.
Declaration
public static XrplWallet FromEntropy(byte[] entropy, string? masterAddress = null, string? algorithm = null)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | entropy | |
System.Nullable<System.String> | masterAddress | Include if a Wallet uses a Regular Key Pair. It must be the master address of the account. |
System.Nullable<System.String> | algorithm | The digital signature algorithm to generate an address for. |
Returns
Type | Description |
---|---|
XrplWallet | A Wallet derived from an entropy. |
FromSeed(String, Nullable<String>, Nullable<String>)
Derives a wallet from a seed.
Declaration
public static XrplWallet FromSeed(string seed, string? masterAddress = null, string? algorithm = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | seed | A string used to generate a keypair (publicKey/privateKey) to derive a wallet. |
System.Nullable<System.String> | masterAddress | Include if a Wallet uses a Regular Key Pair. It must be the master address of the account. |
System.Nullable<System.String> | algorithm | The digital signature algorithm to generate an address for. |
Returns
Type | Description |
---|---|
XrplWallet | A Wallet derived from a seed. |
Generate(String)
Generates a new Wallet using a generated seed.
Declaration
public static XrplWallet Generate(string algorithm = "ed25519")
Parameters
Type | Name | Description |
---|---|---|
System.String | algorithm | The digital signature algorithm to generate an address for. |
Returns
Type | Description |
---|---|
XrplWallet | A new Wallet derived from a generated seed. |
GetXAddress(Int32, Boolean)
Declaration
public string GetXAddress(int tag, bool isTestnet = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tag | |
System.Boolean | isTestnet |
Returns
Type | Description |
---|---|
System.String |
Sign(Dictionary<String, Object>, Boolean, Nullable<String>)
Signs a transaction offline.
Declaration
public SignatureResult Sign(Dictionary<string, dynamic> transaction, bool multisign = false, string? signingFor = null)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<System.String, System.Object> | transaction | A transaction to be signed offline. |
System.Boolean | multisign | Specify true/false to use multisign or actual address (classic/x-address) to make multisign tx request. |
System.Nullable<System.String> | signingFor |
Returns
Type | Description |
---|---|
SignatureResult | A Wallet derived from the seed. |
VerifyTransaction(String)
Verifies a signed transaction offline.
Declaration
public bool VerifyTransaction(string signedTransaction)
Parameters
Type | Name | Description |
---|---|---|
System.String | signedTransaction | A signed transaction (hex string of signTransaction result) to be verified offline. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if a signedTransaction is valid. |