0.11.8 • Published 7 months ago

@solana-wallets/solid-2.0 v0.11.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Solid-2.0

Solid.js adapter for the core-2.0 package

Installation

npm install @your-repository-name/solid-2.0
# or
yarn add @your-repository-name/solid-2.0
# or
pnpm add @your-repository-name/solid-2.0

How to use it

import { WalletProvider } from "@your-repository-name/solid-2.0"

// App.tsx
<WalletProvider
  autoConnect={true}
  disconnectOnAccountChange={true}
  localStorageKey="unified:wallet-storage-key"
  env={"devnet"}
  // NOTE: only wallet adapters that use
  // @solana/web3.js v2.x.x should be added
  additionalWallets={[]}
>
  {props.children}
</WalletProvider>

// Example.tsx
import { useWallet } from "@your-repository-name/solid-2.0"

const Example: Component = () => {
  const { connectedAccount, signMessage, getTransactionSendingSigner } = useWallet()
  const publicKey = createMemo<string | undefined>(() => {
    const accInfo = connectedAccount()
    if (!accInfo) {
      return
    }
    return accInfo.type === "standard"
      ? accInfo.info?.pubKey
      : (accInfo.info.publicKey?.toString() ?? undefined)
  })
  return (
    <>
      ...
    </>
  )
}

Changelog

See CHANGELOG.md.

0.11.8

7 months ago

0.11.2

8 months ago

0.11.3

8 months ago

0.11.4

8 months ago

0.11.5

8 months ago

0.11.6

8 months ago

0.11.7

8 months ago

0.11.1

9 months ago

0.11.0

9 months ago

0.10.4

9 months ago

0.10.3

9 months ago

0.10.2

9 months ago

0.10.1

9 months ago

0.10.0

9 months ago

0.9.0

9 months ago

0.8.0

9 months ago

0.7.0

9 months ago