API Documentation
ArkEcosystem.Crypto.Configuration.Fee
get()
def self.get(type)
Get a fee for a given transaction type
Parameters
Type | Name | Required | Description |
---|---|---|---|
ArkEcosystem::Crypto::Enums::Fees | type | Yes | Transaction type for which we wish to get a fee |
Return Value
?
set()
def self.set(type, fee)
Set a fee
Parameters
Type | Name | Required | Description |
---|---|---|---|
ArkEcosystem::Crypto::Enums::Fees | type | Yes | Transaction type for which we wish to get a fee |
Integer | fee | Yes | Fee for a given transaction type |
Return Value
?
ArkEcosystem.Crypto.Configuration.Network
get()
def self.get
Get settings for a selected network, default network is mainnet.
Return Value
?
set()
def self.set(network)
Set settings for a selected network, default network is mainnet.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | type | Yes | Transaction type for which we wish to get a fee |
Return Value
?
ArkEcosystem.Crypto.Identities.Address
from_public_key()
def self.from_public_key(public_key, network = nil)
Derive the address from the given public key.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | public_key | Yes | Public key |
string | network | No | Version of the network |
Return Value
string
from_private_key()
def self.from_private_key(private_key, network = nil)
Derive the address from the given private key.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | private_key | Yes | Private key |
string | network | No | Version of the network |
Return Value
?
from_passphrase()
def self.from_passphrase(passphrase, network = nil)
Derive the address from the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
string | network | No | Version of the network |
Return Value
string
validate()
def self.validate(address)
Validate the given address.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | address | Yes | Address |
Return Value
bool
ArkEcosystem.Crypto.Identities.PrivateKey
from_passphrase()
def self.from_passphrase(passphrase)
Derive the private key for the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
Return Value
?
from_hex()
def self.from_hex(private_key)
Create a private key instance from a hex string.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | private_key | Yes | Private key |
Return Value
?
ArkEcosystem.Crypto.Identities.PublicKey
from_passphrase()
def self.from_passphrase(passphrase)
Derive the public from the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
Return Value
?
from_hex()
def self.from_hex(public_key)
Create a public key instance from a hex string.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | public_key | Yes | Public key |
Return Value
?
ArkEcosystem.Crypto.Identities.WIF
from_passphrase()
def self.from_passphrase(passphrase, network = nil)
Derive the WIF from the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
string | network | No | Network wif |
Return Value
?
ArkEcosystem.Crypto.Networks.Devnet
epoch()
def self.epoch
Get the epoch time of the Network.
Return Value
String
version()
def self.version
Get the version of the Network.
Return Value
Integer
wif()
def self.wif
Get the WIF of the Network.
Return Value
Integer
ArkEcosystem.Crypto.Networks.Mainnet
epoch()
def self.epoch
Get the epoch time of the Network.
Return Value
String
version()
def self.version
Get the version of the Network.
Return Value
Integer
wif()
def self.wif
Get the WIF of the Network.
Return Value
Integer
ArkEcosystem.Crypto.Networks.Testnet
epoch()
def self.epoch
Get the epoch time of the Network.
Return Value
String
version()
def self.version
Get the version of the Network.
Return Value
Integer
wif()
def self.wif
Get the WIF of the Network.
Return Value
Integer
ArkEcosystem.Crypto.Transactions.Builder.Base
sign()
def sign(passphrase)
Sign the transaction using the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | passphrase |
Return Value
?
sign_and_create_id()
def sign_and_create_id(passphrase)
Sign the transaction using the given passphrase and generate a valid id for it.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | passphrase |
Return Value
?
second_sign()
def second_sign(second_passphrase)
Sign the transaction using the given second passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | passphrase |
Return Value
?
verify()
def verify
Verify the transaction with a public key.
Return Value
?
second_verify()
def second_verify(second_public_key)
Verify the transaction with a second public key.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | second_public_key | Yes | Second public key |
Return Value
?
to_params()
def to_params
Convert the transaction to its params representation.
Return Value
?
to_json()
def to_json
Convert the transaction to its JSON representation.
Return Value
?
ArkEcosystem.Crypto.Transactions.Builder.DelegateRegistration
def set_username()
def set_username(username)
Set the username to assign.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | username | Yes | Delegate username |
Return Value
?
def sign()
def sign(passphrase)
Sign the transaction using the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | passphrase |
Return Value
?
def type()
def type
Get the type of the transaction.
Return Value
ArkEcosystem::Crypto::Enums::Types::DELEGATE_REGISTRATION
ArkEcosystem.Crypto.Transactions.Builder.MultiSignatureRegistration
def set_keysgroup()
def set_keysgroup(keysgroup)
Set the keysgroup of signatures.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | keysgroup | Yes | Transaction keysgroup |
Return Value
?
def set_lifetime()
def set_lifetime(lifetime)
Set the transaction lifetime.
Parameters
Type | Name | Required | Description |
---|---|---|---|
Integer | lifetime | Yes | Transaction lifetime |
Return Value
?
def set_min()
def set_min(min)
Set the transaction minimum required signatures.
Parameters
Type | Name | Required | Description |
---|---|---|---|
Integer | min | Yes | Minimum required signatures |
Return Value
?
def type()
def type
Get the type of the transaction.
Return Value
ArkEcosystem::Crypto::Enums::Types::MULTI_SIGNATURE_REGISTRATION
ArkEcosystem.Crypto.Transactions.Builder.SecondSignatureRegistration
def set_second_passphrase()
def set_second_passphrase(second_passphrase)
Set the second passphrase for the transaction.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | second_passphrase | Yes | Second passphrase |
Return Value
?
def type()
def type
Get the type of the transaction.
Return Value
ArkEcosystem::Crypto::Enums::Types::SECOND_SIGNATURE_REGISTRATION
ArkEcosystem.Crypto.Transactions.Builder.Transfer
def set_recipient_id()
def set_recipient_id(recipient_id)
Set the recipient id of the transaction.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | recipient_id | Yes | Recipient identifier |
Return Value
?
def set_amount()
def set_amount(amount)
Set the amount of the transaction.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | amount | Yes | Transaction amount |
Return Value
?
def set_vendor_field()
def set_vendor_field(vendor_field)
Set the vendorfield of the transaction.
Parameters
Type | Name | Required | Description |
---|---|---|---|
String | vendor_field | Yes | Transaction vendorfield |
Return Value
?
def type()
def type
Get the type of the transaction.
Return Value
ArkEcosystem::Crypto::Enums::Types::TRANSFER
ArkEcosystem.Crypto.Transactions.Builder.Vote
def set_votes()
def set_votes(votes)
Set the votes to cast.
Parameters
Type | Name | Required | Description |
---|---|---|---|
Array | votes | Yes | Votes |
Return Value
?
def sign()
def sign(passphrase)
Sign the transaction using the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | passphrase | Yes | Passphrase |
Return Value
?
def type()
def type
Get the type of the transaction.
Return Value
ArkEcosystem::Crypto::Enums::Types::VOTE
ArkEcosystem.Crypto.Transactions.Deserializers.Base
initialize()
def initialize(serialized, binary, asset_offset, transaction)
The base deserializer for transactions.
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | serialized | Yes | Serialized |
? | binary | Yes | … |
? | asset_offset | Yes | Offset |
? | transaction | Yes | Transaction |
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.DelegateRegistration
deserialize()
def deserialize
Handle the deserialization of “delegate registration” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.DelegateResignation
deserialize()
def deserialize
Handle the deserialization of “delegate resignation” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.IPFS
deserialize()
def deserialize
Handle the deserialization of “ipfs” data
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.MultiPayment
deserialize()
def deserialize
Handle the deserialization of “multi payment” data
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.MultiSignatureRegistration
deserialize()
def deserialize
Handle the deserialization of “multi signature registration” data
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.SecondSignatureRegistration
deserialize()
def deserialize
Handle the deserialization of “second signature” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.TimelockTransfer
deserialize()
def deserialize
Handle the deserialization of “timelock transfer” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.Transfer
deserialize()
def deserialize
Handle the deserialization of “transfer” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Deserializers.Vote
deserialize()
def deserialize
Handle the deserialization of “vote” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.Base
initialize()
def initialize(transaction, bytes)
The base serializer for transactions
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | transaction | Yes | Transaction |
? | bytes | Yes | … |
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.DelegateRegistration
serialize()
def serialize
Handle the serialization of “delegate registration” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.DelegateResignation
serialize()
def serialize
Handle the serialization of “delegate resignation” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.IPFS
serialize()
def serialize
Handle the serialization of “IPFS” data.
Return Value
void
ArkEcosystem.Crypto.Transactions.Serializers.MultiPayment
serialize()
def serialize
Handle the serialization of “multi payment” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.MultiSignatureRegistration
serialize()
def serialize
Handle the serialization of “multi signature registration” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.SecondSignatureRegistration
serialize()
def serialize
Handle the serialization of “second signature registration” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.TimelockTransfer
serialize()
def serialize
Handle the serialization of “timelock transfer” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.Transfer
serialize()
def serialize
Handle the serialization of “transfer” data.
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializers.Vote
serialize()
def serialize
Handle the serialization of “vote” data.
Return Value
void
ArkEcosystem.Crypto.Transactions.Deserializer
initialize()
def initialize(serialized)
The base deserializer for transactions
Parameters
Type | Name | Required | Description |
---|---|---|---|
Map | serialized | Yes | Serialized |
Return Value
?
deserialize()
def deserialize
Perform AIP11 compliant deserialization.
Return Value
?
handle_type()
def handle_type(asset_offset, transaction)
Handle the deserialization of “type” data
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | asset_offset | Yes | Offset |
? | transaction | Yes | Transaction |
Return Value
?
handle_version_one()
def handle_version_one(transaction)
Handle the deserialization of transaction data with a version of 1.0.
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | transaction | Yes | Transaction |
Return Value
?
ArkEcosystem.Crypto.Transactions.Serializer
initialize()
def initialize(transaction)
The base serializer for transactions.
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | transaction | Yes | Transaction |
Return Value
?
serialize()
def serialize
Perform AIP11 compliant serialization.
Return Value
?
handle_type()
def handle_type(bytes)
Handle the serialization of “type” data
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | bytes | Yes | … |
Return Value
?
handle_signatures()
def handle_signatures(bytes)
Handle the serialization of “signatures” data
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | bytes | Yes | … |
Return Value
?
ArkEcosystem.Crypto.Transactions.Transaction
get_id()
def get_id
Convert the byte representation to a unique identifier.
Return Value
String
sign()
def sign(passphrase)
Sign the transaction using the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
String | passphrase | Yes | Passphrase |
Return Value
?
second_sign()
def second_sign(second_passphrase)
Sign the transaction using the given second passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | second_passphrase | Yes | Second passphrase |
Return Value
?
verify()
def verify
Verify the transaction.
Return Value
?
second_verify()
def second_verify(second_public_key)
Verify the transaction with a second public key.
Parameters
Type | Name | Required | Description |
---|---|---|---|
String | second_public_key | Yes | Second public key |
Return Value
?
to_bytes()
def to_bytes(skip_signature = true, skip_second_signature = true)
Convert the transaction to its byte representation.
Parameters
Type | Name | Required | Description |
---|---|---|---|
string | skip_signature | No | Skip first signature |
string | skip_second_signature | No | Skip second signature |
Return Value
?
parse_signatures()
def parse_signatures(serialized, start_offset)
Parse the signature, second signature, and multi signatures.
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | serialized | Yes | Serialized |
? | start_offset | Yes | Offset |
Return Value
?
to_params()
def to_params
Convert the transaction to its params representation.
Return Value
?
to_json()
def to_json
Convert the transaction to its JSON representation.
Return Value
?
serialize()
def serialize(transaction)
Perform AIP11 compliant serialization
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | transaction | Yes | Transaction |
Return Value
?
deserialize()
def serialize(transaction)
Perform AIP11 compliant deserialization.
Parameters
Type | Name | Required | Description |
---|---|---|---|
? | transaction | Yes | Transaction |
Return Value
?
ArkEcosystem.Crypto.Utils.Message
initialize()
def initialize(message)
The builder to work with signed messages.
Parameters
Type | Name | Required | Description |
---|---|---|---|
String | message | Yes | Message |
Return Value
?
sign()
def self.sign(message, passphrase)
Sign a message using the given passphrase.
Parameters
Type | Name | Required | Description |
---|---|---|---|
String | message | Yes | Message |
String | passphrase | Yes | Passphrase |
Return Value
?
verify()
def verify
Verify the message contents
Return Value
?
to_params()
def to_params
Convert the message to its params representation
Return Value
?
to_json()
def to_json
Convert the message to its JSON representation
Return Value
?
ArkEcosystem.Crypto.Utils.Slot
get_time()
def get_time
Get the time diff between now and network start.
Return Value
?
get_epoch()
def get_epoch
Get the network start epoch.
Return Value
?