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

[DRAFT] [1.0.0] Multi provider support #23

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

worlddlckgh
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
unified-wallet-kit ✅ Ready (Inspect) Visit Preview Sep 13, 2024 5:18pm


// 0. Setup chains
const chains = [solana, solanaTestnet, solanaDevnet];
const projectId = '4a4e231c4004ef7b77076a87094fba61';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

projectId, metadata should be dynamic

Comment on lines +120 to +127
if (provider === 'solana-wallet-adapter') {
return <SolanaWalletAdapterProvider {...props} />;
} else if (provider === 'walletconnect') {
return <WalletConnectAdapterProvider {...props} />;
} else {
console.error('Invalid wallet connection provider');
return <></>;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there must be a way we can utilise/leverage some conditionals so the end-user provider don't have to re-render.

It might be at the cost of having to write anti-pattern conditional hooks, but it's certainly worth experimenting

? UnifiedWalletValueProvider
: hasInitializedWalletConnect
? UnifiedWalletValueProviderForWalletConnect
: () => null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar comment regarding re-rendering for end users

adapter: {
name: 'WalletConnect' as WalletName,
url: 'https://walletconnect.org',
icon: 'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4NSIgdmlld0JveD0iMCAwIDMwMCAxODUiIHdpZHRoPSIzMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0ibTYxLjQzODU0MjkgMzYuMjU2MjYxMmM0OC45MTEyMjQxLTQ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LTYuNDEwNTc1NSAyLjM5NDQ3Mi04Ljg1NjE2MTIuMDAwMDg3LS4wMDAwMTQzLS4wMDAwMTQtLjAwMDAyOTYtLjAwMDAyOC0uMDAwMDQ0OS0uMDAwMDQ0bC04MC44MTI0MTk0My03OS4xMjIxODVjLTIuNDQ1NTYwMjEtMi4zOTQ0MDgtMi40NDU1NjAyMS02LjI3NjUxMTUgMC04LjY3MDkxOTdsMTcuOTIxNzI5NjMtMTcuNTQ2ODY3M2MyLjQ0NTU2MDItMi4zOTQ0MDgyIDYuNDEwNTk4OS0yLjM5NDQwODIgOC44NTYxNjAyIDBsNTcuMzU0OTc3NSA1Ni4xNTUzNTdjLjYxMTM5MDguNTk4NjAyIDEuNjAyNjQ5LjU5ODYwMiAyLjIxNDAzOTggMCAuMDAwMDA5Mi0uMDAwMDA5LjAwMDAxNzQtLjAwMDAxNy4wMDAwMjY1LS4wMDAwMjRsNTcuMzUyMTAzMS01Ni4xNTUzMzNjMi40NDU1MDUtMi4zOTQ0NjMzIDYuNDEwNTQ0LTIuMzk0NTUzMSA4Ljg1NjE2MS0uMDAwMi4wMDAwMzQuMDAwMDMzNi4wMDAwNjguMDAwMDY3My4wMDAxMDEuMDAwMTAxbDU3LjM1NDkwMiA1Ni4xNTU0MzJjLjYxMTM5LjU5ODYwMSAxLjYwMjY1LjU5ODYwMSAyLjIxNDA0IDBsNTcuMzUzOTc1LTU2LjE1NDMyNDljMi40NDU1NjEtMi4zOTQ0MDkyIDYuNDEwNTk5LTIuMzk0NDA5MiA4Ljg1NjE2IDB6IiBmaWxsPSIjM2I5OWZjIi8+PC9zdmc+',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch to remote sources

@@ -48,6 +48,11 @@ export const UnifiedWalletButton: React.FC<{

const handleClick = useCallback(async () => {
try {
if (provider === 'walletconnect') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cases can be simplified

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "@jup-ag/wallet-adapter",
"version": "0.2.0",
"version": "1.0.0-alpha-3",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update READMEs

};

const Header: React.FC<{ onClose: () => void }> = ({ onClose }) => {
const { theme } = useUnifiedWalletContext();
const { t } = useTranslation();

return (
<div css={[tw`px-5 py-6 flex justify-between leading-none`, styles.header[theme]]}>
<div css={[tw`px-5 py-3 flex justify-between leading-none`, styles.header[theme]]}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styling is still awkward

@worlddlckgh worlddlckgh changed the title [DRAFT] Multi provider support [DRAFT] [1.0.0] Multi provider support Sep 6, 2024
bump alpha5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant