JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 39
  • Score
    100M100P100Q77044F
  • License GPLv3

A simple SDK for stablecoin micropayments

Package Exports

  • micropayments

Readme

Overview

To install the package, you can run npm i micropayments in your project.

To use the micropayments package, you can use the following code:

import PayUSDCButton from 'micropayments'

function App() {
  return (
    <div>
      <h1>Welcome to my webpage</h1>
      <p>Here is free content that is visible to everyone</p>

      <PayUSDCButton webpageOwnerAddress="0x86F6E87FF613bba027C6F0Cb24Da9aD1dB7c93aB" amount={0.1} webpageId={1} >
        <p>Here is some content that is only visible if you pay 0.1 USDC</p>
      </PayUSDCButton>
    </div>
  )
}

Any content within the PayUSDCButton component will only be visible if the user pays the specified amount of USDC.

Parameters

webpageOwnerAddress

The webpageOwnerAddress is the address of the owner of the webpage. Only this address will be able to receive any amount of USDC that is paid to the webpage.

amount

The is the minimum amount of USDC that the user needs to pay to access the content within the PayUSDCButton component.

webpageId

The webpageId refers to the id of the webpage created by webPageOwnerAddress. If a webpage owner has multiple webpages that users must pay for separately, they should have different webpageIds. If a webpage owner has multiple webpages that users only need to pay for once, they should have the same webpageId.