mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-10-30 00:47:48 +00:00
5a7a0e01a7
* Make address to output script a single entry point Fix network type for bitcoin cash * Add MoonPay to sell polygon * Normalize currency for moonpay widget * Minor fix * fix: litecoin & bch address types * fix: remove print * fix: network decode location * fix: missing place additional network type * fix: wrong initial address page type * fix: initial address generation * fix: btc exchange sending all, bch without change addresses * Minor fixes * Update app versions [skip ci] --------- Co-authored-by: Rafael Saes <git@rafael.saes.dev>
14 lines
474 B
Dart
14 lines
474 B
Dart
import 'dart:typed_data';
|
|
import 'package:bitcoin_base/bitcoin_base.dart' as bitcoin;
|
|
|
|
List<int> addressToOutputScript(String address, bitcoin.BasedUtxoNetwork network) {
|
|
try {
|
|
if (network == bitcoin.BitcoinCashNetwork.mainnet) {
|
|
return bitcoin.BitcoinCashAddress(address).baseAddress.toScriptPubKey().toBytes();
|
|
}
|
|
return bitcoin.addressToOutputScript(address: address, network: network);
|
|
} catch (err) {
|
|
print(err);
|
|
return Uint8List(0);
|
|
}
|
|
}
|