react-web3-checkout
v1.0.0
Published
A customizable React Web3 Checkout Widget.
Downloads
71
Readme
React Web3 Checkout
A customizable React Web3 Checkout widget for handling Web3 payments.
Installation
npm install react-web3-checkout
Usage
import { CheckoutWidget } from "react-web3-checkout";
function App() {
const config = {
receiverAddress: "0xYourWalletAddress",
amount: 10, // 10 USDC
token: "0xYourTokenAddress", // USDC
chain: 137,
webhookUrl: "https://your-server.com/webhook"
};
return <CheckoutWidget config={config} />;
}
export default App;
Configuration
The CheckoutWidget
component accepts a config
prop which is an object with the following properties:
receiverAddress
: The Ethereum address to which the payment will be sent.amount
: The amount of the payment. Default is 0.token
: The token to use for the payment. Default is "ETH".chain
: The chain to use for the payment. Default is "mainnet".
Publishing
npm run build
npm publish --access public
Safety
This project is in early development and has not been audited. Use at your own risk.
License
This project is licensed under the MIT License - see the LICENSE file for details.