@solana-mobile/mobile-wallet-adapter-protocol 2.2.6 → 2.2.7
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/README.md +9 -6
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +1 -1
- package/lib/cjs/index.browser.js +816 -963
- package/lib/cjs/index.browser.js.map +1 -0
- package/lib/cjs/index.js +816 -963
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/index.native.js +239 -290
- package/lib/cjs/index.native.js.map +1 -0
- package/lib/cjs/package.json +1 -3
- package/lib/esm/index.browser.js +815 -961
- package/lib/esm/index.browser.js.map +1 -0
- package/lib/esm/index.js +815 -961
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +1 -3
- package/lib/types/index.d.ts +172 -181
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +7 -6
- package/lib/types/index.browser.d.ts +0 -270
- package/lib/types/index.browser.d.ts.map +0 -1
- package/lib/types/index.native.d.ts +0 -270
- package/lib/types/index.native.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ This is a reference implementation of the [Mobile Wallet Adapter specification](
|
|
|
5
5
|
If you are simply looking to integrate a JavaScript application with mobile wallets, see [`@solana-mobile/wallet-adapter-mobile`](https://www.npmjs.com/package/@solana-mobile/wallet-adapter-mobile) instead.
|
|
6
6
|
|
|
7
7
|
## Learn how to use this API on our [documentation website](https://docs.solanamobile.com/):
|
|
8
|
+
|
|
8
9
|
- React Native
|
|
9
10
|
- [Quickstart Setup](https://docs.solanamobile.com/react-native/quickstart)
|
|
10
11
|
- [dApp Integration Guide](https://docs.solanamobile.com/react-native/mwa_integration_rn)
|
|
@@ -16,7 +17,7 @@ If you are simply looking to integrate a JavaScript application with mobile wall
|
|
|
16
17
|
Use this API to start a session:
|
|
17
18
|
|
|
18
19
|
```typescript
|
|
19
|
-
import {transact} from '@solana-mobile/mobile-wallet-adapter-protocol';
|
|
20
|
+
import { transact } from '@solana-mobile/mobile-wallet-adapter-protocol';
|
|
20
21
|
|
|
21
22
|
await transact(async (wallet) => {
|
|
22
23
|
/* ... */
|
|
@@ -27,9 +28,11 @@ The callback you provide will be called once a session has been established with
|
|
|
27
28
|
|
|
28
29
|
```typescript
|
|
29
30
|
const signedPayloads = await transact(async (wallet) => {
|
|
30
|
-
const {signed_payloads} = await wallet.signMessages({
|
|
31
|
+
const { signed_payloads } = await wallet.signMessages({
|
|
31
32
|
auth_token,
|
|
32
|
-
payloads: [
|
|
33
|
+
payloads: [
|
|
34
|
+
/* ... */
|
|
35
|
+
],
|
|
33
36
|
});
|
|
34
37
|
return signed_payloads;
|
|
35
38
|
});
|
|
@@ -52,13 +55,13 @@ try {
|
|
|
52
55
|
e.code === SolanaMobileWalletAdapterProtocolErrorCode.ERROR_REAUTHORIZE
|
|
53
56
|
) {
|
|
54
57
|
console.error('The auth token has gone stale');
|
|
55
|
-
await wallet.reauthorize({auth_token, identity});
|
|
58
|
+
await wallet.reauthorize({ auth_token, identity });
|
|
56
59
|
// Retry...
|
|
57
60
|
}
|
|
58
61
|
throw e;
|
|
59
62
|
}
|
|
60
63
|
});
|
|
61
|
-
} catch(e) {
|
|
64
|
+
} catch (e) {
|
|
62
65
|
if (
|
|
63
66
|
e instanceof SolanaMobileWalletAdapterError &&
|
|
64
67
|
e.code === SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND
|
|
@@ -67,4 +70,4 @@ try {
|
|
|
67
70
|
}
|
|
68
71
|
throw e;
|
|
69
72
|
}
|
|
70
|
-
```
|
|
73
|
+
```
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
|
4
4
|
networkTimeout=10000
|
|
5
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
6
6
|
zipStorePath=wrapper/dists
|
package/android/gradlew
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
# Darwin, MinGW, and NonStop.
|
|
58
58
|
#
|
|
59
59
|
# (3) This script is generated from the Groovy template
|
|
60
|
-
# https://github.com/gradle/gradle/blob/
|
|
60
|
+
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
61
61
|
# within the Gradle project.
|
|
62
62
|
#
|
|
63
63
|
# You can find Gradle at https://github.com/gradle/gradle/.
|