https://github.com/ronanyeah/sui-connect
https://github.com/ronanyeah/sui-connect
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ronanyeah/sui-connect
- Owner: ronanyeah
- Created: 2025-04-10T19:22:11.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-25T20:38:58.000Z (about 1 year ago)
- Last Synced: 2025-04-25T21:29:52.188Z (about 1 year ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sui-connect
A wrapper for importing the `@mysten/dapp-kit` Sui wallet select menu into a non-React project. ([Webpack example](https://github.com/ronanyeah/elm-webpack))
For an alternative project that uses a `` tag instead of imports, see: [juzybits/polymedia-suiconnect](https://github.com/juzybits/polymedia-suiconnect)
### Usage
```ts
import { WalletAccount } from "@mysten/wallet-standard";
import { init as suiConnectInit } from "sui-connect";
const hooks = await suiConnectInit("sui:testnet");
hooks.setModalOpen(true);
hooks.walletSubscribe((wallet: WalletAccount | null) => {
console.log("wallet:", wallet);
});
const wallet: WalletAccount | null = hooks.currentAccount();
hooks.signTransaction(tx);
hooks.signMessage(msg);
hooks.disconnectWallet();
```