MCPcopy Index your code
hub / github.com/TeamRaccoons/Unified-Wallet-Kit

github.com/TeamRaccoons/Unified-Wallet-Kit @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
159 symbols 341 edges 100 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Unified Wallet Kit

Unified Wallet Kit is an open-sourced, Swiss Army Knife wallet adapter, striving for the best wallet integration experience for developers, and best wallet experience for your users.

Along with Terminal, it's the fastest way to get started on Solana.

Used by Jupiter and Meteora.

NPM: https://www.npmjs.com/package/@jup-ag/wallet-adapter

Motives

Why not just use the existing wallet adapters?

  • To bootstrap a dApp, we always find ourself doing the same thing over and over again, such as:
  • Notification when wallets are selected, connecting, connected, disconnected.
  • Auto reconnect to the last connected wallet
  • Mobile-first, responsive design
  • Themeing support
  • Internationalization (i18n) support
  • New user onboarding
  • Built on-top of @solana/wallet-adapter-base, @solana/wallet-adapter-react and @solana-mobile/wallet-adapter-mobile, you are always welcomed to onboard or depart.

Philosophy

  • Set a sensible defaults
  • Lightweight, easy to adopt, fast to access
  • Extensible wallets, with a BYOW (Bring your own wallets) approach
  • Better onboarding experience for new users

Core features

  • [x] Main esm bundle at 94Kb (~20Kb gzipped)
  • [x] Built-in Wallet Standard, Mobile Wallet Adapter support
  • [x] Abstracted wallet adapter, with a BYOW (Bring your own wallets) approach
  • [x] Mobile responsive
  • [x] Notification plug-in
  • [x] Internationalization (i18n)

  • More contributions required for more languages

  • Currently generated from Copilot
  • Help contribute

  • [x] New user onboarding on Jupiter Station

  • PR welcomed on Jupiter Station Github
  • [x] Theming
  • Light, Dark, Jupiter
  • More thmes coming soon
  • [x] Pluralization for i18n

Getting Started

  • pnpm i @jup-ag/wallet-adapter
  • Wrap your app with <UnifiedWalletProvider /> and pass in as little to as many wallets you would like to support.
  • Below example is ExampleBaseOnly.tsx
const ExampleBaseOnly = () => {
  return (
    <UnifiedWalletProvider
      wallets={[]}
      config={{
        autoConnect: false,
        env: 'mainnet-beta',
        metadata: {
          name: 'UnifiedWallet',
          description: 'UnifiedWallet',
          url: 'https://jup.ag',
          iconUrls: ['https://jup.ag/favicon.ico'],
        },
        notificationCallback: WalletNotification,
        walletlistExplanation: {
          href: 'https://station.jup.ag/docs/additional-topics/wallet-list',
        },
      }}
    >
      <UnifiedWalletButton />
    </UnifiedWalletProvider>
  );
};

export default ExampleBaseOnly;
  • More example can be found on the demo page, or in src/components/examples

More features

  • [x] Wallet attachment
  • Target specific wallet and attach custom element to it
config={{
  walletAttachments: { 
    'Phantom': {
      attachment: 

Auto Confirm


    } 
  }
}}

FAQs

  • Why not ship with all wallets?

  • Unnecessary bloat and bundle size on your dApp

  • It's not sensible to always maintain an ever-growing list of wallets
  • Many existing wallets are not well maintained, often with unpatched security, or abandoned development
  • Lack of users
  • Does not support Versioned Transaction, severely limiting the adoption of many innovative functionalities of dApp.
  • And hopefully, a gradually disappearing list of installed wallet adapter, as they migrate to wallet-standard

  • Why not ship with notification by default

  • Existing dApp might already have their own notification system

  • Checkout src/components/examples/WalletNotification.tsx for an example of how to use the notification system

  • How to add/develop a new wallet?

  • We recommend new developer develops Wallets that comforms to WalletStandard or MWA, to get instant discoverability.
  • https://github.com/solana-labs/wallet-adapter/blob/master/WALLET.md

#By Raccoons

Extension points exported contracts — how you extend this code

DOMAttributes (Interface)
(no doc)
index.d.ts
DOMAttributes (Interface)
(no doc)
types/twin.d.ts
SwapInfo (Interface)
(no doc)
src/components/Swap/UltraClient.ts
IUnifiedWalletContext (Interface)
(no doc)
src/contexts/UnifiedWalletContext.ts
RoutePlan (Interface)
(no doc)
src/components/Swap/UltraClient.ts
IAccountsBalance (Interface)
(no doc)
src/contexts/accounts.tsx
SwapQuoteResponse (Interface)
(no doc)
src/components/Swap/UltraClient.ts
IAccountContext (Interface)
(no doc)
src/contexts/accounts.tsx

Core symbols most depended-on inside this repo

useUnifiedWalletContext
called by 9
src/contexts/UnifiedWalletContext.ts
constructMissingProviderErrorMessage
called by 7
src/contexts/UnifiedWalletContext.ts
useTranslation
called by 7
src/contexts/TranslationProvider/index.tsx
sortByPrecedence
called by 3
src/components/UnifiedWalletModal/index.tsx
shortenAddress
called by 3
src/misc/utils.ts
useUnifiedWallet
called by 3
src/contexts/UnifiedWalletContext.ts
connect
called by 2
src/contexts/UnifiedWalletContext.ts
getSwapQuote
called by 1
src/components/Swap/UltraClient.ts

Shape

Function 123
Interface 20
Method 10
Class 6

Languages

TypeScript100%

Modules by API surface

src/contexts/UnifiedWalletContext.ts11 symbols
src/misc/utils.ts10 symbols
src/components/Swap/UltraClient.ts10 symbols
src/contexts/WalletConnectionProvider/HardcodedWalletStandardAdapter.tsx9 symbols
src/contexts/accounts.tsx8 symbols
src/components/UnifiedWalletModal/index.tsx6 symbols
src/contexts/WalletConnectionProvider/index.tsx5 symbols
src/components/UnifiedWalletModal/WalletListItem.tsx4 symbols
src/components/UnifiedWalletModal/Onboarding.tsx4 symbols
src/pages/_document.tsx3 symbols
src/contexts/UnifiedWalletProvider.tsx3 symbols
src/contexts/WalletConnectionProvider/previouslyConnectedProvider.tsx2 symbols

For agents

$ claude mcp add Unified-Wallet-Kit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact