wasm

package
v0.1.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BidStateToString

func BidStateToString(state int32) string

BidState enum conversion

func DeploymentStateToString

func DeploymentStateToString(state int32) string

DeploymentState enum conversion

func EncodePageKey

func EncodePageKey(b []byte) string

EncodePageKey is a small helper for off-chain tools that need a human-readable cursor (e.g. for tx broadcasts via JSON RPC). The keeper's binary cursor is safe to JSON-encode as base64; we expose this helper for callers that prefer an opaque text cursor.

func GroupStateToString

func GroupStateToString(state int32) string

GroupState enum conversion

func LeaseStateToString

func LeaseStateToString(state int32) string

LeaseState enum conversion

func OrderStateToString

func OrderStateToString(state int32) string

OrderState enum conversion

Types

type ActiveProviderEndpoint

type ActiveProviderEndpoint struct {
	Owner         string            `json:"owner"`
	DSeq          uint64            `json:"dseq"`
	GSeq          uint32            `json:"gseq"`
	OSeq          uint32            `json:"oseq"`
	Provider      string            `json:"provider"`
	LeaseState    string            `json:"lease_state"`
	Price         string            `json:"price"`
	HostURI       string            `json:"host_uri"`
	Scheme        string            `json:"scheme,omitempty"`
	Host          string            `json:"host,omitempty"`
	Port          string            `json:"port,omitempty"`
	ServiceURL    string            `json:"service_url,omitempty"`
	Attributes    map[string]string `json:"attributes,omitempty"`
	ProviderFound bool              `json:"provider_found"`
	// Workload-facing ports (NodePort → container) from recent orchestration
	// responses when the provider submitted them; empty if none on-chain yet.
	WorkloadForwardedPorts []apiorch.ForwardedPort `json:"workload_forwarded_ports,omitempty"`
}

ActiveProviderEndpoint describes one active lease joined with the provider's on-chain HostURI (provider-services gateway / API), not the lease workload's ingress or container listen port from the manifest expose graph.

type AkashMsg

type AkashMsg struct {
	// Create a new deployment
	CreateDeployment *MsgCreateDeployment `json:"create_deployment,omitempty"`
	// Close a deployment
	CloseDeployment *MsgCloseDeployment `json:"close_deployment,omitempty"`
	// Accept a bid (creates a lease)
	AcceptBid *MsgAcceptBid `json:"accept_bid,omitempty"`
	// Create a lease from a bid
	CreateLease *MsgCreateLease `json:"create_lease,omitempty"`
	// Close a lease
	CloseLease *MsgCloseLease `json:"close_lease,omitempty"`
	// Close a group
	CloseGroup *MsgCloseGroup `json:"close_group,omitempty"`
	// Report health attestation (for providers)
	ReportHealth *MsgReportHealth `json:"report_health,omitempty"`

	// === Orchestration Messages ===
	// Request health check from provider
	RequestHealth *MsgRequestHealth `json:"request_health,omitempty"`
	// Request deployment status from provider
	RequestStatus *MsgRequestStatus `json:"request_status,omitempty"`
	// Request logs from provider
	RequestLogs *MsgRequestLogs `json:"request_logs,omitempty"`
	// Send command to provider (scale, restart, etc.)
	SendProviderCommand *MsgSendProviderCommand `json:"send_provider_command,omitempty"`
	// Mark orchestration message as processed
	AckOrchestrationMessage *MsgAckOrchestrationMessage `json:"ack_orchestration_message,omitempty"`

	// === Manifest Messages ===
	// Set deployment manifest (stored on-chain for provider auto-fetch)
	SetDeploymentManifest *MsgSetDeploymentManifest `json:"set_deployment_manifest,omitempty"`

	// === Escrow Messages ===
	// Deposit additional funds into deployment escrow
	DepositDeployment *MsgDepositDeployment `json:"deposit_deployment,omitempty"`

	// === Reputation Messages ===
	// Submit a provider reputation score for a closed lease the contract owns.
	// Routed to x/reputation MsgSubmitProviderScore. Tenant + lease.owner are
	// always set to the contract address by the encoder, so contracts cannot
	// score leases they don't own.
	SubmitProviderScore *MsgSubmitProviderScore `json:"submit_provider_score,omitempty"`
}

AkashMsg represents custom messages that CosmWasm contracts can send to Akash modules

func ParseAkashMsg

func ParseAkashMsg(data []byte) (*AkashMsg, error)

ParseAkashMsg parses a JSON message into AkashMsg

type AkashQuery

type AkashQuery struct {
	// Query deployment by owner and dseq
	Deployment *QueryDeploymentRequest `json:"deployment,omitempty"`
	// Query order by full ID
	Order *QueryOrderRequest `json:"order,omitempty"`
	// Query lease by full ID
	Lease *QueryLeaseRequest `json:"lease,omitempty"`
	// Query bids for an order
	Bids *QueryBidsRequest `json:"bids,omitempty"`
	// Query providers (optionally filtered by attributes)
	Providers *QueryProvidersRequest `json:"providers,omitempty"`
	// Query provider by address
	Provider *QueryProviderRequest `json:"provider,omitempty"`
	// Query active provider endpoints for deployments owned by a contract
	ActiveProviderEndpoints *QueryActiveProviderEndpointsRequest `json:"active_provider_endpoints,omitempty"`
	// Query health attestation for a lease
	Health *QueryHealthRequest `json:"health,omitempty"`

	// === Orchestration Queries ===
	// Query orchestration messages for this contract
	OrchestrationMessages *QueryOrchestrationMessagesRequest `json:"orchestration_messages,omitempty"`
	// Query orchestration messages for a specific lease
	LeaseMessages *QueryLeaseMessagesRequest `json:"lease_messages,omitempty"`

	// === Manifest Queries ===
	// Query deployment manifest (for provider auto-fetch)
	DeploymentManifest *QueryDeploymentManifestRequest `json:"deployment_manifest,omitempty"`
	// Query manifest reference (hash only, for content-hash model)
	ManifestRef *QueryManifestRefRequest `json:"manifest_ref,omitempty"`

	// === Escrow Queries ===
	// Query escrow balance for a deployment
	EscrowBalance *QueryEscrowBalanceRequest `json:"escrow_balance,omitempty"`

	// === Reputation Queries ===
	// Reputation params (governance-tunable thresholds)
	ReputationParams *QueryReputationParamsRequest `json:"reputation_params,omitempty"`
	// Reputation score for a single provider
	ReputationScore *QueryReputationScoreRequest `json:"reputation_score,omitempty"`
	// Filtered, sorted, paginated provider list
	ReputationProviders *QueryReputationProvidersRequest `json:"reputation_providers,omitempty"`
	// Chronological score-entry history for a provider
	ReputationHistory *QueryReputationHistoryRequest `json:"reputation_history,omitempty"`
	// Chain-derived availability summary for a single provider
	ReputationAvailability *QueryReputationAvailabilityRequest `json:"reputation_availability,omitempty"`
	// Chronological availability event history for a provider
	ReputationAvailabilityHistory *QueryReputationAvailabilityHistoryRequest `json:"reputation_availability_history,omitempty"`
}

AkashQuery represents custom queries that CosmWasm contracts can make to Akash modules

func ParseAkashQuery

func ParseAkashQuery(data []byte) (*AkashQuery, error)

ParseAkashQuery parses a JSON query into AkashQuery

type AvailabilityEventInfo

type AvailabilityEventInfo struct {
	Provider  string `json:"provider"`
	Kind      string `json:"kind"`
	Height    int64  `json:"height"`
	Source    string `json:"source"`
	Reference string `json:"reference,omitempty"`
}

AvailabilityEventInfo is the JSON-friendly view of a single audit row from the per-provider event history.

type AvailabilityInfo

type AvailabilityInfo struct {
	Provider                 string `json:"provider"`
	AvailabilityBps          uint32 `json:"availability_bps"`
	AvailableRatioBps        uint32 `json:"available_ratio_bps"`
	RespondedBids            uint64 `json:"responded_bids"`
	MissedEligibleBids       uint64 `json:"missed_eligible_bids"`
	OnlineBlocks             uint64 `json:"online_blocks"`
	OfflineBlocks            uint64 `json:"offline_blocks"`
	AggregateOnlineBlocks    uint64 `json:"aggregate_online_blocks"`
	AggregateOfflineBlocks   uint64 `json:"aggregate_offline_blocks"`
	FirstSeenHeight          int64  `json:"first_seen_height"`
	LastSeenHeight           int64  `json:"last_seen_height"`
	LastOfflineHeight        int64  `json:"last_offline_height"`
	CurrentStateOnline       bool   `json:"current_state_online"`
	CurrentWindowStartHeight int64  `json:"current_window_start_height"`
	LastEventHeight          int64  `json:"last_event_height"`
	ObservationCount         uint32 `json:"observation_count"`
}

AvailabilityInfo is the JSON-friendly view of rtypes.ProviderAvailability. Fields are 1:1 with the keeper struct; AvailableRatioBps is the live (decayed-free) ratio computed at read time so contracts don't have to redo the math.

type BidInfo

type BidInfo struct {
	Provider  string `json:"provider"`
	Price     string `json:"price"`
	State     string `json:"state"`
	CreatedAt int64  `json:"created_at"`
}

BidInfo represents a single bid

type DeploymentGroup

type DeploymentGroup struct {
	GSeq      uint32 `json:"gseq"`
	State     string `json:"state"`
	Name      string `json:"name"`
	CreatedAt int64  `json:"created_at"`
}

DeploymentGroup represents a deployment group

type DepositAmount

type DepositAmount struct {
	Denom  string `json:"denom,omitempty"`
	Amount string `json:"amount"`
}

DepositAmount handles flexible deposit parsing from contracts Contracts can send either a string amount or a full coin object

func (*DepositAmount) ToSDKCoin

func (d *DepositAmount) ToSDKCoin() (sdk.Coin, error)

ToSDKCoin converts DepositAmount to sdk.Coin

func (*DepositAmount) UnmarshalJSON

func (d *DepositAmount) UnmarshalJSON(data []byte) error

UnmarshalJSON handles both string and object formats for deposit

type GetPendingMessagesRequest

type GetPendingMessagesRequest struct {
	Contract string `json:"contract"`
}

GetPendingMessagesRequest requests pending messages for a contract

type GetPendingMessagesResponse

type GetPendingMessagesResponse struct {
	Messages []MessageEnvelope `json:"messages"`
	Count    int               `json:"count"`
}

GetPendingMessagesResponse contains pending messages

type GetSubscriptionsRequest

type GetSubscriptionsRequest struct {
	Contract string `json:"contract"`
}

GetSubscriptionsRequest requests subscriptions for a contract

type GetSubscriptionsResponse

type GetSubscriptionsResponse struct {
	Subscriptions []Subscription `json:"subscriptions"`
	Count         int            `json:"count"`
}

GetSubscriptionsResponse contains subscriptions

type GetTopicSubscribersRequest

type GetTopicSubscribersRequest struct {
	Topic string `json:"topic"`
}

GetTopicSubscribersRequest requests subscribers for a topic

type GetTopicSubscribersResponse

type GetTopicSubscribersResponse struct {
	Subscribers []string `json:"subscribers"`
	Count       int      `json:"count"`
}

GetTopicSubscribersResponse contains subscribers

type GroupSpec

type GroupSpec struct {
	Name      string         `json:"name"`
	Resources []ResourceSpec `json:"resources"`
	Placement PlacementSpec  `json:"placement"`
}

GroupSpec defines resources for a deployment group

type MessageBusMsg

type MessageBusMsg struct {
	// Send a message to another contract or topic
	SendMessage *SendMessageRequest `json:"send_message,omitempty"`
	// Subscribe to a topic
	Subscribe *SubscribeRequest `json:"subscribe,omitempty"`
	// Unsubscribe from a topic
	Unsubscribe *UnsubscribeRequest `json:"unsubscribe,omitempty"`
	// Process pending messages (deliver to contract)
	ProcessMessages *ProcessMessagesRequest `json:"process_messages,omitempty"`
}

MessageBusMsg represents custom messages that CosmWasm contracts can send to the message bus

func ParseMessageBusMsg

func ParseMessageBusMsg(data []byte) (*MessageBusMsg, error)

ParseMessageBusMsg parses a JSON message into MessageBusMsg

type MessageBusQuery

type MessageBusQuery struct {
	// Get pending messages for a contract
	GetPendingMessages *GetPendingMessagesRequest `json:"get_pending_messages,omitempty"`
	// Get subscriptions for a contract
	GetSubscriptions *GetSubscriptionsRequest `json:"get_subscriptions,omitempty"`
	// Get subscribers for a topic
	GetTopicSubscribers *GetTopicSubscribersRequest `json:"get_topic_subscribers,omitempty"`
}

MessageBusQuery represents custom queries that CosmWasm contracts can make to the message bus

func ParseMessageBusQuery

func ParseMessageBusQuery(data []byte) (*MessageBusQuery, error)

ParseMessageBusQuery parses a JSON query into MessageBusQuery

type MessageEnvelope

type MessageEnvelope struct {
	ID          string `json:"id"`
	From        string `json:"from"`
	To          string `json:"to"`
	Topic       string `json:"topic"`
	MessageType string `json:"message_type"`
	Payload     []byte `json:"payload"`
	TTL         uint64 `json:"ttl"`        // Block height when message expires
	Priority    uint8  `json:"priority"`   // 0-255, higher = more priority
	CreatedAt   uint64 `json:"created_at"` // Block height when created
	Delivered   bool   `json:"delivered"`  // Whether message has been delivered
}

MessageEnvelope represents a message sent between contracts

type MsgAcceptBid

type MsgAcceptBid struct {
	Owner    string `json:"owner,omitempty"` // Deployment owner (contract address used if empty)
	DSeq     uint64 `json:"dseq"`
	GSeq     uint32 `json:"gseq"`
	OSeq     uint32 `json:"oseq"`
	Provider string `json:"provider"`
}

MsgAcceptBid accepts a bid from a provider

type MsgAckOrchestrationMessage

type MsgAckOrchestrationMessage struct {
	MessageID string `json:"message_id"`
}

MsgAckOrchestrationMessage acknowledges an orchestration message

type MsgCloseDeployment

type MsgCloseDeployment struct {
	DSeq uint64 `json:"dseq"`
}

MsgCloseDeployment closes a deployment

type MsgCloseGroup

type MsgCloseGroup struct {
	DSeq uint64 `json:"dseq"`
	GSeq uint32 `json:"gseq"`
}

MsgCloseGroup closes a deployment group

type MsgCloseLease

type MsgCloseLease struct {
	Owner    string `json:"owner"`
	DSeq     uint64 `json:"dseq"`
	GSeq     uint32 `json:"gseq"`
	OSeq     uint32 `json:"oseq"`
	Provider string `json:"provider"`
}

MsgCloseLease closes a lease

type MsgCreateDeployment

type MsgCreateDeployment struct {
	// The contract is the owner - funds come from contract
	// DSeq is the deployment sequence number (typically current block height or contract-chosen sequence)
	DSeq uint64 `json:"dseq"`
	// SDL is the YAML SDL manifest - if provided, will be parsed to generate groups
	SDL string `json:"sdl,omitempty"`
	// Groups can be provided directly if SDL is not used
	Groups []GroupSpec `json:"groups,omitempty"`
	// Deposit can be sent as either:
	// - A string amount (e.g., "1000000") - will use "uakt" denom
	// - A full coin object {denom: "uakt", amount: "1000000"}
	Deposit DepositAmount `json:"deposit"`
	// SDL hash for verification
	Hash []byte `json:"hash,omitempty"`
}

MsgCreateDeployment creates a new deployment

type MsgCreateLease

type MsgCreateLease struct {
	Owner    string `json:"owner"` // deployment owner (usually contract address)
	DSeq     uint64 `json:"dseq"`
	GSeq     uint32 `json:"gseq"`
	OSeq     uint32 `json:"oseq"`
	Provider string `json:"provider"`
}

MsgCreateLease creates a lease from a bid

type MsgDepositDeployment

type MsgDepositDeployment struct {
	DSeq   uint64 `json:"dseq"`   // Deployment sequence number
	Amount string `json:"amount"` // Amount to deposit in uakt
}

MsgDepositDeployment deposits additional funds into a deployment's escrow account

type MsgReportHealth

type MsgReportHealth struct {
	LeaseOwner string `json:"lease_owner"`
	DSeq       uint64 `json:"dseq"`
	GSeq       uint32 `json:"gseq"`
	OSeq       uint32 `json:"oseq"`
	Provider   string `json:"provider"`
	Status     string `json:"status"` // "healthy", "degraded", "failed", "unknown"
	Timestamp  int64  `json:"timestamp"`
	Message    string `json:"message,omitempty"`
}

MsgReportHealth reports health status for a lease

type MsgRequestHealth

type MsgRequestHealth struct {
	LeaseOwner string   `json:"lease_owner"`
	DSeq       uint64   `json:"dseq"`
	GSeq       uint32   `json:"gseq"`
	OSeq       uint32   `json:"oseq"`
	Provider   string   `json:"provider"`
	Services   []string `json:"services,omitempty"` // Specific services (empty = all)
	Detailed   bool     `json:"detailed"`           // Include detailed metrics
}

MsgRequestHealth requests health check from provider

type MsgRequestLogs

type MsgRequestLogs struct {
	LeaseOwner string `json:"lease_owner"`
	DSeq       uint64 `json:"dseq"`
	GSeq       uint32 `json:"gseq"`
	OSeq       uint32 `json:"oseq"`
	Provider   string `json:"provider"`
	Service    string `json:"service"` // Service name (empty = all)
	Lines      int    `json:"lines"`   // Number of lines (default 100)
	Since      int64  `json:"since"`   // Unix timestamp (0 = from beginning)
}

MsgRequestLogs requests logs from provider

type MsgRequestStatus

type MsgRequestStatus struct {
	LeaseOwner        string `json:"lease_owner"`
	DSeq              uint64 `json:"dseq"`
	GSeq              uint32 `json:"gseq"`
	OSeq              uint32 `json:"oseq"`
	Provider          string `json:"provider"`
	IncludeContainers bool   `json:"include_containers"`
	IncludeResources  bool   `json:"include_resources"`
}

MsgRequestStatus requests deployment status from provider

type MsgSendProviderCommand

type MsgSendProviderCommand struct {
	LeaseOwner  string          `json:"lease_owner"`
	DSeq        uint64          `json:"dseq"`
	GSeq        uint32          `json:"gseq"`
	OSeq        uint32          `json:"oseq"`
	Provider    string          `json:"provider"`
	CommandType string          `json:"command_type"` // "scale", "restart", "stop"
	Payload     json.RawMessage `json:"payload"`      // Command-specific payload
}

MsgSendProviderCommand sends a command to provider

type MsgSetDeploymentManifest

type MsgSetDeploymentManifest struct {
	DSeq     uint64 `json:"dseq"`
	Manifest []byte `json:"manifest"` // Raw manifest JSON bytes
	SDL      string `json:"sdl"`      // Original SDL YAML (optional, for reference)
}

MsgSetDeploymentManifest stores a manifest on-chain for a deployment This allows providers to fetch the manifest directly from the chain

type MsgSubmitProviderScore

type MsgSubmitProviderScore struct {
	Provider string `json:"provider"`
	DSeq     uint64 `json:"dseq"`
	GSeq     uint32 `json:"gseq"`
	OSeq     uint32 `json:"oseq"`
	BPS      uint32 `json:"bps"`
}

MsgSubmitProviderScore submits a reputation score for a closed lease. The contract address is used for both the tenant signer and lease.owner so the chain-side eligibility check (signer == lease owner) holds: the lease must have been created by this contract via CreateDeployment + AcceptBid.

type OrchestrationMessageInfo

type OrchestrationMessageInfo struct {
	ID            string          `json:"id"`
	MessageType   string          `json:"message_type"`
	From          string          `json:"from"`
	LeaseOwner    string          `json:"lease_owner"`
	DSeq          uint64          `json:"dseq"`
	GSeq          uint32          `json:"gseq"`
	OSeq          uint32          `json:"oseq"`
	Provider      string          `json:"provider"`
	CorrelationID string          `json:"correlation_id"`
	Payload       json.RawMessage `json:"payload"`
	CreatedAt     int64           `json:"created_at"`
	BlockHeight   uint64          `json:"block_height"`
	TTL           uint64          `json:"ttl"`
	Processed     bool            `json:"processed"`
}

OrchestrationMessageInfo represents a message in query response

type PlacementSpec

type PlacementSpec struct {
	Attributes map[string]string `json:"attributes,omitempty"`
	Pricing    PricingSpec       `json:"pricing"`
}

PlacementSpec defines placement requirements

type PricingSpec

type PricingSpec struct {
	Denom  string `json:"denom"`
	Amount string `json:"amount"`
}

PricingSpec defines pricing requirements

type ProcessMessagesRequest

type ProcessMessagesRequest struct {
	Contract string `json:"contract"`
}

ProcessMessagesRequest processes pending messages for a contract

type ProcessMessagesResponse

type ProcessMessagesResponse struct {
	Processed int               `json:"processed"`
	Messages  []MessageEnvelope `json:"messages"`
}

ProcessMessagesResponse contains processed messages

type ProviderAggregateInfo

type ProviderAggregateInfo struct {
	Provider             string `json:"provider"`
	WeightedBps          uint32 `json:"weighted_bps"`
	WeightTotal          string `json:"weight_total"`
	NumeratorBps         string `json:"numerator_bps"`
	ObservationCount     uint32 `json:"observation_count"`
	LastUpdateHeight     int64  `json:"last_update_height"`
	LastRecomputedHeight int64  `json:"last_recomputed_height"`

	// Availability fields (chain-derived, optional).
	AvailabilityBps          uint32 `json:"availability_bps"`
	RespondedBids            uint64 `json:"responded_bids"`
	MissedEligibleBids       uint64 `json:"missed_eligible_bids"`
	OnlineBlocks             uint64 `json:"online_blocks"`
	OfflineBlocks            uint64 `json:"offline_blocks"`
	FirstSeenHeight          int64  `json:"first_seen_height"`
	LastSeenHeight           int64  `json:"last_seen_height"`
	LastOfflineHeight        int64  `json:"last_offline_height"`
	CurrentStateOnline       bool   `json:"current_state_online"`
	CurrentWindowStartHeight int64  `json:"current_window_start_height"`
	AvailabilityObservations uint32 `json:"availability_observations"`
}

ProviderAggregateInfo is the JSON-friendly view of rtypes.ProviderAggregate. Strings are kept verbatim from the on-chain LegacyDec encoding so contracts can do their own arithmetic if needed.

The availability fields are populated from the parallel ProviderAvailability record (when present) so a single wasm/RPC call gives contracts both the subjective tenant-score and the chain-derived availability signal. They are zero-valued when no availability data has been recorded yet, mirroring the "no opinion" convention used by observation_count == 0 on the tenant lane.

type ProviderDetails

type ProviderDetails struct {
	EMail   string `json:"email"`
	Website string `json:"website"`
}

ProviderDetails contains detailed provider info

type ProviderInfo

type ProviderInfo struct {
	Owner      string            `json:"owner"`
	HostURI    string            `json:"host_uri"`
	Attributes map[string]string `json:"attributes"`
}

ProviderInfo represents provider information

type QueryActiveProviderEndpointsRequest

type QueryActiveProviderEndpointsRequest struct {
	Owner string `json:"owner"`
	// Optional deployment sequence filter. Zero means all active deployments
	// owned by Owner.
	DSeq uint64 `json:"dseq,omitempty"`
	// Optional result cap. Zero means the default cap.
	Limit uint32 `json:"limit,omitempty"`
}

QueryActiveProviderEndpointsRequest queries active leases for an owner and joins them with provider host/port metadata from x/provider.

type QueryActiveProviderEndpointsResponse

type QueryActiveProviderEndpointsResponse struct {
	Owner     string                   `json:"owner"`
	DSeq      uint64                   `json:"dseq,omitempty"`
	Endpoints []ActiveProviderEndpoint `json:"endpoints"`
	Count     uint32                   `json:"count"`
}

QueryActiveProviderEndpointsResponse contains active provider endpoints for a contract owner.

type QueryBidsRequest

type QueryBidsRequest struct {
	Owner string `json:"owner"`
	DSeq  uint64 `json:"dseq"`
	GSeq  uint32 `json:"gseq"`
	OSeq  uint32 `json:"oseq"`
}

QueryBidsRequest queries bids for an order

type QueryBidsResponse

type QueryBidsResponse struct {
	Bids []BidInfo `json:"bids"`
}

QueryBidsResponse contains bid information

type QueryDeploymentManifestRequest

type QueryDeploymentManifestRequest struct {
	Owner string `json:"owner"`
	DSeq  uint64 `json:"dseq"`
}

QueryDeploymentManifestRequest queries a deployment's manifest from chain storage

type QueryDeploymentManifestResponse

type QueryDeploymentManifestResponse struct {
	Owner     string `json:"owner"`
	DSeq      uint64 `json:"dseq"`
	Manifest  []byte `json:"manifest"`   // Raw manifest JSON bytes
	SDL       string `json:"sdl"`        // Original SDL YAML
	Hash      []byte `json:"hash"`       // Canonical hash
	Version   uint32 `json:"version"`    // Version number
	CreatedAt int64  `json:"created_at"` // Block height created
	UpdatedAt int64  `json:"updated_at"` // Block height updated
	Found     bool   `json:"found"`      // Whether manifest exists
}

QueryDeploymentManifestResponse contains the stored manifest

type QueryDeploymentRequest

type QueryDeploymentRequest struct {
	Owner string `json:"owner"`
	DSeq  uint64 `json:"dseq"`
}

QueryDeploymentRequest queries a deployment by owner and dseq

type QueryDeploymentResponse

type QueryDeploymentResponse struct {
	Owner     string            `json:"owner"`
	DSeq      uint64            `json:"dseq"`
	State     string            `json:"state"`
	Hash      []byte            `json:"hash"`
	CreatedAt int64             `json:"created_at"`
	Groups    []DeploymentGroup `json:"groups"`
}

QueryDeploymentResponse contains deployment information

type QueryEscrowBalanceRequest

type QueryEscrowBalanceRequest struct {
	Owner string `json:"owner"`
	DSeq  uint64 `json:"dseq"`
}

QueryEscrowBalanceRequest queries escrow balance for a deployment

type QueryEscrowBalanceResponse

type QueryEscrowBalanceResponse struct {
	Owner           string `json:"owner"`
	DSeq            uint64 `json:"dseq"`
	Balance         string `json:"balance"`          // Current escrow balance in uakt
	Transferred     string `json:"transferred"`      // Total transferred to providers
	Settled         string `json:"settled"`          // Total settled
	State           string `json:"state"`            // "open", "closed", "overdrawn"
	IsLow           bool   `json:"is_low"`           // Balance below threshold
	BlocksRemaining int64  `json:"blocks_remaining"` // Estimated blocks before depletion (based on burn rate)
	Found           bool   `json:"found"`            // Whether escrow account exists
}

QueryEscrowBalanceResponse contains escrow balance information

type QueryHealthRequest

type QueryHealthRequest struct {
	Owner    string `json:"owner"`
	DSeq     uint64 `json:"dseq"`
	GSeq     uint32 `json:"gseq"`
	OSeq     uint32 `json:"oseq"`
	Provider string `json:"provider"`
}

QueryHealthRequest queries health attestation for a lease

type QueryHealthResponse

type QueryHealthResponse struct {
	LeaseOwner  string `json:"lease_owner"`
	DSeq        uint64 `json:"dseq"`
	GSeq        uint32 `json:"gseq"`
	OSeq        uint32 `json:"oseq"`
	Provider    string `json:"provider"`
	Status      string `json:"status"`
	BlockHeight int64  `json:"block_height"`
	Timestamp   int64  `json:"timestamp"`
	Message     string `json:"message,omitempty"`
	IsHealthy   bool   `json:"is_healthy"`
	// Freshness metadata
	Found          bool  `json:"found"`           // Whether any attestation was found
	IsFresh        bool  `json:"is_fresh"`        // Attestation within freshness threshold
	AttestationAge int64 `json:"attestation_age"` // Blocks since attestation
	CurrentBlock   int64 `json:"current_block"`   // Current block height for reference
}

QueryHealthResponse contains health attestation information

type QueryLeaseMessagesRequest

type QueryLeaseMessagesRequest struct {
	Owner    string `json:"owner"`
	DSeq     uint64 `json:"dseq"`
	GSeq     uint32 `json:"gseq"`
	OSeq     uint32 `json:"oseq"`
	Provider string `json:"provider"`
	// Filter by message type (optional)
	MessageType string `json:"message_type,omitempty"`
}

QueryLeaseMessagesRequest queries messages for a specific lease

type QueryLeaseRequest

type QueryLeaseRequest struct {
	Owner    string `json:"owner"`
	DSeq     uint64 `json:"dseq"`
	GSeq     uint32 `json:"gseq"`
	OSeq     uint32 `json:"oseq"`
	Provider string `json:"provider"`
}

QueryLeaseRequest queries a lease by full ID

type QueryLeaseResponse

type QueryLeaseResponse struct {
	Owner     string `json:"owner"`
	DSeq      uint64 `json:"dseq"`
	GSeq      uint32 `json:"gseq"`
	OSeq      uint32 `json:"oseq"`
	Provider  string `json:"provider"`
	State     string `json:"state"`
	Price     string `json:"price"`
	CreatedAt int64  `json:"created_at"`
}

QueryLeaseResponse contains lease information

type QueryManifestRefRequest

type QueryManifestRefRequest struct {
	Owner string `json:"owner"`
	DSeq  uint64 `json:"dseq"`
}

QueryManifestRefRequest queries manifest reference (hash) for a deployment

type QueryManifestRefResponse

type QueryManifestRefResponse struct {
	Owner     string `json:"owner"`
	DSeq      uint64 `json:"dseq"`
	Found     bool   `json:"found"`
	Hash      string `json:"hash"`       // Hex-encoded SHA256 hash
	Version   uint32 `json:"version"`    // Schema version
	CreatedAt int64  `json:"created_at"` // Block height when created
	UpdatedAt int64  `json:"updated_at"` // Block height when last updated
}

QueryManifestRefResponse contains manifest reference metadata

type QueryOrchestrationMessagesRequest

type QueryOrchestrationMessagesRequest struct {
	// Filter by message type (optional)
	MessageType string `json:"message_type,omitempty"`
	// Only unprocessed messages (default true)
	OnlyUnprocessed bool `json:"only_unprocessed"`
	// Limit results (default 100)
	Limit uint32 `json:"limit,omitempty"`
}

QueryOrchestrationMessagesRequest queries orchestration messages for a contract

type QueryOrchestrationMessagesResponse

type QueryOrchestrationMessagesResponse struct {
	Messages []OrchestrationMessageInfo `json:"messages"`
	Count    uint32                     `json:"count"`
}

QueryOrchestrationMessagesResponse contains orchestration messages

type QueryOrderRequest

type QueryOrderRequest struct {
	Owner string `json:"owner"`
	DSeq  uint64 `json:"dseq"`
	GSeq  uint32 `json:"gseq"`
	OSeq  uint32 `json:"oseq"`
}

QueryOrderRequest queries an order by full ID

type QueryOrderResponse

type QueryOrderResponse struct {
	Owner     string `json:"owner"`
	DSeq      uint64 `json:"dseq"`
	GSeq      uint32 `json:"gseq"`
	OSeq      uint32 `json:"oseq"`
	State     string `json:"state"`
	CreatedAt int64  `json:"created_at"`
}

QueryOrderResponse contains order information

type QueryProviderRequest

type QueryProviderRequest struct {
	Owner string `json:"owner"`
}

QueryProviderRequest queries a specific provider by address

type QueryProviderResponse

type QueryProviderResponse struct {
	Owner      string            `json:"owner"`
	HostURI    string            `json:"host_uri"`
	Attributes map[string]string `json:"attributes"`
	Info       ProviderDetails   `json:"info"`
}

QueryProviderResponse contains single provider information

type QueryProvidersRequest

type QueryProvidersRequest struct {
}

QueryProvidersRequest queries providers

type QueryProvidersResponse

type QueryProvidersResponse struct {
	Providers []ProviderInfo `json:"providers"`
}

QueryProvidersResponse contains list of providers

type QueryReputationAvailabilityHistoryRequest

type QueryReputationAvailabilityHistoryRequest struct {
	Provider   string `json:"provider"`
	FromHeight int64  `json:"from_height,omitempty"`
	ToHeight   int64  `json:"to_height,omitempty"`
	Limit      uint32 `json:"limit,omitempty"`
	PageKey    []byte `json:"page_key,omitempty"`
}

QueryReputationAvailabilityHistoryRequest is the paginated per-provider event-history query.

type QueryReputationAvailabilityHistoryResponse

type QueryReputationAvailabilityHistoryResponse struct {
	Events      []AvailabilityEventInfo `json:"events"`
	NextPageKey []byte                  `json:"next_page_key,omitempty"`
	Count       uint32                  `json:"count"`
}

QueryReputationAvailabilityHistoryResponse is the paginated history response.

type QueryReputationAvailabilityRequest

type QueryReputationAvailabilityRequest struct {
	Provider string `json:"provider"`
	// Optional caller-supplied current block height used to fold the
	// in-flight window into the OnlineBlocks/OfflineBlocks accumulators
	// at read time. Zero means "use ctx.BlockHeight()".
	AtHeight int64 `json:"at_height,omitempty"`
}

QueryReputationAvailabilityRequest fetches the availability summary for a single provider. Distinct from QueryReputationScore so contracts can pull just the availability lane when they don't need tenant scores.

type QueryReputationAvailabilityResponse

type QueryReputationAvailabilityResponse struct {
	Found        bool             `json:"found"`
	Availability AvailabilityInfo `json:"availability"`
}

QueryReputationAvailabilityResponse is the response body.

type QueryReputationHistoryRequest

type QueryReputationHistoryRequest struct {
	Provider   string `json:"provider"`
	FromHeight int64  `json:"from_height,omitempty"`
	ToHeight   int64  `json:"to_height,omitempty"`
	Limit      uint32 `json:"limit,omitempty"`
	PageKey    []byte `json:"page_key,omitempty"`
}

QueryReputationHistoryRequest mirrors rtypes.QueryProviderHistoryRequest.

type QueryReputationHistoryResponse

type QueryReputationHistoryResponse struct {
	Entries     []ScoreEntryInfo `json:"entries"`
	NextPageKey []byte           `json:"next_page_key,omitempty"`
	Count       uint32           `json:"count"`
}

QueryReputationHistoryResponse is the paginated entry list returned by the wasm Reputation/History route.

type QueryReputationParamsRequest

type QueryReputationParamsRequest struct{}

QueryReputationParamsRequest is the wasm-binding wrapper for reputation Params; payload is empty (an empty object {}).

type QueryReputationParamsResponse

type QueryReputationParamsResponse struct {
	MinTransferredForScore            string `json:"min_transferred_for_score"`
	ScoreDenom                        string `json:"score_denom"`
	MaxBps                            uint32 `json:"max_bps"`
	HalfLifeBlocks                    uint64 `json:"half_life_blocks"`
	MaxScoreHistoryPerProvider        uint32 `json:"max_score_history_per_provider"`
	MaxAvailabilityHistoryPerProvider uint32 `json:"max_availability_history_per_provider"`
	MaxQueryPageSize                  uint32 `json:"max_query_page_size"`
}

QueryReputationParamsResponse mirrors rtypes.QueryParamsResponse for the JSON wire format used by CosmWasm.

type QueryReputationProvidersRequest

type QueryReputationProvidersRequest struct {
	MinBps                uint32 `json:"min_bps,omitempty"`
	MinObservations       uint32 `json:"min_observations,omitempty"`
	MinAvailabilityBps    uint32 `json:"min_availability_bps,omitempty"`
	MinOnlineBlocks       uint64 `json:"min_online_blocks,omitempty"`
	MaxMissedEligibleBids uint64 `json:"max_missed_eligible_bids,omitempty"`
	SortBy                string `json:"sort_by,omitempty"`
	Limit                 uint32 `json:"limit,omitempty"`
	PageKey               []byte `json:"page_key,omitempty"`
}

QueryReputationProvidersRequest mirrors rtypes.QueryProvidersRequest.

PageKey is the opaque cursor returned from the previous response; callers pass [] (or omit) on the first call. SortBy options are the same as the gRPC query: "bps_desc" (default), "bps_asc", "weight_desc", "recent_desc".

type QueryReputationProvidersResponse

type QueryReputationProvidersResponse struct {
	Providers   []ProviderAggregateInfo `json:"providers"`
	NextPageKey []byte                  `json:"next_page_key,omitempty"`
	Count       uint32                  `json:"count"`
}

QueryReputationProvidersResponse is the paginated list returned by the wasm Reputation/Providers route.

type QueryReputationScoreRequest

type QueryReputationScoreRequest struct {
	Provider string `json:"provider"`
}

QueryReputationScoreRequest fetches a single provider aggregate.

type QueryReputationScoreResponse

type QueryReputationScoreResponse struct {
	Found     bool                  `json:"found"`
	Aggregate ProviderAggregateInfo `json:"aggregate"`
}

QueryReputationScoreResponse is the wasm-side representation of a ProviderAggregate.

type ResourceSpec

type ResourceSpec struct {
	CPU     uint64 `json:"cpu"`     // millicores
	Memory  uint64 `json:"memory"`  // bytes
	Storage uint64 `json:"storage"` // bytes
	GPU     uint64 `json:"gpu"`     // count
	Count   uint32 `json:"count"`   // number of instances
	Price   string `json:"price"`   // max price per block
}

ResourceSpec defines resource requirements

type ScoreEntryInfo

type ScoreEntryInfo struct {
	Tenant          string `json:"tenant"`
	Provider        string `json:"provider"`
	LeaseID         string `json:"lease_id"`
	Bps             uint32 `json:"bps"`
	Weight          string `json:"weight"`
	SubmittedHeight int64  `json:"submitted_height"`
}

ScoreEntryInfo is the JSON-friendly view of rtypes.ScoreEntry.

type SendMessageRequest

type SendMessageRequest struct {
	To          string `json:"to"`                 // Contract address (empty for topic-only)
	Topic       string `json:"topic"`              // Topic name (optional, for pub/sub)
	MessageType string `json:"message_type"`       // Type of message
	Payload     []byte `json:"payload"`            // Message payload (JSON)
	TTL         uint64 `json:"ttl,omitempty"`      // TTL in blocks (default: 100)
	Priority    uint8  `json:"priority,omitempty"` // Priority 0-255 (default: 0)
}

SendMessageRequest creates a new message

type SendMessageResponse

type SendMessageResponse struct {
	MessageID string `json:"message_id"`
	CreatedAt uint64 `json:"created_at"`
	TTL       uint64 `json:"ttl"`
}

SendMessageResponse contains message ID

type SubscribeRequest

type SubscribeRequest struct {
	Topic string `json:"topic"`
}

SubscribeRequest subscribes a contract to a topic

type SubscribeResponse

type SubscribeResponse struct {
	Contract string `json:"contract"`
	Topic    string `json:"topic"`
	Created  uint64 `json:"created"`
}

SubscribeResponse confirms subscription

type Subscription

type Subscription struct {
	Contract string `json:"contract"`
	Topic    string `json:"topic"`
	Created  uint64 `json:"created"` // Block height when subscribed
}

Subscription represents a contract's subscription to a topic

type UnsubscribeRequest

type UnsubscribeRequest struct {
	Topic string `json:"topic"`
}

UnsubscribeRequest unsubscribes a contract from a topic

type UnsubscribeResponse

type UnsubscribeResponse struct {
	Contract string `json:"contract"`
	Topic    string `json:"topic"`
}

UnsubscribeResponse confirms unsubscription

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL