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 +4 -4
- data/.github/workflows/pull-request.yml +1 -1
- data/.gitignore +2 -1
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +1 -1
- data/README.md +11 -0
- data/lib/lbd_sdk/client.rb +24 -3
- data/lib/lbd_sdk/request.rb +21 -5
- data/lib/lbd_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fc6f61507f7ea43d1bc0a23d90a5715a41c120e8af4fbcc7d252ff91db94b36
|
4
|
+
data.tar.gz: e605084332cb992f7c41d9c75c82224050bbaf6e3049c1f28d35a0f27fb78bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6798a3454dd3a8295e4d068ac045e446fd1637a0292127f36d9d820c7af6e8320eab17736cd959a6ca2be393bacdcc75a2905fced43ddd735eddf60ee3f9557
|
7
|
+
data.tar.gz: 3d9eefa14e3dc3ff89bfc8e64d8b36acfc710ec6e5b228a033cf0c91965cfc208c9f3ec654d7d9dcc95e2dcf2606a94b4330723cb2f58a27b0a45de56764be82
|
data/.gitignore
CHANGED
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
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).
|
data/lib/lbd_sdk/client.rb
CHANGED
@@ -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:
|
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:
|
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:
|
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
|
data/lib/lbd_sdk/request.rb
CHANGED
@@ -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
|
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
|
data/lib/lbd_sdk/version.rb
CHANGED
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
|
+
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:
|
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.
|