dartsv library

Support for doing something awesome.

More dartdocs go here.

Classes

Address
This class abstracts away the internals of address encoding and provides a convenient means to both encode and decode information from a bitcoin address.
Block
A block is the largest of the blockchain's building blocks.
BlockHeader
The BlockHeader contains the metadata for the contents of a block, as well as data describing it's place/position in the blockchain.
BoolItem
ByteArrayItem
ChildNumber
Coin
Represents a monetary Bitcoin value. This class is immutable.
DefaultLockBuilder
DefaultUnlockBuilder
Ecies
A Class for performing Elliptic Curve Integrated Encryption Scheme operations.
HDPrivateKey
Provides support for Extended Private keys (Hierarchical Deterministic keys) as described in the BIP32 spec.
HDPublicKey
Provides support for Extended Public keys (Hierarchical Deterministic keys) as described in the BIP32 spec.
HDUtils
Static utilities used in BIP 32 Hierarchical Deterministic Wallets (HDW). Ported from BitcoinJ-SV
Interpreter
InterpreterStack<T>
Utility class to represent the Script Interpreter Stack.
LockingScriptBuilder
Base class for the Locking Script part of the Script Builder API
MerkleBlock
A merkle block represents a partial/filtered view of the transactions in a block.
Message
Bitcoin Signed Messages
Mnemonic
This class implements the Bip39 spec.
Networks
Utility class used to inject strong typing into the Address class' representation of network and address types.
OpCodes
OpCodes are used as the instruction set of the Bitcoin Script programming language.
P2MSLockBuilder
P2MSUnlockBuilder
P2PKHDataLockBuilder
A combination of P2PKH and an "OP_PUSHDATA data OP_DROP" pre-prended to the Locking Script. This results in a spendable output that has data attached. The implication here is that spending the output signs over the data.
P2PKHLockBuilder
** P2PKH locking Script ***
P2PKHUnlockBuilder
P2PKLockBuilder
P2PKUnlockBuilder
P2SHLockBuilder
P2SHUnlockBuilder
ScriptBuilder
ScriptChunk
Utility class to represent a parsed 'token' in the encoded script.
ScriptFlags
Flags are used to signal various expected behaviours to the Script Interpreter.
ScriptPattern
Sighash
Implements the Signature Hash algorithm.
SignerDto
SVPrivateKey
Manages an ECDSA private key.
SVPublicKey
Manages an ECDSA public key.
SVScript
Bitcoin has a built-in scripting language. This class allows one to easily move between human-readable instructions and internal hexadecimal representations of bitcoin script.
SVSignature
Sign bitcoin transactions and verify signatures.
Transaction
Transactions are at the heart of this library. It is the primary means by which we interact with the Bitcoin network.
TransactionBuilder
TransactionInput
Class that represents the "input" to a transaction.
TransactionOutpoint
TransactionOutput
Class that represents the output (UTXO) of a transaction.
TransactionSigner
UnlockingScriptBuilder
UnspendableDataLockBuilder
A locking script that starts with "OP_FALSE OP_RETURN" which renders the output unspendable. Allows for data to be appended to the script.
VarInt

Enums

AddressType
KeyType
NetworkAddressType
NetworkType
ScriptError
SighashType
Transaction signature flags that determine which portions of a Transaction the signature in the TransactionInput applies to.
TransactionOption
When serializing the transaction to hexadecimal it is possible to selectively disable some checks. See Transaction.serialize()
VerifyFlag
Wordlist
The supported word lists for Bip39 mnemonics

Properties

ALPHABET String
getter/setter pair

Functions

calcVarInt(int value) List<int>
castToBigInt(List<int> buf, bool fRequireMinimal, {int nMaxNumSize = 4}) BigInt
castToBuffer(BigInt value) List<int>
checkMinimallyEncoded(List<int> bytes, int maxNumSize) bool
checks that LE encoded number is minimally represented. That is that there are no leading zero bytes except in the case: if there's more than one byte and the most significant bit of the second-most-significant-byte is set it would conflict with the sign bit. @param bytesLE @return
decode(String input) List<int>
decodeBigIntSV(List<int> bytes) BigInt
decodeChecked(String input) List<int>
divmod(List<int> number, int firstDigit, int base, int divisor) → dynamic
Divides a number, represented as an array of bytes each containing a single digit in the specified base, by the given divisor. The given number is modified in-place to contain the quotient, and the return value is the remainder.
encode(List<int> encodedInput) Uint8List
Encodes the given bytes as a base58 string (no checksum is appended).
encodeBigIntLE(BigInt number) List<int>
encodeBigIntSV(BigInt number) Uint8List
fromSM(List<int> buf, {Endian endian = Endian.big}) BigInt
hash160(List<int> bytes) List<int>
hexToInt32(List<int> hexBuffer) int
hexToInt64(List<int> hexBuffer) int
hexToUint16(List<int> hexBuffer) int
hexToUint32(List<int> hexBuffer) int
hexToUint64(List<int> hexBuffer) BigInt
LShift(List<int> x, int n) List<int>
make_lshift_mask(int n) int
make_rshift_mask(int n) int
minimallyEncode(List<int> buf) List<int>
Minimally encode the buffer content
readUint16(List<int> bytes, int offset) int
Parse 2 bytes from the byte array (starting at the offset) as unsigned 16-bit integer in little endian format.
readUint32(List<int> bytes, int offset) int
Parse 4 bytes from the byte array (starting at the offset) as unsigned 32-bit integer in little endian format.
readVarInt(Uint8List buffer) BigInt
readVarIntNum(ByteDataReader reader) int
ripemd160(List<int> bytes) List<int>
RShift(List<int> x, int n) List<int>
sha1(List<int> bytes) List<int>
sha256(List<int> bytes) List<int>
sha256Twice(List<int> bytes) List<int>
sizeOf(int value) int
Returns the minimum encoded size of the given unsigned long value.
toBuffer(BigInt value, {int size = 0, Endian endian = Endian.big}) List<int>
toSM(BigInt value, {Endian endian = Endian.big}) List<int>
toSMBigEndian(BigInt value) List<int>
varIntWriter(int? length) Uint8List

Typedefs

RandomBytes = Uint8List Function(int size)
Byte buffer to represent a random seed