orca.js
A JavaScript API for web3 Transaction and Authenticating
PLEASE NOTE: orca.js is still in development! And comming soon in 2022. Stay tuned on our Discord Server
Contents
Overview
Compatible wallets (latest Version)
- Phantom
- (Soon get Matamask Wallet added!)
Use cases
First of all, require the library using CommonJS syntax. For the import use require
const orca = require("orca.js"); // CommonJS
orcaJS Documentation
Written by OctoDino for Statch
Get Started
Cloning the Project from GitHub
Git:
$ git clone https://github.com/statch/orca.js
GitHub CLI:
$ gh repo clone statch/orca.js
Initialize orca.js
orca.init([debugMode?]) //Load this first for the orca.js API
debugMode?
is a Boolean where you can set if orcaJS can use console.log! (Still in development)
Make a Transaction
How to make a Transaction between two Wallets? Here you have the chainJS Solution for it!
What do we use?
orca.transaction([order])
order
is a const we write it like in the following example!
Code example
// Simple ETH payment
const orca = require('orcajs')
const transaction = {
currency: 'sol', //The Currency to use (at the time only solona aviable!)
amount: 1.1234133, //Transaction amount in SOL
test: false, //Test switch the clusterApiUrl to 'devnet'
wallet: 'enter wallet here', //Ge the transaction
clusterApiUrl: '' //Leave blank for devnet
}
orca.transaction(transaction)
In our const transaction = {...}
we can define whith what currency our transaction is, and many more things. Let's take a look
- With the String Parameter
currency
we can declare the currency we want to use. But at the time we only Support sol! - In the
amount
Float Parameter we can add the amount of the currency that will be transferred. Here we write only the amount in SOL - The
test
Boolean Parameter toogle the Test Mode and switch the clusterApiUrl when true todevnet
- The
wallet
String Parameter is to declerate the Wallet of the reciver of the transaction - With the String Parameter
clusterApiUrl
you can retrieves the RPC API URL for the specified cluster. Leave blank to set todevnet
Support
How you can Support the project? Support Statch by writing to us on our Discord Server or committing to this Repository! Thanks :)
Credits
Contributors
Suporters
No one :,) ...maybe you'll be the first Supporter