@mintbase-js/react
This package contains React helpers for interacting with Mintbase JS.
@mintbase-js/react relies on React and React Dom version v18.2.0 due to @near-wallet-selector/modal-ui
npm install @mintbase-js/react
npm install @near-wallet-selector/modal-ui
yarn add @mintbase-js/react
yarn add @near-wallet-selector/modal-ui
pnpm install @mintbase-js/react
pnpm install @near-wallet-selector/modal-ui
the default way of interacting with Mintbase Wallet is using the MintbaseWalletContextProvider
app.tsx
1
contractAddress :
your near contract address / your mintbase store address
network :
mainnet | testnet
callbackUrl :
a valid https/http address to the user be sent after the transaction
onlyMbWallet :
boolean, it sets up only MintbaseWallet or if false(default) MintbaseWallet + default wallets
additionalWallets :
WalletModuleFactory[] extra wallets setup
import "@near-wallet-selector/modal-ui/styles.css";
import { MintbaseWalletContextProvider } from '@mintbase-js/react'
<MintbaseWalletContextProvider
contractAddress="mycontract.mintbase1.near"
network="mainnet"
callbackUrl="https://www.mywebsite.com/callback"
>
<Component {...pageProps} />
</MintbaseWalletContextProvider>
The wallet runs only on client-side.
This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
Last modified 7d ago