import { mpp } from '@skalenetwork/mpp/server'
import express from 'express'
const app = express()
const method = mpp.charge({
chain: 'skale-base',
currency: 'USDC.e',
extensions: { gasless: 'eip3009' }
})
app.post('/api/payment', async (req, res) => {
const { amount, from, signature } = req.body
try {
const tx = await method.createTransfer({
to: process.env.RECEIVING_ADDRESS,
amount,
from
})
// Process with signature...
res.json({ success: true })
} catch (error) {
res.status(400).json({ error: error.message })
}
})