![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@nextgensoftware/oasis-api
Advanced tools
A JavaScript proxy for the Oasis API. To be used only in the browser.
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.
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.
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"
The Auth class handles the authentication of the oasis-api. It can be imported by:
import { Auth } from "oasis-api"
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)
})
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",
});
This logs a user out and revokes his token
import { Auth } from "oasis-api";
const oasisAuth = new Auth();
const data = await OasisAuth.logout();
import { Auth } from "oasis-api";
const oasisAuth = new Auth();
const data = await OasisAuth.forgotPassword({ email: "test@test.com" });
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();
This class manages a user's avatar from adding Karma, deleting and updating avatar, etc,
import { Avatar } from "oasis-api"
This function gets an avatar when its ID is provided
import { Avatar } from "oasis-api";
const avatar = new Avatar();
const res = await avatar.get();
This function returns all registered avatars
import { Avatar } from "oasis-api";
const avatar = new Avatar();
const res = await avatar.getAll();
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"
}
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
})
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"
}
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"
}
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
Load's all holon data object for the given id.
const data = new oasis.Data()
data.loadAllHolons().then(()=>{
//pass
}).catch((err)=>{
// pass
})
saves holon data object.
const data = new oasis.Data()
data.saveHolon(data).then(()=>{
//pass
}).catch((err)=>{
// pass
})
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
gets karma value of an avatar
const karma = new oasis.Karma()
karma.getKarmaForAvatar(id).then(()=>{
//pass
}).catch((err)=>{
// pass
})
params id: Avatar id
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,
}
oasis.Karma.getKarmaAkashicRecordsForAvatar(id)
params
id: Avatar id
oasis.Holochain.getHolochainAgentIdForAvatar(id)
params
id: holochain id
oasis.Holochain.getHolochainAgentPrivateKeyForAvatar(id)
params
id: avatar id
oasis.Holochain.getAvatarIdForHolochainAgentId(id)
params
id: agent id
oasis.Holochain.getHoloFuelBalanceForAgentId(id)
params
id: agent id
oasis.Holochain.getHoloFuelBalanceForAvatar(id)
params
id: avatar id
oasis.Holochain.getHoloFuelBalanceForAvatar(data)
params
data schema: {agentId: string, avatarId: string}
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,
},
}
oasis.NFT.createPurchase(count, couponCode)
oasis.NFT.purchaseOLAND(data)
params
data schema
{
olandId: "",
avatarId: "",
avatarUsername: "",
tiles: "",
walletAddress: "",
cargoSaleId: "",
}
oasis.Solana.mint(data)
oasis.Solana.exchange(data)
params
data schema
{
fromAccount: {
publicKey: "",
},
toAccount: {
publicKey: "",
},
memoText: "",
amount: 0,
mintAccount: {
publicKey: "",
},
}
FAQs
A JavaScript proxy for the Oasis API. To be used only in the browser.
The npm package @nextgensoftware/oasis-api receives a total of 0 weekly downloads. As such, @nextgensoftware/oasis-api popularity was classified as not popular.
We found that @nextgensoftware/oasis-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.