lrnzlo / Opensea-Transaction-Parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Commitizen friendly

Description

A simple transaction parser for Opensea. Trough @ethersproject library component, decode the log from event that occur on Opensea transaction when an NFT is selled.

Info decoded:

  • Seller
  • Buyer
  • Price
  • Royalty payed to Opensea
  • Address of Royalty Collector Contract
  • NFT Id
  • NFT Collection Address + Name (If exists on chain)

For contribution method please check Contributing section below.

Installation

Run

yarn add || npm i

Fill .env variable as needed.

Usage

Run

yarn test || npm run test

If everything passed, you can

import {GetTransactionData, DecodeTransactionInfo} from "src/index"

GetTransactionData(TrxHash, EtherscanApiKey).then(logs => {
  DecodeTransactionInfo(logs).then(res => {
    console.log(res) // Decoded Transaction as Object
  })
})

Or you can deploy it on aws as API Endpoint via

yarn serverless deploy

In order to do this you will need an aws account and aws credential set as explained in serverless docs.

After that you can test the api endpoint serverlesss return to you via a POST request with TrxHash property in body.

Contributing

For contribution please make a new branch following the name convention as follow

Type: WIP(Work in progress) | FEAT(Features) | BUG | ISSUE(ISSUE:Number of Issue)
Author: Your name
Branch Title: A short Description of implementation that you think to make (3-5 words)

Example:
  ISSUE:10-AuthorName-implement_new_branch

Commits via

yarn cz || npm run cz

About


Languages

Language:TypeScript 98.0%Language:JavaScript 1.3%Language:Shell 0.6%