An open API service indexing awesome lists of open source software.

https://github.com/ronanyeah/sui-connect


https://github.com/ronanyeah/sui-connect

Last synced: 11 months ago
JSON representation

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();
```