iOS SDK

Import

import RampInstant

Constructor

RampInstantManager(configuration: RampInstant.Configuration);

Example

let configuration = RampInstant.Configuration(
    hostLogoUrl: "www.example.com/icon.png",
    hostAppName: "Example App Name",
    userAddress: "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
    swapAsset: "ETH",
    swapAmount: "1500000000000000000", // 1.5 ETH in wei
    webhookStatusUrl: "https://my.domain/callback/123/"
)

let manager = RampInstantManager(configuration: configuration!)

manager.presentWidget(on: YOUR_VIEW_CONTROLLER, animated: true)

Config parameters

RampInstant.Configuration(
  // 'ETH' or 'DAI'
  swapAsset: string;

  // int string - wei or token units
  swapAmount: string;

  // 0x-prefixed ETH address of the buyer
  userAddress: string;

  // URL to your app's logo
  hostLogoUrl: string;

  // your app's name
  hostAppName: string;

  // _optional_
  // allows to provide an alternative URL to load
  // a non-production version of the widget
  url?: string;

  // _optional_
  // your URL for webhook updates of the purchase status
  webhookStatusUrl?: string;
)

Methods

presentWidget()

presentWidget(on viewController: UIViewController, animated: Bool)

Initializes the widget and displays it.

Note: this can be only called once per RampInstantManager instance - if you want to open the widget again, you need to create a new RampInstantManager.