Class: Weft::Facilitator::RouteConfig
- Inherits:
-
Struct
- Object
- Struct
- Weft::Facilitator::RouteConfig
- Defined in:
- lib/weft/facilitator/middleware.rb
Overview
Configuration for a route that requires payment.
{
path: "/api/resource", # string or Regexp
price: "0.01", # price in asset units
asset: "USDC",
network: "base-sepolia",
pay_to: "0x...", # recipient address
description: "Access resource",
max_deadline_seconds: 60,
}
Instance Attribute Summary collapse
-
#asset ⇒ Object
Returns the value of attribute asset.
-
#description ⇒ Object
Returns the value of attribute description.
-
#max_deadline_seconds ⇒ Object
Returns the value of attribute max_deadline_seconds.
-
#network ⇒ Object
Returns the value of attribute network.
-
#path ⇒ Object
Returns the value of attribute path.
-
#pay_to ⇒ Object
Returns the value of attribute pay_to.
-
#price ⇒ Object
Returns the value of attribute price.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ RouteConfig
constructor
A new instance of RouteConfig.
Constructor Details
#initialize(**kwargs) ⇒ RouteConfig
Returns a new instance of RouteConfig.
22 23 24 25 26 27 |
# File 'lib/weft/facilitator/middleware.rb', line 22 def initialize(**kwargs) super self.network ||= 'base-sepolia' self.max_deadline_seconds ||= 60 self.description ||= '' end |
Instance Attribute Details
#asset ⇒ Object
Returns the value of attribute asset
17 18 19 |
# File 'lib/weft/facilitator/middleware.rb', line 17 def asset @asset end |
#description ⇒ Object
Returns the value of attribute description
17 18 19 |
# File 'lib/weft/facilitator/middleware.rb', line 17 def description @description end |
#max_deadline_seconds ⇒ Object
Returns the value of attribute max_deadline_seconds
17 18 19 |
# File 'lib/weft/facilitator/middleware.rb', line 17 def max_deadline_seconds @max_deadline_seconds end |
#network ⇒ Object
Returns the value of attribute network
17 18 19 |
# File 'lib/weft/facilitator/middleware.rb', line 17 def network @network end |
#path ⇒ Object
Returns the value of attribute path
17 18 19 |
# File 'lib/weft/facilitator/middleware.rb', line 17 def path @path end |
#pay_to ⇒ Object
Returns the value of attribute pay_to
17 18 19 |
# File 'lib/weft/facilitator/middleware.rb', line 17 def pay_to @pay_to end |
#price ⇒ Object
Returns the value of attribute price
17 18 19 |
# File 'lib/weft/facilitator/middleware.rb', line 17 def price @price end |