erpc-sdk 0.11.0 → 0.12.0
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/README.md +22 -5
- data/lib/erpc_sdk/base.rb +1 -1
- data/lib/erpc_sdk/bitcoin_codec.rb +2 -2
- data/lib/erpc_sdk/near_transport.rb +2 -2
- data/lib/erpc_sdk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 00b006e2d80e7fc6ca0080437b86bf068328e1bf394af7c8b346ed8be2110fe8
|
|
4
|
+
data.tar.gz: f5571b29c4e19a6848f98b6de3170165fd1bbd687fd0c2616659653f993a6d4f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98ee31be31b6deee6f3fb5fffbc9fa890d21009072c4b31a0967a2bfc9ac9c02ab045ed74c5114c59e5776eeabee45ffdd761037df903a972b32b7adf8ae5104
|
|
7
|
+
data.tar.gz: eacfbf0f95c0beb6f29f7ca4813f2a3043f4e635584718f0e1a9ec106e615927ec56eafc6e2c96489daaeedaf6b0d8824c5d9ae62f5fada51773ca8a7fd53f17
|
data/README.md
CHANGED
|
@@ -5,15 +5,15 @@ Avalanche C/P/X-chain JSON-RPC, indexed data, analytics, WebSocket subscriptions
|
|
|
5
5
|
price REST and server-sent events, account usage, and scoped Cloud reads.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
# Install the 0.
|
|
9
|
-
gem install erpc-sdk -v 0.
|
|
8
|
+
# Install the 0.12.0 gem:
|
|
9
|
+
gem install erpc-sdk -v 0.12.0
|
|
10
10
|
# Historical public 0.9.0 remains available for compatibility checks.
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Ruby 3.1 or newer is required. Local Mayan unsigned construction uses the
|
|
14
14
|
approved native `digest-keccak` 0.0.7 runtime dependency.
|
|
15
15
|
|
|
16
|
-
This guide documents version `0.
|
|
16
|
+
This guide documents version `0.12.0`. Check the [RubyGems release
|
|
17
17
|
metadata](https://rubygems.org/api/v1/versions/erpc-sdk.json) for available
|
|
18
18
|
versions.
|
|
19
19
|
|
|
@@ -35,6 +35,23 @@ ensure
|
|
|
35
35
|
end
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
## Read known Solana accounts
|
|
39
|
+
|
|
40
|
+
With the client from the quick start, put your base58 account addresses in
|
|
41
|
+
`addresses` and fetch them in one request.
|
|
42
|
+
|
|
43
|
+
```ruby
|
|
44
|
+
accounts = erpc.solana.rpc.get_multiple_accounts(
|
|
45
|
+
addresses, { "encoding" => "base64", "commitment" => "confirmed" }
|
|
46
|
+
).send
|
|
47
|
+
puts accounts.fetch("context").fetch("slot")
|
|
48
|
+
p accounts.fetch("value")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The result preserves address order, including a null entry for a missing
|
|
52
|
+
account. For program or token-account discovery, see the
|
|
53
|
+
[Agave v4.5 migration guide](https://github.com/elsoul/erpc-sdk/blob/main/docs/METHODS.md#solana-account-reads-on-agave-v45).
|
|
54
|
+
|
|
38
55
|
## Named Bitcoin, Base, and Arbitrum reads
|
|
39
56
|
|
|
40
57
|
The C1 clients expose bounded, read-only JSON-RPC surfaces. Requests remain
|
|
@@ -284,7 +301,7 @@ See the [Solana v1 guide](https://github.com/elsoul/erpc-sdk/blob/main/packages/
|
|
|
284
301
|
|
|
285
302
|
`MayanSwiftV2BridgeClient` is an explicit standalone adapter for the reviewed issued EURC
|
|
286
303
|
routes between Ethereum mainnet and Solana mainnet. The public `0.9.0` gem contains
|
|
287
|
-
the native USDC and local-builder additions alongside EURC. This `0.
|
|
304
|
+
the native USDC and local-builder additions alongside EURC. This `0.12.0` guide
|
|
288
305
|
documents these APIs; check the [RubyGems release metadata](https://rubygems.org/api/v1/versions/erpc-sdk.json)
|
|
289
306
|
for available versions.
|
|
290
307
|
|
|
@@ -346,7 +363,7 @@ quotes = bridge.quote_exact_input(
|
|
|
346
363
|
```
|
|
347
364
|
|
|
348
365
|
The public `0.9.0` gem supports the EURC bridge, native USDC, and local-builder
|
|
349
|
-
support. This `0.
|
|
366
|
+
support. This `0.12.0` guide documents these APIs; check the [RubyGems release
|
|
350
367
|
metadata](https://rubygems.org/api/v1/versions/erpc-sdk.json) for available
|
|
351
368
|
versions.
|
|
352
369
|
|
data/lib/erpc_sdk/base.rb
CHANGED
|
@@ -237,7 +237,7 @@ module ERPC
|
|
|
237
237
|
end
|
|
238
238
|
|
|
239
239
|
def unwrap(raw_body, expected_id)
|
|
240
|
-
parsed = JSON.parse(raw_body.to_s,
|
|
240
|
+
parsed = JSON.parse(raw_body.to_s, allow_nan: false, decimal_class: BigDecimal)
|
|
241
241
|
unless parsed.is_a?(Hash) && parsed["id"] == expected_id
|
|
242
242
|
raise InvalidResponseError.new("ERPC returned an unexpected response id"), cause: nil
|
|
243
243
|
end
|
|
@@ -251,8 +251,8 @@ module ERPC
|
|
|
251
251
|
|
|
252
252
|
JSON.parse(
|
|
253
253
|
text,
|
|
254
|
-
create_additions: false,
|
|
255
254
|
allow_nan: false,
|
|
255
|
+
allow_duplicate_key: true,
|
|
256
256
|
max_nesting: limits.container_depth,
|
|
257
257
|
decimal_class: adapter
|
|
258
258
|
)
|
|
@@ -488,7 +488,7 @@ module ERPC
|
|
|
488
488
|
end
|
|
489
489
|
|
|
490
490
|
def decode_key(raw)
|
|
491
|
-
JSON.parse(raw
|
|
491
|
+
JSON.parse(raw)
|
|
492
492
|
rescue JSON::ParserError, ArgumentError, TypeError
|
|
493
493
|
invalid!
|
|
494
494
|
end
|
|
@@ -106,7 +106,7 @@ module ERPC
|
|
|
106
106
|
loop do
|
|
107
107
|
raise_invalid! unless @text[@index] == '"'
|
|
108
108
|
key_start = @index; string
|
|
109
|
-
key = JSON.parse(@text[key_start...@index]
|
|
109
|
+
key = JSON.parse(@text[key_start...@index])
|
|
110
110
|
skip; raise_invalid! unless @text[@index] == ":"; @index += 1
|
|
111
111
|
value(path + [key]); skip
|
|
112
112
|
if @text[@index] == ","
|
|
@@ -322,7 +322,7 @@ module ERPC
|
|
|
322
322
|
raise InvalidResponseError.new("ERPC returned an invalid NEAR response"), cause: nil
|
|
323
323
|
end
|
|
324
324
|
end
|
|
325
|
-
response = JSON.parse(text,
|
|
325
|
+
response = JSON.parse(text, allow_nan: false, allow_duplicate_key: true, decimal_class: decimal_class)
|
|
326
326
|
raise InvalidResponseError.new("ERPC returned an invalid NEAR response"), cause: nil unless response.is_a?(Hash) && response["id"] == expected_id
|
|
327
327
|
if response.key?("error") && !response["error"].nil?
|
|
328
328
|
error = response["error"]
|
data/lib/erpc_sdk/version.rb
CHANGED