Get Started
Install the package and initialize MoonPayProtocol with your wallet and keys.
This guide covers installation and initializing the protocol. You need Node.js, npm, and MoonPay API keys from your MoonPay dashboard.
Installation
Run the following to install @tetherto/wdk-protocol-fiat-moonpay:
npm install @tetherto/wdk-protocol-fiat-moonpayInitialize MoonPayProtocol
You can create a fiat ramp client with new MoonPayProtocol(account, config):
import MoonPayProtocol from '@tetherto/wdk-protocol-fiat-moonpay'
const moonpay = new MoonPayProtocol(walletAccount, {
apiKey: process.env.MOONPAY_PUBLISHABLE_KEY,
secretKey: process.env.MOONPAY_SECRET_KEY
})Never ship a secret key to browsers. Run server-side signing where your architecture allows, and rotate keys if they leak.
See Configuration for cacheTime and related options.