solace 0.1.3 → 0.1.4

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: 4c4e4949dfaad369b5fbe6db182896b73fce66456fa04b480a394753bd76f3d8
4
- data.tar.gz: e0fc2a7292a0ef3688555b419a534b7d8aa64fae214cc5f0317aebcd2af767e1
3
+ metadata.gz: 18aca49d63b09deffe93ba871b65d6b816a7c81863b0b0e2b2c2bd29ce709ce6
4
+ data.tar.gz: 810a45b1324aa282684e4a5d62ea48738ac2b33a6eb87538e2e0458ca2f54593
5
5
  SHA512:
6
- metadata.gz: a1653573d2cabf8c0253157a03b7bb5ebfadedf0eeeb6dea1eefa89c0b79aa01250637bab175f0d91e3072bcf7fd18a43b082d40851cb9b5d5bc7759971d54fe
7
- data.tar.gz: 718ea842339b67b89b99f9c1a674148b510e3ed6bdd4921a9fa574cd83525452e8ff7e17d8138a97821d9885cdb54a8b09037b3826666c7db59328bdfc25f67c
6
+ metadata.gz: 50eeac609077e873b361fdb8ed34459ccbed1b4e44d52ad911803350ea0d2f0e669fcfcb30bcddd6d20e9f54dade972a50907532a108dae7142ecca8475f42fb
7
+ data.tar.gz: 5fba491757746aa8fad865bae93941f3469148c6a5fc8cb5c984ebccb79934f1b1c3425184ab37ff2342f6215a1d5b1147a9d04f6d9225a96e7c6b34c38d8b0d
@@ -17,7 +17,7 @@ module Solace
17
17
  # end
18
18
  #
19
19
  # @since 0.0.1
20
- class ConfirmationTimeout < StandardError
20
+ class ConfirmationTimeout < Error
21
21
  attr_reader :signature, :commitment, :timeout
22
22
 
23
23
  # @param [String] message The error message
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Solace
4
+ module Errors
5
+ # Base error class for connection-related failures.
6
+ #
7
+ # Both {Solace::Errors::HTTPError} and {Solace::Errors::RPCError} inherit
8
+ # from this class, allowing consumers to rescue all connection errors with
9
+ # a single clause:
10
+ #
11
+ # @example Rescuing all connection errors
12
+ # begin
13
+ # connection.send_transaction(transaction)
14
+ # rescue Solace::Errors::ConnectionError => e
15
+ # puts "Connection error: #{e.message}"
16
+ # end
17
+ #
18
+ # @see Solace::Errors::HTTPError
19
+ # @see Solace::Errors::RPCError
20
+ # @since 0.1.4
21
+ class ConnectionError < Error; end
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Solace
4
+ module Errors
5
+ # Base error class for all Solace errors.
6
+ #
7
+ # All Solace-specific exceptions inherit from this class, allowing consumers
8
+ # to rescue all Solace errors with a single clause:
9
+ #
10
+ # @example Rescuing all Solace errors
11
+ # begin
12
+ # connection.get_account_info(address)
13
+ # rescue Solace::Errors::Error => e
14
+ # puts "Solace error: #{e.message}"
15
+ # end
16
+ #
17
+ # @since 0.1.4
18
+ class Error < StandardError; end
19
+ end
20
+ end
@@ -18,7 +18,7 @@ module Solace
18
18
  #
19
19
  # @see Solace::Errors::RPCError
20
20
  # @since 0.0.1
21
- class HTTPError < StandardError
21
+ class HTTPError < ConnectionError
22
22
  attr_reader :code, :body
23
23
 
24
24
  # @param [String] message The error message
@@ -17,7 +17,7 @@ module Solace
17
17
  # end
18
18
  #
19
19
  # @since 0.0.1
20
- class ParseError < StandardError
20
+ class ParseError < Error
21
21
  attr_reader :body
22
22
 
23
23
  # @param [String] message The error message
@@ -19,7 +19,7 @@ module Solace
19
19
  #
20
20
  # @see Solace::Errors::HTTPError
21
21
  # @since 0.0.1
22
- class RPCError < StandardError
22
+ class RPCError < ConnectionError
23
23
  attr_reader :rpc_code, :rpc_message, :rpc_data
24
24
 
25
25
  # @param [String] message The error message
data/lib/solace/errors.rb CHANGED
@@ -5,6 +5,8 @@ module Solace
5
5
  #
6
6
  # These exceptions provide specific error handling for various failure scenarios
7
7
  # when interacting with the Solana blockchain, including:
8
+ # - {Solace::Errors::Error} - Base class for all Solace errors
9
+ # - {Solace::Errors::ConnectionError} - Base class for connection-related errors
8
10
  # - {Solace::Errors::HTTPError} - HTTP communication failures
9
11
  # - {Solace::Errors::RPCError} - RPC method errors returned by the node
10
12
  # - {Solace::Errors::ParseError} - Data parsing and deserialization errors
@@ -13,7 +15,8 @@ module Solace
13
15
  # @see Solace::Connection
14
16
  # @since 0.0.8
15
17
  module Errors
16
- # JSON-RPC Errors
18
+ require 'solace/errors/error'
19
+ require 'solace/errors/connection_error'
17
20
  require 'solace/errors/rpc_error'
18
21
  require 'solace/errors/http_error'
19
22
  require 'solace/errors/parse_error'
@@ -24,8 +24,18 @@ module Solace
24
24
  # @return [String] The path to the native library
25
25
  # @raise [RuntimeError] If the platform is not supported
26
26
  libfile = case RUBY_PLATFORM
27
- when /linux/ then 'libcurve25519_dalek-linux/libcurve25519_dalek.so'
28
- when /darwin/ then 'libcurve25519_dalek-macos/libcurve25519_dalek.dylib'
27
+ when /linux/
28
+ if RUBY_PLATFORM =~ /arm|aarch64/
29
+ 'libcurve25519_dalek-linux-arm64/libcurve25519_dalek.so'
30
+ else
31
+ 'libcurve25519_dalek-linux/libcurve25519_dalek.so'
32
+ end
33
+ when /darwin/
34
+ if RUBY_PLATFORM =~ /arm64|aarch64/
35
+ 'libcurve25519_dalek-macos-arm64/libcurve25519_dalek.dylib'
36
+ else
37
+ 'libcurve25519_dalek-macos/libcurve25519_dalek.dylib'
38
+ end
29
39
  when /mingw|mswin/ then 'libcurve25519_dalek-windows/curve25519_dalek.dll'
30
40
  else raise 'Unsupported platform'
31
41
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Solace
4
4
  # Latest version of the Solace gem.
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Scholl
@@ -122,6 +122,8 @@ files:
122
122
  - lib/solace/constants.rb
123
123
  - lib/solace/errors.rb
124
124
  - lib/solace/errors/confirmation_timeout.rb
125
+ - lib/solace/errors/connection_error.rb
126
+ - lib/solace/errors/error.rb
125
127
  - lib/solace/errors/http_error.rb
126
128
  - lib/solace/errors/parse_error.rb
127
129
  - lib/solace/errors/rpc_error.rb
@@ -159,7 +161,9 @@ files:
159
161
  - lib/solace/utils/account_context.rb
160
162
  - lib/solace/utils/codecs.rb
161
163
  - lib/solace/utils/curve25519_dalek.rb
164
+ - lib/solace/utils/libcurve25519_dalek-linux-arm64/libcurve25519_dalek.so
162
165
  - lib/solace/utils/libcurve25519_dalek-linux/libcurve25519_dalek.so
166
+ - lib/solace/utils/libcurve25519_dalek-macos-arm64/libcurve25519_dalek.dylib
163
167
  - lib/solace/utils/libcurve25519_dalek-macos/libcurve25519_dalek.dylib
164
168
  - lib/solace/utils/libcurve25519_dalek-windows/curve25519_dalek.dll
165
169
  - lib/solace/utils/pda.rb
@@ -192,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
196
  - !ruby/object:Gem::Version
193
197
  version: '0'
194
198
  requirements: []
195
- rubygems_version: 3.6.7
199
+ rubygems_version: 4.0.6
196
200
  specification_version: 4
197
201
  summary: Solana ruby library
198
202
  test_files: []