Class: Siwe::Config
- Inherits:
-
Object
- Object
- Siwe::Config
- Defined in:
- lib/siwe/config.rb
Overview
Verification config — pluggable adapter (crypto), RPC URL or RPC client (smart wallet), and optional verification fallback.
Set globally via Siwe.configure { |c| … } or per-call as ‘verify(config: …)`.
Defined Under Namespace
Classes: Builder
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#rpc ⇒ Object
readonly
Returns the value of attribute rpc.
-
#rpc_url ⇒ Object
readonly
Returns the value of attribute rpc_url.
-
#verification_fallback ⇒ Object
readonly
Returns the value of attribute verification_fallback.
Instance Method Summary collapse
-
#initialize(rpc_url: nil, rpc: nil, adapter: nil, verification_fallback: nil) ⇒ Config
constructor
A new instance of Config.
- #to_h ⇒ Object
Constructor Details
#initialize(rpc_url: nil, rpc: nil, adapter: nil, verification_fallback: nil) ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 18 |
# File 'lib/siwe/config.rb', line 13 def initialize(rpc_url: nil, rpc: nil, adapter: nil, verification_fallback: nil) @rpc_url = rpc_url @rpc = rpc @adapter = adapter || Siwe::Adapter::DEFAULT @verification_fallback = verification_fallback end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
11 12 13 |
# File 'lib/siwe/config.rb', line 11 def adapter @adapter end |
#rpc ⇒ Object (readonly)
Returns the value of attribute rpc.
11 12 13 |
# File 'lib/siwe/config.rb', line 11 def rpc @rpc end |
#rpc_url ⇒ Object (readonly)
Returns the value of attribute rpc_url.
11 12 13 |
# File 'lib/siwe/config.rb', line 11 def rpc_url @rpc_url end |
#verification_fallback ⇒ Object (readonly)
Returns the value of attribute verification_fallback.
11 12 13 |
# File 'lib/siwe/config.rb', line 11 def verification_fallback @verification_fallback end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/siwe/config.rb', line 20 def to_h { rpc_url: @rpc_url, rpc: @rpc, adapter: @adapter, verification_fallback: @verification_fallback } end |