JSPM

payed

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q29485F
  • License MIT

Confirm ethereum payments

Package Exports

  • payed
  • payed/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (payed) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Payed

Payed is a NodeJS module that lets you check if a transaction is made on the ethereum network. It works using the etherscan API so you will need to get an etherscan API key

Install

npm i payed

Initializing

First you will need import Payed:

import Payed from "payed"

Then you can initialize it by providing your API key:

const payed = new Payed("YOUR_API_KEY")

Usage

To use payed to confirm a payment, you can use the confirm method

let res = await payed.confirm(
    "SOURCE_ADDRESS", 
    "DESTINATION_ADDRESS", 
    "PAYMENT_AMOUNT_IN_USD"
)
console.log("Confirmed?", res)

Or you can use the .then() syntax:

payed.confirm(
    "SOURCE_ADDRESS", 
    "DESTINATION_ADDRESS", 
    "PAYMENT_AMOUNT_IN_USD"
).then(res=>{
    console.log("Confirmed?", res)
}).catch(err=>{
    console.log("Error!", err)
})

License

This project is under MIT license, feel free to use it in your projects