Same functionality. Same runtime behavior. One is ~40 lines. The other is ~400+.
#[derive(uniffi::Object)]| // | |
| // CollapsibleStackView.swift | |
| // TemplateApp | |
| // | |
| // Created by Andrei Terentiev on 4/3/22. | |
| // | |
| import Foundation | |
| import SwiftUI | |
| import UniformTypeIdentifiers |
| let wif = "" | |
| let pubkeyCompressed = "028013a81902a823dec80b54b5e1591b8d2fa359e9024934dae604aaa3be7dc020" | |
| let pubkeyUncompressed = "048013a81902a823dec80b54b5e1591b8d2fa359e9024934dae604aaa3be7dc0202c487e634ab286179f6fefd9689e30465b6bbf658408928ddb01a419a81bf168" | |
| let addressCompressed = "1KM68pTTgD172nJqykCUPpMA7hT7aGnn7w" | |
| let addressUncompressed = "1KRhiKNai3ke3hZgSPZ5TpJoSJvs1aZfWo" //funds are here | |
| var allAvailableUtxos = [ | |
| InputUtxo( |
Bug fixes Total balance at home screen is still display including BTC balances even though disabled BTC https://www.notion.so/bitcoincom/AH-20210308-Total-balance-at-home-screen-is-still-display-including-BTC-balances-even-though-disabl-277a5768aa0b4ceb93264c36a1b7bebe
New feature Show Hide Blockchain https://www.notion.so/bitcoincom/Show-Hide-Blockchain-62db82740cbc4aec94fa152591465a47
| func testJPMnemonic1() throws { | |
| let mnemonic = ["γ΅γγ¨γ", "γγγγ", "γ―γγγ", "γγγ", "γγΎγγ", "γ«γ‘γγγγ", "γγγγ", "γγγγ", "γγγγγ€", "γγͺγ", "γγγγ", "γγγΎ"] | |
| let wallet = BcomWallet(mnemonic: mnemonic, chain: .bitcoin) | |
| let address = BlockchainAddressGenerator.shared.getDefaultBlockchainAddress(from: wallet, x: 0, y: 0, chain: BcomBlockchain.bitcoin) | |
| XCTAssertEqual(address, "15wZ1znjcz48MDjSgzasvzJBiSyLn8cqZ4") | |
| let xPub = wallet.getExtendedPubKey(for: .bitcoin) | |
| XCTAssertEqual(xPub, "xpub6D9oYGG8TsHWBxYaGMQPyMq7o7xyv6kvqUozhzTGnHgA9gY4WYdPdQJt2WWCUBP3iYW8xs4pymVhJAhR7Mdi7qbTbP2in2FFV7kHcSJdXgv") | |
| } |
| let txTrust = BcomBlockchainTransactionBuilder(signingWallet: pr.selectedWallet!.masterWallet!, chainAssetProtocol: .bch, amount: 0.00001547, assetId: "bch", destination: pr.toAddress!) | |
| .buildBitcoinCash(utxos: utxos, satsPerByteFee: 1, changeAddress: pr.toAddress!) { baseResult in | |
| baseResult.buildSlp() { slpResult in | |
| slpResult | |
| .withSLPUtxos() | |
| .withSpentSLPUtxos() | |
| } | |
| .withSpentUtxos() | |
| .withChangeUtxos() | |
| } |
| class BcomBlockchainTransactionBuilder { | |
| private var tx: BcomBlockchainTransaction | |
| init(signingWallet: BcomWallet, chainAssetProtocol: ChainAssetProtocol, amount: Decimal, assetId: String) { | |
| tx = BcomBlockchainTransaction(signingWallet: signingWallet, chainAssetProtocol: chainAssetProtocol, amount: amount, assetId: assetId) | |
| } | |
| //Chain Level Builder | |
| func buildBitcoinCash(utxos: [UTXO], satsPerByteFee: Int) -> BitcoinCashBuilder { | |
| tx.satsPerByteFee = satsPerByteFee |
| class BcomBlockchainTransaction { | |
| var wallet: BcomWallet | |
| var chainAssetProtocol: ChainAssetProtocol | |
| var amount: Decimal | |
| var assetId: String | |
| //bitcoin specific | |
| var utxo: [UTXO]? | |
| var satsPerByteFee: Int | |
I hereby claim:
To claim this, I am signing this object:
| import 'package:english_words/english_words.dart'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| Color color = Theme.of(context).primaryColor; | |
| Widget buttonSection = Container( |