Skip to content

Commit 05ee976

Browse files
Merge pull request #52 from ostdotcom/develop
Support for new API route - /base-tokens
2 parents 75d3cf9 + 8c65ef7 commit 05ee976

File tree

11 files changed

+93
-13
lines changed

11 files changed

+93
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[OST JAVA SDK v2.1.0](https://github.com/ostdotcom/ost-sdk-java/tree/v2.1.0)
2+
---
3+
4+
* Added base tokens module to V2 API's
5+
16
[OST Ruby SDK v2.0.0](https://github.com/ostdotcom/ost-sdk-ruby/tree/v2.0.0)
27
---
38

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018 OST.com Ltd.
1+
Copyright (c) 2019 OST.com Inc.
22

33
MIT License
44

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
# OST Ruby SDK
22
[![Build Status](https://travis-ci.org/ostdotcom/ost-sdk-ruby.svg?branch=develop)](https://travis-ci.org/ostdotcom/ost-sdk-ruby)
33

4-
The official [OST](https://dev.ost.com/) Ruby SDK.
4+
[OST](https://dev.ost.com/) Platform SDK for Ruby.
55

66
## Introduction
77

88
OST is a complete technology solution enabling mainstream businesses
99
to easily launch blockchain-based economies without
1010
requiring blockchain development.
1111

12-
At the core of OST is the concept of OST-powered Brand Tokens (BTs).
13-
BTs are white-label cryptocurrency tokens with utility representations
12+
Brand Tokens (BTs) are white-label cryptocurrency tokens with utility representations
1413
running on highly-scalable Ethereum-based side blockchains,
15-
backed by OST tokens staked on Ethereum mainnet. Within a business’s
14+
backed by value token (such as OST, USDC) staked on Ethereum mainnet. Within a business’s
1615
token economy, BTs can only be transferred to whitelisted user addresses.
1716
This ensures that they stay within the token economy.
1817

1918
The OST technology stack is designed to give businesses everything they need
2019
to integrate, test, and deploy BTs. Within the OST suite of products, developers
21-
can use OST Platform to create, test, and launch Brand Tokens backed by OST.
20+
can use OST Platform to create, test, and launch Brand Tokens backed by value token (such as OST, USDC).
2221

2322
OST APIs and server-side SDKs make it simple and easy for developers to
2423
integrate blockchain tokens into their apps.
@@ -250,7 +249,7 @@ response = rules_service.get_list(get_params)
250249

251250
#### Price Points Module
252251

253-
To know the OST price point in USD and when it was last updated,
252+
To know the value tokens (such as OST, USDC) price point in pay currency and when it was last updated,
254253
use services provided by the Price Points module.
255254

256255
```ruby
@@ -426,3 +425,20 @@ get_params[:chain_id] = 2000
426425
response = chains_service.get(get_params)
427426
```
428427

428+
429+
### Base Tokens Module
430+
431+
To get information about the value tokens (such as OST, USDC) available on the OST Platform interface, use services
432+
provided by the Base Tokens module. You can use this service to obtain the value token details
433+
on OST Platform interface.
434+
435+
```ruby
436+
base_tokens_service = ost_sdk.services.base_tokens
437+
```
438+
439+
Get Base Token Detail:
440+
441+
```ruby
442+
get_params = {}
443+
response = base_tokens_service.get(get_params)
444+
```

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.1.0

lib/ost-sdk-ruby/saas.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
require_relative 'saas/tokens'
1313
require_relative 'saas/transactions'
1414
require_relative 'saas/users'
15+
require_relative 'saas/base_tokens'
1516

1617
module OSTSdk
1718

lib/ost-sdk-ruby/saas/base_tokens.rb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
module OSTSdk
2+
3+
module Saas
4+
5+
6+
class BaseTokens < OSTSdk::Saas::Base
7+
8+
# Initialize
9+
#
10+
# Arguments:
11+
# api_base_url: (String)
12+
# api_key: (String)
13+
# api_secret: (String)
14+
# api_spec: (Boolean)
15+
# config: (Hash)
16+
#
17+
def initialize(params)
18+
super
19+
@url_prefix = '/base-tokens'
20+
end
21+
22+
# Get token details
23+
#
24+
# Returns:
25+
# response: (Hash)
26+
#
27+
def get(params = {})
28+
http_helper.send_get_request("#{@url_prefix}", params)
29+
end
30+
31+
end
32+
33+
end
34+
35+
end

lib/ost-sdk-ruby/saas/manifest.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Saas
55
class Manifest
66

77
attr_reader :balance, :chains, :device_managers, :devices, :price_points, :recovery_owners, :rules,
8-
:sessions, :tokens, :transactions, :users
8+
:sessions, :tokens, :transactions, :users, :base_tokens
99

1010
# Initialize
1111
#
@@ -30,6 +30,7 @@ def initialize(params)
3030
@tokens = OSTSdk::Saas::Tokens.new(params)
3131
@transactions = OSTSdk::Saas::Transactions.new(params)
3232
@users = OSTSdk::Saas::Users.new(params)
33+
@base_tokens = OSTSdk::Saas::BaseTokens.new(params)
3334

3435
end
3536

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require_relative "../../../lib/ost-sdk-ruby/util"
2+
require_relative "../../../lib/ost-sdk-ruby/saas"
3+
require "test/unit"
4+
require_relative "../../../lib/config"
5+
6+
class BaseTokensTest < Test::Unit::TestCase
7+
8+
def base_tokens_service
9+
@base_tokens_service ||= Config::OST_SDK.services.base_tokens
10+
end
11+
12+
def test_base_tokens_get
13+
result = base_tokens_service.get()
14+
puts "result=>#{result}" unless result["success"]
15+
assert_equal(result["success"], true )
16+
end
17+
18+
end

lib/ost-sdk-ruby/util/http_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,12 @@ def perform_and_handle_exceptions(internal_id = 'swr', msg = 'Something Went Wro
169169
begin
170170
yield if block_given?
171171
rescue Timeout::Error => ex
172+
puts "TimeoutError::message #{ex.message}"
173+
puts "TimeoutError::backtrace #{ex.backtrace}"
172174
OSTSdk::Util::CustomErrorResponse.new({internal_id: internal_id, msg: msg}).timeout_error_response
173175
rescue StandardError => se
176+
puts "StandardError::message #{se.message}"
177+
puts "StandardError::backtrace #{se.backtrace}"
174178
OSTSdk::Util::CustomErrorResponse.new({internal_id: internal_id, msg: msg}).default_error_response
175179
end
176180
end

lib/ost-sdk-ruby/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module OSTSdk
22

3-
VERSION = "2.0.0"
3+
VERSION = "2.0.1.beta1"
44

55
end

ost-sdk-ruby.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Gem::Specification.new do |spec|
77

88
spec.name = "ost-sdk-ruby"
99
spec.version = OSTSdk::VERSION
10-
spec.authors = ['OST.COM LTD.']
10+
spec.authors = ['OST.com Inc.']
1111
spec.email = []
1212
spec.summary = 'OST Ruby SDK'
13-
spec.description = 'The official OST Ruby SDK'
14-
spec.homepage = "https://kit.ost.com"
13+
spec.description = 'OST Platform SDK for Ruby'
14+
spec.homepage = "https://platform.ost.com"
1515
spec.license = "MIT"
1616
spec.metadata = {
1717
"documentation_uri" => "https://dev.ost.com"

0 commit comments

Comments
 (0)