massa library
Classes
- Account
- Account class holds keypair, balance, address and address types
- ActiveCursor
- ActiveCursor class
- Address
- Address class
- AddressKeyEntry
- AddressKeyEntry
- AddressKeysEntries
- AddressKeys holds a list of addresses - keys
- Args
- Args class handles serialisation and deserialisation
- AsyncMessage
- Asynchronous smart contract message
- AsyncMessageTrigger
- Structure defining a trigger for an asynchronous message
- AsyncMessageUpdate
- Asynchronous smart contract message
- AsyncPoolChangeEntry
- AsyncPoolChange Entry
- AsyncPoolChangeType
- AsyncPoolChangeType type enum
- AsyncPoolChangeValue
- AsyncPoolChangeValue
- BaseSendOperation
- Abstract base class for send operation
- Block
- Massa block class
- BlockContent
- Block content class
- BlockHeader
- Block header class
- BuyRolls
- Buy roll class extends send operation base class
- BytecodeExecution
- / Execute a bytecode
- CallSC
- Call smart contract class extends send operation base class
- Client
- HTTP client
- Cliques
- Cliques class
- Config
- Config class
- ConsensusStats
- Consensus stats class
- Content
- Content class
- CycleInfos
- Cycle Infos class
- DatastoreEntry
- DatastoreEntry
- EndorsemenContent
- Endorsement content class
- Endorsement
- Endorsement class
- ExecutedOpsChangeEntry
- ExecutedOpsChangeEntry
- ExecutedOpsChangeValue
- ExecutedOpsChangeValue
- ExecutionOutput
- ExecutionOutput
- ExecutionOutputStatus
- ExecutionOutputStatus type enum
- ExecutionStackElement
-
Structure describing an element of the execution stack.
Every time a function is called from bytecode,
a new
ExecutionStackElement
is pushed at the top of the execution stack to represent the local execution context of the called function, instead of the caller's which should lie just below in the stack. - ExecutionStats
- ExecutionStats class
- FinalizedExecutionOutput
- FinalizedExecutionOutput
- FunctionCall
- Execute a function call
- GraphInterval
- Graph interval class
- GRPCPrivateClient
- GRPCPublicClient
- GRPCPublicClient is class for defining the public GRPC client.
- Header
- Header class
- JsonrpcPublicApi
- KeyPair
- KeyPair is the type of Ed25519 public/private key pair.
- LedgerChangeEntry
- LedgerChangeEntry
- LedgerChangeType
- LedgerChangeType type enum
- LedgerChangeValue
- LedgerChangeValue
- LedgerEntry
-
An entry associated to an address in the
FinalLedger
- LedgerEntryUpdate
-
Represents an update to one or more fields of a
LedgerEntry
- MassaUnits
- NetworkStats
- Network stat class
- NextEndorsementDraws
- Next endosement draws class
- Operation
- Operation model is for managing types of various types of operations
- OperationContent
- Operation contents
- OperationData
- OperationData
- OperationExecutionStatus
- OperationExecutionStatus type enum
- PrivateKey
- PrivateKey is the type of Ed25519 private key.
- PublicKey
- PublicKey is the type of Ed25519 public key.
- ReadOnlyExecutionCall
- Read-only execution call
- ReadOnlyExecutionOutput
- Structure describing the output of a read only execution
- RequestMethod
- HTTP massa supported api methods
- ScExecutionEvent
- ScExecutionEvent
- ScExecutionEventContext
- ScExecutionEvent context
- ScExecutionEventsStatus
- ScExecutionEventsStatus
- ScExecutionEventStatus
- ScExecutionEventStatus type enum
- SellRolls
- Sell roll class extends send operation base class
- SendResponse
- SendTransaction
- Send transaction class extends send operation base class
- SetOrDeleteDatastoreEntry
- Set or Delete DatastoreEntry
- SetOrKeepAsyncMessageTrigger
- Set or Keep AsyncMessageTrigger
- SetOrKeepBalance
- Set or Keep Balance
- SetOrKeepBool
- Set or Keep Bool
- SetOrKeepBytes
- Set or Keep Bytes
- SetOrKeepSlot
- Set or Keep Slot
- SetOrKeepString
- Set or Keep String
- SetOrKeepUint64
- Set or Keep Uint64
- Slot
- Slot class
- SlotExecutionOutput
- SlotExecutionOutput
- Staker
- Staker class
- Stakers
- Stakers class
- StateChanges
- StateChanges
- Status
- Status class
- Varint
- Variable interger class
- Wallet
Enums
- AddressType
- Address type - which are either user address or smart contract address User address starts with AU and Smart contract address starts with AS
- ArrayTypes
- AsyncPoolChangeValue_Message
- CommonAddresses
- DefaultProvider
- GasLimit
- LedgerChangeValue_Entry
- NetworkType
- OperationType
- Operation types
- ReadOnlyExecutionCall_Target
- SetOrDeleteDatastoreEntry_Change
- SetOrKeepAsyncMessageTrigger_Change
- SetOrKeepBalance_Change
- SetOrKeepBool_Change
- SetOrKeepBytes_Change
- SetOrKeepSlot_Change
- SetOrKeepString_Change
- SetOrKeepUint64_Change
- StorageCost
Constants
- addressPrefix → const String
- decimalFactor → const double
- decimalScale → const int
- keyPairVersion → const int
- maxRetryAttempts → const int
- minimumFee → const double
- minimumFee sets the minimum transaction fee which is 0.01 MAS
- publicPrefix → const String
- secretPrefix → const String
- smartContractAddressPrefix → const String
- userAddressPrefix → const String
Properties
Functions
-
address(
PublicKey publicKey) → String -
Generate massa address from a given public key
publicKey
-
arrayToBytes(
{required List source, required ArrayTypes type}) → Uint8List - arrayToByes coverts an array of specified data types into byte array
-
asHexString(
List< int> bytes) → String - Converts list of bytes as hex string
-
base58Decode(
String data) → Uint8List -
decodes given
data
using base58 check decode -
base58Encode(
Uint8List data) → String - base58Encode encodes the input string into base58 check encode
-
bigIntToBytes(
BigInt number, {int? outLen, Endian endian = Endian.big}) → Uint8List - Encode a BigInt into bytes This is I2OSP as defined in rfc3447.
-
bigIntToHex(
BigInt? bigInt) → String - Convert a bigint to a byte array Convert a bigint to a byte array
-
bin2hex(
Uint8List bytes, {required String separator, int? wrap}) → String -
Represent bytes in hexadecimal
If a
separator
is provided, it is placed the hexadecimal characters representing each byte. Otherwise, all the hexadecimal characters are simply concatenated together. -
binaryToHex(
String binary) → String - Converts a binary string into a hex string
-
blake3(
List< int> input, [int outputLength = 32]) → List<int> - brake3 function hashes the data using brake 3
-
blake3Hash(
Uint8List bytes) → Uint8List - Generates blake3 hash of a given data bytes
-
blake3Hex(
List< int> input, [int outputLength = 32]) → String - Hashes the supplied bytes into blake3 hashes and returns the result as hex string
-
boolToByte(
bool val) → Uint8List - boolToByte converts a boolean to an array of Uint8List
-
buyRoles(
Account account, int rollCount, double fee, int expirePeriod) → Future< Uint8List> - buy rolls
-
bytesToArray(
{required Uint8List source, required int length, required ArrayTypes type}) → List - bytesToArray coverts the bytes to an array of specified type
-
bytesToBigInt(
Iterable< int> bytes, {Endian endian = Endian.big}) → BigInt - Decodes the provided BigInt from bytes. This is OS2IP as defined in rfc3447.
-
bytesToStr(
Uint8List arr) → String -
bytesToU128(
Uint8List arr, [int offset = 0]) → BigInt -
bytesToU256(
Uint8List arr, [int offset = 0]) → BigInt -
bytesToUtf8String(
Uint8List bytes) → String - Convert byte array to string utf-8
-
byteToBool(
Uint8List arr) → bool - byteToBool converts an array of Uint8List to bool
-
byteToHex(
Uint8List bytes) → String - Converts a Uint8List to a hex string
-
callSC(
Account account, String targetAddress, String targetFunction, Uint8List functionParameters, double fee, double maximumGas, double maximumCoins, int expirePeriod) → Future< Uint8List> - Call contract
-
concat(
List< Uint8List> bytes) → Uint8List - Concatenates one or more byte arrays @param {List
-
decodePrivateKey(
String privateKeyString) → PrivateKey -
Decodes private key string
privateKeyString
into PrivateKey -
decodePublicKey(
String publicKeyString) → PublicKey -
Decodes public key string
publicKeyString
into PublicKey -
doubleToMassaInt(
num value) → int - Converts double to massa integer
-
encodePrivateKey(
PrivateKey privateKey) → String -
Encodes private key
privateKey
into base 58 format -
encodePublicKey(
PublicKey publicKey) → String -
Encodes public key
publicKey
into base 58 format -
executeSC(
Account account, Uint8List data, double fee, double maximumGas, double maximumCoins, int expirePeriod, {Map< Uint8List, Uint8List> ? dataStore}) → Future<Uint8List> - Execute smart contract
-
fromMAS(
double amount) → BigInt -
generateKeyPair(
) → Future< KeyPair> - Generates ed25519 key pair
-
generateRandomString(
int len) → String -
generateSecureRandom(
) → SecureRandom -
Generates a secure
FortunaRandom
-
generateSecureRandomBytes(
int length) → Uint8List - generate a secure random bytes of a specific length
-
getBytesPublicKey(
String publicKeyString) → Uint8List - Retrieves the byte representation of a given public key.
-
getBytesPublicKeyVersioned(
String publicKeyString) → Uint8List - Retrieves the byte representation of a given public key.
-
getDataTypeSize(
ArrayTypes value) → int - get array data type size
-
getTimestamp(
) → int - Get current time stamp
-
hex2bin(
String hexStr) → Uint8List -
Decode a hexadecimal string
hexStr
into a sequence of bytes. -
hexToBinary(
String hex) → String - Converts a hex string to a binary string
-
hexToBytes(
String hex) → Uint8List - Converts a hex string to a Uint8List
-
joinUint8Lists(
Uint8List p1, Uint8List p2) → Uint8List - Joins two lists into one
-
keyPairFromSecret(
String privateKeyString) → Future< KeyPair> -
Generate ed25519 key pair from the
privateKeyString
-
parseAddress(
String address) → Uint8List -
Parses address
address
into bytes -
public(
PrivateKey privateKey) → Future< PublicKey> -
Returns PublicKey from a given private key
privateKey
-
ripemd160Digest(
Uint8List bytes) → Uint8List -
Calculates the RIPEMD-160 hash of the given
bytes
. -
ripmed160sha256(
Uint8List hash) → Uint8List -
sellRoles(
Account account, int rollCount, double fee, int expirePeriod) → Future< Uint8List> -
sendTransaction(
Account account, String recipientAddress, double amount, double fee, int expirePeriod) → Future< Uint8List> - Send transaction from one address to another
-
serialiseAddress(
String address) → Uint8List -
Parses address
address
into bytesaddress type (1 byte)|version (1 byte) | address (22 bytes)
-
sha256Digest(
Uint8List bytes) → Uint8List -
Get a SHA256 hash bytes for the given
bytes
. -
sha256DigestString(
Uint8List bytes) → String -
Get a SHA256 hash string for the given
bytes
. -
stringToBytesUtf8(
String str) → Uint8List - Convert string to byte array
-
strToBytes(
String str) → Uint8List -
toMAS(
BigInt amount) → double -
toSigned(
Uint8List bytes) → List< int> - Converts Uint8List to List
-
u128ToBytes(
BigInt value) → Uint8List -
u256ToBytes(
BigInt value, [int offset = 0]) → Uint8List
Exceptions / Errors
- APIException
- API exceptions class
- BadGatewayException
- Bad gateway exception
- BadRequestException
- Bad request or invalid request exception
- ConsensusException
- Consensus execution exception
- ExecutionException
- Execution exception
- InconsistanceException
- Inconsistance exception
- InternalServerErrorException
- Internal server error exception
- MessageHashException
- Message hash exception
- MissingCommandSenderException
- Missing command sender exception
- MissingConfigException
- Missing configuration exception
- ModelsException
- Models exception
- NetworkException
- Network exception
- NotFoundException
- Not found exception
- ProtocolException
- Protocol exception
- ReceiveChannelException
- Receive channel exception
- SendChannelException
- Send channel exception
- TimeException
- Time exception
- WalletException
- Wallet exception
- WrongAPIException
- Wrong api exception