Accepting Payments
Configuring & Connecting Wallets and Managing Identities
The best way to see the payments hooks in action is to try out the Crowdfunding Portal Template, which provides examples of all major wallet hooks. If you're not accustomed to crypto, it can be a bit overwhelming to configure and manage a set of wallets, but we've got you covered. We'll start small and help you expand as you need to.
The funding process used in the Crowdfunding portal is to send
eth
from the user's address to the funding address. Full example here.First import the
sendEth
function inside wallet.tsimport { sendEth } from "api/funding";
Call it whenever you need to send the
eth
const doSendToken = async () => {
try {
await sendEth({
from: fundModal.ethAddress, User's metamask address
to: config.fundAddress,
amount: fundModal.tokenAmount // Fund amount in Wei
}).then(() => {
// Success.
});
} catch (error) {
// Handle your error.
}
};
Last modified 11mo ago