Browse Source

Some of the wallet implementation

gradlePlay
Gutyn 9 years ago
parent
commit
bda94b5287
  1. 1
      .idea/dictionaries/Mihail.xml
  2. 4
      app/src/main/java/com/breadwallet/presenter/activities/IntroActivity.java
  3. 62
      app/src/main/java/com/breadwallet/presenter/activities/MainActivity.java
  4. 16
      app/src/main/java/com/breadwallet/tools/adapter/AmountAdapter.java
  5. 3
      app/src/main/java/com/breadwallet/tools/others/CurrencyManager.java
  6. 5
      app/src/main/java/com/breadwallet/tools/others/WordsReader.java
  7. 28
      app/src/main/java/com/breadwallet/wallet/BRAddress.java
  8. 28
      app/src/main/java/com/breadwallet/wallet/BRMasterPubKey.java
  9. 28
      app/src/main/java/com/breadwallet/wallet/BRTransaction.java
  10. 70
      app/src/main/java/com/breadwallet/wallet/BRWallet.java
  11. 206
      app/src/main/java/com/breadwallet/wallet/BRWalletManager.java
  12. 12
      app/src/main/res/layouts/activities/layout/activity_main.xml
  13. BIN
      app/src/main/res/raw/coinflip.mp3

1
.idea/dictionaries/Mihail.xml

@ -3,6 +3,7 @@
<words>
<w>bitcoin</w>
<w>mydecoderview</w>
<w>passcode</w>
<w>qrdecoderview</w>
</words>
</dictionary>

4
app/src/main/java/com/breadwallet/presenter/activities/IntroActivity.java

@ -23,7 +23,7 @@ import com.breadwallet.presenter.fragments.IntroNewWalletFragment;
import com.breadwallet.presenter.fragments.IntroRecoverWalletFragment;
import com.breadwallet.presenter.fragments.IntroWarningFragment;
import com.breadwallet.presenter.fragments.IntroWelcomeFragment;
import com.breadwallet.tools.others.PListReader;
import com.breadwallet.tools.others.WordsReader;
import java.io.IOException;
import java.util.List;
@ -130,7 +130,7 @@ public class IntroActivity extends FragmentActivity {
List<String> wordList = null;
try {
wordList = PListReader.getWordList(this);
wordList = WordsReader.getWordList(this);
} catch (IOException e) {
e.printStackTrace();
}

62
app/src/main/java/com/breadwallet/presenter/activities/MainActivity.java

@ -5,10 +5,12 @@ import android.content.ClipboardManager;
import android.content.DialogInterface;
import android.content.IntentFilter;
import android.graphics.Point;
import android.media.MediaPlayer;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.PersistableBundle;
import android.support.v4.BuildConfig;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
@ -20,6 +22,7 @@ import android.view.animation.ScaleAnimation;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewFlipper;
@ -27,12 +30,12 @@ import com.breadwallet.R;
import com.breadwallet.presenter.BreadWalletApp;
import com.breadwallet.presenter.fragments.FragmentAbout;
import com.breadwallet.presenter.fragments.FragmentCurrency;
import com.breadwallet.presenter.fragments.FragmentDecoder;
import com.breadwallet.presenter.fragments.FragmentRecoveryPhrase;
import com.breadwallet.presenter.fragments.FragmentScanResult;
import com.breadwallet.presenter.fragments.FragmentSettings;
import com.breadwallet.presenter.fragments.FragmentWipeWallet;
import com.breadwallet.presenter.fragments.FragmentDecoder;
import com.breadwallet.presenter.fragments.FragmentSettingsAll;
import com.breadwallet.presenter.fragments.FragmentWipeWallet;
import com.breadwallet.presenter.fragments.PasswordDialogFragment;
import com.breadwallet.tools.adapter.AmountAdapter;
import com.breadwallet.tools.adapter.CustomPagerAdapter;
@ -45,6 +48,8 @@ import com.breadwallet.tools.others.NetworkChangeReceiver;
import java.util.HashMap;
import java.util.Map;
import java.util.Observable;
import java.util.Observer;
/**
* BreadWallet
@ -71,7 +76,7 @@ import java.util.Map;
* THE SOFTWARE.
*/
public class MainActivity extends FragmentActivity {
public class MainActivity extends FragmentActivity implements Observer {
public static final String TAG = "MainActivity";
public static final String PREFS_NAME = "MyPrefsFile";
public static MainActivity app;
@ -109,13 +114,18 @@ public class MainActivity extends FragmentActivity {
public static boolean unlocked = false;
public static Point screenParametersPoint = new Point();
private int middleViewPressed = 0;
public static final int DEBUG = 1;
public static final int RELEASE = 2;
public static int MODE = RELEASE;
private static final String DEBUG_KEY =
"get the debug key from logcat after calling the function below once from the emulator";
TextView testnet;
//loading the native library
static {
System.loadLibrary("BreadWalletCore");
}
/**
* Public constructor used to assign the current instance to the app variable
*/
@ -124,7 +134,7 @@ public class MainActivity extends FragmentActivity {
app = this;
}
private native String messageFromNativeCode(String logThis);
// private native String messageFromNativeCode(String logThis);
@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
@ -142,22 +152,27 @@ public class MainActivity extends FragmentActivity {
if (savedInstanceState != null) {
return;
}
if (isEmulatorOrDebug()) {
MODE = DEBUG;
Log.e(TAG, "DEBUG MODE!!!!!!");
}
final FragmentManager fm = getSupportFragmentManager();
initializeViews();
testnet.setVisibility(MODE == DEBUG ? View.VISIBLE : View.GONE);
//testing native code bridge
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
((BreadWalletApp)getApplication()).setTopMiddleView(BreadWalletApp.BREAD_WALLET_TEXT, messageFromNativeCode("Here, worked"));
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
((BreadWalletApp) getApplication()).setTopMiddleView(BreadWalletApp.BREAD_WALLET_IMAGE, "");
}
}, 2000);
}
},3000);
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// ((BreadWalletApp)getApplication()).setTopMiddleView(BreadWalletApp.BREAD_WALLET_TEXT, messageFromNativeCode("Here, worked"));
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// ((BreadWalletApp) getApplication()).setTopMiddleView(BreadWalletApp.BREAD_WALLET_IMAGE, "");
// }
// }, 2000);
// }
// },3000);
viewFlipper.setOnClickListener(new View.OnClickListener() {
@Override
@ -244,6 +259,7 @@ public class MainActivity extends FragmentActivity {
*/
private void initializeViews() {
testnet = (TextView) findViewById(R.id.testnet);
networkErrorBar = (RelativeLayout) findViewById(R.id.main_internet_status_bar);
burgerButton = (Button) findViewById(R.id.main_button_burger);
lockerPayFlipper = (ViewFlipper) findViewById(R.id.locker_pay_flipper);
@ -426,6 +442,8 @@ public class MainActivity extends FragmentActivity {
public void pay(View view) {
SpringAnimator.showAnimation(view);
Log.d(TAG, "Test pay button_regular_blue!");
final MediaPlayer mp = MediaPlayer.create(this, R.raw.coinflip);
mp.start();
if (AmountAdapter.isPayLegal()) {
//TODO implement pay method
} else {
@ -441,4 +459,14 @@ public class MainActivity extends FragmentActivity {
alert.show();
}
}
@Override
public void update(Observable observable, Object data) {
//TODO balance observer stuff here
}
public boolean isEmulatorOrDebug() {
return Build.BRAND.equalsIgnoreCase("generic") || BuildConfig.DEBUG;
}
}

16
app/src/main/java/com/breadwallet/tools/adapter/AmountAdapter.java

@ -12,6 +12,7 @@ import com.breadwallet.tools.others.CurrencyManager;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Observable;
/**
* BreadWallet
@ -37,7 +38,7 @@ import java.text.DecimalFormat;
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
public class AmountAdapter {
public class AmountAdapter extends Observable {
private static final String TAG = "AmountAdapter";
public static boolean comaHasBeenInserted = false;
private static final int DIGITS_LIMIT = 12;
@ -48,6 +49,7 @@ public class AmountAdapter {
public static int digitsInserted = 0;
public static void preConditions(String tmp) {
switch (tmp) {
case "":
doBackSpace();
@ -76,7 +78,7 @@ public class AmountAdapter {
if (rightValue.equals("0.")) {
changeTextColor(2);
calculateAndPassValuesToFragment(rightValue.substring(0, length - 1));
((BreadWalletApp)app.getApplication()).setLockerPayButton(BreadWalletApp.LOCKER_BUTTON);
((BreadWalletApp) app.getApplication()).setLockerPayButton(BreadWalletApp.LOCKER_BUTTON);
}
}
if (length > 1) {
@ -86,7 +88,7 @@ public class AmountAdapter {
calculateAndPassValuesToFragment(rightValue.substring(0, length - 1));
}
} else {
((BreadWalletApp)app.getApplication()).setLockerPayButton(BreadWalletApp.LOCKER_BUTTON);
((BreadWalletApp) app.getApplication()).setLockerPayButton(BreadWalletApp.LOCKER_BUTTON);
changeTextColor(2);
calculateAndPassValuesToFragment("0");
}
@ -97,7 +99,7 @@ public class AmountAdapter {
MainActivity app = MainActivity.app;
if (isTextColorGrey) {
changeTextColor(1);
((BreadWalletApp)app.getApplication()).setLockerPayButton(BreadWalletApp.PAY_BUTTON);
((BreadWalletApp) app.getApplication()).setLockerPayButton(BreadWalletApp.PAY_BUTTON);
}
String amount = rightValue;
CurrencyManager.separatorNeedsToBeShown = true;
@ -115,7 +117,7 @@ public class AmountAdapter {
if (isTextColorGrey) {
changeTextColor(1);
((BreadWalletApp)app.getApplication()).setLockerPayButton(BreadWalletApp.PAY_BUTTON);
((BreadWalletApp) app.getApplication()).setLockerPayButton(BreadWalletApp.PAY_BUTTON);
}
if (isDigitInsertingLegal(amount)) {
@ -189,7 +191,7 @@ public class AmountAdapter {
}
leftValue = new DecimalFormat("0.##").format(leftValueObject.doubleValue());
FragmentScanResult.updateBothTextValues(rightValueObject, leftValueObject);
} catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
FragmentScanResult.updateBothTextValues(new BigDecimal("0"), new BigDecimal("0"));
}
@ -222,7 +224,7 @@ public class AmountAdapter {
return rightValue;
}
public static boolean isPayLegal(){
public static boolean isPayLegal() {
//Return false for now every time.
//TODO implement this check

3
app/src/main/java/com/breadwallet/tools/others/CurrencyManager.java

@ -174,7 +174,8 @@ public class CurrencyManager {
double result = target * 1000000 / current;
// Log.e(TAG, "result of the exchange rate calculation: " + result);
DecimalFormat decimalFormat = new DecimalFormat("0.00");
String finalResult = getFormattedCurrencyString(iso, "1") + " = " + bitcoinLowecase + decimalFormat.format(result);
String finalResult = getFormattedCurrencyString(iso, "1") + " = " + bitcoinLowecase +
decimalFormat.format(result);
return finalResult;
}

5
app/src/main/java/com/breadwallet/tools/others/PListReader.java → app/src/main/java/com/breadwallet/tools/others/WordsReader.java

@ -13,9 +13,9 @@ import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class PListReader {
public class WordsReader {
public static final String TAG = PListReader.class.getName();
public static final String TAG = WordsReader.class.getName();
public static final int WORD_LIST_SIZE = 2048;
public static List<String> getWordList(Context context) throws IOException {
@ -42,7 +42,6 @@ public class PListReader {
if (wordList.size() != WORD_LIST_SIZE)
throw new IllegalArgumentException("The list should have " + WORD_LIST_SIZE + " items");
return wordList;
}
}

28
app/src/main/java/com/breadwallet/wallet/BRAddress.java

@ -0,0 +1,28 @@
package com.breadwallet.wallet;
/**
* BreadWallet
* <p/>
* Created by Mihail on 9/23/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
public class BRAddress {
}

28
app/src/main/java/com/breadwallet/wallet/BRMasterPubKey.java

@ -0,0 +1,28 @@
package com.breadwallet.wallet;
/**
* BreadWallet
* <p/>
* Created by Mihail on 9/23/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
public class BRMasterPubKey {
}

28
app/src/main/java/com/breadwallet/wallet/BRTransaction.java

@ -0,0 +1,28 @@
package com.breadwallet.wallet;
/**
* BreadWallet
* <p/>
* Created by Mihail on 9/23/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
public class BRTransaction {
}

70
app/src/main/java/com/breadwallet/wallet/BRWallet.java

@ -0,0 +1,70 @@
package com.breadwallet.wallet;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.util.List;
/**
* BreadWallet
* <p/>
* Created by Mihail on 9/23/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
public class BRWallet {
public static final String TAG = BRWallet.class.getName();
public ByteBuffer walletBuff;
private BRWallet() {
}
public static BRWallet createFromBytes(byte[] bytes) throws IOException {
final BRWallet wallet = new BRWallet();
final ByteBuffer buf = ByteBuffer.wrap(bytes);
wallet.walletBuff = buf;
// If needed: buf.order(ByteOrder.LITTLE_ENDIAN);
// Example to convert unsigned short to a positive int
return wallet;
}
public native long walletBalance();
public native List<BRUTXO> walletUTXOs();
public native List<BRTransaction> walletTransactions();
public native long walletTotalSent();
public native long walletTotalReceived();
public native void walletSetFeePerKb();
private class BRUTXO {
BigInteger hash;
int n;
}
}

206
app/src/main/java/com/breadwallet/wallet/BRWalletManager.java

@ -0,0 +1,206 @@
package com.breadwallet.wallet;
import java.nio.ByteBuffer;
import java.text.NumberFormat;
import java.util.List;
/**
* BreadWallet
* <p/>
* Created by Mihail on 9/22/15.
* Copyright (c) 2015 Mihail Gutan <mihail@breadwallet.com>
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
public class BRWalletManager {
public static final String TAG = BRWalletManager.class.getName();
private static BRWalletManager instance;
public static final long SATOSHIS = 100000000;
public static final long MAX_MONEY = 21000000 * SATOSHIS;
public static final long DEFAULT_FEE_PER_KB = 4096 * 1000 / 225; // fee required by eligius pool, which supports child-pays-for-parent
public static final long MAX_FEE_PER_KB = 100100 * 1000 / 225; // slightly higher than a 1000bit fee on a typical 225byte transaction
public static final String UNSPENT_URL_1 = "https://api.chain.com/v2/"; // + a string
public static final String UNSPENT_URL_2 = "/addresses/"; // + a string
public static final String UNSPENT_URL_3 = "/unspents?api-key-id=eed0d7697a880144bb854676f88d123f";
public static final String TICKER_URL = "https://bitpay.com/rates";
public static final String FEE_PER_KB_URL = "https://api.breadwallet.com/v1/fee-per-kb";
public static final int SEED_ENTROPY_LENGTH = 128 / 8;
public static final String SEC_ATTR_SERVICE = "org.voisine.breadwallet";
ByteBuffer masterPublicKey; // master public key used to generate wallet addresses
char[] seedPhrase; // requesting seedPhrase will trigger authentication
long seedCreationTime; // interval since reference date, 00:00:00 01/01/01 GMT
long secureTime; // last known time from an ssl server connection
long spendingLimit; // amount that can be spent using touch id without pin entry
boolean passcodeEnabled; // true if device passcode is enabled
boolean didAuthenticate; // true if the user authenticated after this was last set to false
NumberFormat format; // bitcoin currency formatter
NumberFormat localFormat; // local currency formatter
String localCurrencyCode; // local currency ISO code
double localCurrencyPrice; // exchange rate in local currency units per bitcoin
List<String> currencyCodes; // list of supported local currency codes
List<String> currencyNames; // names for local currency codes
private BRWalletManager() {
/**
* initialize the class
*/
}
public static synchronized BRWalletManager getInstance() {
if (instance == null) {
instance = new BRWalletManager();
}
return instance;
}
public BRWallet wallet() {
return null;
}
public static boolean setKeychainData(ByteBuffer buffer, String key, boolean authenticated) {
return false;
}
public static ByteBuffer getKeychainData(String key) {
return null;
}
public static boolean setKeychainInt(long i, String key, boolean authenticated) {
return false;
}
public static long getKeychainInt(String key) {
return 0;
}
public static boolean setKeychainString(String s, String key, boolean authenticated) {
return false;
}
public static String getKeychainString(String key) {
return null;
}
/**
* generates a random seed, saves to keychain and returns the associated seedPhrase
*/
public String generateRandomSeed() {
return null;
}
/**
* authenticates user and returns seed
*/
public ByteBuffer seedWithPrompt(String authPrompt, long amount) {
return null;
}
/**
* authenticates user and returns seedPhrase
*/
public String seedPhraseWithPrompt(String authPrompt) {
return null;
}
/**
* prompts the user to set or change wallet pin and returns true if the pin was successfully set
*/
public boolean setPin() {
return false;
}
/**
* queries chain.com and calls the completion block with unspent outputs for the given address
*/
public void utxosForAddress(String address) {
//?????????????????????????????
}
/**
* given a private key, queries chain.com for unspent outputs and calls the completion block with
* a signed transaction that will sweep the balance into wallet (doesn't publish the tx)
*/
public void sweepPrivateKey(String privKey, boolean fee) {
//?????????????????????????????
}
public long amountForString(String string) {
return 0;
}
public String stringForAmount(long amount) {
return null;
}
public long amountForLocalCurrencyString(String string) {
return 0;
}
public String localCurrencyStringForAmount(long amount) {
return null;
}
/**
* true if keychain is available and we know that no wallet exists on it
*/
public boolean noWallet() {
return false;
}
/**
* master public key used to generate wallet addresses
*/
public ByteBuffer masterPublicKey() {
return null;
}
/**
* requesting seedPhrase will trigger authentication
*/
public String seedPhrase() {
return null;
}
public void setSeedPhrase(char[] seedPhrase) {
}
/**
* interval since refrence date, 00:00:00 01/01/01 GMT
*/
public long seedCreationTime() {
return 0;
}
/**
* true if device passcode is enabled
*/
public boolean isPasscodeEnabled() {
return false;
}
public void updateFeePerKb(){
}
}

12
app/src/main/res/layouts/activities/layout/activity_main.xml

@ -130,4 +130,16 @@
android:src="@drawable/circle_indicator" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="testnet"
android:textColor="@color/dark_red"
android:alpha="0.7"
android:id="@+id/testnet"
android:padding="20dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>

BIN
app/src/main/res/raw/coinflip.mp3

Binary file not shown.
Loading…
Cancel
Save