public void verifyTransactions(int index)
 {
     currentBtcAsset = index;
     StartCoroutine(BlockchainWebChecker.GetTransactionInfo_Coroutine(availableAssets[currentBtcAsset].transactionHashStr, GetTXHashCallback));
 }
Beispiel #2
0
 public void verifyTransactions()
 {
     transactionHashStr = InputField_TxHash.GetComponentInChildren <InputField>().text;
     StartCoroutine(BlockchainWebChecker.GetTransactionInfo_Coroutine(transactionHashStr, GetTXHashCallback));
 }
Beispiel #3
0
    void OnGUI()
    {
        float centerx = Screen.width / 2;
        //float centery = Screen.height / 2;

        float buttonWidth          = Screen.width / 3;
        float buttonHeight         = Screen.height / 20;
        float buttonSpacing        = buttonHeight * .10f;
        float buttonSpacer         = buttonHeight + buttonSpacing;
        float buttonVerticalOffset = Screen.height * .002f;

        GUI.Label(new Rect(centerx - (buttonWidth / 2), buttonVerticalOffset, buttonWidth, buttonHeight),
                  "Bitcoin SDK Game Client", labelStyle);



        //GUILayout.BeginArea(new Rect(
        //    (centerx * 0.5f) - (buttonWidth / 2),
        //    buttonVerticalOffset + (buttonSpacer * 1),
        //    buttonWidth, buttonHeight * 12));

        GUILayout.BeginArea(new Rect(
                                Screen.width * ((1f - .7f) / 2f),
                                buttonVerticalOffset + (buttonSpacer * 1),
                                buttonWidth * 2, buttonHeight * 12));

        if (GUILayout.Button("Get Exchange Rates", GUILayout.Height(buttonHeight)))
        {
            BlockchainWebChecker.instance.GetExchangeRates(GetExchangeRatesCallback);
        }


        //GUILayout.EndArea();

        //GUILayout.BeginArea(new Rect(
        //    (Screen.width * 0.75f) - (buttonWidth / 2),
        //    buttonVerticalOffset + (buttonSpacer * 1),
        //    buttonWidth, buttonHeight * 12));

        GUILayout.BeginHorizontal();
        GUILayout.Label("source currency:");
        sourceCurrencyTypeStr = GUILayout.TextField(sourceCurrencyTypeStr);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("source amount:");
        sourceCurrencyAmountStr = GUILayout.TextField(sourceCurrencyAmountStr);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("currency type:");
        currencyTypeStr = GUILayout.TextField(currencyTypeStr);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("currency amount:");
        currencyAmountStr = GUILayout.TextField(currencyAmountStr);
        GUILayout.EndHorizontal();



        GUILayout.Label("transaction notes:");
        transactionNotes = GUILayout.TextArea(transactionNotes, GUILayout.Height(buttonHeight));

        GUILayout.Label("send btc to wallet address:");
        sendToWalletAddress = GUILayout.TextArea(sendToWalletAddress, GUILayout.Height(buttonHeight));


        if (GUILayout.Button("Post Transactions Request Money", GUILayout.Height(buttonHeight)))
        {
            long amount = long.Parse(currencyAmountStr);
            //BitcoinIntegration.instance.StartRequest(sendToWalletAddress, amount, transactionNotes);
            BitcoinIntegration.instance.StartRequest(sendToWalletAddress, amount, transactionNotes, SendRequestCallback);

            //long amount = long.Parse(currencyAmountStr);
            //BitcoinIntegration.instance.StartRequest2(sendToWalletAddress, amount, transactionNotes);
        }


        GUILayout.Label("transaction hash (receipt):");
        transactionHashStr = GUILayout.TextArea(transactionHashStr, GUILayout.Height(buttonHeight));


        if (GUILayout.Button("Verify Transactions (complete)", GUILayout.Height(buttonHeight)))
        {
            //StartCoroutine(BlockchainWebChecker.GetTransactionInfo_Coroutine(BitcoinIntegration.instance.getCurrentTxHash(), GetTXHashCallback));
            StartCoroutine(BlockchainWebChecker.GetTransactionInfo_Coroutine(transactionHashStr, GetTXHashCallback));
        }

        GUILayout.EndArea();

        Rect scrollOuterRect = new Rect(Screen.width * ((1f - .7f) / 2f),
                                        Screen.height * (1.0f - .3f),
                                        Screen.width * .7f,
                                        Screen.height * .3f);

        Rect scrollInnerRect = new Rect(0f, 0f,
                                        Screen.width * .7f,
                                        Screen.height);

        scrollPosition = GUI.BeginScrollView(
            scrollOuterRect,
            //Rect (10,300,100,100),
            scrollPosition,
            //Rect (0, 0, 220, 200)
            scrollInnerRect
            );

        // use a callback, rather than constantly appending from another class...
        //messageLog = BitcoinIntegration.instance.messageLog;
        messageLog = GUI.TextArea(new Rect(0f, 0f, Screen.width, Screen.height),
                                  messageLog);

        GUI.EndScrollView();
    }
 void OnApplicationQuit()
 {
     _instance = null;
     DestroyImmediate(gameObject);
 }