id | title |
---|---|
api-documentation |
API Documentation |
{% hint style="danger" %} WARNING! This package is deprecated and is no longer maintained and supported. {% endhint %}
public static UInt64 Get(int type)
Get a fee for a given transaction type
Type | Name | Required | Description |
---|---|---|---|
int | type | Yes | Transaction type for which we wish to get a fee |
UInt64
public static void Set(int type, UInt64 value)
Set a fee
Type | Name | Required | Description |
---|---|---|---|
int | type | Yes | Transaction type for which we wish to get a fee |
UInt64 | value | Yes | Fee for a given transaction type |
void
public static void Set(INetwork network)
Set what network you want to use in the crypto library
Type | Name | Required | Description |
---|---|---|---|
INetwork | network | Yes | Testnet, Devnet, Mainnet |
void
public static INetwork Get()
Get settings for a selected network, default network is devnet
INetwork
public static string FromPassphrase(string passphrase, byte publicKeyHash = 0)
Get an address from a passphrase.
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
byte | publicKeyHash | No | Public key hash |
string
public static string FromPublicKey(PubKey publicKey, byte publicKeyHash = 0)
Get an address from a public key.
Type | Name | Required | Description |
---|---|---|---|
PubKey | publicKey | Yes | Public key |
byte | publicKeyHash | No | Public key hash |
string
public static string FromPrivateKey(Key privateKey, byte publicKeyHash = 0)
Get an address from a private key.
Type | Name | Required | Description |
---|---|---|---|
Key | privateKey | Yes | Private key |
byte | publicKeyHash | No | Public key hash |
string
public static bool Validate(string address, byte publicKeyHash = 0)
Validate a given address
Type | Name | Required | Description |
---|---|---|---|
String | address | Yes | Address to validate |
byte | publicKeyHash | No | Public key hash |
bool
public static Key FromPassphrase(string passphrase)
Create PrivateKey object from a given passphrase.
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
Key
public static Key FromHex(string privateKey)
Create PrivateKey object from a hex string.
Type | Name | Required | Description |
---|---|---|---|
string | privateKey | Yes | Private key |
Key
public static PubKey FromPassphrase(string passphrase)
Create PublicKey object from a given passphrase.
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
PubKey
public static PubKey FromHex(string publicKey)
Create PublicKey object from a given public key.
Type | Name | Required | Description |
---|---|---|---|
string | publicKey | Yes | Public key |
PubKey
public static string FromPassphrase(string passphrase)
Get wif from passphrase
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
string
public DateTime GetEpoch()
Return the epoch date for devnet.
DateTime
public byte GetVersion()
Return the version for devnet.
byte
public byte GetWIF()
Return the WIF for devnet.
byte
public DateTime GetEpoch()
Return the epoch date for main net.
DateTime
public byte GetVersion()
Return the version for main net.
byte
public byte GetWIF()
Return the WIF for main net.
byte
public DateTime GetEpoch()
Return the epoch date for testnet.
DateTime
public byte GetVersion()
Return the version for testnet.
byte
public byte GetWIF()
Return the WIF for testnet.
byte
public static Transaction Sign(Transaction transaction, string passphrase, string secondPassphrase = null)
Builds a transaction for a transfer.
Type | Name | Required | Description |
---|---|---|---|
Transaction | transaction | Yes | Transaction |
string | passphrase | Yes | Passphrase associated with the account sending this transaction |
string | secondPassphrase | No | Second passphrase associated with the account sending this transaction |
Transaction
public static Transaction Create(string username, string passphrase, string secondPassphrase = null)
Builds a transaction for a delegate registration.
Type | Name | Required | Description |
---|---|---|---|
string | username | Yes | Username to be associated with the delegate |
string | passphrase | Yes | Passphrase associated with the account sending this transaction |
string | secondPassphrase | No | Second passphrase associated with the account sending this transaction |
Transaction
public static Transaction Create(int min, int lifetime, List<string> keysgroup, string passphrase, string secondPassphrase)
Builds a transaction for a multi signature registration.
Type | Name | Required | Description |
---|---|---|---|
int | min | Yes | Transaction minimum required signatures |
int | lifetime | Yes | Transaction lifetime |
List | keysgroup | Yes | Transaction keysgroup |
string | passphrase | Yes | Passphrase associated with the account sending this transaction |
string | secondPassphrase | No | Second passphrase associated with the account sending this transaction |
Transaction
public static Transaction Create(string passphrase, string secondPassphrase)
Builds a transaction for a second signature registration.
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase associated with the account sending this transaction |
string | secondPassphrase | No | Second passphrase associated with the account sending this transaction |
Transaction
public static Transaction Create(string recipientId, ulong amount, string vendorField, string passphrase, string secondPassphrase = null)
Builds a transaction for a transfer.
Type | Name | Required | Description |
---|---|---|---|
string | recipientId | Yes | Recipient identifier |
ulong | amount | Yes | Transaction amount |
string | vendorField | Yes | Transaction vendorfield |
string | passphrase | Yes | Passphrase associated with the account sending this transaction |
string | secondPassphrase | No | Second passphrase associated with the account sending this transaction |
Transaction
public static Transaction Create(List<string> votes, string passphrase, string secondPassphrase = null)
Builds a transaction for a vote.
Type | Name | Required | Description |
---|---|---|---|
List | votes | Yes | Votes |
string | passphrase | Yes | Passphrase associated with the account sending this transaction |
string | secondPassphrase | No | Second passphrase associated with the account sending this transaction |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "delegate registration" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "delegate resignation" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "IPFS" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "multi payments" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "multi signature registration" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "second signature registration" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "timelock transfer" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "transfer" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static Transaction Deserialize(
BinaryReader reader,
MemoryStream stream,
Transaction transaction,
string serialized,
int assetOffset
)
Handle the deserialization of "vote" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
MemoryStream | stream | Yes | Stream |
Transaction | transaction | No | Transaction |
string | serialized | No | Serialized |
int | assetOffset | No | Offset |
Transaction
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "delegate registration" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "delegate resignation" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "IPFS" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "multi payments" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "multi signature registration" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "second signature registration" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "timelock transfer" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "transfer" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public static void Serialize(BinaryWriter writer, Transaction transaction)
Handle the serialization of "vote" data.
Type | Name | Required | Description |
---|---|---|---|
BinaryReader | reader | Yes | Reader |
Transaction | transaction | No | Transaction |
void
public Deserializer(string serialized)
Class constructor.
Type | Name | Required | Description |
---|---|---|---|
string | serialized | Yes | Serialized |
Deserializer
public Transaction Deserialize()
Perform AIP11 compliant deserialization.
Transaction
public Transaction HandleHeader(Transaction transaction)
Handle the deserialization of "headers" data.
Type | Name | Required | Description |
---|---|---|---|
Transaction | transaction | Yes | Transaction |
Transaction
Transaction HandleType(Transaction transaction)
Handle the deserialization of "type" data
Type | Name | Required | Description |
---|---|---|---|
Transaction | transaction | Yes | Transaction |
Transaction
Transaction HandleVersionOne(Transaction transaction)
Handle the deserialization of transaction data with a version of 1.0.
Type | Name | Required | Description |
---|---|---|---|
Transaction | transaction | Yes | Transaction |
Transaction
public Serializer(Transaction transaction)
Class constructor.
Type | Name | Required | Description |
---|---|---|---|
Transaction | transaction | Yes | Transaction |
Serializer
public byte[] Serialize()
Perform AIP11 compliant serialization.
byte[]
public void HandleHeader()
Handle the serialization of "headers" data.
void
public string GetId()
Convert the byte representation to a unique identifier.
string
public string Sign(string passphrase)
Sign the transaction using the given passphrase.
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
string
public string SecondSign(string passphrase)
Sign the transaction using the given second passphrase.
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
string
public bool Verify()
Verify the transaction.
bool
public bool SecondVerify(string secondPublicKey)
Verify the transaction with a second public key.
Type | Name | Required | Description |
---|---|---|---|
String | secondPublicKey | Yes | Second public key |
bool
public Transaction ParseSignatures(string serialized, int startOffset)
Parse the signature, second signature and multi signatures.
Type | Name | Required | Description |
---|---|---|---|
string | serialized | Yes | Serialized |
int | startOffset | Yes | Offset |
Transaction
public byte[] ToBytes(bool skipSignature = true, bool skipSecondSignature = true)
Convert the transaction to its byte representation.
Type | Name | Required | Description |
---|---|---|---|
bool | skipSignature | No | Skip first signature |
bool | skipSecondSignature | No | Skip second signature |
byte[]
public byte[] Serialize()
Perform AIP11 compliant serialization.
byte[]
public static Transaction Deserialize(string serialized)
Perform AIP11 compliant deserialization.
Type | Name | Required | Description |
---|---|---|---|
string | serialized | Yes | Serialized |
Transaction
public Dictionary<string, dynamic> ToDictionary()
Convert the transaction to its dict representation.
Dictionary<string, dynamic>
public string ToJson()
Convert the transaction to its JSON representation.
string
public Message(string publicKey, string signature, string message)
Create a new message instance.
Type | Name | Required | Description |
---|---|---|---|
string | publicKey | Yes | Public Key |
string | signature | Yes | Signature |
string | message | Yes | Lessage |
Message
public static Message Sign(string message, string passphrase)
Sign a message using the given passphrase.
Type | Name | Required | Description |
---|---|---|---|
string | message | Yes | Message |
string | passphrase | Yes | Passphrase |
Message
public bool Verify()
Verify the message contents.
bool
public Dictionary<string, string> ToDictionary()
Convert the message to its dict representation.
Dictionary<string, string>
public string ToJson()
Convert the message to its JSON representation.
string
public static uint GetTime()
Get the time diff between now and network start.
uint
public static DateTime GetEpoch()
Get the network start epoch.
DateTime