Skip to main content

Overview

NVM Pay supports both cryptocurrency and fiat payment methods, giving AI builders maximum flexibility in how they monetize their services.

Cryptocurrency Payments

Supported Tokens

Accept any ERC-20 token on supported chains:
// Accept USDC
const usdcPrice = getERC20PriceConfig(
  10_000_000n, // 10 USDC (6 decimals)
  '0xA0b86991c014B64b0Ba6BB0d1f13Ea5a76f7e74C', // USDC address
  builderAddress
)

// Accept WETH
const wethPrice = getERC20PriceConfig(
  1_000_000_000_000_000n, // 0.001 WETH (18 decimals)
  '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH address
  builderAddress
)

// Accept native token (ETH, MATIC, etc.)
const nativePrice = {
  priceType: 'FIXED_PRICE',
  tokenAddress: '0x0000000000000000000000000000000000000000',
  amounts: [1_000_000_000_000_000n], // 0.001 ETH
  receivers: [builderAddress]
}

Multi-Chain Support

NVM Pay works across multiple EVM chains:

Base Mainnet

Production environment

Base Sepolia

Testing environment

Custom Chains

Any EVM-compatible chain

Cross-Chain

Coming soon

Fiat Payments

Stripe Integration

Accept credit card payments through Stripe:
// $49.99 via credit card
const fiatPrice = getFiatPriceConfig(
  49_990_000n, // $49.99 (8 decimals)
  builderAddress
)

const { planId } = await payments.plans.registerCreditsPlan(
  { name: 'Pro Plan', description: 'Billed monthly' },
  fiatPrice,
  creditsConfig
)

Supported Currencies

  • USD (United States Dollar)
  • EUR (Euro)
  • GBP (British Pound)
  • More currencies coming soon

Payment Flow

1

User Selection

User chooses fiat payment option
2

Stripe Redirect

Redirected to Stripe checkout
3

Payment Processing

Credit card charged by Stripe
4

Credits Issued

On-chain credits minted on success
5

Settlement

Funds settled to builder’s account

Ordering Fiat Plans

The SDK provides a dedicated method for fiat payment processing:
// Order a plan with fiat payment (credit card via Stripe)
const { sessionId, url } = await payments.plans.orderFiatPlan(planId)

// Redirect user to Stripe checkout
window.location.href = url

// After successful payment, user returns to your app
// The credits are automatically minted to their account
The orderFiatPlan() method returns:
  • sessionId: Stripe checkout session ID for tracking
  • url: Stripe checkout URL for redirect

Complete Fiat Payment Example

async function purchaseWithCreditCard(planId: string) {
  try {
    // Initialize payments SDK
    const payments = Payments.getInstance({
      nvmApiKey: process.env.NVM_API_KEY,
      environment: 'production'
    })
    
    // Get plan details to show user
    const plan = await payments.plans.getPlan(planId)
    console.log(`Purchasing ${plan.metadata.name} for $${plan.price.amounts[0] / 1_000_000}`)
    
    // Initiate fiat payment
    const { sessionId, url } = await payments.plans.orderFiatPlan(planId)
    
    // Store session ID for tracking (optional)
    localStorage.setItem('stripe_session', sessionId)
    
    // Redirect to Stripe checkout
    window.location.href = url
  } catch (error) {
    console.error('Payment failed:', error)
    // Handle error (show user message, etc.)
  }
}

// Handle return from Stripe (in your success page)
async function handlePaymentReturn() {
  const payments = Payments.getInstance({
    nvmApiKey: process.env.NVM_API_KEY,
    environment: 'production'
  })
  
  // Check if payment was successful
  const sessionId = localStorage.getItem('stripe_session')
  
  // Verify the user now has access
  const balance = await payments.plans.getPlanBalance(planId)
  
  if (balance.isSubscriber) {
    console.log('Payment successful! Credits available:', balance.remaining)
    // Clear session storage
    localStorage.removeItem('stripe_session')
    // Redirect to agent or show success message
  }
}

Payment Distribution

Single Receiver

Standard payment to one address:
const singleReceiverPrice = {
  priceType: 'FIXED_PRICE',
  tokenAddress: USDC_ADDRESS,
  amounts: [20_000_000n], // 20 USDC
  receivers: [builderAddress]
}

Multiple Receivers

Split payments between parties:
const multiReceiverPrice = {
  priceType: 'FIXED_PRICE',
  tokenAddress: USDC_ADDRESS,
  amounts: [
    14_000_000n,  // 70% to main developer
    4_000_000n,   // 20% to data provider
    2_000_000n    // 10% to platform
  ],
  receivers: [
    developerAddress,
    dataProviderAddress,
    platformAddress
  ]
}

Revenue Sharing Examples

// 90% to developer, 10% platform fee
const amounts = [18_000_000n, 2_000_000n]
const receivers = [developerAddress, platformAddress]

Payment Security

Transaction Safety

  • All payments are atomic (all-or-nothing)
  • Smart contract escrow ensures delivery
  • No chargebacks on crypto payments
  • Stripe handles fiat fraud prevention

Best Practices

  • Use stablecoins for predictable pricing
  • Consider token liquidity
  • Provide multiple options
  • Display clear conversion rates
  • Show prices in familiar units
  • Include network fees if applicable
  • Update exchange rates regularly
  • Offer currency selection
  • Wait for sufficient confirmations
  • Handle failed transactions gracefully
  • Provide clear error messages
  • Offer support for issues

Implementation Examples

Multi-Payment Plan

async function createMultiPaymentPlan() {
  const metadata = { 
    name: 'Universal Plan',
    description: 'Pay with crypto or card' 
  }
  
  // Crypto option
  const cryptoPlan = await payments.plans.registerCreditsPlan(
    { ...metadata, name: 'Universal Plan (Crypto)' },
    getERC20PriceConfig(50_000_000n, USDC_ADDRESS, builderAddress),
    getFixedCreditsConfig(500n, 1n)
  )
  
  // Fiat option
  const fiatPlan = await payments.plans.registerCreditsPlan(
    { ...metadata, name: 'Universal Plan (Card)' },
    getFiatPriceConfig(49_990_000n, builderAddress),
    getFixedCreditsConfig(500n, 1n)
  )
  
  return [cryptoPlan.planId, fiatPlan.planId]
}