api

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBitcoinAnchorsResponse

type GetBitcoinAnchorsResponse struct {
	Anchors []slidechain.BitcoinAnchorData `json:"anchors"`
}

GetBitcoinAnchorsResponse is the response for Bitcoin anchors

type GetPolygonResponse

type GetPolygonResponse struct {
	SubchainID string                           `json:"subchainID"`
	TimeStep   int                              `json:"timeStep"`
	Vertices   []slidechain.GeometricCoordinate `json:"vertices"`
	SpanoRoot  string                           `json:"spanoRoot"`
	CreatedAt  time.Time                        `json:"createdAt"`
}

GetPolygonResponse is the response for polygon data

type GetSpanoRootArgs

type GetSpanoRootArgs struct {
	IncludeCoordinates bool `json:"includeCoordinates"` // Whether to include the full coordinate history
}

GetSpanoRootArgs is the request for retrieving a SpanoRoot

type GetSpanoRootResponse

type GetSpanoRootResponse struct {
	SpanoRootHash string                           `json:"spanoRootHash"`
	TimeStep      int                              `json:"timeStep"`    // Latest time step (Z-coordinate)
	VertexCount   int                              `json:"vertexCount"` // Number of vertices in latest polygon
	Coordinates   []slidechain.GeometricCoordinate `json:"coordinates,omitempty"`
	BitcoinAnchor *slidechain.BitcoinAnchorData    `json:"bitcoinAnchor,omitempty"`
}

GetSpanoRootResponse is the response for a SpanoRoot query

type RegisterSubchainArgs

type RegisterSubchainArgs struct {
	GenesisBlockHash string `json:"genesisBlockHash"` // The genesis block hash of the new subchain
	SubchainName     string `json:"subchainName"`     // Optional name for the subchain
	OwnerID          string `json:"ownerID"`          // Optional owner identifier
}

RegisterSubchainArgs is the request for registering a subchain

type RegisterSubchainResponse

type RegisterSubchainResponse struct {
	Success        bool   `json:"success"`
	SubchainID     string `json:"subchainID"`     // The assigned ID for the subchain
	ParentHash     string `json:"parentHash"`     // The parent SlideChain block hash
	CombinedHash   string `json:"combinedHash"`   // The combined hash that's recorded
	RegistrationTx string `json:"registrationTx"` // Transaction ID on SlideChain
}

RegisterSubchainResponse is the response for the registration

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides the SlideChain API endpoints

func NewService

func NewService(
	log logging.Logger,
	slideManager *slidechain.SlideChainManager,
	zkpVerifier *slidechain.ZKPVerifier,
	btcAnchor *slidechain.BitcoinAnchorManager,
) *Service

NewService creates a new SlideChain API service

func (*Service) Routes

func (s *Service) Routes() []api.Route

Routes returns the API endpoints this service handles

type SubmitArtifactsArgs

type SubmitArtifactsArgs struct {
	SubchainID string   `json:"subchainID"` // The ID of the subchain
	Artifacts  []string `json:"artifacts"`  // Artifact hashes in hex format
	ZKProof    *string  `json:"zkProof"`    // Optional ZK proof
}

SubmitArtifactsArgs is the request for submitting artifact hashes

type SubmitArtifactsResponse

type SubmitArtifactsResponse struct {
	Success     bool   `json:"success"`
	SpanoRoot   string `json:"spanoRoot"`   // The computed SpanoRoot hash
	TimeStep    int    `json:"timeStep"`    // The Z-coordinate (time step)
	VertexCount int    `json:"vertexCount"` // Number of vertices in the polygon
	TxID        string `json:"txID"`        // Transaction ID on SlideChain
}

SubmitArtifactsResponse is the response for the submission

type VerifyZKPArgs

type VerifyZKPArgs struct {
	SpanoRootHash string              `json:"spanoRootHash"`
	Proof         *slidechain.ZKProof `json:"proof"`
}

VerifyZKPArgs is the request for verifying a ZKP

type VerifyZKPResponse

type VerifyZKPResponse struct {
	Valid     bool   `json:"valid"`
	SpanoRoot string `json:"spanoRoot"`
}

VerifyZKPResponse is the response for ZKP verification

Jump to

Keyboard shortcuts

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