@getpara/solana-wallet-connectors 2.0.0-alpha.67 → 2.0.0-alpha.69

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 ADDED
@@ -0,0 +1,14 @@
1
+ https://www.npmjs.com/package/@getpara/solana-wallet-connectors
2
+
3
+ `@getpara/solana-wallet-connectors` is a package that provides wallet connectors for Solana when using Para's React SDK Lite.
4
+ The package enables integration with popular Solana wallets like Phantom, Backpack, Solflare, and Glow through Para's provider system. After installation, you can configure it in your ParaProvider.
5
+
6
+ ###Prerequisites
7
+
8
+ To use Para, you need an API key. This key authenticates your requests to Para services and is essential for integration.
9
+
10
+ Don't have an API key yet? Request access to the [Developer Portal](https://developer.getpara.com/) to create API keys, manage billing, teams, and more.
11
+
12
+ ###Learn more
13
+
14
+ For more information on Para’s Solana wallet connector visit the [Para Docs](https://docs.getpara.com/v2/react/guides/external-wallets/solana-lite#solana-wallets-with-react-sdk-lite)
@@ -48,7 +48,7 @@ function ParaSolanaProvider({ children, config, internalConfig }) {
48
48
  ],
49
49
  localStorageKey: "paraSolanaExternal",
50
50
  autoConnect: true,
51
- children: /* @__PURE__ */ jsx(SolanaExternalWalletProvider, __spreadProps(__spreadValues({}, solanaExternalWalletProviderProps), { children }))
51
+ children: /* @__PURE__ */ jsx(SolanaExternalWalletProvider, __spreadProps(__spreadValues({}, solanaExternalWalletProviderProps), { chain, children }))
52
52
  }
53
53
  ) });
54
54
  }
@@ -2,9 +2,12 @@ import { PropsWithChildren } from 'react';
2
2
  import { CreateWalletFn } from '../types/Wallet.js';
3
3
  import { ExternalWalletContextType, ExternalWalletProviderConfig, ExternalWalletProviderConfigBase, FarcasterMiniAppManagement } from '@getpara/react-common';
4
4
  import { TExternalHooks } from './externalHooks.js';
5
+ import { Chain } from '@solana-mobile/mobile-wallet-adapter-protocol';
5
6
  export type SolanaExternalWalletContextType = ExternalWalletContextType & TExternalHooks & FarcasterMiniAppManagement;
6
7
  export declare const SolanaExternalWalletContext: import("react").Context<SolanaExternalWalletContextType>;
7
8
  export type SolanaExternalWalletProviderConfig = ExternalWalletProviderConfigBase;
8
9
  type SolanaExternalWalletProviderConfigFull = ExternalWalletProviderConfig<CreateWalletFn>;
9
- export declare function SolanaExternalWalletProvider({ children, wallets: walletFns, onSwitchWallet, para, walletsWithFullAuth, includeWalletVerification, connectionOnly, }: SolanaExternalWalletProviderConfigFull & PropsWithChildren): import("react/jsx-runtime").JSX.Element;
10
+ export declare function SolanaExternalWalletProvider({ children, wallets: walletFns, onSwitchWallet, para, walletsWithFullAuth, includeWalletVerification, connectionOnly, chain, }: SolanaExternalWalletProviderConfigFull & PropsWithChildren & {
11
+ chain: Chain;
12
+ }): import("react/jsx-runtime").JSX.Element;
10
13
  export {};
@@ -58,7 +58,8 @@ function SolanaExternalWalletProvider({
58
58
  para,
59
59
  walletsWithFullAuth,
60
60
  includeWalletVerification,
61
- connectionOnly
61
+ connectionOnly,
62
+ chain
62
63
  }) {
63
64
  const {
64
65
  wallets: adapters,
@@ -96,7 +97,9 @@ function SolanaExternalWalletProvider({
96
97
  withFullParaAuth: walletsWithFullAuth === "ALL" || (walletsWithFullAuth == null ? void 0 : walletsWithFullAuth.includes((_b = (_a = getWallet(providerName != null ? providerName : "")) == null ? void 0 : _a.id.toUpperCase()) != null ? _b : "")),
97
98
  withVerification: includeWalletVerification,
98
99
  isConnectionOnly: connectionOnly
99
- }
100
+ },
101
+ uri: window == null ? void 0 : window.location.origin,
102
+ chainId: chain
100
103
  });
101
104
  } catch (err) {
102
105
  yield reset();
@@ -178,6 +181,11 @@ function SolanaExternalWalletProvider({
178
181
  if (!adapter) {
179
182
  throw new Error("Adapter not found.");
180
183
  }
184
+ const wallet2 = getWallet(adapter.name);
185
+ if (wallet2.getQrUri) {
186
+ const qrUri = yield wallet2.getQrUri();
187
+ window.dispatchEvent(new CustomEvent("PARA_WALLETCONNECT_URI_READY", { detail: qrUri }));
188
+ }
181
189
  selectWallet(adapter.name);
182
190
  yield new Promise((resolve) => setTimeout(resolve, 100));
183
191
  let address;
@@ -238,7 +246,8 @@ function SolanaExternalWalletProvider({
238
246
  switch (err.message) {
239
247
  case "User aborted.":
240
248
  case "Approval Denied":
241
- case "You canceled this request.": {
249
+ case "You canceled this request.":
250
+ case "Disconnected before connect event": {
242
251
  error = "Connection request rejected";
243
252
  break;
244
253
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@getpara/solana-wallet-connectors",
3
- "version": "2.0.0-alpha.67",
3
+ "version": "2.0.0-alpha.69",
4
4
  "dependencies": {
5
- "@getpara/react-common": "2.0.0-alpha.67",
6
- "@getpara/web-sdk": "2.0.0-alpha.67",
5
+ "@getpara/react-common": "2.0.0-alpha.69",
6
+ "@getpara/web-sdk": "2.0.0-alpha.69",
7
7
  "bs58": "6.0.0"
8
8
  },
9
9
  "devDependencies": {
@@ -23,7 +23,7 @@
23
23
  "dist",
24
24
  "package.json"
25
25
  ],
26
- "gitHead": "0266cc49e978575fed0b12c9bb0c832651e140eb",
26
+ "gitHead": "956310e0ff58cc8e2736625d221245ab68304855",
27
27
  "main": "dist/index.js",
28
28
  "peerDependencies": {
29
29
  "@farcaster/mini-app-solana": "^1.0.0",