Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oasis-api

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oasis-api

A JavaScript proxy for the WEB4 OASIS API. To be used only in the browser.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
2
Weekly downloads
 
Created
Source

WEB4 OASIS API Javascript Package

Introduction

This package is for client applications to connect and work with the OASIS API. Various OASIS API functions and services can be accessed with this API such as Authentication, Karma, Avatars, Data, SEEDS, Wallets/Keys & more...

Overview

WEB4 OASIS API Javascript Package allowing peeps to build and integrate the OASIS API into any web application using Javascript.

This allows you to bridge between all of WEB2 & WEB3 including Holochain, IPFS, MongoDB, SQLLite, Neo4j, Solana, Ethereum, EOS & ThreeFold with many more coming soon such as COSMOS, Polkadot, Polygon, SOLID, ActivityPub, Near & many more! :)

WEB 4 OASIS API is a fully distributed decentralised fault tolerant load balanced integrated API that runs across the full Internet acting as an abstraction layer over everything and serves as a network of networks.

One of the core design goals of the OASIS is maximum interoperability (to remove all silos and walled gardens) to the point everything merges into one (the singularity) and also to be super powerful but super easy and intuitive to use.

It also harnesses the best of each provider so the OASIS uses the strengths of each provider to the maximum and removes all weaknesses, it automatically uses the most appropriate provider or providers for any given use case.

The WEB4 OASIS API connects & Integrates everything (all of Web 2 & Web 3) including all blockchains, holochain, ipfs, databases, cloud etc into one fully unified API that is an abstraction layer over everything) and the STAR OASIS Omniverse (WEB 5) where Our World is the first world in the infinite Omniverse (what comes after Metaverse). It connects and integrates all metaverses together through the SSO Avatar/Karma system (part of the OASIS API). It is also a fully interoperable Metaverse Low Code Generator (connecting all WEB 2 and WEB 3 together) through the WEB 4 OASIS API.

The OASIS API features a powerful Avatar SSO API allowing one login across all your sites, games, apps, services, etc. This avatar is the digital twin of YOU and allows you to earn/lose karma through the Karma API.

It also features the Data API allowing data to be shared between the above providers giving for interoperability. It also has powerful features such as auto-fail over, auto-load balancing and auto-replication across the providers so if one node goes down in your local area it will automatically switch to the next fastest node in your area independent of the network it belongs to, this way the OASIS API never has any downtime and will always be super fast and not reliant on only one network.

The OASIS API also has a SEEDS API allowing people to earn karma for donating and paying with Seeds as well as when they invite or join Seeds. Read more here: https://joinseeds.earth/

Finally it also features a Keys/Wallets API, which allows public private keys to be linked to your avatar per provider and private keys are only stored locally. Public keys and the rest of the wallet are stored on any provider. Because of the auto replication the private keys are automatically backed up to your local devices and can automatically sync between them so if you get a new device it can automatically sync with it, a bit like a decentralised offline cloud.

You will never lose your keys again! ;-)

It can also then sync your public key and wallet address etc when you go back online. With this architecture it opens the doors to many new use cases...

The whole point of the OASIS API is to allow everything to be fully interoperable so data can be shared between any provider, the architecture opens the doors for many more use cases like importing and exporting your data between providers, aggregating all your data to remove all silos so better sense making and AI machine learning can be made to analyse and to make predictions etc, smart contract interoperability, etc

It also allows full data redundancy and for it to be network independent so if one network goes down it can automatically switch to the next fastest node in your area regardless of what network it is on...

WEB 5 OASIS STAR OMNIVERSE is built on top of the OASIS API and aggregates all the worlds data and expresses it within a cyberspace ontology using a cutting edge custom built ORM (Object Relational Mapper) called COSMIC. The STAR Omniverse is both a simulation & game of life and aggregates all metaverses into one fully integrated unified platform. It is also a fully integrated immersive interoperable metaverse Low Code Generator and soooooo much more.... ;-)

Both WEB 4 & WEB 5 use machine learning AI to analyse all of the worlds data to generate useful insights, predictions & so much more!

To summarize, WEB4 OASIS API aggregates all of the worlds data into a fully unified API to allow better sense making to made, which then feeds into WEB5 STAR, which expresses it in a cyberspace ontology and connects the worlds data to the rest of the COSMOS and Galaxy... ;-)

Benefits Of Building On The WEB4 OASIS API:

  • Integrate any WEB2 or WEB3 tech into your (web)app without having to learn or worry about new tech stacks/languages (the OASIS API hides all the complexity away so you can focus on creating your dream app!).

  • No need to worry about how different blockchains or WEB2 and WEB3 can talk and integrate with each other, the OASIS handles all this for you!

  • Future prove so when any new language/tech comes out such as Ethereum2 etc, these will be automatically added to the OASIS API for FREE, you will have FREE upgrades for life!

  • WEB5 ready when it is released later this year...

Check out more info below:

The Power Of The OASIS API
What Is WEB4 & WEB5 Really?
First Production Release Of The WEB4 OASIS API
Annoucing WEB5 STAR ODK/HDK/COSMIC
STAR ODK/HDK/COSMIC/OASIS API/Our World Update
Main WEB4 OASIS API & WEB5 STAR Repo

Do You Want To Get Involved?

We are always looking for people to jump in and get involved, you do not need to be an existing coder, we can help you with that... you just need a willingness to learn and to have an open heart, we are always more interested with what is in your heart rather than your head! ;-)

The whole world is the Our World team, hence the name... ;-) It is not our project; it is all of humanities...

We also offer FREE training and apprenticeship program with the NextGen Developer Training Programmes. We will teach you all we know over time and you get to work on this real live commercial codebase rather than wasting time working on throw away dummy apps as most training offers. No previous skills/experience required and is open to everyone, but especially for all disadvantaged people including special needs, homeless, unemployed, prison inmates, kids on the streets etc. We want to help the people the world has forgotten and for people who have stopped believing in themselves, we BELIEVE IN YOU and in time you will again too. Everyone has a gift for the world, and we will help you find yours… Find out more by checking out the links below:

NextGen Developer Training Programme
NextGen Junior Developer Training Programme

We are looking for Web Devs (with any of these: react, angular, vue, js, html, css), Unity Devs & C# Devs.

If anyone is interested in developing this game/platform, then we would LOVE to hear from you! 😊 There will be opportunities for people to own shares and/or cryptocurrency (as well as other unique perks such as premium locations in both the geolocation and VR versions, personal or business service spotlights, free lifetime access to all premium paid services, massive karma points (allowing your avatar to progress to more advanced stages in the game unlocking new exciting quests, areas to explore & new special abilities/superpowers) plus lots more!) based on the input they are willing to provide.

Thank you and we hope we find interest from people to join us on this exciting incredible journey.

Want to make a difference in the world?

What will be your legacy?

Ready to be a hero?

If the answer is YES, then please proceed to here...

Dev Requirements To Join The Our World Tribe
The Our World Mission (Summary)
http://www.ourworldthegame.com
http://oasisplatform.world/swagger
https://github.com/NextGenSoftwareUK/Our-World-OASIS-API-HoloNET-HoloUnity-And-.NET-HDK
http://www.gofundme.com/ourworldthegame

http://www.nextgensoftware.co.uk
http://www.yoga4autism.com

https://youtu.be/wdYa5wQUfrg
https://www.youtube.com/watch?v=2oY4_LZBW4M&t=3s
https://www.youtube.com/watch?v=rvNJ6poMduo&t=5s
https://www.youtube.com/watch?v=zyVmciqD9rs
https://www.youtube.com/watch?v=SB97mvzJiRg&t=3s

TOGETHER WE CAN CREATE A BETTER WORLD

In Love, Light & Hope,
The Our World Tribe

How To Use

Each function call you make returns a promise of an object which is in this form: {error: boolean, data: object}.

object values error: true when response from api fails data: response gotten from server.

Getting started

To get started with this package run

npm install oasis-api

This installs the package to your project. To use it in the Application, it can be imported by

import oasis from "oasis-api"

Auth

The Auth class handles the authentication of the oasis-api. It can be imported by:

import { Auth } from "oasis-api"

Login

To login use this code:

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

oasisAuth.login({
  username: "email@test.com",
  password: "testpass",
}).then((res)=>{
  if(res.error){
    // Error
  }
  else // No error
}).catch((err)=>{
  console.log(err)
})

Signup

For signup, use this code snippet:

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const data = await OasisAuth.signup({
  firstName: "test",
  lastName: "test",
  email: "test@email.com",
  password: "test",
  confirmPassword: "test",
  acceptTerms: true,
  avatarType: "User",
  title: "Mr",
});

Logout

This logs a user out and revokes his token

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const data = await OasisAuth.logout();

Forgot password

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const data = await OasisAuth.forgotPassword({ email: "test@test.com" });

Get user

This function is used when trying to get a currently logged in user. Code snippet:

import { Auth } from "oasis-api";

const oasisAuth = new Auth();

const data = await OasisAuth.getUser();

Avatar

This class manages a user's avatar from adding Karma, deleting and updating avatar, etc,

import { Avatar } from "oasis-api"

get

This function gets an avatar when its ID is provided

import { Avatar } from "oasis-api";
const avatar = new Avatar();

const res = await avatar.get();

Get All

This function returns all registered avatars

import { Avatar } from "oasis-api";
const avatar = new Avatar();

const res = await avatar.getAll();

update

This updates the avatar with the given ID. User must be logged in & authenticated for this method to work.

avatar.update(data, id).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

the parameter data should be of this shape

  "title": "string",
  "firstName": "string",
  "lastName": "string",
  "avatarType": "string",
  "email": "user@example.com",
  "password": "string",
  "confirmPassword": "string"
}

delete

This updates the avatar with the given ID. User must be logged in & authenticated for this method to work.

avatar.delete(id).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

addKarma

Adds karma to avatar. User must be logged in & authenticated for this method to work.

avatar.addKarma(id, data).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

params id: Avatar id data schema

  "karmaType": "string",
  "karmaSourceType": "string",
  "karamSourceTitle": "string",
  "karmaSourceDesc": "string"
}

removeKarma

Removes karma to avatar. User must be logged in & authenticated for this method to work.

avatar.removeKarma(id, data).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

params id: Avatar id data schema

  "karmaType": "string",
  "karmaSourceType": "string",
  "karamSourceTitle": "string",
  "karmaSourceDesc": "string"
}

Data

loadHolon

Load's a holon data object for the given id.

const data = new oasis.Data()
data.loadHolon(id).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

params id: Holon id

loadAllHolons

Load's all holon data object for the given id.

const data = new oasis.Data()
data.loadAllHolons().then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

saveHolon

saves holon data object.

const data = new oasis.Data()
data.saveHolon(data).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

deleteHolon

deletes a holon data object for the given id.

const data = new oasis.Data()
data.deleteHolon(id).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

params id: Holon id

Karma

getKarmaForAvatar

gets karma value of an avatar

const karma = new oasis.Karma()
karma.getKarmaForAvatar(id).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

params id: Avatar id

removeKarmaForAvatar

removes karma value of an avatar

const karma = new oasis.Karma()
karma.getKarmaForAvatar(id, data).then(()=>{
  //pass
}).catch((err)=>{
  // pass
})

params id: Avatar id data schema:

const data={
      karmaType: string,
      karmaSourceType: string,
      karamSourceTitle: string,
      karmaSourceDesc: string,
}

getKarmaAkashicRecordsForAvatar

oasis.Karma.getKarmaAkashicRecordsForAvatar(id) params id: Avatar id

Holochain

getHolochainAgentIdForAvatar

oasis.Holochain.getHolochainAgentIdForAvatar(id) params id: holochain id

getHolochainAgentPrivateKeyForAvatar

oasis.Holochain.getHolochainAgentPrivateKeyForAvatar(id) params id: avatar id

getAvatarIdForHolochainAgentId

oasis.Holochain.getAvatarIdForHolochainAgentId(id) params id: agent id

getHoloFuelBalanceForAgentId

oasis.Holochain.getHoloFuelBalanceForAgentId(id) params id: agent id

getHoloFuelBalanceForAvatar

oasis.Holochain.getHoloFuelBalanceForAvatar(id) params id: avatar id

getHoloFuelBalanceForAvatar

oasis.Holochain.getHoloFuelBalanceForAvatar(data) params data schema: {agentId: string, avatarId: string}

NFT

createPurchase

oasis.NFT.createPurchase(data) params data schema

nftProvider: number,
     solanaExchange: {
       fromAccount: {
         publicKey: string,
       },
       toAccount: {
         publicKey: string,
       },
       memoText: string,
       amount: number,
       mintAccount: {
         publicKey: string,
       },
     },
     cargoExchange: {
       saleId: string,
     },
   }

getOlandPrice

oasis.NFT.createPurchase(count, couponCode)

purchaseOLAND

oasis.NFT.purchaseOLAND(data) params data schema

{
     olandId: "",
     avatarId: "",
     avatarUsername: "",
     tiles: "",
     walletAddress: "",
     cargoSaleId: "",
}

Solona

mint

oasis.Solana.mint(data)

exchange

oasis.Solana.exchange(data) params data schema

{
      fromAccount: {
        publicKey: "",
      },
      toAccount: {
        publicKey: "",
      },
      memoText: "",
      amount: 0,
      mintAccount: {
        publicKey: "",
      },
    }

Keywords

FAQs

Package last updated on 11 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc