@glass-wallet/glass-wallet-adapter
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Glass Wallet Adapter

Integrate your DApp with Glass Wallet.

With this adapter, your DApp can easily connect with the Glass Wallet. Demo: demo
Integrate with Glass Adapter: github
Integrate with WalletStandardAdapterProvider: github

🚀 Get Started

Installation

npm install @glass-wallet/glass-wallet-adapter
# or
yarn add install @glass-wallet/glass-wallet-adapter

Setup

With WalletStandardAdapterProvider

// App.js
import "./App.css";
import { useMemo } from "react";
import { WalletProvider } from "@mysten/wallet-adapter-react";
import { WalletStandardAdapterProvider } from "@mysten/wallet-adapter-all-wallets";
import MainScreen from "./MainScreen";

function App() {
  const adapters = useMemo(() => [new WalletStandardAdapterProvider()], []);

  return (
    <div className="App">
      <header className="App-header">
        <WalletProvider adapters={adapters}>
          <MainScreen />
        </WalletProvider>
      </header>
    </div>
  );
}

export default App;

With GlassWalletAdapter

// App.js
import "./App.css";
import { useMemo } from "react";
import {
  Wallet,
  WalletAdapter,
  WalletProvider,
} from "@mysten/wallet-adapter-react";
import MainScreen from "./MainScreen";
import { GlassWalletAdapter } from "@glass-wallet/glass-wallet-adapter";

const glassAdapter = new GlassWalletAdapter();

function App() {
  const adapters = useMemo(() => {
    return [
      {
        adapter: glassAdapter,
      } as Wallet,
    ];
  }, []);

  return (
    <div className="App">
      <header className="App-header">
        <WalletProvider supportedWallets={adapters}>
          <MainScreen />
        </WalletProvider>
      </header>
    </div>
  );
}

export default App;

@Reference: MystenLabs/sui

Readme

Keywords

Package Sidebar

Install

npm i @glass-wallet/glass-wallet-adapter

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

74.3 kB

Total Files

11

Last publish

Collaborators

  • miknevermind