The Quicksilver SDK's fluent Domain-Specific Language (DSL) is powered by a set of builders that allow for the intuitive, type-safe, and expressive construction of complex financial logic and programm
The Quicksilver SDK's fluent Domain-Specific Language (DSL) is powered by a set of builders that allow for the intuitive, type-safe, and expressive construction of complex financial logic and programmable entities. These builders encapsulate intricate JSON structures, enabling developers to write readable and maintainable code.
For a deeper dive into the philosophy behind these builders, refer to [Core Concepts: Fluent DSL].
The QuickSilverEvent enum defines standard events that can trigger conditional logic within the Quicksilver Engine.
The Action class represents a singular, atomic operation that can be executed as part of a conditional rule or product workflow. It serves as a factory for creating various types of actions.
The ActionBuilder provides a fluent interface for constructing complex actions, typically used with Action.release() to specify target accounts and additional metadata. This class implements the ActionInterface directly, meaning a built ActionBuilder instance can be used where an Action is expected.
The ConditionBuilder facilitates the creation of conditional logic using a fluent interface. It allows defining "when" conditions with optional predicates and chaining "then" actions, as well as an "otherwise" fallback.
The ProductBuilder provides a fluent DSL for defining programmable products and services. It allows specifying pricing models, guarantees, multi-agent workflows, and associating conditions and actions. An instance of ProductBuilder directly represents a Product definition, eliminating the need for a separate .build() method.
The ProductBuilder class is designed to be directly assignable as a Product type, making .build() redundant and enhancing the fluent nature of the SDK. For example, const myProduct: Product = client.product('id').charge(...); is a valid and encouraged pattern.
You can initiate a ProductBuilder via the [QuicksilverClient.product()] method.