Class: Siwe::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/siwe/config.rb

Overview

Verification config — pluggable adapter (crypto) plus RPC URL or RPC client for the smart-wallet (ERC-1271 / ERC-6492) verification path.

Set globally via Siwe.configure { |c| … } or per-call as ‘verify(config: …)`.

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rpc_url: nil, rpc: nil, adapter: nil) ⇒ Config

Returns a new instance of Config.



13
14
15
16
17
# File 'lib/siwe/config.rb', line 13

def initialize(rpc_url: nil, rpc: nil, adapter: nil)
  @rpc_url = rpc_url
  @rpc = rpc
  @adapter = adapter || Siwe::Adapter::DEFAULT
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



11
12
13
# File 'lib/siwe/config.rb', line 11

def adapter
  @adapter
end

#rpcObject (readonly)

Returns the value of attribute rpc.



11
12
13
# File 'lib/siwe/config.rb', line 11

def rpc
  @rpc
end

#rpc_urlObject (readonly)

Returns the value of attribute rpc_url.



11
12
13
# File 'lib/siwe/config.rb', line 11

def rpc_url
  @rpc_url
end

Instance Method Details

#to_hObject



19
20
21
# File 'lib/siwe/config.rb', line 19

def to_h
  { rpc_url: @rpc_url, rpc: @rpc, adapter: @adapter }
end