Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prantadas/opensea-js
Integrate with OpenSea using the OpenSea-JS library for seamless interaction with the OpenSea API and smart contracts. This project provides JavaScript functions for various actions, including getting wallet balances, fetching asset details, creating offers, listing assets for sale, and more.
https://github.com/prantadas/opensea-js
javascript opensea web3js
Last synced: 20 days ago
JSON representation
Integrate with OpenSea using the OpenSea-JS library for seamless interaction with the OpenSea API and smart contracts. This project provides JavaScript functions for various actions, including getting wallet balances, fetching asset details, creating offers, listing assets for sale, and more.
- Host: GitHub
- URL: https://github.com/prantadas/opensea-js
- Owner: PrantaDas
- Created: 2023-04-11T15:17:46.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-25T17:19:48.000Z (about 1 year ago)
- Last Synced: 2024-11-05T14:15:13.999Z (2 months ago)
- Topics: javascript, opensea, web3js
- Language: JavaScript
- Homepage:
- Size: 320 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenSea-JS Integration
Integrate with OpenSea using the OpenSea-JS library for seamless interaction with the OpenSea API and smart contracts. This project provides JavaScript functions for various actions, including getting wallet balances, fetching asset details, creating offers, listing assets for sale, and more.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Functions](#functions)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)## Installation
1. Clone the repository:
```bash
git clone https://github.com/PrantaDas/opensea-js.git
```2. Change to the project directory:
```bash
cd opensea-js-integration
```3. Install dependencies:
```bash
npm install or yarn
```4. Create a `.env` file and add the necessary environment variables:
```env
MNEMONIC_PHRASE=your_mnemonic_phrase
INFURA_API_KEY=your_infura_api_key
WALLET_ADDRESS=your_wallet_address
```## Usage
Import the functions you need from the `opensea.js` module and use them in your project. Make sure to handle errors appropriately.
```javascript
const {
getBalance,
getAsset,
getAseetBalance,
getTokenBalance,
createOffer,
listAsset,
getCollectionStat,
placeOrder,
transferAsset,
getAllOrder
} = require('./opensea/opensea');// Use the functions as needed in your application
// Example: Get wallet balance
const balance = await getBalance('0x12d9c5fd9e271d2ccc3d8697ff9d2d139d534108');
console.log('Wallet Balance:', balance);