Documentation
¶
Index ¶
- Variables
- type APIKey
- type CreditMetadata
- type FAQItem
- type Plugin
- type PluginAvgRatingDto
- type PluginCategory
- type PluginCreateDto
- type PluginFilters
- type PluginImage
- type PluginPolicyPaginatedList
- type PluginPolicySync
- type PluginRating
- type PluginRatingDto
- type PluginTotalCount
- type PluginUpdateDto
- type PluginWithRatings
- type PluginsPaginatedList
- type PolicySyncStatus
- type PolicySyncType
- type RecipeFunctions
- type Review
- type ReviewCreateDto
- type ReviewDto
- type ReviewsDto
- type Tag
- type TimeTrigger
- type TimeTriggerStatus
- type TransactionHistoryPaginatedList
- type VaultToken
- type VaultTokenCreate
Constants ¶
This section is empty.
Variables ¶
View Source
var FeeDefaultPolicy = &types.Policy{ Rules: []*types.Rule{ { Resource: "ethereum.send", Effect: types.Effect_EFFECT_ALLOW, ParameterConstraints: []*types.ParameterConstraint{ { ParameterName: "asset", Constraint: &types.Constraint{ Type: types.ConstraintType_CONSTRAINT_TYPE_FIXED, Value: &types.Constraint_FixedValue{ FixedValue: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", }, Required: false, }, }, { ParameterName: "from_address", Constraint: &types.Constraint{ Type: types.ConstraintType_CONSTRAINT_TYPE_ANY, Required: true, }, }, { ParameterName: "amount", Constraint: &types.Constraint{ Type: types.ConstraintType_CONSTRAINT_TYPE_ANY, Required: true, }, }, { ParameterName: "to_address", Constraint: &types.Constraint{ Type: types.ConstraintType_CONSTRAINT_TYPE_MAGIC_CONSTANT, Value: &types.Constraint_MagicConstantValue{ MagicConstantValue: types.MagicConstant_VULTISIG_TREASURY, }, Required: true, }, }, }, }, }, }
TODO: Temporary solution for testing purposes. This will be replaced by integrating the fee policy into every relevant policy.
Functions ¶
This section is empty.
Types ¶
type CreditMetadata ¶
type Plugin ¶
type Plugin struct {
ID types.PluginID `json:"id" validate:"required"`
Title string `json:"title" validate:"required"`
Description string `json:"description" validate:"required"`
ServerEndpoint string `json:"server_endpoint" validate:"required"`
Category PluginCategory `json:"category_id" validate:"required"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Pricing []types.Pricing `json:"pricing,omitempty"` // New field for multiple pricing options
LogoURL string `json:"logo_url,omitempty"` // New field, should be validated once plugins have this data in db.
ThumbnailURL string `json:"thumbnail_url,omitempty"` // New field, should be validated once plugins have this data in db.
Images []PluginImage `json:"images,omitempty"` // New field, should be validated once plugins have this data in db.
FAQs []FAQItem `json:"faqs,omitempty"`
Features []string `json:"features,omitempty"`
Audited bool `json:"audited"`
RatesCount int `json:"rates_count"`
AvgRating float64 `json:"avg_rating"`
Installations int `json:"installations"`
}
type PluginAvgRatingDto ¶
type PluginCategory ¶
type PluginCategory string
const ( PluginCategoryAIAgent PluginCategory = "ai-agent" PluginCategoryPlugin PluginCategory = "plugin" )
func (PluginCategory) IsValid ¶
func (pc PluginCategory) IsValid() bool
IsValid checks if the plugin category is valid
func (PluginCategory) String ¶
func (pc PluginCategory) String() string
String returns the string representation of the plugin category
type PluginCreateDto ¶
type PluginCreateDto struct {
Type string `json:"type" validate:"required"`
Title string `json:"title" validate:"required"`
Description string `json:"description" validate:"required"`
Metadata json.RawMessage `json:"metadata" validate:"required"`
ServerEndpoint string `json:"server_endpoint" validate:"required"`
LogoURL string `json:"logo_url"`
CategoryID uuid.UUID `json:"category_id" validate:"required"`
PricingData []types.PricingCreateDataDto `json:"pricing_data" validate:"required"`
}
type PluginFilters ¶
type PluginImage ¶
type PluginPolicyPaginatedList ¶
type PluginPolicyPaginatedList struct {
Policies []types.PluginPolicy `json:"policies" validate:"required"`
TotalCount int `json:"total_count" validate:"required"`
}
type PluginPolicySync ¶
type PluginPolicySync struct {
ID uuid.UUID `json:"id" validate:"required"`
PolicyID uuid.UUID `json:"policy_id" validate:"required"`
PluginID ptypes.PluginID `json:"plugin_id" validate:"required"`
Signature string `json:"signature" validate:"required"`
SyncType PolicySyncType `json:"sync_type" validate:"required"`
Status PolicySyncStatus `json:"status" validate:"required"`
FailReason string `json:"fail_reason"` // when synced is false, this field contains the reason for the failure
}
type PluginRating ¶
type PluginRatingDto ¶
type PluginTotalCount ¶
type PluginUpdateDto ¶
type PluginUpdateDto struct {
Title string `json:"title"`
Description string `json:"description"`
Metadata json.RawMessage `json:"metadata"`
ServerEndpoint string `json:"server_endpoint"`
LogoURL string `json:"logo_url"`
PricingData []types.PricingCreateDataDto `json:"pricing_data"`
CategoryID uuid.UUID `json:"category_id"`
}
using references on struct fields allows us to process partially field DTOs
type PluginWithRatings ¶
type PluginWithRatings struct {
Plugin
Ratings []PluginRatingDto `json:"ratings,omitempty"`
}
PluginWithRatings is used for API responses that include rating statistics
type PluginsPaginatedList ¶
type PolicySyncStatus ¶
type PolicySyncStatus int
const ( NotSynced PolicySyncStatus = iota Synced PolicySyncStatus = iota + 1 Failed PolicySyncStatus = iota + 2 )
type PolicySyncType ¶
type PolicySyncType int
const ( AddPolicy PolicySyncType = iota UpdatePolicy RemovePolicy )
type RecipeFunctions ¶
type Review ¶
type Review struct {
ID string `json:"id" validate:"required"`
Address string `json:"address" validate:"required"`
Rating int `json:"rating" validate:"required,min=1,max=5"`
Comment string `json:"comment,omitempty"`
CreatedAt time.Time `json:"created_at"`
PluginId string `json:"plugin_id" validate:"required"`
}
type ReviewCreateDto ¶
type ReviewDto ¶
type ReviewDto struct {
ID string `json:"id" validate:"required"`
Address string `json:"address" validate:"required"`
Rating int `json:"rating" validate:"required"`
Comment string `json:"comment,omitempty"`
CreatedAt time.Time `json:"created_at"`
PluginId string `json:"plugin_id" validate:"required"`
Ratings []PluginRatingDto `json:"ratings,omitempty"`
}
type ReviewsDto ¶
type Tag ¶
type Tag struct {
ID string `json:"id" validate:"required"`
Name string `json:"name" validate:"required,min=2,max=50"`
CreatedAt time.Time `json:"created_at" validate:"required"`
}
Tag represents a plugin tag with unique identifier, name
type TimeTrigger ¶
type TimeTrigger struct {
PolicyID string `json:"policy_id"`
CronExpression string `json:"cron_expression"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time"`
Frequency string `json:"frequency"`
Interval int `json:"interval"`
LastExecution *time.Time `json:"last_execution"`
Status TimeTriggerStatus `json:"status"`
}
type TimeTriggerStatus ¶
type TimeTriggerStatus string
const ( StatusTimeTriggerPending TimeTriggerStatus = "PENDING" StatusTimeTriggerRunning TimeTriggerStatus = "RUNNING" )
type TransactionHistoryPaginatedList ¶
type TransactionHistoryPaginatedList struct {
History []tx_indexer_storage.Tx `json:"history"`
TotalCount uint32 `json:"total_count"`
}
type VaultToken ¶
type VaultToken struct {
ID string `json:"id"`
TokenID string `json:"token_id"`
PublicKey string `json:"public_key"`
ExpiresAt time.Time `json:"expires_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LastUsedAt time.Time `json:"last_used_at"`
RevokedAt *time.Time `json:"revoked_at"`
}
VaultToken represents a token stored in the database
func (*VaultToken) IsRevoked ¶
func (t *VaultToken) IsRevoked() bool
Click to show internal directories.
Click to hide internal directories.