@solana-mobile/wallet-standard-mobile 0.4.3 → 0.4.4-hotfix.0
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 +5 -5
- package/lib/cjs/index.browser.js +10 -3
- package/lib/cjs/index.js +10 -3
- package/lib/cjs/index.native.js +10 -3
- package/lib/esm/index.browser.js +10 -3
- package/lib/esm/index.js +10 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# `@solana-mobile/wallet-standard-mobile`
|
|
2
|
-
|
|
3
|
-
This is a plugin that registers a [`@wallet-standard/wallet-standard`](https://github.com/wallet-standard/wallet-standard) for mobile wallets. It enables web apps to use a native wallet app on a mobile device to sign messages and transactions, and to send transactions if the wallet offers support for sending transactions.
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
# `@solana-mobile/wallet-standard-mobile`
|
|
2
|
+
|
|
3
|
+
This is a plugin that registers a [`@wallet-standard/wallet-standard`](https://github.com/wallet-standard/wallet-standard) for mobile wallets. It enables web apps to use a native wallet app on a mobile device to sign messages and transactions, and to send transactions if the wallet offers support for sending transactions.
|
|
4
|
+
|
|
5
|
+
|
package/lib/cjs/index.browser.js
CHANGED
|
@@ -618,7 +618,7 @@ class LocalSolanaMobileWalletAdapterWallet {
|
|
|
618
618
|
}));
|
|
619
619
|
_LocalSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
620
620
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
621
|
-
const supportsSignTransaction = capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
621
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction') || capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
622
622
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions;
|
|
623
623
|
const didCapabilitiesChange = walletStandardFeatures.SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
624
624
|
walletStandardFeatures.SolanaSignTransaction in this.features !== supportsSignTransaction;
|
|
@@ -997,7 +997,7 @@ class RemoteSolanaMobileWalletAdapterWallet {
|
|
|
997
997
|
}));
|
|
998
998
|
_RemoteSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
999
999
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
1000
|
-
const supportsSignTransaction = capabilities.features.includes('solana:
|
|
1000
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction'); //SolanaSignTransactions);
|
|
1001
1001
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions ||
|
|
1002
1002
|
capabilities.features.includes('solana:signAndSendTransaction');
|
|
1003
1003
|
const didCapabilitiesChange = walletStandardFeatures.SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
@@ -1398,6 +1398,11 @@ function getIsRemoteAssociationSupported() {
|
|
|
1398
1398
|
typeof document !== 'undefined' &&
|
|
1399
1399
|
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
|
|
1400
1400
|
}
|
|
1401
|
+
// Source: https://github.com/anza-xyz/wallet-adapter/blob/master/packages/core/react/src/getEnvironment.ts#L14
|
|
1402
|
+
// This is the same implementation that gated MWA in the Anza wallet-adapter-react library.
|
|
1403
|
+
function isWebView(userAgentString) {
|
|
1404
|
+
return /(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(userAgentString);
|
|
1405
|
+
}
|
|
1401
1406
|
|
|
1402
1407
|
function registerMwa(config) {
|
|
1403
1408
|
if (typeof window === 'undefined') {
|
|
@@ -1408,7 +1413,9 @@ function registerMwa(config) {
|
|
|
1408
1413
|
console.warn(`MWA not registered: secure context required (https)`);
|
|
1409
1414
|
return;
|
|
1410
1415
|
}
|
|
1411
|
-
|
|
1416
|
+
// Local association technically is possible in a webview, but we prevent registration
|
|
1417
|
+
// by default because it usually fails in the most common cases (e.g wallet browsers).
|
|
1418
|
+
if (getIsLocalAssociationSupported() && !isWebView(navigator.userAgent)) {
|
|
1412
1419
|
registerWallet(new LocalSolanaMobileWalletAdapterWallet(config));
|
|
1413
1420
|
}
|
|
1414
1421
|
else if (getIsRemoteAssociationSupported() && config.remoteHostAuthority !== undefined) {
|
package/lib/cjs/index.js
CHANGED
|
@@ -618,7 +618,7 @@ class LocalSolanaMobileWalletAdapterWallet {
|
|
|
618
618
|
}));
|
|
619
619
|
_LocalSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
620
620
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
621
|
-
const supportsSignTransaction = capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
621
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction') || capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
622
622
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions;
|
|
623
623
|
const didCapabilitiesChange = walletStandardFeatures.SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
624
624
|
walletStandardFeatures.SolanaSignTransaction in this.features !== supportsSignTransaction;
|
|
@@ -997,7 +997,7 @@ class RemoteSolanaMobileWalletAdapterWallet {
|
|
|
997
997
|
}));
|
|
998
998
|
_RemoteSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
999
999
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
1000
|
-
const supportsSignTransaction = capabilities.features.includes('solana:
|
|
1000
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction'); //SolanaSignTransactions);
|
|
1001
1001
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions ||
|
|
1002
1002
|
capabilities.features.includes('solana:signAndSendTransaction');
|
|
1003
1003
|
const didCapabilitiesChange = walletStandardFeatures.SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
@@ -1398,6 +1398,11 @@ function getIsRemoteAssociationSupported() {
|
|
|
1398
1398
|
typeof document !== 'undefined' &&
|
|
1399
1399
|
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
|
|
1400
1400
|
}
|
|
1401
|
+
// Source: https://github.com/anza-xyz/wallet-adapter/blob/master/packages/core/react/src/getEnvironment.ts#L14
|
|
1402
|
+
// This is the same implementation that gated MWA in the Anza wallet-adapter-react library.
|
|
1403
|
+
function isWebView(userAgentString) {
|
|
1404
|
+
return /(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(userAgentString);
|
|
1405
|
+
}
|
|
1401
1406
|
|
|
1402
1407
|
function registerMwa(config) {
|
|
1403
1408
|
if (typeof window === 'undefined') {
|
|
@@ -1408,7 +1413,9 @@ function registerMwa(config) {
|
|
|
1408
1413
|
console.warn(`MWA not registered: secure context required (https)`);
|
|
1409
1414
|
return;
|
|
1410
1415
|
}
|
|
1411
|
-
|
|
1416
|
+
// Local association technically is possible in a webview, but we prevent registration
|
|
1417
|
+
// by default because it usually fails in the most common cases (e.g wallet browsers).
|
|
1418
|
+
if (getIsLocalAssociationSupported() && !isWebView(navigator.userAgent)) {
|
|
1412
1419
|
registerWallet(new LocalSolanaMobileWalletAdapterWallet(config));
|
|
1413
1420
|
}
|
|
1414
1421
|
else if (getIsRemoteAssociationSupported() && config.remoteHostAuthority !== undefined) {
|
package/lib/cjs/index.native.js
CHANGED
|
@@ -611,7 +611,7 @@ class LocalSolanaMobileWalletAdapterWallet {
|
|
|
611
611
|
}));
|
|
612
612
|
_LocalSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
613
613
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
614
|
-
const supportsSignTransaction = capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
614
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction') || capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
615
615
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions;
|
|
616
616
|
const didCapabilitiesChange = walletStandardFeatures.SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
617
617
|
walletStandardFeatures.SolanaSignTransaction in this.features !== supportsSignTransaction;
|
|
@@ -990,7 +990,7 @@ class RemoteSolanaMobileWalletAdapterWallet {
|
|
|
990
990
|
}));
|
|
991
991
|
_RemoteSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
992
992
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
993
|
-
const supportsSignTransaction = capabilities.features.includes('solana:
|
|
993
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction'); //SolanaSignTransactions);
|
|
994
994
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions ||
|
|
995
995
|
capabilities.features.includes('solana:signAndSendTransaction');
|
|
996
996
|
const didCapabilitiesChange = walletStandardFeatures.SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
@@ -1391,6 +1391,11 @@ function getIsRemoteAssociationSupported() {
|
|
|
1391
1391
|
typeof document !== 'undefined' &&
|
|
1392
1392
|
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
|
|
1393
1393
|
}
|
|
1394
|
+
// Source: https://github.com/anza-xyz/wallet-adapter/blob/master/packages/core/react/src/getEnvironment.ts#L14
|
|
1395
|
+
// This is the same implementation that gated MWA in the Anza wallet-adapter-react library.
|
|
1396
|
+
function isWebView(userAgentString) {
|
|
1397
|
+
return /(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(userAgentString);
|
|
1398
|
+
}
|
|
1394
1399
|
|
|
1395
1400
|
function registerMwa(config) {
|
|
1396
1401
|
if (typeof window === 'undefined') {
|
|
@@ -1401,7 +1406,9 @@ function registerMwa(config) {
|
|
|
1401
1406
|
console.warn(`MWA not registered: secure context required (https)`);
|
|
1402
1407
|
return;
|
|
1403
1408
|
}
|
|
1404
|
-
|
|
1409
|
+
// Local association technically is possible in a webview, but we prevent registration
|
|
1410
|
+
// by default because it usually fails in the most common cases (e.g wallet browsers).
|
|
1411
|
+
if (getIsLocalAssociationSupported() && !isWebView(navigator.userAgent)) {
|
|
1405
1412
|
registerWallet(new LocalSolanaMobileWalletAdapterWallet(config));
|
|
1406
1413
|
}
|
|
1407
1414
|
else if (getIsRemoteAssociationSupported() && config.remoteHostAuthority !== undefined) {
|
package/lib/esm/index.browser.js
CHANGED
|
@@ -609,7 +609,7 @@ class LocalSolanaMobileWalletAdapterWallet {
|
|
|
609
609
|
}));
|
|
610
610
|
_LocalSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
611
611
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
612
|
-
const supportsSignTransaction = capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
612
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction') || capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
613
613
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions;
|
|
614
614
|
const didCapabilitiesChange = SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
615
615
|
SolanaSignTransaction in this.features !== supportsSignTransaction;
|
|
@@ -988,7 +988,7 @@ class RemoteSolanaMobileWalletAdapterWallet {
|
|
|
988
988
|
}));
|
|
989
989
|
_RemoteSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
990
990
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
991
|
-
const supportsSignTransaction = capabilities.features.includes('solana:
|
|
991
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction'); //SolanaSignTransactions);
|
|
992
992
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions ||
|
|
993
993
|
capabilities.features.includes('solana:signAndSendTransaction');
|
|
994
994
|
const didCapabilitiesChange = SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
@@ -1389,6 +1389,11 @@ function getIsRemoteAssociationSupported() {
|
|
|
1389
1389
|
typeof document !== 'undefined' &&
|
|
1390
1390
|
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
|
|
1391
1391
|
}
|
|
1392
|
+
// Source: https://github.com/anza-xyz/wallet-adapter/blob/master/packages/core/react/src/getEnvironment.ts#L14
|
|
1393
|
+
// This is the same implementation that gated MWA in the Anza wallet-adapter-react library.
|
|
1394
|
+
function isWebView(userAgentString) {
|
|
1395
|
+
return /(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(userAgentString);
|
|
1396
|
+
}
|
|
1392
1397
|
|
|
1393
1398
|
function registerMwa(config) {
|
|
1394
1399
|
if (typeof window === 'undefined') {
|
|
@@ -1399,7 +1404,9 @@ function registerMwa(config) {
|
|
|
1399
1404
|
console.warn(`MWA not registered: secure context required (https)`);
|
|
1400
1405
|
return;
|
|
1401
1406
|
}
|
|
1402
|
-
|
|
1407
|
+
// Local association technically is possible in a webview, but we prevent registration
|
|
1408
|
+
// by default because it usually fails in the most common cases (e.g wallet browsers).
|
|
1409
|
+
if (getIsLocalAssociationSupported() && !isWebView(navigator.userAgent)) {
|
|
1403
1410
|
registerWallet(new LocalSolanaMobileWalletAdapterWallet(config));
|
|
1404
1411
|
}
|
|
1405
1412
|
else if (getIsRemoteAssociationSupported() && config.remoteHostAuthority !== undefined) {
|
package/lib/esm/index.js
CHANGED
|
@@ -609,7 +609,7 @@ class LocalSolanaMobileWalletAdapterWallet {
|
|
|
609
609
|
}));
|
|
610
610
|
_LocalSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
611
611
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
612
|
-
const supportsSignTransaction = capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
612
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction') || capabilities.features.includes('solana:signTransactions'); //SolanaSignTransactions);
|
|
613
613
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions;
|
|
614
614
|
const didCapabilitiesChange = SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
615
615
|
SolanaSignTransaction in this.features !== supportsSignTransaction;
|
|
@@ -988,7 +988,7 @@ class RemoteSolanaMobileWalletAdapterWallet {
|
|
|
988
988
|
}));
|
|
989
989
|
_RemoteSolanaMobileWalletAdapterWallet_handleWalletCapabilitiesResult.set(this, (capabilities) => __awaiter(this, void 0, void 0, function* () {
|
|
990
990
|
// TODO: investigate why using SolanaSignTransactions constant breaks treeshaking
|
|
991
|
-
const supportsSignTransaction = capabilities.features.includes('solana:
|
|
991
|
+
const supportsSignTransaction = capabilities.features.includes('solana:signTransaction'); //SolanaSignTransactions);
|
|
992
992
|
const supportsSignAndSendTransaction = capabilities.supports_sign_and_send_transactions ||
|
|
993
993
|
capabilities.features.includes('solana:signAndSendTransaction');
|
|
994
994
|
const didCapabilitiesChange = SolanaSignAndSendTransaction in this.features !== supportsSignAndSendTransaction ||
|
|
@@ -1389,6 +1389,11 @@ function getIsRemoteAssociationSupported() {
|
|
|
1389
1389
|
typeof document !== 'undefined' &&
|
|
1390
1390
|
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
|
|
1391
1391
|
}
|
|
1392
|
+
// Source: https://github.com/anza-xyz/wallet-adapter/blob/master/packages/core/react/src/getEnvironment.ts#L14
|
|
1393
|
+
// This is the same implementation that gated MWA in the Anza wallet-adapter-react library.
|
|
1394
|
+
function isWebView(userAgentString) {
|
|
1395
|
+
return /(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(userAgentString);
|
|
1396
|
+
}
|
|
1392
1397
|
|
|
1393
1398
|
function registerMwa(config) {
|
|
1394
1399
|
if (typeof window === 'undefined') {
|
|
@@ -1399,7 +1404,9 @@ function registerMwa(config) {
|
|
|
1399
1404
|
console.warn(`MWA not registered: secure context required (https)`);
|
|
1400
1405
|
return;
|
|
1401
1406
|
}
|
|
1402
|
-
|
|
1407
|
+
// Local association technically is possible in a webview, but we prevent registration
|
|
1408
|
+
// by default because it usually fails in the most common cases (e.g wallet browsers).
|
|
1409
|
+
if (getIsLocalAssociationSupported() && !isWebView(navigator.userAgent)) {
|
|
1403
1410
|
registerWallet(new LocalSolanaMobileWalletAdapterWallet(config));
|
|
1404
1411
|
}
|
|
1405
1412
|
else if (getIsRemoteAssociationSupported() && config.remoteHostAuthority !== undefined) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/wallet-standard-mobile",
|
|
3
3
|
"description": "A wallet-standard wallet for mobile wallet apps that conform to the Solana Mobile Wallet Adapter protocol",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4-hotfix.0",
|
|
5
5
|
"author": "Marco Martinez <marco.martinez@solana.com>",
|
|
6
6
|
"repository": "https://github.com/solana-mobile/mobile-wallet-adapter",
|
|
7
7
|
"license": "Apache-2.0",
|