archethic_lib_dart library

SPDX-License-Identifier: AGPL-3.0-or-later

Package archEthic aims to provide a easy way to create Archethic transaction and to send them over the network.

This implementation is based on Official Archethic Javascript library for Node and Browser.

Classes

Address
The Address scalar type represents a transaction's address.
AddressJsonConverter
AddressService
AesAuthEncryptInfos
Holds a key pair (private and public key)
ApiService
ArchethicOracle
ArchethicTransactionSender
TransactionSenderInterface which talks to the Phoenix API.
AuthorizedKey
AuthorizedKey represents a authorized public key with the encrypted secret key for this given key. By decrypting this secret key, the authorized public key will be able to decrypt its related secret
Balance
Balance represents a ledger balance.
CrossValidationStamp
CrossValidationStamp represents the approval of the validation stamp by a cross validation node.
Data
Data represents the data section for every transaction.
Error
HostingRef
HostingRefContentMetaData
Keychain
KeyPair
Holds a key pair (private and public key)
Ledger
Ledger represents the ledger operations to perform
LedgerOperations
LedgerOperations represents the ledger operations performed by the transaction.
Location
Location of an error
Node
OnChainWalletData
OnChainWalletData represents informations about a wallet stored on Archethic blockchain in encrypted form.
OracleService
OracleUcoPrice
To parse this JSON data, do
OriginKeyResponse
Ownership
Ownership represents a block to set a secret and the authorized public keys able to decrypt the secret
A link for subscriptions (or also mutations/queries) over phoenix channels
PushNotification
Rates
Recipient
Recipient represents a Smart Contract call.
SCCallFunctionParams
SCCallFunctionRequest
Secret
Service
SharedSecrets
SharedSecrets represents the public shared secret information
Token
TokenBalance
TokenBalance represents a token ledger balance.
TokenLedger
TokenLedger represents the transfers to perform on the token ledger
TokenTransfer
TokenTransfer represents the an asset transfer
Transaction
Transaction represents a unitary transaction in the Archethic network.
TransactionConfirmation
TransactionFee
TransactionFeeErrors
TransactionInput
TransactionInput represents the inputs from the transaction.
TransactionMovement
TransactionMovement represents ledger transaction movement.
TransactionNotification
TransactionRemoteRepositoryInterface
TransactionSenderInterface
TransactionStatus
Uco
UCOLedger
UCOLedger represents the transfers to perform on the UCO ledger
UCOTransfer
UCOTransfer represents the an asset transfer
UnspentOutputs
UnspentOutputs represents the remaining unspent output of the transaction.
ValidationStamp
ValidationStamp represents the validation performs by the coordinator

Mixins

ArchethicTransactionParser
Handles conversion from Archethic DTOs to Models
NotificationUtil

Constants

cVersion → const int
kAddressLength → const int
kCurveType → const List<int>
keychainOriginId → const int
kHashType → const List<int>
kOriginPrivateKey → const String
Return the Initial Origin Private Key.
softwareId → const int
txTypes → const Map<String, int>

Functions

addressFromJson(String json) Address
addressToJson(Address? address) String?
aesAuthDecrypt(Uint8List encrypted, Uint8List aesKey, Uint8List iv, Uint8List tag) Uint8List
aesAuthEncrypt(Uint8List data, Uint8List aesKey, Uint8List iv) AesAuthEncryptInfos
aesDecrypt(dynamic cipherText, dynamic key, {bool isCipherTextHexa = true, bool isKeyHexa = true}) Uint8List
aesEncrypt(dynamic data, dynamic key, {bool isDataHexa = true, bool isKeyHexa = true}) Uint8List
Encrypt a data for a given public key using AES algorithm.
concatUint8List(Iterable<Uint8List> list) Uint8List
Concat a list of Uint8List.
curveToID(String curve) int
Get the ID of a given Elliptic curve.
decodeKeychain(Uint8List binary) Keychain
deriveAddress(String seed, int index, {String curve = 'ed25519', String hashAlgo = 'sha256', bool isSeedHexa = true}) String
Create a hash digest from the data with an hash algorithm identification prepending the digest.
deriveArchethicKeypair(dynamic seed, String derivationPath, int index, {String curve = 'ed25519', String pathSuffix = ''}) KeyPair
deriveKeyPair(String seed, int index, {String curve = 'ed25519', bool isSeedHexa = true, int originId = softwareId}) KeyPair
Generate a keypair using a derivation function with a seed and an index. Each keys is prepending with a curve identification.
derivePrivateKey(dynamic seed, int index, {bool isSeedHexa = true}) Uint8List
deriveSecret(dynamic sharedKey, {bool isSharedKey = true}) Secret
deriveServiceSeed(dynamic seed, String derivationPath, int index, {String pathSuffix = ''}) Uint8List
ecDecrypt(dynamic cipherText, dynamic privateKey, {bool isCipherTextHexa = true, bool isPrivateKeyHexa = true}) Uint8List
Decrypt a ciphertext for a given private key using ECIES algorithm
ecEncrypt(dynamic data, dynamic publicKey, {bool isDataHexa = true, bool isPublicKeyHexa = true}) Uint8List
Encrypt a data for a given public key using ECIES algorithm
extractTransactionErrorMessages(Map<String, dynamic> json) String
fromBigInt(int? number) num
Convert big int of 10^8 decimals to any number.
generateDeterministicKeyPair(Uint8List pvKey, String curve, int originID) KeyPair
Generate a new keypair deterministically with a given private key, curve and origin id.
generateRandomAESKey({int length = 32}) String
Generate a random AESKey
generateRandomSeed() String
Generate a random seed
getHashDigest(dynamic content, dynamic algo) Uint8List
getKeypair(Uint8List pvKey, String curve) KeyPair
hash(dynamic content, {String algo = 'sha256', bool isContentHexa = true}) Uint8List
Create a hash digest from the data with an hash algorithm identification prepending the digest
hashAlgoToID(String hashAlgo) int
Get the ID of a given hash algorithm.
hexToUint8List(String hexString) Uint8List
Encode an hexadecimal string into a Uint8List.
idToCurve(int id) String
Get the curve name from the curve ID.
idToHashAlgo(int id) String
Get the hash algo name from the hash algorithm ID.
isHex(String inputString) bool
Determines if a string is an hexadecimal.
isPathWithIndex(String path) bool
keyToJWK(Uint8List publicKey, String keyId) → Jwk
nextUint8(Iterator<MapEntry<int, int>> iterator) int
Return the next Uint8 from an iterator of Uint8Array.
oracleUcoPriceFromJson(String str) OracleUcoPrice
oracleUcoPriceToJson(OracleUcoPrice data) String
originKeyResponseFromJson(String str) OriginKeyResponse
originKeyResponseToJson(OriginKeyResponse data) String
removeAliasPrefix<T>(Map<String, T?>? map) Map<String, T>?
Remove alias prefix (underscore) used in graphQL requests
replaceDerivationPathIndex(String path, String suffix, int index) String
sign(dynamic data, dynamic privateKey, {bool isDataHexa = true, bool isPrivateKeyHexa = true}) Uint8List
Sign the data.
sortObjectKeysAsc(dynamic term) → dynamic
toBigInt(num? number) int
Convert any number into a big int for 10^8 decimals.
toByteArray(int value, {int length = 0}) Uint8List
Convert any number into a byte array
transactionStatusFromJson(String str) TransactionStatus
uint8ListToHex(Uint8List bytes) String
Encode an Uint8List into an hexadecimal string.
uint8ListToInt(Uint8List bytes) int
Decode byte array (4 bytes) into a integer.
verify(dynamic sig, dynamic data, dynamic publicKey, {bool isSigHexa = true, bool isDataHexa = true, bool isPublicKeyHexa = true}) bool
walletEncoder(String originPublicKey) OnChainWalletData
Archethic Onchain Wallet Generator and Encoder, using V1 specifications

Typedefs

TransactionConfirmationHandler = Future<void> Function(TransactionConfirmation confirmation)
TransactionErrorHandler = Future<void> Function(TransactionError error)