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

AddressService
AesAuthEncryptInfos
ApiService
AuthorizedKey
SPDX-License-Identifier: AGPL-3.0-or-later 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
SPDX-License-Identifier: AGPL-3.0-or-later CrossValidationStamp represents the approval of the validation stamp by a cross validation node.
Data
TransactionData represents the data section for every transaction.
Error
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
SPDX-License-Identifier: AGPL-3.0-or-later Location of an error
Node
SPDX-License-Identifier: AGPL-3.0-or-later
OnChainWalletData
SPDX-License-Identifier: AGPL-3.0-or-later OnChainWalletData represents informations about a wallet stored on Archethic blockchain in encrypted form.
OracleService
OracleUcoPrice
OriginKeyResponse
Ownership
Ownership represents a block to set a secret and the authorized public keys able to decrypt the secret
Rates
Secret
Service
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.
SharedSecrets
SPDX-License-Identifier: AGPL-3.0-or-later SharedSecrets represents the public shared secret information
Token
TokenBalance
SPDX-License-Identifier: AGPL-3.0-or-later TokenBalance represents a token ledger balance.
TokenLedger
TokenLedger represents the transfers to perform on the token ledger
TokenTransfer
SPDX-License-Identifier: AGPL-3.0-or-later TokenTransfer represents the an asset transfer
Transaction
Transaction represents a unitary transaction in the Archethic network.
TransactionFee
TransactionFeeErrors
TransactionInput
TransactionMovement
SPDX-License-Identifier: AGPL-3.0-or-later TransactionMovement represents ledger transaction movement.
TransactionStatus
Uco
SPDX-License-Identifier: AGPL-3.0-or-later
UCOLedger
UCOLedger represents the transfers to perform on the UCO ledger
UCOTransfer
SPDX-License-Identifier: AGPL-3.0-or-later UCOTransfer represents the an asset transfer
UnspentOutputs
SPDX-License-Identifier: AGPL-3.0-or-later UnspentOutput represents the remaining unspent output of the transaction.
ValidationStamp
ValidationStamp represents the validation performs by the coordinator

Constants

cVersion → const int
keychainOriginId → const int
kOriginPrivateKey → const String
Return the Initial Origin Private Key
softwareId → const int
txTypes → const Map<String, int>

Functions

addressFormatControl(String? address) bool
Verify the structure of an address @param {String} address to control
aesAuthDecrypt(Uint8List encrypted, Uint8List aesKey, Uint8List iv, Uint8List tag) Uint8List
aesAuthEncrypt(Uint8List data, Uint8List aesKey, Uint8List iv) AesAuthEncryptInfos
aesDecrypt(dynamic cipherText, dynamic key) Uint8List
aesEncrypt(dynamic data, dynamic key) Uint8List
Encrypt a data for a given public key using AES algorithm @param {String | Uint8List} data Data to encrypt @param {String | Uint8List} key Symmetric key
concatUint8List(Iterable<Uint8List> list) Uint8List
Concat a list of Uint8List @param {Array} arrays Uint8List
curveToID(String curve) int
Get the ID of a given Elliptic curve @params {String} curve Elliptic curve
decodeKeychain(Uint8List binary) Keychain
deriveAddress(String seed, int index, {String curve = 'ed25519', String hashAlgo = 'sha256'}) String
Create a hash digest from the data with an hash algorithm identification prepending the digest @param {String} seed Keypair derivation seed @param {int} index Number to identify the order of keys to generate @param {String} curve Elliptic curve to use ("ed25519", "P256", "secp256k1") @param {String} hashAlgo Hash algorithm ("sha256", "sha512", "sha3-256", "sha3-512", "blake2b")
deriveArchethicKeypair(dynamic seed, String derivationPath, int index, {String curve = 'ed25519'}) KeyPair
deriveKeyPair(String seed, int index, {String curve = 'ed25519'}) KeyPair
Generate a keypair using a derivation function with a seed and an index. Each keys is prepending with a curve identification. @param {String} seed Keypair derivation seed @param {int} index Number to identify the order of keys to generate @param {String} curve Elliptic curve to use ("P256", "secp256k1", "ed25519")
derivePrivateKey(dynamic seed, int index) Uint8List
deriveSecret(dynamic sharedKey) Secret
ecDecrypt(dynamic cipherText, dynamic privateKey) Uint8List
Decrypt a ciphertext for a given private key using ECIES algorithm @param {String | Uint8List} ciphertext Ciphertext to decrypt @param {String | Uint8List} privateKey Private key for the shared secret encryption
ecEncrypt(dynamic data, dynamic publicKey) Uint8List
Encrypt a data for a given public key using ECIES algorithm @param {String | Uint8List} data Data to encrypt @param {String | Uint8List} publicKey Public key for the shared secret encryption
fromBigInt(int? number) num
Convert big int of 10^8 decimals to any number @param {int} Number to convert
generateDeterministicKeyPair(Uint8List pvKey, String curve, int originID) KeyPair
Generate a new keypair deterministically with a given private key, curve and origin id @params {Uint8List} privateKey Private key @params {String} curve Elliptic curve @params {int} originID Origin identification
getHashDigest(dynamic content, dynamic algo) Uint8List
getKeypair(Uint8List pvKey, String curve) KeyPair
hash(dynamic content, {String algo = 'sha256'}) Uint8List
Create a hash digest from the data with an hash algorithm identification prepending the digest @param {String | Uint8List} content Data to hash (string or buffer) @param {String} algo Hash algorithm ("sha256", "sha512", "sha3-256", "sha3-512", "blake2b")
hashAlgoToID(String hashAlgo) int
Get the ID of a given hash algorithm @params {String} hashAlgo Hash algorithm
hexToUint8List(String hexString) Uint8List
Encode an hexadecimal string into a Uint8List @param {Uint8List} hexString Hexadecimal string
idToCurve(int id) String
Get the curve name from the curve ID @param {int} ID Curve's ID
idToHashAlgo(int id) String
Get the hash algo name from the hash algorithm ID @param {int} ID Hash algorithm's ID
isHex(String inputString) bool
Determines if a string is an hexadecimal @param {String} inputString Potential hexadecimal string
keyToJWK(Uint8List publicKey, String keyId) → Jwk
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, int index) String
sign(dynamic data, dynamic privateKey) Uint8List
Sign the data @param {String | Uint8List} data Data to sign @param {String | Uint8List} privateKey Private key to use to sign the data
toBigInt(num? number) int
Convert any number into a big int for 10^8 decimals @param {num} Number to convert
toByteArray(int value, {int length = 0}) Uint8List
Convert any number into a byte array
tokenFromJson(String str) Token
SPDX-License-Identifier: AGPL-3.0-or-later
tokenToJson(Token data) String
tokenToJsonForTxDataContent(Token data) String
transactionEncoding() String
transactionFeeFromJson(String str) TransactionFee
transactionFeeToJson(TransactionFee data) String
transactionStatusFromJson(String str) TransactionStatus
transactionStatusToJson(TransactionStatus data) String
uint8ListToHex(Uint8List bytes) String
Encode an Uint8List into an hexadecimal string @param {Uint8List} bytes Uint8List
verify(dynamic sig, dynamic data, dynamic publicKey) bool
walletEncoder(String originPublicKey) OnChainWalletData
Archethic Onchain Wallet Generator and Encoder, using V1 specifications https://archethic-foundation.github.io/archethic-docs/build/clients/wallet-spec