promise based client for OST KIT
Using npm:
npm install ostkit --save
Using yarn:
yarn add ostkit --save
Check out the tutorial for beginners!
List users
var Ostkit=require("ostkit")
var ok = new Ostkit("YOUR_API_KEY", "YOUR_API_SECRET");
ok.usersList().then((res) => {
console.log(res)
});
Create a user
var Ostkit=require("ostkit")
var ok = new Ostkit("YOUR_API_KEY", "YOUR_API_SECRET");
ok.usersCreate({name: "Stefan"}).then((res) => {
console.log(res)
}).catch((e) => {
console.log("Err", e.response.data.err)
});
You can monitor transactions by using monitorTransaction(transaction_uuid, callback) it only gets fired when the transaction status changes and is removed after the first complete
or failed
status.
var Ostkit=require("ostkit")
var ok = new Ostkit("YOUR_API_KEY", "YOUR_API_SECRET");
ok.monitorTransaction("transaction-uuid" , function(transaction) {
if (transaction.status == "complete") {
console.log("Successful transaction")
} else if (transaction.status == "failed") {
console.log("Transaction failed")
} else {
console.log("Status: ",transaction.status)
}
})
- usersCreate
({name})
- usersEdit
({uuid, name})
- usersList
({page_no = 1, filter = "all", order_by = "creation_time", order="desc"})
- usersAirdropDrop
({amount, list_type})
- usersAirdropStatus
({airdrop_uuid})
- transactiontypesCreate
({name, kind, currency_type, currency_value, commission_percent})
- transactiontypesEdit
({client_transaction_id, name, kind, currency_type, currency_value, commission_percent})
- transactiontypesList
()
- transactiontypesExecute
({from_uuid, to_uuid, transaction_kind})
- transactiontypesStatus
({transaction_uuids})
ostkit.js is part of my OST KIT⍺ Phase II Project FIRMAMENT
I am using serveo for development on ostkit.js and Firmament. The author of that awesome service (Trevor) is asking his users for donations to help fund his friends babys liver transplant. If anyone of you can spare some coins please do so at gofundme.com