How to Create Your Own Store on HashUp?
HashUp's mission is to power thousands of stores at once!
HashUp is the infrastructure and protocol needed to create your own game store. A full-fledged Web3 game store requires a Games + Whitelabel Web3 PC Launcher with Metamask.
The HashUp architecture is divided into four segments:
The HashUp protocol for license sales
ERC20-compliant licenses
An open API that allows you to have information about licenses
PC Launcher!
HashUp SDK for React
This is official HashUp protocol SDK for React. You can use it to make your own marketplace using our protocol.
Installation
Usage
At top of the file import useHashup
hook from our SDK.
Now declare it in your component
buyGame()
function
buyGame()
functionaccepts two arguments:
ERC20 token address of license you want to buy
how many licenses you want to buy
Click the button to open the MetaMask window. If the user is not connected, it will ask them to connect, then request approval (if required). After successful approval, it will request a license purchase transaction. It will take specified amount of USDT from the user's account and send licenses to his wallet.
setMarketplace()
function
setMarketplace()
functionaccepts a single argument:
address of your own marketplace
Sets up your marketplace address.
approve()
function
approve()
functionTriggers manual payment token approval. Example use case:
Hook Interface
Class Diagram
Where to get license data?
All games listed on HashUp protocol are available at https://open-api.hashup.it/v1/tokens endpoint of our public API.
For example:
https://open-api.hashup.it/v1/tokens/<chain|chainId>
– to get all polygon tokens example: https://open-api.hashup.it/v1/tokens/137/https://open-api.hashup.it/v1/token/<chain|chainId>/<address>
– to get a specific token example: https://open-api.hashup.it/v1/token/137/0x6cbf4648d1f326585f7aa768913991efc0f2b952
You can check full API specification at wiki.hashup.it.
buyGame()
function accepts two arguments
ERC20 token address of license you want to buy
how many licenses you want to buy
Click the button to open the MetaMask window. If user is not connected, it will ask him to connect, then request approval. After successful approval, it will request a license purchase transaction. It will take specified amount of USDT from the user's account and send licenses to his wallet.
The HashUp API - how to connect?
PC Launcher!
Last updated