npm i smartypay-client-subscriptions-react
How to use with Metamask Browser Extension
- Addition install smartypay-client-metamask
npm i smartypay-client-metamask
- Use hook: useConnectToWalletCallback
- See demo project for more details
import { SmartyPayMetamaskProvider } from 'smartypay-client-metamask';
import { useConnectToWalletCallback, useSmartyApiLocked } from 'smartypay-client-subscriptions-react';
export function MetamaskConnectButton(){
const isSmartyApiLocked = useSmartyApiLocked();
const connectToMetamask = useConnectToWalletCallback(SmartyPayMetamaskProvider);
return (
<>
<button
disabled={isSmartyApiLocked}
onClick={connectToMetamask}
>
Metamask
</button>
</>
)
}
- Use static method: activateSubscriptionInWallet
- See demo project for more details
- Use static method: pauseSubscriptionInWallet
- See demo project for more details
- Use static method: unPauseSubscriptionInWallet
- See demo project for more details
- Use static method: cancelSubscriptionInWallet
- See demo project for more details
- Use static method: addSubscriptionsListener
- See demo project for more details