Skip to content

Commit c9695c3

Browse files
authored
Merge pull request #415 from WalletConnect/develop
RC.5
2 parents f6dff52 + f92bd60 commit c9695c3

File tree

756 files changed

+10929
-3952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

756 files changed

+10929
-3952
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Relay Integration Tests'
2+
description: 'Runs Kotlin SDK integration tests with Relay server'
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
# Necessary to macos-latest to update to Java 11, and to enable caching gradle files for quicker execution
8+
- name: Setup Java JDK
9+
uses: actions/[email protected]
10+
with:
11+
distribution: 'zulu'
12+
java-version: '11'
13+
architecture: x86_64
14+
cache: 'gradle'
15+
16+
- name: Relay integration tests
17+
# TODO: Add SDK_VERSION env var
18+
shell: bash
19+
run: ./gradlew :foundation:test --tests "com.walletconnect.foundation.RelayTest" -i

.github/workflows/ci_relay.yml

Lines changed: 33 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,33 @@
1-
#name: Relay Integration
2-
#
3-
#
4-
## IMPORTANT. GHA only for demo purposes.
5-
#on:
6-
# push:
7-
# branches:
8-
# - feature/sign/instrumented_tests
9-
# pull_request:
10-
# branches:
11-
# - feature/sign/instrumented_tests
12-
#
13-
#concurrency:
14-
# # Support push/pr as event types with different behaviors each:
15-
# # 1. push: queue up builds by branch
16-
# # 2. pr: only allow one run per PR
17-
# group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}
18-
# # If there is already a workflow running for the same pull request, cancel it
19-
# # For non-PR triggers queue up builds
20-
# cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21-
#
22-
#jobs:
23-
# validate:
24-
# runs-on: macos-latest
25-
# steps:
26-
# - name: Checkout
27-
# uses: actions/checkout@v2
28-
# - name: Setup Java JDK
29-
# uses: actions/[email protected]
30-
# with:
31-
# distribution: 'zulu'
32-
# java-version: '11'
33-
# architecture: x86_64
34-
# - name: Instrumentation tests
35-
# env:
36-
# TEST_RELAY_URL: wss://relay.walletconnect.com
37-
# TEST_PROJECT_ID: 2ee94aca5d98e6c05c38bce02bee952a
38-
# uses: reactivecircus/android-emulator-runner@v2
39-
# with:
40-
# api-level: 32
41-
# arch: x86_64
42-
# target: google_apis
43-
# script: ./gradlew :sign:connectedCheck
1+
name: Relay Integration Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
pull_request:
9+
branches:
10+
- develop
11+
- master
12+
13+
concurrency:
14+
# Support push/pr as event types with different behaviors each:
15+
# 1. push: queue up builds by branch
16+
# 2. pr: only allow one run per PR
17+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}
18+
# If there is already a workflow running for the same pull request, cancel it
19+
# For non-PR triggers queue up builds
20+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21+
22+
jobs:
23+
integration_tests:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
29+
- name: Run Relay CI
30+
env:
31+
TEST_RELAY_URL: wss://relay.walletconnect.com
32+
TEST_PROJECT_ID: ${{ secrets.WC_CLOUD_PROJECT_ID }}
33+
uses: ./.github/actions/ci_relay

.github/workflows/android.yml renamed to .github/workflows/ci_sdks.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Android Test and deploy
1+
name: SDKs Unit Tests
22

33
on:
44
push:
@@ -24,17 +24,26 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- uses: actions/checkout@v2
27-
- name: Unit tests
27+
28+
- name: Cache Gradle
29+
uses: actions/cache@v3
30+
with:
31+
path: |
32+
~/.gradle/caches
33+
~/.gradle/wrapper
34+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
35+
restore-keys: |
36+
${{ runner.os }}-gradle-
37+
38+
- name: Sign Unit tests
39+
env:
40+
WC_CLOUD_PROJECT_ID: ${{ secrets.WC_CLOUD_PROJECT_ID }}
41+
run: ./gradlew :sign:sdk:testDebugUnitTest
42+
43+
- name: Auth Unit tests
2844
env:
2945
WC_CLOUD_PROJECT_ID: ${{ secrets.WC_CLOUD_PROJECT_ID }}
30-
run: ./gradlew test
31-
# android_tests:
32-
# runs-on: macos-latest
33-
# steps:
34-
# - uses: actions/checkout@v2
35-
#
36-
# - name: Instrumentation Tests
37-
# uses: reactivecircus/android-emulator-runner@v2
38-
# with:
39-
# api-level: 29
40-
# script: ./gradlew walletconnectv2:connectedAndroidTest
46+
run: ./gradlew :auth:sdk:testDebugUnitTest
47+
48+
- name: Stop Gradle
49+
run: ./gradlew --stop

ReadMe.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
The communications protocol for web3, WalletConnect brings the ecosystem together by enabling hundreds of wallets and apps to securely connect and interact. This repository contains Kotlin implementation of
66
WalletConnect v2 protocols for Android applications.
77

8-
## Protocols
8+
## SDks
99

10-
* [Sign SDK](https://github.com/WalletConnect/WalletConnectKotlinV2/tree/develop/signSDK)
11-
* [Chat SDK](https://github.com/WalletConnect/WalletConnectKotlinV2/tree/develop/chatSDK)
10+
* [Core SDK](https://github.com/WalletConnect/WalletConnectKotlinV2/tree/develop/androidCore)
11+
* [Sign SDK](https://github.com/WalletConnect/WalletConnectKotlinV2/tree/develop/sign)
12+
* [Auth SDK](https://github.com/WalletConnect/WalletConnectKotlinV2/tree/develop/auth)
1213

1314
## License
1415
WalletConnect v2 is released under the Apache 2.0 license. [See LICENSE](https://github.com/WalletConnect/WalletConnectKotlinV2/blob/feature/develop/LICENSE) for details.

androidCore/ReadMe.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# **WalletConnect Core - Android**
2+
3+
Kotlin implementation of WalletConnect Core SDK for Android applications.
4+
5+
![Maven Central](https://img.shields.io/maven-central/v/com.walletconnect/android-core)
6+
7+
## Requirements
8+
9+
* Android min SDK 23
10+
* Java 11
11+
12+
## Documentation and usage
13+
14+
* [Installation guide](https://docs.walletconnect.com/2.0/kotlin/guides/relay)
15+
16+
 
17+
18+
## Installation
19+
20+
root/build.gradle.kts:
21+
22+
```gradle
23+
allprojects {
24+
repositories {
25+
mavenCentral()
26+
}
27+
}
28+
```
29+
30+
app/build.gradle.kts
31+
32+
```gradle
33+
implementation("com.walletconnect:android-core:release_version")
34+
```
35+
36+
## Project ID
37+
38+
For the Project ID look at [Project ID](https://walletconnect.com/).
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
plugins {
2+
id("com.android.library")
3+
kotlin("android")
4+
id("com.google.devtools.ksp") version kspVersion
5+
id("com.squareup.sqldelight")
6+
id("publish-module-android")
7+
}
8+
9+
project.apply {
10+
extra[KEY_PUBLISH_ARTIFACT_ID] = "android-core-common"
11+
extra[KEY_PUBLISH_VERSION] = "1.0.0"
12+
extra[KEY_SDK_NAME] = "Android Core Common"
13+
}
14+
15+
android {
16+
compileSdk = COMPILE_SDK
17+
18+
defaultConfig {
19+
minSdk = MIN_SDK
20+
targetSdk = TARGET_SDK
21+
22+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
23+
consumerProguardFiles("consumer-rules.pro")
24+
}
25+
26+
buildTypes {
27+
release {
28+
isMinifyEnabled = false
29+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
30+
}
31+
}
32+
33+
compileOptions {
34+
sourceCompatibility = jvmVersion
35+
targetCompatibility = jvmVersion
36+
}
37+
38+
kotlinOptions {
39+
jvmTarget = jvmVersion.toString()
40+
freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.time.ExperimentalTime"
41+
}
42+
}
43+
44+
sqldelight {
45+
database("Database") {
46+
packageName = "com.walletconnect.android.impl"
47+
}
48+
}
49+
50+
dependencies {
51+
debugApi(project(":foundation"))
52+
releaseApi("com.walletconnect:foundation:1.0.0")
53+
54+
bouncyCastle()
55+
coroutines()
56+
moshiKsp()
57+
moshi()
58+
scarlet()
59+
scarletAndroid()
60+
sqlDelightAndroid()
61+
sqlCipher()
62+
security()
63+
koinAndroid()
64+
multibaseJava()
65+
timber()
66+
67+
jUnit5()
68+
jUnit5Android()
69+
mockk()
70+
}
File renamed without changes.
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.walletconnect.android.common">
4+
5+
</manifest>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
package com.walletconnect.sign.core.model.vo.jsonRpc
1+
package com.walletconnect.android.common
22

33
import com.squareup.moshi.JsonClass
44

5-
internal sealed class JsonRpcResponseVO {
5+
sealed class JsonRpcResponse : SerializableJsonRpc {
66
abstract val id: Long
77

8-
@JsonClass(generateAdapter = true)
9-
internal data class JsonRpcResult(
8+
@JsonClass(generateAdapter = false)
9+
data class JsonRpcResult(
1010
override val id: Long,
1111
val jsonrpc: String = "2.0",
1212
val result: Any,
13-
) : JsonRpcResponseVO()
13+
) : JsonRpcResponse()
1414

1515
@JsonClass(generateAdapter = true)
16-
internal data class JsonRpcError(
16+
data class JsonRpcError(
1717
override val id: Long,
1818
val jsonrpc: String = "2.0",
1919
val error: Error,
20-
) : JsonRpcResponseVO() {
20+
) : JsonRpcResponse() {
2121
val errorMessage: String = "${error.message} : code: ${error.code}"
2222
}
2323

24-
internal data class Error(
24+
data class Error(
2525
val code: Int,
2626
val message: String,
2727
)

0 commit comments

Comments
 (0)