📱 Installation guide for our iOS SDK
💡Supporting the latest versionsThe SDK supports iOS 14 and above
Download the SDK by adding the following repository to the Swift Package Manager: .
Initialize the SDK in your application with desired flow, environment and any parameters related to On-Ramp, Off-Ramp or Swap.
See the parameters pages for Buy, Sell, NFT and Swap for details on which parameters can be passed for each flow.
Arguments:
config
: MoonPaySdkConfig,
Your config variant must match your query params variant.
Variants:
MoonPaySdkBuyConfig
MoonPaySdkSellConfig
MoonPaySdkSwapsCustomerSetupConfig
MoonPaySdkLegacyConfig
Arguments:
debug
: Boolean
environment
: MoonPayWidgetEnvironment
params
: MoonPayQueryParams
handlers
: MoonPayHandlers?
📘ConfigurationPossible values for
environment
: MoonPayWidgetEnvironment.sandbox, MoonPayWidgetEnvironment.production
Your query params variant must match your config variant.
Variants:
MoonPayBuyQueryParams
MoonPaySellQueryParams
MoonPaySwapsCustomerSetupParams
MoonPayLegacyParams
All of the following are optional. However, you must explicitly pass nil
for each handler you don't need to implement.
Arguments:
onSwapsCustomerSetupComplete
: () -> Void
onUnsupportedRegion
: () -> Void
onKmsWalletCreated
: () -> Void
onAuthToken
: (OnAuthTokenRequestPayload) -> Void
onLogin
: (OnLoginRequestPayload) -> Void
onInitiateDeposit
: (OnInitiateDepositRequestPayload) -> OnInitiateDepositResponsePayload
Arguments:
token
: String
csrfToken
: String
Arguments:
isRefresh
: Boolean
Arguments:
transactionId
: String
cryptoCurrencyAmount
: String
cryptoCurrencyAmountSmallestDenomination
: String
fiatCurrencyAmount
: String?
depositWalletAddress
: String
cryptoCurrency
: CryptoCurrency
fiatCurrency
: FiatCurrency
Arguments:
depositId
: String
Arguments:
id
: String
name
: String
code
: String
contractAddress
: String?
chainId
: String?
coinType
: String?
networkCode
: String?
Arguments:
id
: String
name
: String
code
: String
If you're using the walletAddress
or walletAddresses
query param, you need to sign your widget URL before you can display the widget. Learn more about URL signing.
moonPaySdk.show
takes one argument, mode
, which takes a value of type MoonPayRenderingOptioniOS. The mode variants are MoonPayRenderingOptioniOS.WebViewOverlay() and MoonPayRenderingOptioniOS.InAppBrowser().
Updated 4 months ago
Table of Contents
Download
Initialize
SDK Configuration
MoonPayiOSSdk
MoonPaySdkConfig
MoonPayQueryParams
MoonPayHandlers
Handler Payload Types
OnAuthTokenRequestPayload
OnLoginRequestPayload
OnInitiateDepositRequestPayload
OnInitiateDepositResponsePayload
CryptoCurrency
FiatCurrency
Display