diff --git a/README.md b/README.md index 844464eba..4aca2b967 100644 --- a/README.md +++ b/README.md @@ -162,8 +162,8 @@ To add it to your dApp, you only need the core packages and UI components for yo ### Core These packages are what most projects can use to support wallets on Solana. -| package | description | npm | -| --------------------------------------------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------ | +| package | description | npm | +| --------------------------------------------------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------- | | [wallets](https://github.com/solana-labs/wallet-adapter/tree/master/packages/core/wallets) | All wallets with icons | [`@solana/wallet-adapter-wallets`](https://npmjs.com/package/@solana/wallet-adapter-wallets) | | [base](https://github.com/solana-labs/wallet-adapter/tree/master/packages/core/base) | Adapter interfaces, error types, and common utilities | [`@solana/wallet-adapter-base`](https://npmjs.com/package/@solana/wallet-adapter-base) | | [react](https://github.com/solana-labs/wallet-adapter/tree/master/packages/core/react) | Contexts and hooks for React dApps | [`@solana/wallet-adapter-react`](https://npmjs.com/package/@solana/wallet-adapter-react) | @@ -175,21 +175,19 @@ These packages are what most projects can use to support wallets on Solana. ### UI Components These packages provide components for common UI frameworks. -| package | description | npm | -| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| package | description | npm | +| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | [material-ui](https://github.com/solana-labs/wallet-adapter/tree/master/packages/ui/material-ui) | Components for [Material UI](https://material-ui.com) | [`@solana/wallet-adapter-material-ui`](https://npmjs.com/package/@solana/wallet-adapter-material-ui) | | [ant-design](https://github.com/solana-labs/wallet-adapter/tree/master/packages/ui/ant-design) | Components for [Ant Design](https://ant.design) | [`@solana/wallet-adapter-ant-design`](https://npmjs.com/package/@solana/wallet-adapter-ant-design) | | [react-ui](https://github.com/solana-labs/wallet-adapter/tree/master/packages/ui/react-ui) | Components for React (no UI framework, just CSS) | [`@solana/wallet-adapter-react-ui`](https://npmjs.com/package/@solana/wallet-adapter-react-ui) | -| [vue-ui](https://github.com/solana-labs/wallet-adapter/tree/master/packages/ui/vue-ui) \* | Components for Vue (no UI framework, just CSS) | [`@solana/wallet-adapter-vue-ui`](https://npmjs.com/package/@solana/wallet-adapter-vue-ui) | - -\* Package has not been published to NPM yet. +| [vue-ui](https://github.com/solana-labs/wallet-adapter/tree/master/packages/ui/vue-ui) | Components for Vue (no UI framework, just CSS) | [`@solana/wallet-adapter-vue-ui`](https://npmjs.com/package/@solana/wallet-adapter-vue-ui) | ### Starter Projects These packages provide projects that you can use to start building a dApp with built-in wallet support. Alternatively, check out [dapp-scaffold](https://github.com/solana-labs/dapp-scaffold) for a more complete framework. -| package | description | npm | -| --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | +| package | description | npm | +| --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | [example](https://github.com/solana-labs/wallet-adapter/tree/master/packages/starter/example) | Demo of UI components | [`@solana/wallet-adapter-example`](https://npmjs.com/package/@solana/wallet-adapter-example) | | [material-ui-starter](https://github.com/solana-labs/wallet-adapter/tree/master/packages/starter/material-ui-starter) | [Create React App](https://create-react-app.dev) project using Material UI | [`@solana/wallet-adapter-material-ui-starter`](https://npmjs.com/package/@solana/wallet-adapter-material-ui-starter) | | [react-ui-starter](https://github.com/solana-labs/wallet-adapter/tree/master/packages/starter/react-ui-starter) | [Create React App](https://create-react-app.dev) project using React UI | [`@solana/wallet-adapter-react-ui-starter`](https://npmjs.com/package/@solana/wallet-adapter-react-ui-starter) | diff --git a/packages/core/vue/package.json b/packages/core/vue/package.json index 8f58b6a44..ba941aff2 100644 --- a/packages/core/vue/package.json +++ b/packages/core/vue/package.json @@ -1,6 +1,6 @@ { "name": "@solana/wallet-adapter-vue", - "version": "0.3.0", + "version": "0.3.1", "author": "Solana Maintainers ", "repository": "https://github.com/solana-labs/wallet-adapter", "license": "Apache-2.0", diff --git a/packages/core/vue/src/useWallet.ts b/packages/core/vue/src/useWallet.ts index f15ef5b83..a04dec6be 100644 --- a/packages/core/vue/src/useWallet.ts +++ b/packages/core/vue/src/useWallet.ts @@ -53,8 +53,11 @@ export interface WalletStoreProps { const walletStoreKey: InjectionKey = Symbol(); -export const useWallet = (): WalletStore | undefined => { - return inject(walletStoreKey); +export const useWallet = (): WalletStore => { + const walletStore = inject(walletStoreKey); + if (!walletStore) + throw new Error('Wallet not initialized. Please use the `WalletProvider` component to initialize the wallet.'); + return walletStore; }; export const initWallet = ({ diff --git a/packages/ui/vue-ui/package.json b/packages/ui/vue-ui/package.json index c2fe0fda7..2d7406d24 100644 --- a/packages/ui/vue-ui/package.json +++ b/packages/ui/vue-ui/package.json @@ -1,10 +1,12 @@ { - "private": true, "name": "@solana/wallet-adapter-vue-ui", "version": "0.1.0", "author": "Solana Maintainers ", "repository": "https://github.com/solana-labs/wallet-adapter", "license": "Apache-2.0", + "main": "lib/index.js", + "esnext": "lib/index.js", + "types": "lib/src/index.d.ts", "files": [ "lib", "src", diff --git a/packages/ui/vue-ui/src/WalletModal.vue b/packages/ui/vue-ui/src/WalletModal.vue index 0e7a70774..c62ac4def 100644 --- a/packages/ui/vue-ui/src/WalletModal.vue +++ b/packages/ui/vue-ui/src/WalletModal.vue @@ -1,7 +1,7 @@