Skip to content

Commit d71c640

Browse files
author
Kedar
authored
Merge pull request #3 from OpenSTFoundation/release-0.9.1
Release 0.9.1
2 parents 1dfb8ae + 63dad0c commit d71c640

File tree

5 files changed

+43
-185
lines changed

5 files changed

+43
-185
lines changed

LICENSE

Lines changed: 0 additions & 165 deletions
This file was deleted.

LICENSE.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2018 OST.com Ltd.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# OST Javascript SDK
2-
The official [OST Javascript SDK](https://dev.ost.com/).
1+
# OST JavaScript SDK
2+
The official [OST JavaScript SDK](https://dev.ost.com/).
33

44
## Requirements
55

@@ -14,23 +14,24 @@ To use this node module, developers will need to:
1414

1515
## Installation
1616

17-
Install OST Javascript SDK
17+
Install OST JavaScript SDK
1818

1919
```bash
20-
> npm install @ostdotcom/ost-sdk
20+
> npm install @ostdotcom/ost-sdk-js
2121
```
2222

2323
## Example Usage
2424

2525
Require the SDK:
2626

2727
```node.js
28-
const OSTSDK = require('@ostdotcom/ost-sdk');
28+
const OSTSDK = require('@ostdotcom/ost-sdk-js');
2929
```
3030

3131
Initialize the SDK object:
3232

3333
```node.js
34+
// the currently valid API endpoint is "https://playgroundapi.ost.com", this may change in the future
3435
const ostObj = new OSTSDK({apiKey: <api_key>, apiSecret: <api_secret>, apiEndpoint: <api_endpoint>});
3536
```
3637

@@ -45,39 +46,39 @@ const transactionKindService = ostObj.services.transactionKind;
4546
Create new transaction types:
4647

4748
```node.js
48-
transactionKindService.create({name: 'Like', kind: 'user_to_user', currency_type: 'usd', currency_value: '1.25', commission_percent: '12'}).then(console.log).catch(console.log);
49+
transactionKindService.create({name: 'Like', kind: 'user_to_user', currency_type: 'usd', currency_value: '1.25', commission_percent: '12'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
4950
```
5051

5152
```node.js
52-
transactionKindService.create({name: 'Grant', kind: 'company_to_user', currency_type: 'bt', currency_value: '12', commission_percent: '0'}).then(console.log).catch(console.log);
53+
transactionKindService.create({name: 'Grant', kind: 'company_to_user', currency_type: 'bt', currency_value: '12', commission_percent: '0'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
5354
```
5455

5556
```node.js
56-
transactionKindService.create({name: 'Buy', kind: 'user_to_company', currency_type: 'bt', currency_value: '100', commission_percent: '0'}).then(console.log).catch(console.log);
57+
transactionKindService.create({name: 'Buy', kind: 'user_to_company', currency_type: 'bt', currency_value: '100', commission_percent: '0'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
5758
```
5859

5960
Get a list of existing transaction kinds and other data:
6061

6162
```node.js
62-
transactionKindService.list().then(console.log).catch(console.log);
63+
transactionKindService.list().then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
6364
```
6465

6566
Edit an existing transaction kind:
6667

6768
```node.js
68-
transactionKindService.edit({client_transaction_id: '12', name: 'New Transaction Kind'}).then(console.log).catch(console.log);
69+
transactionKindService.edit({client_transaction_id: '12', name: 'New Transaction Kind'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
6970
```
7071

7172
Execute a branded token transfer by transaction kind:
7273

7374
```node.js
74-
transactionKindService.execute({from_uuid: '1234-1928-1081dsds-djhksjd', to_uuid: '1234-1928-1081-1223232', transaction_kind: 'Purchase'}).then(console.log).catch(console.log);
75+
transactionKindService.execute({from_uuid: '1234-1928-1081dsds-djhksjd', to_uuid: '1234-1928-1081-1223232', transaction_kind: 'Purchase'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
7576
```
7677

7778
Get the status of an executed transaction:
7879

7980
```node.js
80-
transactionKindService.status({transaction_uuids: ['5f79063f-e22a-4d28-99d7-dd095f02c72e']}).then(console.log).catch(console.log);
81+
transactionKindService.status({transaction_uuids: ['5f79063f-e22a-4d28-99d7-dd095f02c72e']}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
8182
```
8283

8384
### User Module
@@ -91,29 +92,29 @@ const userService = ostObj.services.user;
9192
Create a new user:
9293

9394
```node.js
94-
userService.create({name: 'Alice'}).then(console.log).catch(console.log);
95+
userService.create({name: 'Alice'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
9596
```
9697

9798
Get a list of users and other data:
9899

99100
```node.js
100-
userService.list().then(console.log).catch(console.log);
101+
userService.list().then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
101102
```
102103

103104
Edit an existing user:
104105

105106
```node.js
106-
userService.edit({uuid: '1234-1928-1081dsds-djhksjd', name: 'Bob'}).then(console.log).catch(console.log);
107+
userService.edit({uuid: '1234-1928-1081dsds-djhksjd', name: 'Bob'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
107108
```
108109

109110
Airdrop branded tokens to users:
110111

111112
```node.js
112-
userService.airdropTokens({amount: 1, list_type: 'all'}).then(console.log).catch(console.log);
113+
userService.airdropTokens({amount: 1, list_type: 'all'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
113114
```
114115

115116
As airdropping tokens is an asynchronous task, you can check the airdrop's status:
116117

117118
```node.js
118-
userService.airdropStatus({airdrop_uuid: 'd8303e01-5ce0-401f-8ae4-d6a0bcdb2e24'}).then(console.log).catch(console.log);
119+
userService.airdropStatus({airdrop_uuid: 'd8303e01-5ce0-401f-8ae4-d6a0bcdb2e24'}).then(function(res) { console.log(JSON.stringify(res)); }).catch(function(err) { console.log(JSON.stringify(err)); });
119120
```

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.1
1+
0.9.1

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@ostdotcom/ost-sdk",
3-
"version": "0.0.1-beta.1",
2+
"name": "@ostdotcom/ost-sdk-js",
3+
"version": "0.9.1",
44
"description": "The official OST Javascript SDK",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)