Skip to content

Commit

Permalink
Merge pull request #53 from Bitcoin-com/poller-update
Browse files Browse the repository at this point in the history
update poller
  • Loading branch information
jchau207 authored Dec 30, 2024
2 parents 0d3663d + 8e3062e commit 75dfa2f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ proguard/
/captures
.externalNativeBuild
/.idea/
/apikey.properties
25 changes: 17 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ android {
applicationId "com.bitcoin.merchant.app"
minSdkVersion 21
targetSdkVersion 34
versionCode 50401
versionName "5.4.1"
versionCode 50402
versionName "5.4.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

def apikeyProps = new Properties()
file("apikey.properties").withInputStream { apikeyProps.load(it) }

// Access the API key and set the buildConfigField
def restApiKey = apikeyProps.getProperty("restApiKey")
if (restApiKey != null) {
buildConfigField("String", "API_KEY", "\"${restApiKey}\"")
}
}

buildFeatures {
Expand Down Expand Up @@ -73,26 +82,26 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// do NOT upgrade because zxing v3.4.0 requires min SDK 24 instead of SDK 21 currently used
implementation 'com.google.zxing:core:3.3.0'
implementation 'com.journeyapps:zxing-android-embedded:4.0.2@aar'
implementation 'com.journeyapps:zxing-android-embedded:4.2.0@aar'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.google.guava:guava:28.1-android'
implementation 'com.madgag.spongycastle:core:1.58.0.0'
implementation 'com.neovisionaries:nv-websocket-client:2.9'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'commons-io:commons-io:20030203.000550'
implementation 'commons-codec:commons-codec:20041127.091804'
implementation 'commons-codec:commons-codec:1.3'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'org.slf4j:slf4j-android:1.7.29'
implementation 'com.github.pokkst:bitcoincashj:0.17.5.2'
implementation "com.amplitude:android-sdk:2.24.2"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.6.1'
androidTestImplementation 'androidx.test:runner:1.6.2'
androidTestImplementation 'androidx.test:rules:1.6.1'
// Optional -- Hamcrest library
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
// Optional -- UI testing with UI Automator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.util.Log;

import com.bitcoin.merchant.app.BuildConfig;
import com.bitcoin.merchant.app.network.ExpectedAmounts;
import com.bitcoin.merchant.app.network.ExpectedPayments;
import com.bitcoin.merchant.app.network.PaymentReceived;
Expand Down Expand Up @@ -36,7 +37,7 @@ public class PollerSocket implements TxWebSocketHandler {
private WebSocketListener webSocketListener;
private final OkHttpClient okHttpClient;

private String BASE_URL = "https://rest.bch.actorforth.org/v2/address/utxo/";
private String BASE_URL = "https://bchrest.api.wombat.systems/v2/address/utxo/";

private ScheduledExecutorService executorService;

Expand Down Expand Up @@ -102,6 +103,7 @@ private Runnable createPollerTask() {
Request request = new Request.Builder()
.get()
.url(query)
.header("Authorization", BuildConfig.API_KEY)
.build();
Response execute = okHttpClient.newCall(request).execute();
JSONObject jsonObject = new JSONObject(execute.body().string());
Expand Down

0 comments on commit 75dfa2f

Please sign in to comment.