docs/developers/ocean.js/README.md

7.3 KiB

description
JavaScript library to privately & securely publish, exchange, and consume data.

Ocean.js

With ocean.js, you can:

  • Publish data services: downloadable files or compute-to-data. Create an ERC721 data NFT for each service, and ERC20 datatoken for access (1.0 datatokens to access).
  • Sell datatokens for a fixed price. Sell data NFTs.
  • Transfer data NFTs & datatokens.

Ocean.js is part of the Ocean Protocol toolset.

{% embed url="https://www.youtube.com/watch?v=lqGXPkPUCqI" %} Introducing Ocean.JS {% endembed %}

The Ocean.js library adopts the module architectural pattern, ensuring clear separation and organization of code units. Utilizing ES6 modules simplifies the process by allowing you to import only the necessary module for your specific task.

The module structure follows this format:

  • Types
  • Config
  • Contracts
  • Services
  • Utils

When working with a particular module, you will need to provide different parameters. To instantiate classes from the contracts module, you must pass objects such as Signer, which represents the wallet instance, or the contract address you wish to utilize, depending on the scenario. As for the services modules, you will need to provide the provider URI or metadata cache URI.

Examples and Showcases 🌟🚀

Ocean.js is more than just a library; it's a gateway to unlocking your potential in the world of decentralized data services. To help you understand its real-world applications, we've curated a collection of examples and showcases. These examples demonstrate how you can use Ocean.js to create innovative solutions that harness the power of decentralized technologies. Each example provides a unique perspective on how you can apply Ocean.js, from decentralized marketplaces for workshops to peer-to-peer platforms for e-books and AI-generated art. These showcases serve as an inspiration for developers like you, looking to leverage Ocean.js in your projects, showcasing its adaptability and transformative capabilities. Dive into these examples to see how Ocean.js can bring your creative visions to life. 📚

Decentralised Data Marketplace 🌊 A decentralised marketplace for peer-to-peer online workshops. marketplace.png https://github.com/oceanprotocol/market
Music NFTs Marketplace 🎼 A peer-to-peer platform for buying on-demand music NFTs. ocean_waves.png https://github.com/oceanprotocol/waves
Tokengated Content 🔒 A decentralised marketplace for buying & selling AI-generated Art. tokengate.png https://github.com/oceanprotocol/token-gating-template
Tokengated AI Chatbot 🤖 A decentralised e-commerce platform to sell templates, UI kits and plugins. tokengated_chatbot.png https://github.com/oceanprotocol/tokengated-next-chatgpt
Buy & Sell Online Workshops 🎓 A decentralised marketplace for peer-to-peer online workshops. oceanLearn.jpg https://www.figma.com/proto/8nT6qEUMMmJsMs8Ow2KzAN/OceanLearn?type=design&scaling=min-zoom&page-id=5%3A44&starting-point-node-id=5%3A91
E-Books On-Demand 📖 A peer-to-peer platform for reading on-demand e-books. oceanReads.jpg https://www.figma.com/proto/xReYRMMnhrynRsNqdy63tT/OceanReads?type=design&node-id=28-380&scaling=min-zoom&page-id=28%3A380&starting-point-node-id=135%3A92
Buy Templates, UI Kits, and plugins 🎨 A decentralized e-commerce platform to sell templates, UI kits, and plugins. webPallete.png https://www.figma.com/proto/xAcyc0rqZNTA8TdW43NN5P/WebPalette?type=design&node-id=0-1&scaling=min-zoom&page-id=0%3A1&starting-point-node-id=9%3A138
Decentralised Ticketing Mobile App 📱 The first end-to-end decentralized mobile App to buy, sell & trade tickets of any type. TicketingMobileApp.png https://www.figma.com/proto/lu5ODNDwIrJmlM0WqBeBJ3/OceanTickets?page-id=75%3A386&type=design&node-id=336-126&viewport=131%2C706%2C0.19&t=ia9UyDUfZxZQS4k1-1&scaling=scale-down&starting-point-node-id=336%3A126
Publish & Collect Digital Art 🖼️ A decentralised marketplace for buying & selling AI-generated Art. oceanArt.jpg https://www.figma.com/proto/LwbMqloVagXnmlaeDCFiJC/OceanArt?type=design&node-id=13-122&scaling=min-zoom&page-id=13%3A122&starting-point-node-id=13%3A169

With these examples and showcases, you've seen just a glimpse of what you can achieve with this library. Now, it's your turn to dive in, explore, and unleash your creativity using Ocean.js. 🚀