Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mobile adapter #882

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/long-apples-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@solana/wallet-adapter-create-react-app-starter': patch
'@solana/wallet-adapter-material-ui-starter': patch
'@solana/wallet-adapter-react-ui-starter': patch
'@solana/wallet-adapter-nextjs-starter': patch
'@solana/wallet-adapter-example': patch
'@solana/wallet-adapter-material-ui': patch
'@solana/wallet-adapter-ant-design': patch
'@solana/wallet-adapter-react-ui': patch
'@solana/wallet-adapter-react': patch
'@solana/wallet-adapter-base-ui': patch
---

Update wallet-adapter-mobile to version 2.1.0 which includes support for Mobile Wallet Adapter 2.0 and Sign in With Solana
2 changes: 1 addition & 1 deletion packages/core/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"react": "*"
},
"dependencies": {
"@solana-mobile/wallet-adapter-mobile": "^2.0.0",
"@solana-mobile/wallet-adapter-mobile": "^2.1.2",
"@solana/wallet-adapter-base": "workspace:^",
"@solana/wallet-standard-wallet-adapter-react": "^1.1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/react/src/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function WalletProvider({
uri: getUriForAppIdentity(),
},
authorizationResultCache: createDefaultAuthorizationResultCache(),
cluster: getInferredClusterFromEndpoint(connection?.rpcEndpoint),
chain: getInferredClusterFromEndpoint(connection?.rpcEndpoint),
onWalletNotFound: createDefaultWalletNotFoundHandler(),
});
}, [adaptersWithStandardAdapters, connection?.rpcEndpoint]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe('WalletProvider when the environment is `MOBILE_WEB`', () => {
it('creates a new mobile wallet adapter with the appropriate cluster for the given endpoint', () => {
renderTest({});
expect(jest.mocked(SolanaMobileWalletAdapter).mock.instances).toHaveLength(1);
expect(jest.mocked(SolanaMobileWalletAdapter).mock.calls[0][0].cluster).toBe('fake-cluster-for-test');
expect(jest.mocked(SolanaMobileWalletAdapter).mock.calls[0][0].chain).toBe('fake-cluster-for-test');
});
});

Expand All @@ -213,7 +213,7 @@ describe('WalletProvider when the environment is `MOBILE_WEB`', () => {
addressSelector: jest.fn() as unknown as AddressSelector,
appIdentity: CUSTOM_APP_IDENTITY,
authorizationResultCache: jest.fn() as unknown as AuthorizationResultCache,
cluster: CUSTOM_CLUSTER,
chain: CUSTOM_CLUSTER,
onWalletNotFound: jest.fn(),
});
adapters.push(customAdapter);
Expand Down
139 changes: 128 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading