Prerequisites
Before you begin, ensure you have:- Completed the Superlink Partner Onboarding: You must be a Superlink partner to use our SDK. If you aren’t onboarded yet, please reach out to us.
- Received a Partner ID: You must have a Partner ID to initialize the marketplace modal. You will receive a Partner ID when you onboard as a partner.
- A React Project: You must have an existing React project to integrate the React SDK.
Integrating the SDK
To integrate the React SDK into your project, follow these steps:- Install the SDK using npm or yarn
- Add the MarketProvider component
- Add the MarketModal component
- Implement the hooks
setUserInfo
hook is used to set the user’s information, such as their wallet information and external user ID.
setSendTransaction
hook is used to set a function that will handle the transaction. The function will be called when the user confirms the transaction in the marketplace.
The uri
parameter contains the information needed to submit the payment, such as the amount, recipient, and coin type.
In the case of Fiat payments the payment is handled inside the marketplace and the function will not be called.
- coin type:
ethereum
- amount:
1.3062319352247146e17
- recipient:
0x965933D5C73ef443f3a2E4B370c3b6C964fc76eC
open
hook is used to open the marketplace modal.