///
This page provides a comprehensive reference for the core types, enums, and interfaces used throughout the Quicksilver SDK. Understanding these fundamental building blocks is essential for effectively
86 views
~86 views from guests
Guest views are estimated from total page views. These include anonymous visitors and users who weren't logged in when they viewed the page.
This page provides a comprehensive reference for the core types, enums, and interfaces used throughout the Quicksilver SDK. Understanding these fundamental building blocks is essential for effectively using the SDK's fluent Domain-Specific Language (DSL) and interacting with the Quicksilver Engine API.
The types defined here empower the SDK's strong Type Safety and rich autocompletion, making it easier to build robust and error-resistant applications.
These define the categorical values used across accounts, transactions, and streams.
AccountTypeDefines the different classifications for accounts within the Quicksilver Engine.
Human: An account representing a human user.AgentMain: A primary AI agent account, capable of delegating to sub-agents.AgentDelegated: A sub-agent account delegated by a AgentMain account, often with specific limits or permissions.TransactionTypeSpecifies the various types of financial operations supported by the Quicksilver Engine.
Payment: A direct, immediate transfer of funds.Escrow: Funds held by a third party (the Quicksilver Engine) pending fulfillment of conditions.Stream: Continuous, real-time transfer of funds (streaming payments).Scheduled: A transaction set to execute at a future date or recurring interval.Fund: An operation to add funds to an account.Refund: An operation to return funds from a previous transaction.TransactionStateDescribes the current lifecycle status of a transaction.
Draft: The transaction has been defined but not yet initiated or submitted for execution.Pending: The transaction has been initiated and is awaiting further action (e.g., approval, conditions to be met, processing by a gateway).Executing: The transaction is actively being processed, especially relevant for streaming or complex conditional transactions.Completed: The transaction has successfully finished.Failed: The transaction could not be completed due to an error.Cancelled: The transaction was explicitly cancelled before completion.StreamRateUnitDefines the unit by which a streaming transaction's rate is measured.
PerSecond, PerMinute, PerHour: Time-based units for streaming.PerWord: Unit for content-based streaming (e.g., per word translated).PerToken: Unit for AI-compute based streaming (e.g., per AI token processed).Custom: Allows for defining any other arbitrary unit.CurrencySpecifies the supported currencies for financial operations.
USD: United States Dollar.USDC: USD Coin (a stablecoin).EUR: Euro.Custom: Allows for defining any other arbitrary currency or token.QuickSilverEventA core enum used by the ConditionBuilder to define triggers for conditional logic. These events represent significant occurrences within the Quicksilver Engine that can activate specific actions.
MilestoneApproved: Triggered when a specific project milestone is approved, typically used in escrow scenarios.TimeElapsed: Triggered after a specified duration, useful for scheduled payments or time-based releases.ApiCallSuccess: Triggered upon a successful external API call.ApiCallFailure: Triggered when an external API call fails.PaymentReceived: Triggered when a payment is successfully received.StreamStarted: Triggered when a streaming payment begins.StreamStopped: Triggered when a streaming payment ends.Custom: Allows for defining any other arbitrary custom event.These interfaces are central to the SDK's DSL, enabling the definition of complex programmable money logic.
ActionRepresents a single action to be executed when a condition is met. This interface is implemented by the ActionBuilder for fluent construction.
type: The type of action (e.g., 'release', 'notify', 'hold').toJSON(): A method to serialize the action into a JSON object for API consumption.ConditionDefines a single conditional rule, comprising a trigger, an optional predicate, and a list of actions. This is used internally by the ConditionBuilder.
trigger: The event (from QuickSilverEvent) or a custom function that starts evaluating this condition.predicate: An optional function that further refines when the condition is true (e.g., ctx => ctx.amount > 100).actions: An array of Actions to execute if the condition is met.ProductDefinitionDefines the structure of a programmable product or service, including its pricing model, guarantees, and workflow stages. This is used internally by the ProductBuilder.
id: A unique identifier for the product.pricing: Defines how the product is charged (e.g., per unit, streaming).guarantees: A key-value pair of service level agreements or quality assurances (e.g., accuracy, turnaround).workflow: An array of stages, each potentially delegated to a specific agent with a defined charge.These interfaces represent the core entities managed by the Quicksilver Engine.
Account (Data Model)Represents an account within the Quicksilver Engine, holding metadata, limits, and verification status. This is the raw data structure wrapped by the Account Model.
Transaction (Data Model)Represents a financial transaction, including its type, amount, parties involved, state, and optional conditional logic. This is the raw data structure wrapped by the Transaction Model.
StreamingTransactionExtends the base Transaction interface with details specific to streaming payments.
base: The underlying Transaction object.rate: The rate at which funds are streamed.rate_unit: The unit for the streaming rate (e.g., 'PerSecond', 'PerWord').start_time: The ISO timestamp when the stream began.end_time: The ISO timestamp when the stream is scheduled to end, if applicable.accumulated: The total amount transferred so far in the stream.last_batch: The ID of the last batch transaction for the stream.These interfaces define the expected structure of data sent to the Quicksilver API when creating or updating resources.
CreateAccountPayloadThe payload for creating a new account.
CreateTransactionPayloadThe payload for creating a new transaction.
CreateStreamingTransactionPayloadThe payload for creating a streaming transaction.
KycInitiatePayloadThe payload for initiating a KYC verification process for an account.
These interfaces define the structure of common responses received from the Quicksilver API.
StatusResponseA generic response for operations that change the status of a resource (e.g., pausing a stream).
KycStatusDetails the current KYC verification status of an account.
KycInitiateResponseThe response received after attempting to initiate a KYC verification.
These interfaces define the structure of events delivered via Server-Sent Events (SSE) for real-time updates.
SSEStreamEventRepresents a lifecycle event occurring on a streaming transaction.
SSEBatchCreatedEventRepresents an event indicating that a batch payment has been processed for a streaming transaction.
Standard interfaces for error handling and data pagination.
APIErrorThe standard structure for error responses from the Quicksilver API.
error: A short, general error code or name.message: A human-readable description of the error.status_code: The HTTP status code associated with the error.details: Optional additional details about the error (e.g., validation errors).PaginationParamsParameters used when requesting paginated lists of resources.
page: The specific page number to retrieve (for offset-based pagination).limit: The maximum number of items to return per page.cursor: A token used for cursor-based pagination to fetch the next set of results.PaginatedResponse<T>A generic structure for responses that contain a list of items along with pagination metadata.
data: An array of the requested resource type (T).pagination: An object containing metadata about the pagination:
page: The current page number.limit: The number of items per page.total: The total number of items available.has_more: A boolean indicating if there are more pages to fetch.next_cursor: An optional cursor for fetching the next page of results.