@solana-mobile/mobile-wallet-adapter-protocol 2.2.3 → 2.2.4

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.
@@ -8,7 +8,7 @@ buildscript {
8
8
  }
9
9
 
10
10
  dependencies {
11
- classpath 'com.android.tools.build:gradle:8.12.0'
11
+ classpath 'com.android.tools.build:gradle:8.13.0'
12
12
  // noinspection DifferentKotlinGradleVersion
13
13
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
14
  }
@@ -144,7 +144,7 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
144
144
  dependencies {
145
145
  //noinspection GradleDynamicVersion
146
146
  implementation "com.facebook.react:react-native:+" // From node_modules
147
- implementation "com.solanamobile:mobile-wallet-adapter-clientlib:2.0.8"
147
+ implementation "com.solanamobile:mobile-wallet-adapter-clientlib:2.1.0"
148
148
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
149
149
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0"
150
150
  }
@@ -49,7 +49,7 @@ class SolanaMobileWalletAdapterModule(reactContext: ReactApplicationContext) :
49
49
  private val mActivityEventListener: ActivityEventListener =
50
50
  object : BaseActivityEventListener() {
51
51
  override fun onActivityResult(
52
- activity: Activity?,
52
+ activity: Activity,
53
53
  requestCode: Int,
54
54
  resultCode: Int,
55
55
  data: Intent?
@@ -61,10 +61,10 @@ class SolanaMobileWalletAdapterModule(reactContext: ReactApplicationContext) :
61
61
 
62
62
  private val sessionBackgroundTaskConfig
63
63
  get() = HeadlessJsTaskConfig(
64
- taskKey = "SolanaMobileWalletAdapterSessionBackgroundTask",
65
- timeout = 0,
66
- data = Arguments.createMap(),
67
- isAllowedInForeground = true
64
+ "SolanaMobileWalletAdapterSessionBackgroundTask",
65
+ Arguments.createMap(),
66
+ 0,
67
+ true
68
68
  )
69
69
 
70
70
  init {
@@ -87,6 +87,10 @@ class SolanaMobileWalletAdapterModule(reactContext: ReactApplicationContext) :
87
87
  if (taskId != null && headlessJsTaskContext.isTaskRunning(taskId)) {
88
88
  headlessJsTaskContext.finishTask(taskId)
89
89
  }
90
+ // fix for Expo 52/RN 0.72/0.73 where the older kotlin/gradle toolchain complains
91
+ // about the above if statement being used as an expression. Explicitly returning
92
+ // Unit here tells the compiler that the above if is not an expression
93
+ Unit
90
94
  } catch (e: Exception) {
91
95
  Log.w(TAG, "Failed to finish headless JS task", e)
92
96
  }
@@ -121,10 +125,11 @@ class SolanaMobileWalletAdapterModule(reactContext: ReactApplicationContext) :
121
125
  // stop the headless js task, regardless if the association was successful or not
122
126
  finishHeadlessTask(sessionTaskId)
123
127
  }
124
- currentActivity?.startActivityForResult(intent, REQUEST_LOCAL_ASSOCIATION)
125
- ?: throw NullPointerException(
126
- "Could not find a current activity from which to launch a local association"
127
- )
128
+ reactApplicationContext.currentActivity?.apply {
129
+ startActivityForResult(intent, REQUEST_LOCAL_ASSOCIATION)
130
+ } ?: throw NullPointerException(
131
+ "Could not find a current activity from which to launch a local association"
132
+ )
128
133
  val client = localAssociation.start()
129
134
  .get(ASSOCIATION_TIMEOUT_MS.toLong(), TimeUnit.MILLISECONDS)
130
135
  sessionState = SessionState(client, localAssociation)
@@ -247,7 +247,7 @@ type SignInPayloadWithRequiredFields = Partial<SignInPayload> & Required<Pick<Si
247
247
  type SignInResult = Readonly<{
248
248
  address: Base64EncodedAddress;
249
249
  signed_message: Base64EncodedSignedMessage;
250
- signature: Base64EncodedAddress;
250
+ signature: Base64EncodedSignature;
251
251
  signature_type?: string;
252
252
  }>;
253
253
  type Scenario = Readonly<{
@@ -247,7 +247,7 @@ type SignInPayloadWithRequiredFields = Partial<SignInPayload> & Required<Pick<Si
247
247
  type SignInResult = Readonly<{
248
248
  address: Base64EncodedAddress;
249
249
  signed_message: Base64EncodedSignedMessage;
250
- signature: Base64EncodedAddress;
250
+ signature: Base64EncodedSignature;
251
251
  signature_type?: string;
252
252
  }>;
253
253
  type Scenario = Readonly<{
@@ -247,7 +247,7 @@ type SignInPayloadWithRequiredFields = Partial<SignInPayload> & Required<Pick<Si
247
247
  type SignInResult = Readonly<{
248
248
  address: Base64EncodedAddress;
249
249
  signed_message: Base64EncodedSignedMessage;
250
- signature: Base64EncodedAddress;
250
+ signature: Base64EncodedSignature;
251
251
  signature_type?: string;
252
252
  }>;
253
253
  type Scenario = Readonly<{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solana-mobile/mobile-wallet-adapter-protocol",
3
3
  "description": "An implementation of the Solana Mobile Mobile Wallet Adapter protocol. Use this to open a session with a mobile wallet app, and to issue API calls to it.",
4
- "version": "2.2.3",
4
+ "version": "2.2.4",
5
5
  "author": "Steven Luscher <steven.luscher@solanamobile.com>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -18,8 +18,8 @@
18
18
  "require": "./lib/cjs/index.js"
19
19
  },
20
20
  "browser": {
21
- "import": "./lib/cjs/index.browser.js",
22
- "require": "./lib/esm/index.browser.js"
21
+ "import": "./lib/esm/index.browser.js",
22
+ "require": "./lib/cjs/index.browser.js"
23
23
  },
24
24
  "node": {
25
25
  "import": "./lib/esm/index.js",