myria-wallet-provider
v0.3.0
Published
``` npm install myria-wallet-provider ```
Downloads
38
Readme
Installation
npm install myria-wallet-providerUsages
- Create an instance of WalletClient
import { WalletClient } from 'myria-wallet-provider';
const walletClient = new WalletClient();- Connect wallet
const Component = () => {
const handleConnect = () => {
try {
const data = walletClient.connect();
// handle data
} catch (e) {
// handle error
}
};
return <button> Connect </button>;
};By default, it will create a popup (new window) to connect, if the you want to embed an iframe instead, create an WalletClient instance with iframeOptions:
import { WalletClient } from 'myria-wallet-provider';
const walletClient = new WalletClient({
iframeOptions: {
containerSelector: '#__next',
},
});