Skip to content

hashup-it/hashup-preview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HashUp Store preview sample

React-implemented HashUp store example app.

Uses npm @hashup-it/hashup-react-sdk package to get HashUp Store functionality, paired alongside with HashUp API to fetch any Store's game & analytics data.

User's-point-of-view flow:
Fetch licences (https://open-api.hashup.it:3000/v1/tokens) --> display licenses --> purchase a licence.

Example use:

import { useHashup } from '@hashup-it/hashup-react-sdk'

function App() {
  const { buyGame } = useHashup()
  
  /** Address of license you wish to buy. 
	  Fetched from https://open-api.hashup.it/ OpenAPI. */
  const licenseAddress = '0x123…abc'
  
  /** Amount of licenses you wish to buy. */
  const licenseAmount = 2

  function handleLicenseBuy() { 
      buyGame(licenseAddress, licenseAmount)
  }

  return (
    <div className="App">
       <button onClick={handleLicenseBuy}>Buy 2 copies of game</button>
    </div>
  );
}

Further reading


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published