@bit-buccaneers/wallet-abstraction 0.0.13 → 0.0.14

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/dist/dev.js CHANGED
@@ -763,8 +763,27 @@ var STORAGE_KEYS2 = {
763
763
  SESSION: "phantom_mobile_session",
764
764
  SIGN_PENDING: "phantom_mobile_sign_pending"
765
765
  };
766
- WALLETS.find((i) => i.id === "phantom");
766
+ var phantomWalletConfig = WALLETS.find((i) => i.id === "phantom");
767
767
  var createPhantomEvmConnector = () => createDownloadOnlyEvmConnector({ walletId: "phantom" });
768
+ var createPhantomEvmConnectorDeeplink = () => ({
769
+ ...phantomWalletConfig,
770
+ type: "evm",
771
+ wallet: {
772
+ _connector: null,
773
+ connect: async () => {
774
+ const currentUrl = encodeURIComponent(window.location.href);
775
+ window.location.href = `${PHANTOM_BROWSE_URL}/${currentUrl}?ref=${encodeURIComponent(
776
+ window.location.origin
777
+ )}`;
778
+ return pendingResult();
779
+ },
780
+ disconnect: async () => {
781
+ },
782
+ signMessage: async () => {
783
+ throw new Error("signMessage not supported via mobile deeplink");
784
+ }
785
+ }
786
+ });
768
787
  var createPhantomSolanaConnector = () => createDownloadOnlySolanaConnector({ walletId: "phantom" });
769
788
  var isPhantomMobilePending = () => storage.getString(STORAGE_KEYS2.PENDING) === "1";
770
789
  var handlePhantomMobileCallback = () => handleMobileCallback(PHANTOM_CONFIG, STORAGE_KEYS2.PENDING, STORAGE_KEYS2.SESSION);
@@ -986,7 +1005,10 @@ var createWalletConnectSolanaConnector = () => {
986
1005
 
987
1006
  // src/lib/evm/connectors.ts
988
1007
  var EVM_FALLBACK_CONNECTORS = [
989
- { id: "phantom", create: createPhantomEvmConnector },
1008
+ {
1009
+ id: "phantom",
1010
+ create: isMobile() ? createPhantomEvmConnectorDeeplink : createPhantomEvmConnector
1011
+ },
990
1012
  { id: "metamask", create: createMetaMaskEvmConnector },
991
1013
  { id: "trust", create: createTrustEvmMobileConnector },
992
1014
  { id: "binance", create: createBinanceEvmConnector },
package/dist/dev.jsx CHANGED
@@ -773,6 +773,25 @@ var STORAGE_KEYS2 = {
773
773
  };
774
774
  var phantomWalletConfig = WALLETS.find((i) => i.id === "phantom");
775
775
  var createPhantomEvmConnector = () => createDownloadOnlyEvmConnector({ walletId: "phantom" });
776
+ var createPhantomEvmConnectorDeeplink = () => ({
777
+ ...phantomWalletConfig,
778
+ type: "evm",
779
+ wallet: {
780
+ _connector: null,
781
+ connect: async () => {
782
+ const currentUrl = encodeURIComponent(window.location.href);
783
+ window.location.href = `${PHANTOM_BROWSE_URL}/${currentUrl}?ref=${encodeURIComponent(
784
+ window.location.origin
785
+ )}`;
786
+ return pendingResult();
787
+ },
788
+ disconnect: async () => {
789
+ },
790
+ signMessage: async () => {
791
+ throw new Error("signMessage not supported via mobile deeplink");
792
+ }
793
+ }
794
+ });
776
795
  var createPhantomSolanaConnector = () => createDownloadOnlySolanaConnector({ walletId: "phantom" });
777
796
  var isPhantomMobilePending = () => storage.getString(STORAGE_KEYS2.PENDING) === "1";
778
797
  var handlePhantomMobileCallback = () => handleMobileCallback(PHANTOM_CONFIG, STORAGE_KEYS2.PENDING, STORAGE_KEYS2.SESSION);
@@ -997,7 +1016,10 @@ var createWalletConnectSolanaConnector = () => {
997
1016
 
998
1017
  // src/lib/evm/connectors.ts
999
1018
  var EVM_FALLBACK_CONNECTORS = [
1000
- { id: "phantom", create: createPhantomEvmConnector },
1019
+ {
1020
+ id: "phantom",
1021
+ create: isMobile() ? createPhantomEvmConnectorDeeplink : createPhantomEvmConnector
1022
+ },
1001
1023
  { id: "metamask", create: createMetaMaskEvmConnector },
1002
1024
  { id: "trust", create: createTrustEvmMobileConnector },
1003
1025
  { id: "binance", create: createBinanceEvmConnector },
package/dist/index.js CHANGED
@@ -763,8 +763,27 @@ var STORAGE_KEYS2 = {
763
763
  SESSION: "phantom_mobile_session",
764
764
  SIGN_PENDING: "phantom_mobile_sign_pending"
765
765
  };
766
- WALLETS.find((i) => i.id === "phantom");
766
+ var phantomWalletConfig = WALLETS.find((i) => i.id === "phantom");
767
767
  var createPhantomEvmConnector = () => createDownloadOnlyEvmConnector({ walletId: "phantom" });
768
+ var createPhantomEvmConnectorDeeplink = () => ({
769
+ ...phantomWalletConfig,
770
+ type: "evm",
771
+ wallet: {
772
+ _connector: null,
773
+ connect: async () => {
774
+ const currentUrl = encodeURIComponent(window.location.href);
775
+ window.location.href = `${PHANTOM_BROWSE_URL}/${currentUrl}?ref=${encodeURIComponent(
776
+ window.location.origin
777
+ )}`;
778
+ return pendingResult();
779
+ },
780
+ disconnect: async () => {
781
+ },
782
+ signMessage: async () => {
783
+ throw new Error("signMessage not supported via mobile deeplink");
784
+ }
785
+ }
786
+ });
768
787
  var createPhantomSolanaConnector = () => createDownloadOnlySolanaConnector({ walletId: "phantom" });
769
788
  var isPhantomMobilePending = () => storage.getString(STORAGE_KEYS2.PENDING) === "1";
770
789
  var handlePhantomMobileCallback = () => handleMobileCallback(PHANTOM_CONFIG, STORAGE_KEYS2.PENDING, STORAGE_KEYS2.SESSION);
@@ -986,7 +1005,10 @@ var createWalletConnectSolanaConnector = () => {
986
1005
 
987
1006
  // src/lib/evm/connectors.ts
988
1007
  var EVM_FALLBACK_CONNECTORS = [
989
- { id: "phantom", create: createPhantomEvmConnector },
1008
+ {
1009
+ id: "phantom",
1010
+ create: isMobile() ? createPhantomEvmConnectorDeeplink : createPhantomEvmConnector
1011
+ },
990
1012
  { id: "metamask", create: createMetaMaskEvmConnector },
991
1013
  { id: "trust", create: createTrustEvmMobileConnector },
992
1014
  { id: "binance", create: createBinanceEvmConnector },
package/dist/index.jsx CHANGED
@@ -773,6 +773,25 @@ var STORAGE_KEYS2 = {
773
773
  };
774
774
  var phantomWalletConfig = WALLETS.find((i) => i.id === "phantom");
775
775
  var createPhantomEvmConnector = () => createDownloadOnlyEvmConnector({ walletId: "phantom" });
776
+ var createPhantomEvmConnectorDeeplink = () => ({
777
+ ...phantomWalletConfig,
778
+ type: "evm",
779
+ wallet: {
780
+ _connector: null,
781
+ connect: async () => {
782
+ const currentUrl = encodeURIComponent(window.location.href);
783
+ window.location.href = `${PHANTOM_BROWSE_URL}/${currentUrl}?ref=${encodeURIComponent(
784
+ window.location.origin
785
+ )}`;
786
+ return pendingResult();
787
+ },
788
+ disconnect: async () => {
789
+ },
790
+ signMessage: async () => {
791
+ throw new Error("signMessage not supported via mobile deeplink");
792
+ }
793
+ }
794
+ });
776
795
  var createPhantomSolanaConnector = () => createDownloadOnlySolanaConnector({ walletId: "phantom" });
777
796
  var isPhantomMobilePending = () => storage.getString(STORAGE_KEYS2.PENDING) === "1";
778
797
  var handlePhantomMobileCallback = () => handleMobileCallback(PHANTOM_CONFIG, STORAGE_KEYS2.PENDING, STORAGE_KEYS2.SESSION);
@@ -997,7 +1016,10 @@ var createWalletConnectSolanaConnector = () => {
997
1016
 
998
1017
  // src/lib/evm/connectors.ts
999
1018
  var EVM_FALLBACK_CONNECTORS = [
1000
- { id: "phantom", create: createPhantomEvmConnector },
1019
+ {
1020
+ id: "phantom",
1021
+ create: isMobile() ? createPhantomEvmConnectorDeeplink : createPhantomEvmConnector
1022
+ },
1001
1023
  { id: "metamask", create: createMetaMaskEvmConnector },
1002
1024
  { id: "trust", create: createTrustEvmMobileConnector },
1003
1025
  { id: "binance", create: createBinanceEvmConnector },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-buccaneers/wallet-abstraction",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Solid.js web3 wallet abstraction for EVM and Solana",
5
5
  "license": "MIT",
6
6
  "author": "Bit Buccaneers",