Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
9a65f46
add pos module
jakubuid Aug 20, 2025
c23099d
add POSClient
jakubuid Aug 20, 2025
a172a86
core POS flow logic
jakubuid Aug 20, 2025
a8a55ba
add disconnect
jakubuid Aug 20, 2025
9f6162a
add pos sample module
jakubuid Aug 20, 2025
4d1a3d3
add initialization logic
jakubuid Aug 20, 2025
66dcdf7
add navigation
jakubuid Aug 21, 2025
a220896
add start screen and amount screen
jakubuid Aug 21, 2025
6d56508
add token screen
jakubuid Aug 21, 2025
dd532c4
Add network selection screen
jakubuid Aug 21, 2025
0480552
Add payment screen
jakubuid Aug 21, 2025
67be79b
clean up the POSClient
jakubuid Aug 22, 2025
95385ce
Add error screen
jakubuid Aug 22, 2025
7cd7301
update errors navigation
jakubuid Aug 22, 2025
1bc893e
Add chain intents validation
jakubuid Aug 25, 2025
33621bb
Add bc api with types
jakubuid Aug 26, 2025
a6368fc
Add check status endpoint
jakubuid Aug 26, 2025
875dcf2
update
jakubuid Aug 26, 2025
e4bbe47
update read me
jakubuid Sep 1, 2025
f77c09f
update
jakubuid Sep 1, 2025
5a54313
update example json
jakubuid Sep 1, 2025
d4dec20
remove firebase dependencies and init the pos sdk on the background t…
jakubuid Sep 2, 2025
9ef038c
endpoints integration
jakubuid Sep 2, 2025
eb01c24
handle on disconnect
jakubuid Sep 2, 2025
73b3b40
check tx status use case
jakubuid Sep 2, 2025
881ee84
build transaction use case
jakubuid Sep 2, 2025
d11fb8c
clean up
jakubuid Sep 2, 2025
8c50791
simplify the flow
jakubuid Sep 2, 2025
db8c081
use fake token
jakubuid Sep 5, 2025
6af196f
Merge branch 'develop' of https://github.com/reown-com/reown-kotlin i…
jakubuid Sep 9, 2025
5215d1c
merge corrections
jakubuid Sep 9, 2025
d0534cb
adjust to the new endpoints changes
jakubuid Sep 9, 2025
de8a93a
adapt to the new payloads
jakubuid Sep 10, 2025
67d9280
Merge branch 'develop' of https://github.com/reown-com/reown-kotlin i…
jakubuid Oct 8, 2025
26339e2
Merge branch 'develop' of https://github.com/reown-com/reown-kotlin i…
jakubuid Oct 13, 2025
7fd34ea
add dynamic token selection
jakubuid Oct 13, 2025
db96396
add support for more networks and stable coins
jakubuid Oct 13, 2025
6fd7eef
add multiple intents validation
jakubuid Oct 13, 2025
d9861a4
build namespaces
jakubuid Oct 14, 2025
099b845
build namespaces
jakubuid Oct 14, 2025
4387b1b
filter sign namespaces
jakubuid Oct 14, 2025
63bb130
reset loader
jakubuid Oct 14, 2025
ecc209e
change recipient
jakubuid Oct 14, 2025
f01f732
handle solana transactions
jakubuid Oct 14, 2025
ed38dec
clean up logs
jakubuid Oct 14, 2025
9dcff77
clean ups
jakubuid Oct 15, 2025
2518353
fix types
jakubuid Oct 15, 2025
be5bc53
remove logs
jakubuid Oct 15, 2025
29be259
clean up deps
jakubuid Oct 15, 2025
74ee901
fix builds
jakubuid Oct 15, 2025
ac80348
add recipient to the success result
jakubuid Oct 27, 2025
e17eacb
add recipient edit text
jakubuid Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ captures/
.idea/dictionaries
.idea/libraries
.idea/jarRepositories.xml
.idea/codeStyles/Project.xml
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
!.idea/codeStyles/**
!.idea/editor.xml
!/.idea/inspectionProfiles

Expand Down
35 changes: 35 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 111 additions & 10 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ The Reown Kotlin SDK is organized as a modular system with several layers:
5. **Sample Applications**: Example implementations
- `sample/wallet/`: Wallet sample application
- `sample/dapp/`: dApp sample application
- `sample/pos/`: POS sample application
- `sample/modal/`: Modal sample application

## Installation

Expand All @@ -66,13 +68,112 @@ dependencies {
}
```



## Sample Applications

The repository includes sample applications to demonstrate SDK usage:

- **Wallet Sample**: Demonstrates how to build a wallet application using WalletKit
- **dApp Sample**: Shows how to build a dApp that connects to wallets using AppKit

Check the `sample/` directory for complete implementations.
## Building Sample Applications

The repository includes several sample applications that demonstrate different use cases of the Reown Kotlin SDK. Follow these instructions to build and run the sample apps:

### Prerequisites

- Android Studio Arctic Fox or later
- Android SDK API level 21 or higher
- Gradle 7.0 or later
- JDK 11 or later

### Setup Steps
1. **Configure Keystore Properties**
Create a `secrets.properties` file in the root directory with empty strings:
```properties
WC_KEYSTORE_ALIAS=""
WC_KEYSTORE_ALIAS_DEBUG=""
WC_FILENAME_DEBUG=""
WC_STORE_PASSWORD_DEBUG=""
WC_KEY_PASSWORD_DEBUG=""
WC_FILENAME_INTERNAL=""
WC_STORE_PASSWORD_INTERNAL=""
WC_KEY_PASSWORD_INTERNAL=""
WC_FILENAME_UPLOAD=""
WC_STORE_PASSWORD_UPLOAD=""
WC_KEY_PASSWORD_UPLOAD=""
```

2. **Configure Google Services**
Each sample app requires a `google-services.json` file in its `src` directory. The file should contain:
- `mobilesdk_app_id`: Your Firebase project ID
- `package_name`: The sample app's package name
- `api_key`: Your Firebase API key

**Example `google-services.json` file:**
```json
{
"project_info": {
"project_number": "1234567890",
"project_id": "dummy-project-id",
"storage_bucket": "dummy-project-id.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1234567890:android:abcdef123456",
"android_client_info": {
"package_name": "com.reown.sample.{sample_name}.debug"
}
},
"oauth_client": [
{
"client_id": "1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaDummyKeyForSample123456"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
```

**Note:** Replace `{sample_name}` with the actual sample name: `wallet`, `dapp`, `pos`, or `modal`. You need to create this file for each sample app you want to build. Use the example content if you want to just build samples locally.

### Available Sample Apps

#### Wallet Sample (`sample/wallet/`)
- **Purpose**: Demonstrates a complete wallet implementation
- **Package**: `com.reown.sample.wallet`
- **Build Command**: `./gradlew :sample:wallet:assembleDebug`

#### dApp Sample (`sample/dapp/`)
- **Purpose**: Shows how to build a dApp that connects to wallets
- **Package**: `com.reown.sample.dapp`
- **Build Command**: `./gradlew :sample:dapp:assembleDebug`

#### POS Sample (`sample/pos/`)
- **Purpose**: Point of Sale application example
- **Package**: `com.reown.sample.pos`
- **Build Command**: `./gradlew :sample:pos:assembleDebug`

#### Modal Sample (`sample/modal/`)
- **Purpose**: Modal UI integration example
- **Package**: `com.reown.sample.modal`
- **Build Command**: `./gradlew :sample:modal:assembleDebug`

### Build Commands

- **Build all samples**: `./gradlew :sample:assembleDebug`
- **Build specific sample**: `./gradlew :sample:{sample_name}:assembleDebug`
- **Install on device**: `./gradlew :sample:{sample_name}:installDebug`
- **Run tests**: `./gradlew :sample:{sample_name}:testDebugUnitTest`

### Troubleshooting

- **Build errors**: Ensure all dependencies are synced with `./gradlew build`
- **Keystore issues**: Verify `secrets.properties` contains valid keystore information
- **Google Services**: Ensure `google-services.json` is properly configured for each sample
- **Gradle sync**: Try `./gradlew clean` followed by `./gradlew build`
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const val NOTIFY_VERSION = "1.4.11"
const val WALLETKIT_VERSION = "1.4.11"
const val APPKIT_VERSION = "1.4.11"
const val MODAL_CORE_VERSION = "1.4.11"
const val POS_VERSION = "1.0.0"

//Artifact ids
const val ANDROID_BOM = "android-bom"
Expand All @@ -23,6 +24,7 @@ const val NOTIFY = "notify"
const val WALLETKIT = "walletkit"
const val APPKIT = "appkit"
const val MODAL_CORE = "modal-core"
const val POS = "pos"

val jvmVersion = JavaVersion.VERSION_11
const val MIN_SDK: Int = 23
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/release-scripts.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ fun compileListOfSDKs(): List<Triple<String, String?, String>> = mutableListOf(
Triple("protocol", "sign", "android"),
Triple("protocol", "notify", "android"),
Triple("product", "walletkit", "android"),
Triple("product", "appkit", "android")
Triple("product", "appkit", "android"),
Triple("product", "pos", "android")
).apply {
// The BOM has to be last artifact
add(Triple("core", "bom", "jvm"))
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/signing-config.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.android.build.gradle.BaseExtension
import com.google.firebase.appdistribution.gradle.firebaseAppDistribution
import com.android.build.gradle.BaseExtension
import java.util.Properties

plugins {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ enum class AndroidCommonDITags {
ENABLE_AUTHENTICATE,
TELEMETRY_ENABLED,
PACKAGE_NAME,
POC_RETROFIT,
POC_OK_HTTP
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ internal class PairingEngine(
crypto.removeKeys(pairingTopic.value)
pairingRepository.deletePairing(pairingTopic)
metadataRepository.deleteMetaData(pairingTopic)
jsonRpcInteractor.unsubscribe(pairingTopic)
logger.error("Pairing - subscribed failure on pairing topic: $pairingTopic, error: $throwable")
onFailure(throwable)
} catch (e: Exception) {
logger.error("Pairing - subscribed failure on pairing topic: $pairingTopic, error: $e")
Expand Down
1 change: 1 addition & 0 deletions core/bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ dependencies {
api(project(":protocol:notify"))
api(project(":product:appkit"))
api(project(":product:walletkit"))
api(project(":product:pos"))
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package com.reown.foundation.network.model

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import com.reown.foundation.common.adapters.SubscriptionIdAdapter
import com.reown.foundation.common.adapters.TopicAdapter
import com.reown.foundation.common.adapters.TtlAdapter
import com.reown.foundation.common.model.SubscriptionId
import com.reown.foundation.common.model.Topic
import com.reown.foundation.common.model.Ttl
import com.reown.foundation.network.model.RelayDTO.Publish.Request.Params
import com.reown.util.generateClientToServerId
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

sealed class RelayDTO {
abstract val id: Long
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ object Modal {

data class JsonRpcResult(
override val id: Long,
val result: String?,
val result: Any?,
) : JsonRpcResponse()

data class JsonRpcError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ internal class AppKitEngine(
val siweResponse = Modal.Model.SIWEAuthenticateResponse.Result(
id = response.result.id,
message = siweRequestIdWithMessage!!.second,
signature = (response.result as Sign.Model.JsonRpcResponse.JsonRpcResult).result ?: ""
signature = ((response.result as Sign.Model.JsonRpcResponse.JsonRpcResult).result ?: "") as? String ?: ""
)
siweRequestIdWithMessage = null
val account = getAccount() ?: throw IllegalStateException("Account is null")
Expand Down
1 change: 1 addition & 0 deletions product/pos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
79 changes: 79 additions & 0 deletions product/pos/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
plugins {
id("com.android.library")
id(libs.plugins.kotlin.android.get().pluginId)
alias(libs.plugins.google.ksp)
id("publish-module-android")
id("jacoco-report")
}

project.apply {
extra[KEY_PUBLISH_ARTIFACT_ID] = POS
extra[KEY_PUBLISH_VERSION] = POS_VERSION
extra[KEY_SDK_NAME] = "pos"
}

android {
namespace = "com.reown.pos"
compileSdk = COMPILE_SDK

defaultConfig {
minSdk = MIN_SDK

aarMetadata {
minCompileSdk = MIN_SDK
}

buildConfigField(type = "String", name = "SDK_VERSION", value = "\"${requireNotNull(extra.get(KEY_PUBLISH_VERSION))}\"")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

lint {
abortOnError = true
ignoreWarnings = true
warningsAsErrors = false
}

compileOptions {
sourceCompatibility = jvmVersion
targetCompatibility = jvmVersion
}

kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf("-XXLanguage:+PropertyParamAnnotationDefaultTargetMode")
}

buildFeatures {
buildConfig = true
}
}

dependencies {
debugImplementation(project(":core:android"))
debugImplementation(project(":protocol:sign"))

releaseImplementation("com.reown:android-core:$CORE_VERSION")
releaseImplementation("com.reown:sign:$SIGN_VERSION")

ksp(libs.moshi.ksp)

implementation(libs.androidx.core)
implementation(libs.androidx.appCompat)
implementation(libs.androidx.material)

testImplementation(libs.jUnit)

androidTestImplementation(libs.mockk.android)
androidTestImplementation(libs.coroutines.test)
androidTestImplementation(libs.core)

androidTestUtil(libs.androidx.testOrchestrator)
androidTestImplementation(libs.bundles.androidxAndroidTest)
}
Empty file added product/pos/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions product/pos/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
4 changes: 4 additions & 0 deletions product/pos/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
Loading
Loading