lbd_sdk 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fe4cd4a5ba5159dccfe1e54b289334b53a641389d39e3c396cb619504a0c78f
4
- data.tar.gz: 05626e0d48fe8d95ea6fe696b21ea33331e96e2355a6b60940fdab98931983da
3
+ metadata.gz: f464551eba6200365069c1ba80d422a746e0ba869ae0473ef3c919ed82876e73
4
+ data.tar.gz: 01a2ed334e9f1cdae2525f351354c552e5688faffc6e128782c16bfa827966b4
5
5
  SHA512:
6
- metadata.gz: e692f8fd463489b26b01f4c0d69c8fb5f88b33bd6d3534c364f5fcf371d9fe662ed9c18772cc00c2dcbfbe806d7ca470b8fe3f80a08995b434ba44321171c279
7
- data.tar.gz: 866721319f5fd52693cb1a2933f834bf255f5c6bcc35626887589bc0fb22d7d922973ca2d38db19127bc0fba1bd8a44fbb44d7958d9521c7efa35647a8cfa3ef
6
+ metadata.gz: 1cc3d4d3bec1aad18027755b8e6092543fe2511ffcf91ed039c734f66a5be5cccd784e656b7cd4aa725c92f3755ff39a0cc5e3ad7519aeabeafc72cf5161c66f
7
+ data.tar.gz: 57ec0a30603dd83e31b75bea1e59df3f53c33d2538eba3fe0691faee920e2101585fa158b10a943d2adc241743ed838379bbc638e710c6e688471ae1d23bf567
@@ -0,0 +1,27 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ name: Ruby v3.0
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Install Ruby 3.0
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: 3.0
18
+ - name: Publish gem to rubygems.org
19
+ run: |
20
+ mkdir -p $HOME/.gem
21
+ touch $HOME/.gem/credentials
22
+ chmod 0600 $HOME/.gem/credentials
23
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
24
+ gem build *.gemspec
25
+ gem push *.gem
26
+ env:
27
+ GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
data/.gitignore CHANGED
@@ -6,3 +6,5 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ .ruby-version
10
+ node_modules/
data/.rubocop.yml CHANGED
@@ -1,3 +1,6 @@
1
+ inherit_gem:
2
+ prettier: rubocop.yml
3
+
1
4
  AllCops:
2
5
  TargetRubyVersion: 2.5
3
6
  DisabledByDefault: true
@@ -2,5 +2,11 @@
2
2
  "ruby.useLanguageServer": true,
3
3
  "ruby.useBundler": true,
4
4
  "ruby.format": "rubocop",
5
- "ruby.lint": { "rubocop": true }
5
+ "ruby.lint": {
6
+ "rubocop": true
7
+ },
8
+ "[ruby]": {
9
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
10
+ "editor.formatOnSave": true
11
+ }
6
12
  }
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # 0.1.3(2022-03-23)
2
+
3
+ - Add `GET /v1/item-tokens`.
4
+ - Add `POST /v1/item-tokens`.
5
+ - Add `GET /v1/service-tokens/by-txHash/{txHash}`.
6
+ - Add `POST /v1/service-tokens`.
7
+
8
+ # 0.1.2(2021-12-22)
9
+
10
+ - Add `GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/with-type`.
11
+
12
+ # 0.1.1(2021-12-04)
13
+
14
+ - Refactor payload handling.
15
+
1
16
  # 0.1.0(2021-12-03)
2
17
 
3
18
  - Implemented all LINE Blockchain Developer API client.
data/Gemfile CHANGED
@@ -4,8 +4,9 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :development, :test do
7
+ gem 'prettier', '~> 2.0.0'
7
8
  gem 'rake', '~> 12.0'
8
9
  gem 'rspec', '~> 3.0'
9
10
  gem 'rubocop', '~> 1.12.1', require: false
10
11
  gem 'webmock', '~> 3.8'
11
- end
12
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lbd_sdk (0.1.0)
4
+ lbd_sdk (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -16,6 +16,7 @@ GEM
16
16
  parallel (1.21.0)
17
17
  parser (3.0.3.1)
18
18
  ast (~> 2.4.1)
19
+ prettier (2.0.0)
19
20
  public_suffix (4.0.6)
20
21
  rainbow (3.0.0)
21
22
  rake (12.3.3)
@@ -57,6 +58,7 @@ PLATFORMS
57
58
 
58
59
  DEPENDENCIES
59
60
  lbd_sdk!
61
+ prettier (~> 2.0.0)
60
62
  rake (~> 12.0)
61
63
  rspec (~> 3.0)
62
64
  rubocop (~> 1.12.1)
data/README.md CHANGED
@@ -24,42 +24,60 @@ Or install it yourself as:
24
24
  ## Usage
25
25
 
26
26
  ```ruby
27
- client = LbdSdk::Client.new do |config|
28
- config.endpoint = 'https://test-api.blockchain.line.me/'
29
- config.api_key = 'your_api_key'
30
- config.api_secret_key = 'your_secret_key'
31
- end
32
-
33
- client.time()
34
-
35
- client.user_detail("<your-user-id>")
36
-
37
- client.user_transactions("<your-user-id>", {page: 1, limit: 1})
38
-
39
- client.create_non_fungible_token("<contract_id>", {
40
- owner_address: "owner_address",
41
- owner_secret: "owner_secret",
42
- name: "SampleToken",
43
- })
44
-
45
- client.mint_non_fungible_token("contract_id", "token_type", {
46
- owner_address: "owner_address",
47
- owner_secret: "owner_secret",
48
- name: "SampleToken",
49
- to_user_id: "yout-user-id"
50
- })
51
-
52
- client.update_non_fungible_token("contract_id", "token_type", "token_index", {
53
- owner_address: "owner_address",
54
- owner_secret: "owner_secret",
55
- name: "SampleToken2",
56
- })
57
-
58
- client.burn_non_fungible_token("contract_id", "token_type", "token_index", {
59
- owner_address: "owner_address",
60
- owner_secret: "owner_secret",
61
- from_user_id: "yout-user-id"
62
- })
27
+ client =
28
+ LbdSdk::Client.new do |config|
29
+ config.endpoint = 'https://test-api.blockchain.line.me'
30
+ config.api_key = 'your_api_key'
31
+ config.api_secret_key = 'your_secret_key'
32
+ end
33
+
34
+ client.time
35
+
36
+ client.user_detail('<your-user-id>')
37
+
38
+ client.user_transactions('<your-user-id>', { page: 1, limit: 1 })
39
+
40
+ client.create_non_fungible_token(
41
+ '<contract_id>',
42
+ {
43
+ owner_address: 'owner_address',
44
+ owner_secret: 'owner_secret',
45
+ name: 'SampleToken',
46
+ },
47
+ )
48
+
49
+ client.mint_non_fungible_token(
50
+ 'contract_id',
51
+ 'token_type',
52
+ {
53
+ owner_address: 'owner_address',
54
+ owner_secret: 'owner_secret',
55
+ name: 'SampleToken',
56
+ to_user_id: 'yout-user-id',
57
+ },
58
+ )
59
+
60
+ client.update_non_fungible_token(
61
+ 'contract_id',
62
+ 'token_type',
63
+ 'token_index',
64
+ {
65
+ owner_address: 'owner_address',
66
+ owner_secret: 'owner_secret',
67
+ name: 'SampleToken2',
68
+ },
69
+ )
70
+
71
+ client.burn_non_fungible_token(
72
+ 'contract_id',
73
+ 'token_type',
74
+ 'token_index',
75
+ {
76
+ owner_address: 'owner_address',
77
+ owner_secret: 'owner_secret',
78
+ from_user_id: 'yout-user-id',
79
+ },
80
+ )
63
81
  ```
64
82
 
65
83
  ## TODO
@@ -67,15 +85,19 @@ client.burn_non_fungible_token("contract_id", "token_type", "token_index", {
67
85
  - [x] GET /v1/services/{serviceId}
68
86
  - [x] GET /v1/service-tokens/
69
87
  - [x] GET /v1/service-tokens/{contractId}
88
+ - [x] GET /v1/service-tokens/by-txHash/{txHash}
70
89
  - [x] PUT /v1/service-tokens/{contractId}
71
90
  - [x] POST /v1/service-tokens/{contractId}/mint
72
91
  - [x] POST /v1/service-tokens/{contractId}/burn-from
92
+ - [x] POST /v1/service-tokens
73
93
  - [x] GET /v1/service-tokens/{contractId}/holders
74
94
  - [x] GET /v1/item-tokens/{contractId}
75
95
  - [x] GET /v1/item-tokens/{contractId}/fungibles
76
96
  - [x] GET /v1/item-tokens/{contractId}/fungibles/{tokenType}
77
97
  - [x] GET /v1/item-tokens/{contractId}/fungibles/{tokenType}/holders
78
98
  - [x] GET /v1/item-tokens/{contractId}/non-fungibles
99
+ - [x] POST /v1/item-tokens
100
+ - [x] GET /v1/item-tokens
79
101
  - [x] GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}
80
102
  - [x] GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}
81
103
  - [x] GET /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/holders
@@ -108,6 +130,7 @@ client.burn_non_fungible_token("contract_id", "token_type", "token_index", {
108
130
  - [x] GET /v1/users/{userId}/item-tokens/{contractId}/fungibles
109
131
  - [x] GET /v1/users/{userId}/item-tokens/{contractId}/fungibles/{tokenType}
110
132
  - [x] GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles
133
+ - [x] GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/with-type
111
134
  - [x] GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/{tokenType}
112
135
  - [x] GET /v1/users/{userId}/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}
113
136
  - [x] GET /v1/user-requests/{requestSessionToken}
@@ -142,11 +165,14 @@ client.burn_non_fungible_token("contract_id", "token_type", "token_index", {
142
165
  - [x] GET /v1/memos/{txHash}
143
166
  - [x] GET /v1/time
144
167
  - [x] GET /v1/transactions/{txHash}
168
+ - [ ] API payloads test. All payloads at least should be checked if the inputs are required or optional.
145
169
 
146
170
  ## Development
147
171
 
148
172
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
149
173
 
174
+ To work prettier, run `npm i -D @prettier/plugin-ruby`.
175
+
150
176
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
151
177
 
152
178
  ## Contributing