cashramp
Version: 
Cashramp API NodeJS SDK
113 lines (103 loc) • 1.92 kB
JavaScript
const AVAILABLE_COUNTRIES = `
  query {
    availableCountries {
      id
      name
      code
    }
  }
`;
const MARKET_RATE = `
  query ($countryCode: String!) {
    marketRate(countryCode: $countryCode) {
      depositRate
      withdrawalRate
    }
  }
`;
const PAYMENT_METHOD_TYPES = `
  query ($country: ID!) {
    p2pPaymentMethodTypes(country: $country) {
      id
      identifier
      label
      fields {
        label
        identifier
        required
      }
    }
  }
`;
const RAMPABLE_ASSETS = `
  query {
    rampableAssets {
      name
      symbol
      networks
      contractAddress
    }
  }
`;
const RAMP_LIMITS = `
  query {
    rampLimits {
      minimumDepositUsd
      maximumDepositUsd
      minimumWithdrawalUsd
      maximumWithdrawalUsd
      dailyLimitUsd
    }
  }
`;
const PAYMENT_REQUEST = `
  query ($reference: String!) {
    merchantPaymentRequest(reference: $reference) {
      id
      paymentType
      hostedLink
      amount
      currency
      reference
      status
    }
  }
`;
const ACCOUNT = `
  query {
    account {
      id
      accountBalance
      depositAddress
    }
  }
`;
const RAMP_QUOTE = `
  query ($customer: ID!, $amount: Decimal!, $currency: P2PPaymentCurrency!, $paymentType: PaymentTypeType, $paymentMethodType: String!, $country: String) {
    rampQuote(customer: $customer, amount: $amount, currency: $currency, paymentType: $paymentType, paymentMethodType: $paymentMethodType, country: $country) {
      id
      exchangeRate
      paymentType
    }
  }
`;
const REFRESH_RAMP_QUOTE = `
  query ($rampQuote: ID!, $amount: Decimal) {
    refreshRampQuote(rampQuote: $rampQuote, amount: $amount) {
      id
      exchangeRate
      paymentType
    }
  }
`;
module.exports = {
  AVAILABLE_COUNTRIES,
  MARKET_RATE,
  PAYMENT_METHOD_TYPES,
  RAMPABLE_ASSETS,
  RAMP_LIMITS,
  PAYMENT_REQUEST,
  ACCOUNT,
  RAMP_QUOTE,
  REFRESH_RAMP_QUOTE,
};