What do we need to implement a new provider?

To buy MANA

Integration side

  1. An initializable widget. One option is by opening an URLs configurable by QueryParams , another option could be by using a Javascript library.
    1. If a new tab or window it’s needed, it must let you return to Decentraland with the id of the purchase after finishing it.
  2. A mechanism to get the id and status of the purchase. In order to keep the whole feature only as client-side, we have the following options:
    1. A Javascript library with listenable events that notify status changes in the order.
    2. A public API that lets fetching the whole order with a client-side API key.
    3. A combination of both alternatives is also a valid option.
  3. The entity representing the real purchase, must have the transaction hash. That way, we will be able to show the blockchain transaction in the Activity Page.

dApps Team side

In [decentraland-dapps](<https://github.com/decentraland/decentraland-dapps>) > [src/modules/manaFiatGateway](<https://github.com/decentraland/decentraland-dapps/tree/master/src/modules/manaFiatGateway>)

  1. Add a new folder with the integration adapter.
    1. Ideally, the classes could implement a common interface in order to be treated #polymorphically.
  2. Each implementation should be able to respond to the following calls:
    1. Open the widget / Create the widget URL that should be opened

    2. Suscribe to JS events if relevant

    3. Fetch the integration order by its id

    4. Map the integration order into a Decentraland purchase (Transak example, Moon Pay example):

      type Purchase = {
        id: string
        amount: number
        network: Network
        gateway: NetworkGatewayType
        timestamp: number
        status: 'pending' | 'failed' | 'cancelled' | 'complete'
        address: string
        txHash: string | null
      }
      
    5. (Optional) Get the purchase receipt URL


To buy NFTs

TBD