lbd_sdk 0.1.4 → 0.1.6

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: 938955effbd1d02f7397e594d09b20911bc35134e6e0e0f06a05e5cb27e1b026
4
- data.tar.gz: afb8bbc2bd6e5d5dee86d1e2319f56b9f0662243aea071d7b5bd284247f235a2
3
+ metadata.gz: 1fc6f61507f7ea43d1bc0a23d90a5715a41c120e8af4fbcc7d252ff91db94b36
4
+ data.tar.gz: e605084332cb992f7c41d9c75c82224050bbaf6e3049c1f28d35a0f27fb78bbb
5
5
  SHA512:
6
- metadata.gz: fd8d45127748646d2879765b7cddb71ae9839cedfb6eac3a2adba5897e3cc35aad929d3fa154d37ff12246e72eb2d7a6a0bed0acef664d9d0bd5d0aee0baea1d
7
- data.tar.gz: 8126c5003773417c261a08d62e2ca57a294c196b61e7d081f83c23c8777479d2d6440429379cf96ede1c58d5af8302a9d2875ee9cd951a1706bd5ef14c966d99
6
+ metadata.gz: f6798a3454dd3a8295e4d068ac045e446fd1637a0292127f36d9d820c7af6e8320eab17736cd959a6ca2be393bacdcc75a2905fced43ddd735eddf60ee3f9557
7
+ data.tar.gz: 3d9eefa14e3dc3ff89bfc8e64d8b36acfc710ec6e5b228a033cf0c91965cfc208c9f3ec654d7d9dcc95e2dcf2606a94b4330723cb2f58a27b0a45de56764be82
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  strategy:
9
9
  matrix:
10
- ruby: ["2.5", "2.6", "2.7", "3.0"]
10
+ ruby: ["2.6", "2.7", "3.0"]
11
11
  name: Ruby v${{ matrix.ruby }}
12
12
  steps:
13
13
  - uses: actions/checkout@v2
data/.gitignore CHANGED
@@ -7,4 +7,5 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  .ruby-version
10
- node_modules/
10
+ node_modules/
11
+ tmp_console.md
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # 0.1.6(2023-01-11)
2
+
3
+ ## Add new endpoints
4
+
5
+ - Add `GET /v2/users/{userId}/transactions`
6
+ - Add `GET /v2/wallets/{walletAddress}/transactions`
7
+ - Add `GET /v2/transactions/{txHash}`
8
+
9
+ ## Deprecate endpoints
10
+
11
+ - Add warning to `GET /v1/users/{userId}/transactions`
12
+ - Add warning to `GET /v1/wallets/{walletAddress}/transactions`
13
+ - Add warning to `GET /v1/transactions/{txHash}`
14
+
15
+ # 0.1.5(2022-10-12)
16
+
17
+ - Fix invalid validation to some parametars.
18
+
1
19
  # 0.1.4(2022-07-02)
2
20
 
3
21
  ## Add new endpoints
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lbd_sdk (0.1.4)
4
+ lbd_sdk (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -128,6 +128,7 @@ client.burn_non_fungible_token(
128
128
  - [x] POST /v1/item-tokens/{contractId}/non-fungibles/{tokenType}/{tokenIndex}/burn
129
129
  - [x] GET /v1/users/{userId}
130
130
  - [x] GET /v1/users/{userId}/transactions
131
+ - [x] GET /v2/users/{userId}/transactions
131
132
  - [x] GET /v1/users/{userId}/base-coin
132
133
  - [x] GET /v1/users/{userId}/service-tokens
133
134
  - [x] GET /v1/users/{userId}/service-tokens/{contractId}
@@ -152,6 +153,7 @@ client.burn_non_fungible_token(
152
153
  - [x] GET /v1/wallets
153
154
  - [x] GET /v1/wallets/{walletAddress}
154
155
  - [x] GET /v1/wallets/{walletAddress}/transactions
156
+ - [x] GET /v2/wallets/{walletAddress}/transactions
155
157
  - [x] GET /v1/wallets/{walletAddress}/base-coin
156
158
  - [x] GET /v1/wallets/{walletAddress}/service-tokens
157
159
  - [x] GET /v1/wallets/{walletAddress}/service-tokens/{contractId}
@@ -169,6 +171,7 @@ client.burn_non_fungible_token(
169
171
  - [x] GET /v1/memos/{txHash}
170
172
  - [x] GET /v1/time
171
173
  - [x] GET /v1/transactions/{txHash}
174
+ - [x] GET /v2/transactions/{txHash}
172
175
  - [ ] API payloads test. All payloads at least should be checked if the inputs are required or optional.
173
176
 
174
177
  ## Development
@@ -179,6 +182,14 @@ To work prettier, run `npm i -D @prettier/plugin-ruby`.
179
182
 
180
183
  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).
181
184
 
185
+ ## Release
186
+
187
+ ```
188
+ bundle exec rake build
189
+ git push origin <branch>
190
+ bundle exec rake release
191
+ ```
192
+
182
193
  ## Contributing
183
194
 
184
195
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lbd_sdk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/YuheiNakasaka/lbd_sdk_rb/blob/main/CODE_OF_CONDUCT.md).
@@ -33,12 +33,20 @@ module LbdSdk
33
33
  end
34
34
 
35
35
  def user_transactions(user_id, query_params = {})
36
+ warn('[Deprecated] GET /v1/users/{userId}/transactions')
36
37
  get(
37
38
  "/v1/users/#{user_id}/transactions",
38
39
  query_params: transaction_page_request(query_params),
39
40
  )
40
41
  end
41
42
 
43
+ def user_transactions_v2(user_id, query_params = {})
44
+ get(
45
+ "/v2/users/#{user_id}/transactions",
46
+ query_params: transaction_page_request(query_params),
47
+ )
48
+ end
49
+
42
50
  def base_coin_balance_of_user(user_id)
43
51
  get("/v1/users/#{user_id}/base-coin")
44
52
  end
@@ -239,12 +247,20 @@ module LbdSdk
239
247
  end
240
248
 
241
249
  def wallet_transactions(wallet_address, query_params = {})
250
+ warn('[Deprecated] GET /v1/wallets/{walletAddress}/transactions')
242
251
  get(
243
252
  "/v1/wallets/#{wallet_address}/transactions",
244
253
  query_params: transaction_page_request(query_params),
245
254
  )
246
255
  end
247
256
 
257
+ def wallet_transactions_v2(wallet_address, query_params = {})
258
+ get(
259
+ "/v2/wallets/#{wallet_address}/transactions",
260
+ query_params: transaction_page_request(query_params),
261
+ )
262
+ end
263
+
248
264
  def base_coin_balance_of_wallet(wallet_address)
249
265
  get("/v1/wallets/#{wallet_address}/base-coin")
250
266
  end
@@ -501,7 +517,7 @@ module LbdSdk
501
517
  def create_non_fungible_token(contract_id, payload = {})
502
518
  post(
503
519
  "/v1/item-tokens/#{contract_id}/non-fungibles",
504
- payload: non_fungible_token_create_update_request(payload),
520
+ payload: non_fungible_token_create_request(payload),
505
521
  )
506
522
  end
507
523
 
@@ -552,7 +568,7 @@ module LbdSdk
552
568
  def update_non_fungible_token_type(contract_id, token_type, payload = {})
553
569
  put(
554
570
  "/v1/item-tokens/#{contract_id}/non-fungibles/#{token_type}",
555
- payload: non_fungible_token_create_update_request(payload),
571
+ payload: non_fungible_token_update_request(payload),
556
572
  )
557
573
  end
558
574
 
@@ -564,7 +580,7 @@ module LbdSdk
564
580
  )
565
581
  put(
566
582
  "/v1/item-tokens/#{contract_id}/non-fungibles/#{token_type}/#{token_index}",
567
- payload: non_fungible_token_create_update_request(payload),
583
+ payload: non_fungible_token_update_request(payload),
568
584
  )
569
585
  end
570
586
 
@@ -703,9 +719,14 @@ module LbdSdk
703
719
  end
704
720
 
705
721
  def transaction_result(tx_hash)
722
+ warn('[Deprecated] GET /v1/transactions/{txHash}')
706
723
  get("/v1/transactions/#{tx_hash}")
707
724
  end
708
725
 
726
+ def transaction_result_v2(tx_hash)
727
+ get("/v2/transactions/#{tx_hash}")
728
+ end
729
+
709
730
  def httpclient
710
731
  HTTPClient.new
711
732
  end
@@ -28,11 +28,12 @@ module LbdSdk
28
28
  params = {
29
29
  limit: options[:limit] || 10,
30
30
  page: options[:page] || 1,
31
- orderBy: options[:order_by] || 'desc',
31
+ orderBy: options[:order_by] || options[:orderBy] || 'desc',
32
32
  }
33
33
  params[:before] = options[:before] if !options[:before].nil?
34
34
  params[:after] = options[:after] if !options[:after].nil?
35
35
  params[:msgType] = options[:msgType] if !options[:msgType].nil?
36
+ params[:msgType] = options[:msg_type] if !options[:msg_type].nil?
36
37
  params
37
38
  end
38
39
 
@@ -415,9 +416,8 @@ module LbdSdk
415
416
  params
416
417
  end
417
418
 
418
- def non_fungible_token_create_update_request(options)
419
- if options[:owner_address].nil? || options[:owner_secret].nil? ||
420
- options[:name].nil?
419
+ def non_fungible_token_create_request(options)
420
+ if options[:owner_address].nil? || options[:owner_secret].nil?
421
421
  raise ArgumentError,
422
422
  'owner_address and owner_secret and name are required'
423
423
  end
@@ -425,9 +425,25 @@ module LbdSdk
425
425
  params = {
426
426
  ownerAddress: options[:owner_address],
427
427
  ownerSecret: options[:owner_secret],
428
- name: options[:name],
429
428
  }
430
429
 
430
+ params[:name] = options[:name] if !options[:name].nil?
431
+ params[:meta] = options[:meta] if !options[:meta].nil?
432
+ params
433
+ end
434
+
435
+ def non_fungible_token_update_request(options)
436
+ if options[:owner_address].nil? || options[:owner_secret].nil?
437
+ raise ArgumentError,
438
+ 'owner_address and owner_secret and name are required'
439
+ end
440
+
441
+ params = {
442
+ ownerAddress: options[:owner_address],
443
+ ownerSecret: options[:owner_secret],
444
+ }
445
+
446
+ params[:name] = options[:name] if !options[:name].nil?
431
447
  params[:meta] = options[:meta] if !options[:meta].nil?
432
448
  params
433
449
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LbdSdk
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lbd_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - YuheiNakasaka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-02 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: LINE Blockchain Developer SDK for Ruby. This SDK is not official LINE
14
14
  SDK.