dartsv
비트코인 네트워크와 상호 작용하기 위한 Dart 라이브러리입니다. 이 라이브러리는 Flutter 애플리케이션 개발에 특히 적합합니다.
Dart 언어용 비트코인 라이브러리
^0.2.0^3.1.0^3.7.0^7.0.0^0.2.0^1.1.1^1.17.1^2.3.3^2.1.1^1.18.2^5.0.16아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Dart CI
TwoStack WalletSDK is a Bitcoin library for the Dart Language ( dartlang.org ), loosely based on the Moneybutton/BSV Javascript library. This library has been built in line with the ideals espoused by BitcoinSV, i.e. massive on-chain scaling, protocol stability and original-bitcoin-protocol implementation. It is intended for use in building multi-platform applications using the Flutter framework, or server-side bitcoin applications using frameworks like Serverpod
Version 2.x of the library is a major refactor and breaks backwards compatibility with several previous library APIs.
TransactionBuilder class for composing TransactionsTransaction classSighash class now exposes the SigHash Pre-Image; useful when creating OP_PUSH_TX spending scripts.ScriptBuilder class to make it easy to create custom locking/unlocking scripts.Generally Supported features are :
OP_FALSE OP_RETURN)PUSH_DATA [your_data] OP_DROP [P2PKH locking code]) var utxo = txWithUTXO.outputs[0];
var outpoint = TransactionOutpoint(txWithUTXO.id, 0, utxo.satoshis, utxo.script);
var signer = TransactionSigner(SighashType.SIGHASH_FORKID.value | SighashType.SIGHASH_ALL.value, privateKey);
var unlocker = P2PKHUnlockBuilder(privateKey.publicKey);
var transaction = TransactionBuilder()
.spendFromOutpointWithSigner(signer, outpoint, TransactionInput.MAX_SEQ_NUMBER, unlocker)
.spendToPKH(recipientAddress, BigInt.from(50000000)) //spend half of a bitcoin
.sendChangeToPKH(changeAddress) // spend change to a different address
.withFeePerKb(50) //set a fee of 50 satoshis per kilobyte
.build(false); //build the transaction, disabling checks
//at this point you have a fully signed transaction ready to be broadcast
try {
transaction.verify(); //perform a pre-broadcast sanity check on the transaction
} on VerificationException catch (ex){
print("Transaction failed verification - ${ex.cause}");
}
This library was built using version 3.0.7 of the Dart SDK( https://dart.dev/tools/sdk ).
As of Version 1.0.0 this library supports Dart Null Safety. Current minimum Dart SDK version required is version 2.17.0.
Navigate to the root folder of this project, and pull the required supported Dart libraries using the pub package manager.
> pub get
In the root folder of this project, run the command:
> pub run test
A debt of gratitude is owed to the developers acknowledged in the LICENSE file. Without the hard work of individuals working on earlier library and node implementations like Bitcoin Core, Bitcoin Cash, MoneyButton/BSV, BitcoinJ and many more, this library would likely not have come to fruition. Thank you.
You can reach the author at :