|
| 1 | +import { Mppx, tempo } from "mppx/server"; |
| 2 | +import { createClient, http } from "viem"; |
| 3 | +import { privateKeyToAccount } from "viem/accounts"; |
| 4 | +import { tempoModerato } from "viem/chains"; |
| 5 | + |
| 6 | +const realm = process.env.REALM ?? "mpp.tempo.xyz"; |
| 7 | +const account = privateKeyToAccount( |
| 8 | + (process.env.FEE_PAYER_PRIVATE_KEY ?? |
| 9 | + "0x0000000000000000000000000000000000000000000000000000000000000001") as `0x${string}`, |
| 10 | +); |
| 11 | + |
| 12 | +export const mppx = Mppx.create({ |
| 13 | + methods: [ |
| 14 | + tempo({ |
| 15 | + account, |
| 16 | + currency: import.meta.env.VITE_DEFAULT_CURRENCY!, |
| 17 | + feePayer: true, |
| 18 | + getClient() { |
| 19 | + return createClient({ |
| 20 | + chain: tempoModerato, |
| 21 | + transport: http( |
| 22 | + import.meta.env.RPC_URL ?? "https://rpc.moderato.tempo.xyz", |
| 23 | + ), |
| 24 | + }); |
| 25 | + }, |
| 26 | + html: { |
| 27 | + theme: { |
| 28 | + accent: ["#000000", "#ffffff"], |
| 29 | + background: ["#ffffff", "#0a0a0a"], |
| 30 | + border: ["#e5e5e5", "#262626"], |
| 31 | + colorScheme: "light dark", |
| 32 | + fontFamily: "'Geist', system-ui, sans-serif", |
| 33 | + fontSizeBase: "16px", |
| 34 | + foreground: ["#0a0a0a", "#fafafa"], |
| 35 | + logo: { |
| 36 | + dark: "/logo-light.svg", |
| 37 | + light: "/logo-dark.svg", |
| 38 | + }, |
| 39 | + muted: ["#737373", "#a3a3a3"], |
| 40 | + negative: ["#ef4444", "#f87171"], |
| 41 | + positive: ["#22c55e", "#4ade80"], |
| 42 | + radius: "8px", |
| 43 | + spacingUnit: "4px", |
| 44 | + surface: ["#f5f5f5", "#171717"], |
| 45 | + }, |
| 46 | + text: { |
| 47 | + paymentRequired: "Payment Required", |
| 48 | + title: "MPP — Payment Required", |
| 49 | + }, |
| 50 | + }, |
| 51 | + sse: true, |
| 52 | + testnet: true, |
| 53 | + }), |
| 54 | + ], |
| 55 | + realm, |
| 56 | + secretKey: "demo", |
| 57 | +}); |
0 commit comments