@solana-mobile/seed-vault-lib 0.3.0 → 0.3.3-hotfix.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +157 -150
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradle.properties +1 -1
- package/android/gradlew +185 -185
- package/android/settings.gradle +7 -0
- package/android/src/main/java/com/solanamobile/seedvault/reactnative/SolanaMobileSeedVaultLibModule.kt +623 -585
- package/lib/esm/index.js +11 -6
- package/lib/esm/index.native.js +11 -6
- package/lib/types/index.d.ts +13 -3
- package/lib/types/index.native.d.ts +13 -3
- package/package.json +44 -44
- package/.gitignore +0 -2
- package/android/.gitignore +0 -14
- package/src/index.ts +0 -3
- package/src/seedVaultEvent.ts +0 -101
- package/src/types.ts +0 -108
- package/src/useSeedVault.ts +0 -98
- package/tsconfig.cjs.json +0 -7
- package/tsconfig.json +0 -8
- package/yarn.lock +0 -611
package/android/build.gradle
CHANGED
|
@@ -1,150 +1,157 @@
|
|
|
1
|
-
buildscript {
|
|
2
|
-
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
-
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['SolanaMobileSeedVaultLibModule_kotlinVersion']
|
|
4
|
-
|
|
5
|
-
repositories {
|
|
6
|
-
google()
|
|
7
|
-
mavenCentral()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
dependencies {
|
|
11
|
-
classpath 'com.android.tools.build:gradle:
|
|
12
|
-
// noinspection DifferentKotlinGradleVersion
|
|
13
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
-
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
def isNewArchitectureEnabled() {
|
|
19
|
-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
apply plugin: 'com.android.library'
|
|
23
|
-
apply plugin: 'kotlin-android'
|
|
24
|
-
apply plugin: 'kotlinx-serialization'
|
|
25
|
-
|
|
26
|
-
if (isNewArchitectureEnabled()) {
|
|
27
|
-
apply plugin: 'com.facebook.react'
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
def getExtOrDefault(name) {
|
|
31
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['SolanaMobileSeedVaultLibModule_' + name]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
def getExtOrIntegerDefault(name) {
|
|
35
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['SolanaMobileSeedVaultLibModule_' + name]).toInteger()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
android {
|
|
39
|
-
namespace "com.solanamobile.seedvault.reactnative"
|
|
40
|
-
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
41
|
-
|
|
42
|
-
defaultConfig {
|
|
43
|
-
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
44
|
-
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
45
|
-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
46
|
-
}
|
|
47
|
-
buildTypes {
|
|
48
|
-
release {
|
|
49
|
-
minifyEnabled false
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
lintOptions {
|
|
54
|
-
disable 'GradleCompatible'
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
compileOptions {
|
|
58
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
59
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
repositories {
|
|
64
|
-
mavenCentral()
|
|
65
|
-
google()
|
|
66
|
-
|
|
67
|
-
def found = false
|
|
68
|
-
def defaultDir = null
|
|
69
|
-
def androidSourcesName = 'React Native sources'
|
|
70
|
-
|
|
71
|
-
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
72
|
-
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
73
|
-
} else {
|
|
74
|
-
defaultDir = new File(
|
|
75
|
-
projectDir,
|
|
76
|
-
'/../../../node_modules/react-native/android'
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (defaultDir.exists()) {
|
|
81
|
-
maven {
|
|
82
|
-
url defaultDir.toString()
|
|
83
|
-
name androidSourcesName
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
87
|
-
found = true
|
|
88
|
-
} else {
|
|
89
|
-
def parentDir = rootProject.projectDir
|
|
90
|
-
|
|
91
|
-
1.upto(5, {
|
|
92
|
-
if (found) return true
|
|
93
|
-
parentDir = parentDir.parentFile
|
|
94
|
-
|
|
95
|
-
def androidSourcesDir = new File(
|
|
96
|
-
parentDir,
|
|
97
|
-
'node_modules/react-native'
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
def androidPrebuiltBinaryDir = new File(
|
|
101
|
-
parentDir,
|
|
102
|
-
'node_modules/react-native/android'
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
if (androidPrebuiltBinaryDir.exists()) {
|
|
106
|
-
maven {
|
|
107
|
-
url androidPrebuiltBinaryDir.toString()
|
|
108
|
-
name androidSourcesName
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
112
|
-
found = true
|
|
113
|
-
} else if (androidSourcesDir.exists()) {
|
|
114
|
-
maven {
|
|
115
|
-
url androidSourcesDir.toString()
|
|
116
|
-
name androidSourcesName
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
120
|
-
found = true
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (!found) {
|
|
126
|
-
throw new GradleException(
|
|
127
|
-
"${project.name}: unable to locate React Native android sources. " +
|
|
128
|
-
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
134
|
-
|
|
135
|
-
dependencies {
|
|
136
|
-
//noinspection GradleDynamicVersion
|
|
137
|
-
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
138
|
-
implementation '
|
|
139
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
140
|
-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
|
|
141
|
-
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
react
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
1
|
+
buildscript {
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['SolanaMobileSeedVaultLibModule_kotlinVersion']
|
|
4
|
+
|
|
5
|
+
repositories {
|
|
6
|
+
google()
|
|
7
|
+
mavenCentral()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dependencies {
|
|
11
|
+
classpath 'com.android.tools.build:gradle:8.12.0'
|
|
12
|
+
// noinspection DifferentKotlinGradleVersion
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
def isNewArchitectureEnabled() {
|
|
19
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
apply plugin: 'com.android.library'
|
|
23
|
+
apply plugin: 'kotlin-android'
|
|
24
|
+
apply plugin: 'kotlinx-serialization'
|
|
25
|
+
|
|
26
|
+
if (isNewArchitectureEnabled()) {
|
|
27
|
+
apply plugin: 'com.facebook.react'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def getExtOrDefault(name) {
|
|
31
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['SolanaMobileSeedVaultLibModule_' + name]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
def getExtOrIntegerDefault(name) {
|
|
35
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['SolanaMobileSeedVaultLibModule_' + name]).toInteger()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
android {
|
|
39
|
+
namespace "com.solanamobile.seedvault.reactnative"
|
|
40
|
+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
41
|
+
|
|
42
|
+
defaultConfig {
|
|
43
|
+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
44
|
+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
45
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
46
|
+
}
|
|
47
|
+
buildTypes {
|
|
48
|
+
release {
|
|
49
|
+
minifyEnabled false
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
lintOptions {
|
|
54
|
+
disable 'GradleCompatible'
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
compileOptions {
|
|
58
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
59
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
repositories {
|
|
64
|
+
mavenCentral()
|
|
65
|
+
google()
|
|
66
|
+
|
|
67
|
+
def found = false
|
|
68
|
+
def defaultDir = null
|
|
69
|
+
def androidSourcesName = 'React Native sources'
|
|
70
|
+
|
|
71
|
+
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
72
|
+
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
73
|
+
} else {
|
|
74
|
+
defaultDir = new File(
|
|
75
|
+
projectDir,
|
|
76
|
+
'/../../../node_modules/react-native/android'
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (defaultDir.exists()) {
|
|
81
|
+
maven {
|
|
82
|
+
url defaultDir.toString()
|
|
83
|
+
name androidSourcesName
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
87
|
+
found = true
|
|
88
|
+
} else {
|
|
89
|
+
def parentDir = rootProject.projectDir
|
|
90
|
+
|
|
91
|
+
1.upto(5, {
|
|
92
|
+
if (found) return true
|
|
93
|
+
parentDir = parentDir.parentFile
|
|
94
|
+
|
|
95
|
+
def androidSourcesDir = new File(
|
|
96
|
+
parentDir,
|
|
97
|
+
'node_modules/react-native'
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def androidPrebuiltBinaryDir = new File(
|
|
101
|
+
parentDir,
|
|
102
|
+
'node_modules/react-native/android'
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
if (androidPrebuiltBinaryDir.exists()) {
|
|
106
|
+
maven {
|
|
107
|
+
url androidPrebuiltBinaryDir.toString()
|
|
108
|
+
name androidSourcesName
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
112
|
+
found = true
|
|
113
|
+
} else if (androidSourcesDir.exists()) {
|
|
114
|
+
maven {
|
|
115
|
+
url androidSourcesDir.toString()
|
|
116
|
+
name androidSourcesName
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
120
|
+
found = true
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (!found) {
|
|
126
|
+
throw new GradleException(
|
|
127
|
+
"${project.name}: unable to locate React Native android sources. " +
|
|
128
|
+
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
134
|
+
|
|
135
|
+
dependencies {
|
|
136
|
+
//noinspection GradleDynamicVersion
|
|
137
|
+
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
138
|
+
implementation project(path: ':seedvault')
|
|
139
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
140
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
|
|
141
|
+
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
|
|
142
|
+
// we cannot use the latest version of these dependencies. React native versions are tightly
|
|
143
|
+
// coupled with kotlin versions. If we use the latest versions of these deps that reply on
|
|
144
|
+
// kotlin 2.1+, react native builds break.
|
|
145
|
+
// These are the highest versions found to work with react native 0.76 and higher. Leaving
|
|
146
|
+
// the above versions for now for maximum compatibility.
|
|
147
|
+
// implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
|
|
148
|
+
// implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (isNewArchitectureEnabled()) {
|
|
152
|
+
react {
|
|
153
|
+
jsRootDir = file("../src/")
|
|
154
|
+
libraryName = "SolanaMobileWSeedVaultLibModule"
|
|
155
|
+
codegenJavaPackageName = "com.solanamobile.SeedVault.reactnative"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
|
4
4
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
5
|
zipStorePath=wrapper/dists
|