diff --git a/api/launchpad/v1/launchpad.proto b/api/launchpad/v1/launchpad.proto new file mode 100644 index 0000000000..4ab30ed3ad --- /dev/null +++ b/api/launchpad/v1/launchpad.proto @@ -0,0 +1,147 @@ +syntax = "proto3"; + +package launchpad.v1; +option go_package = "./launchpadpb"; + +service LaunchpadService { + rpc UploadMetadatas(UploadMetadatasRequest) returns (UploadMetadatasResponse); + rpc CalculateCollectionMerkleRoot(CalculateCollectionMerkleRootRequest) returns (CalculateCollectionMerkleRootResponse); + rpc TokenMetadata(TokenMetadataRequest) returns (TokenMetadataResponse); + rpc LaunchpadProjects(LaunchpadProjectsRequest) returns (LaunchpadProjectsResponse); + rpc LaunchpadProjectById(LaunchpadProjectByIdRequest) returns (LaunchpadProjectByIdResponse); + rpc LaunchpadProjectsCounts(LaunchpadProjectsCountsRequest) returns (LaunchpadProjectsCountsResponse); + rpc ProposeApproveProject(ProposeApproveProjectRequest) returns (ProposeApproveProjectResponse); +} + +enum Sort { + SORT_UNSPECIFIED = 0; + SORT_COLLECTION_NAME = 1; +} + +enum SortDirection { + SORT_DIRECTION_UNSPECIFIED = 0; + SORT_DIRECTION_ASCENDING = 1; + SORT_DIRECTION_DESCENDING = 2; +} + +enum Status { + STATUS_UNSPECIFIED = 0; + STATUS_INCOMPLETE = 1; + STATUS_COMPLETE = 2; + STATUS_REVIEWING = 3; + STATUS_CONFIRMED = 4; +} + +// ------------------------------- + +message LaunchpadProjectsRequest { + string network_id = 1; + int32 limit = 2; + int32 offset = 3; + Sort sort = 4; + SortDirection sort_direction = 5; + Status status = 6; + string creator_id = 7; +} + +message LaunchpadProjectsResponse { + repeated LaunchpadProject projects = 1; +} + +message LaunchpadProjectByIdRequest { + string network_id = 1; + string project_id = 2; +} + +message LaunchpadProjectByIdResponse { + LaunchpadProject project = 1; +} + +message UploadMetadatasRequest { + string sender = 1; + string network_id = 2; + string project_id = 3; + repeated Metadata metadatas = 4; + string pinata_jwt = 5; +} + +message UploadMetadatasResponse { + string merkle_root = 1; +} + +message CalculateCollectionMerkleRootRequest { + string sender = 1; + repeated Metadata metadatas = 2; +} + +message CalculateCollectionMerkleRootResponse { + string merkle_root = 1; +} + +message TokenMetadataRequest { + string sender = 1; + string network_id = 2; + string project_id = 3; + uint32 token_id = 4; +} + +message TokenMetadataResponse { + string merkle_root = 1; + Metadata metadata = 2; + repeated string merkle_proof = 3; +} + +message LaunchpadProjectsCountsRequest { + string network_id = 1; +} + +message LaunchpadProjectsCountsResponse { + repeated StatusCount status_counts = 1; +} + +message ProposeApproveProjectRequest { + string sender = 1; + string network_id = 2; + string project_id = 3; + string proposal_id = 4; +} + +message ProposeApproveProjectResponse { + bool approved = 1; +} + +// ------------------------------- + +message StatusCount { + Status status = 1; + uint32 count = 2; +} + +message LaunchpadProject { + string id = 1; + string network_id = 2; + string creator_id = 3; + string collection_data = 4; + Status status = 5; + string proposal_id = 6; +} + +message Metadata { + optional string image = 1; + optional string image_data = 2; + optional string external_url = 3; + optional string description = 4; + optional string name = 5; + repeated Trait attributes = 6; + optional string background_color = 7; + optional string animation_url = 8; + optional string youtube_url = 9; + optional uint64 royalty_percentage = 10; + optional string royalty_payment_address = 11; +} + +message Trait { + optional string display_type = 1; + string trait_type = 2; + string value = 3; +} diff --git a/go.mod b/go.mod index 29c74a0ac7..3926eab58e 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,8 @@ require ( github.com/go-co-op/gocron v1.18.0 github.com/gorilla/websocket v1.5.0 github.com/improbable-eng/grpc-web v0.15.0 + github.com/ipfs/boxo v0.8.0 + github.com/ipfs/go-cid v0.4.1 github.com/jackc/pgx/v5 v5.3.0 github.com/joho/godotenv v1.5.1 github.com/lib/pq v1.10.7 @@ -168,9 +170,8 @@ require ( github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/ipfs/boxo v0.8.0 // indirect - github.com/ipfs/go-cid v0.4.1 // indirect github.com/ipfs/go-ipfs-api v0.6.0 // indirect + github.com/ipfs/go-log/v2 v2.5.1 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jhump/protoreflect v1.15.1 // indirect diff --git a/go.sum b/go.sum index 48f769225e..8be6cc23a7 100644 --- a/go.sum +++ b/go.sum @@ -852,6 +852,8 @@ github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/ipfs/go-ipfs-api v0.6.0 h1:JARgG0VTbjyVhO5ZfesnbXv9wTcMvoKRBLF1SzJqzmg= github.com/ipfs/go-ipfs-api v0.6.0/go.mod h1:iDC2VMwN9LUpQV/GzEeZ2zNqd8NUdRmWcFM+K/6odf0= +github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= +github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= diff --git a/go/cmd/teritori-launchpad-backend/main.go b/go/cmd/teritori-launchpad-backend/main.go new file mode 100644 index 0000000000..6200cb12d7 --- /dev/null +++ b/go/cmd/teritori-launchpad-backend/main.go @@ -0,0 +1,146 @@ +package main + +import ( + "context" + "flag" + "fmt" + "net" + "net/http" + "os" + + "github.com/TERITORI/teritori-dapp/go/internal/indexerdb" + "github.com/TERITORI/teritori-dapp/go/pkg/launchpad" + "github.com/TERITORI/teritori-dapp/go/pkg/launchpadpb" + "github.com/TERITORI/teritori-dapp/go/pkg/networks" + "github.com/improbable-eng/grpc-web/go/grpcweb" + "github.com/peterbourgon/ff/v3" + "github.com/pkg/errors" + "go.uber.org/zap" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" +) + +// FIXME: for now, I dont find how to add reflection on grpc wrapped by http server +// so to enable Postman reflection, I'm using this DEBUG const to switch on/off that capacity +const DEBUG = false + +func main() { + fs := flag.NewFlagSet("teritori-dapp-backend", flag.ContinueOnError) + var ( + enableTls = flag.Bool("enable_tls", false, "Use TLS - required for HTTP2.") + tlsCertFilePath = flag.String("tls_cert_file", "../../misc/localhost.crt", "Path to the CRT/PEM file.") + tlsKeyFilePath = flag.String("tls_key_file", "../../misc/localhost.key", "Path to the private key file.") + dbHost = fs.String("db-indexer-host", "", "host postgreSQL database") + dbPort = fs.String("db-indexer-port", "", "port for postgreSQL database") + dbPass = fs.String("postgres-password", "", "password for postgreSQL database") + dbName = fs.String("database-name", "", "database name for postgreSQL") + dbUser = fs.String("postgres-user", "", "username for postgreSQL") + networksFile = fs.String("networks-file", "networks.json", "path to networks config file") + pinataJWT = fs.String("pinata-jwt", "", "Pinata admin JWT token") + ) + if err := ff.Parse(fs, os.Args[1:], + ff.WithEnvVars(), + ff.WithIgnoreUndefined(true), + ff.WithConfigFile(".env"), + ff.WithConfigFileParser(ff.EnvParser), + ff.WithAllowMissingConfigFile(true), + ); err != nil { + panic(errors.Wrap(err, "failed to parse flags")) + } + + logger, err := zap.NewDevelopment() + if err != nil { + panic(errors.Wrap(err, "failed to create logger")) + } + + if *pinataJWT == "" { + logger.Warn("missing PINATA_JWT, feed pinning will be disabled") + } + + // load networks + networksBytes, err := os.ReadFile(*networksFile) + if err != nil { + panic(errors.Wrap(err, "failed to read networks config file")) + } + netstore, err := networks.UnmarshalNetworkStore(networksBytes) + if err != nil { + panic(errors.Wrap(err, "failed to unmarshal networks config")) + } + + var launchpadModels = []interface{}{ + // users + &indexerdb.User{}, + + // launchpad + &LaunchpadProject{}, + &LaunchpadToken{}, + } + + dataConnexion := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s", + *dbHost, *dbUser, *dbPass, *dbName, *dbPort) + launchpadDB, err := indexerdb.NewPostgresDB(dataConnexion) + + if err != nil { + panic(errors.Wrap(err, "failed to access db")) + } + launchpadDB.AutoMigrate(launchpadModels...) + + port := 9080 + if *enableTls { + port = 9081 + } + + launchpadSvc := launchpad.NewLaunchpadService(context.Background(), &launchpad.Config{ + Logger: logger, + IndexerDB: launchpadDB, + PinataJWT: *pinataJWT, + NetworkStore: netstore, + }) + + server := grpc.NewServer() + launchpadpb.RegisterLaunchpadServiceServer(server, launchpadSvc) + + if DEBUG { + lis, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) + if err != nil { + panic(errors.Wrapf(err, "[DEBUG] failed to listen on port %d", port)) + } + + reflection.Register(server) + + logger.Info(fmt.Sprintf("[DEBUG] gRPC server listening at: %s", lis.Addr().String())) + if err := server.Serve(lis); err != nil { + panic(errors.Errorf("failed to serve: %v", err)) + } + } + + wrappedServer := grpcweb.WrapServer(server, + grpcweb.WithWebsockets(true), + grpcweb.WithWebsocketOriginFunc(func(*http.Request) bool { return true })) + + handler := func(resp http.ResponseWriter, req *http.Request) { + resp.Header().Set("Access-Control-Allow-Origin", "*") + resp.Header().Set("Access-Control-Allow-Headers", "*") + logger.Debug(fmt.Sprintf("Request: %v", req)) + wrappedServer.ServeHTTP(resp, req) + } + + httpServer := http.Server{ + Addr: fmt.Sprintf(":%d", port), + Handler: http.HandlerFunc(handler), + } + + reflection.Register(server) + + logger.Info(fmt.Sprintf("Starting server. http port: %d, with TLS: %v", port, *enableTls)) + + if *enableTls { + if err := httpServer.ListenAndServeTLS(*tlsCertFilePath, *tlsKeyFilePath); err != nil { + panic(fmt.Errorf("failed starting http2 server: %v", err)) + } + } else { + if err := httpServer.ListenAndServe(); err != nil { + panic(fmt.Errorf("failed starting http server: %v", err)) + } + } +} diff --git a/go/cmd/teritori-launchpad-backend/models.go b/go/cmd/teritori-launchpad-backend/models.go new file mode 100644 index 0000000000..d5a1bf7ebc --- /dev/null +++ b/go/cmd/teritori-launchpad-backend/models.go @@ -0,0 +1,22 @@ +package main + +import ( + "github.com/TERITORI/teritori-dapp/go/pkg/launchpadpb" + "gorm.io/datatypes" +) + +type LaunchpadProject struct { + NetworkID string `gorm:"primaryKey"` + ProjectID uint32 `gorm:"primaryKey"` + + Status launchpadpb.Status + ProposalId string +} + +type LaunchpadToken struct { + NetworkID string `gorm:"primaryKey"` + ProjectID uint32 `gorm:"primaryKey"` + TokenID uint32 `gorm:"primaryKey"` + + Metadata datatypes.JSON +} diff --git a/go/internal/indexerdb/db.go b/go/internal/indexerdb/db.go index ef006a9ecd..cf7a5f9691 100644 --- a/go/internal/indexerdb/db.go +++ b/go/internal/indexerdb/db.go @@ -90,6 +90,10 @@ var allModels = []interface{}{ // names &Name{}, + + // launchpad + &LaunchpadProject{}, + &LaunchpadToken{}, } func NewSQLiteDB(path string) (*gorm.DB, error) { diff --git a/go/internal/indexerdb/launchpad.go b/go/internal/indexerdb/launchpad.go new file mode 100644 index 0000000000..806f6f8317 --- /dev/null +++ b/go/internal/indexerdb/launchpad.go @@ -0,0 +1,26 @@ +package indexerdb + +import ( + "github.com/TERITORI/teritori-dapp/go/pkg/launchpadpb" + "github.com/TERITORI/teritori-dapp/go/pkg/networks" + "gorm.io/datatypes" +) + +type LaunchpadProject struct { + NetworkID string `gorm:"primaryKey"` + ProjectID string `gorm:"primaryKey"` + CreatorID networks.UserID `gorm:"index"` + + Status launchpadpb.Status + ProposalId string + + CollectionData datatypes.JSON +} + +type LaunchpadToken struct { + NetworkID string `gorm:"primaryKey"` + ProjectID string `gorm:"primaryKey"` + TokenID uint32 `gorm:"primaryKey"` + + Metadata datatypes.JSON +} diff --git a/go/internal/indexerhandler/dao.go b/go/internal/indexerhandler/dao.go index 7a9fedbcc9..890539905a 100644 --- a/go/internal/indexerhandler/dao.go +++ b/go/internal/indexerhandler/dao.go @@ -268,8 +268,9 @@ func (h *Handler) handleExecuteDAOExecute(e *Message, execMsg *wasmtypes.MsgExec return h.handleExecuteUpdateTNSMetadata(e, syntheticExecMsg) case "create_post": return h.handleExecuteCreatePost(e, syntheticExecMsg) + case "deploy_collection": + return h.handleExecuteDeployCollection(e, syntheticExecMsg) } - h.logger.Debug("ignored dao execute sub message with unknown action", zap.String("action", action), zap.String("payload", string(string(subExecMsg.Execute.Msg))), zap.String("tx", e.TxHash), zap.String("dao", dao.ContractAddress), zap.Uint64("proposal-id", daoExecuteMsg.Execute.ProposalID)) } diff --git a/go/internal/indexerhandler/handle.go b/go/internal/indexerhandler/handle.go index 69bb7129b9..a705fef04d 100644 --- a/go/internal/indexerhandler/handle.go +++ b/go/internal/indexerhandler/handle.go @@ -335,6 +335,19 @@ func (h *Handler) handleExecute(e *Message) error { if err := h.handleExecutePremiumFeedSubscribe(e, &executeMsg); err != nil { return errors.Wrap(err, "failed to handle premium feed subscribe") } + // Launchpad + case "submit_collection": + if err := h.handleExecuteSubmitCollection(e, &executeMsg); err != nil { + return errors.Wrap(err, "failed to handle submit collection") + } + case "update_merkle_root": + if err := h.handleExecuteUpdateMerkleRoot(e, &executeMsg); err != nil { + return errors.Wrap(err, "failed to handle update merkle root") + } + case "deploy_collection": + if err := h.handleExecuteDeployCollection(e, &executeMsg); err != nil { + return errors.Wrap(err, "failed to handle deploy collection") + } } } diff --git a/go/internal/indexerhandler/launchpad.go b/go/internal/indexerhandler/launchpad.go new file mode 100644 index 0000000000..b5468dd69a --- /dev/null +++ b/go/internal/indexerhandler/launchpad.go @@ -0,0 +1,241 @@ +package indexerhandler + +import ( + "encoding/json" + + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/TERITORI/teritori-dapp/go/internal/indexerdb" + "github.com/TERITORI/teritori-dapp/go/pkg/launchpadpb" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/friendsofgo/errors" + "go.uber.org/zap" +) + +type WhitelistInfo struct { + AddressesMerkleRoot string `json:"addresses_merkle_root"` + AddressesCount uint32 `json:"addresses_count"` + AddressesIpfs string `json:"addresses_ipfs"` +} + +type Coin struct { + Denom string `json:"denom"` + Amount int64 `json:"amount"` +} + +type MintPeriod struct { + Price *Coin `json:"price,omitempty"` + MaxTokens *uint32 `json:"max_tokens,omitempty"` + LimitPerAddress *uint32 `json:"limit_per_address,omitempty"` + StartTime uint64 `json:"start_time"` + EndTime *uint64 `json:"end_time,omitempty"` + WhitelistInfo *WhitelistInfo `json:"whitelist_info,omitempty"` +} + +type CollectionData struct { + Name string `json:"name"` + Desc string `json:"desc"` + Symbol string `json:"symbol"` + CoverImgURI string `json:"cover_img_uri"` + TargetNetwork string `json:"target_network"` + WebsiteLink string `json:"website_link"` + ContactEmail string `json:"contact_email"` + IsProjectDerivative bool `json:"is_project_derivative"` + ProjectType string `json:"project_type"` + IsAppliedPreviously bool `json:"is_applied_previously"` + TeamDesc string `json:"team_desc"` + Partners string `json:"partners"` + InvestmentDesc string `json:"investment_desc"` + InvestmentLink string `json:"investment_link"` + ArtworkDesc string `json:"artwork_desc"` + IsReadyForMint bool `json:"is_ready_for_mint"` + EscrowMintProceedsPeriod uint64 `json:"escrow_mint_proceeds_period"` + IsDox bool `json:"is_dox"` + DaoWhitelistCount uint32 `json:"dao_whitelist_count"` + RevealTime *uint64 `json:"reveal_time,omitempty"` + TokensCount uint64 `json:"tokens_count"` + MintPeriods []MintPeriod `json:"mint_periods"` + RoyaltyAddress *sdk.AccAddress `json:"royalty_address,omitempty"` + RoyaltyPercentage *uint8 `json:"royalty_percentage,omitempty"` + BaseTokenURI *string `json:"base_token_uri,omitempty"` + MetadatasMerkleRoot *string `json:"metadatas_merkle_root,omitempty"` + DeployedAddress *string `json:"deployed_address,omitempty"` + Owner *string `json:"owner,omitempty"` +} + +type SubmitCollectionMsg struct { + CollectionData CollectionData +} + +type UpdateMerkleRootMsg struct { + CollectionId string + MerkleRoot string +} + +type DeployCollectionMsg struct { + CollectionId string +} + +func (h *Handler) handleExecuteSubmitCollection(e *Message, execMsg *wasmtypes.MsgExecuteContract) error { + var submitCollectionMsg SubmitCollectionMsg + + if err := json.Unmarshal(execMsg.Msg, &submitCollectionMsg); err != nil { + return errors.Wrap(err, "failed to unmarshal submit collection msg") + } + collectionData := submitCollectionMsg.CollectionData + + collectionId := e.Events["wasm.collection_id"][0] + if collectionId == "" { + return errors.New("failed to get collection id") + } + + collectionDataJson, err := json.Marshal(collectionData) + if err != nil { + return errors.Wrap(err, "failed to marshal collection data") + } + + project := indexerdb.LaunchpadProject{ + NetworkID: h.config.Network.ID, + ProjectID: collectionId, + CollectionData: collectionDataJson, + CreatorID: h.config.Network.UserID(execMsg.Sender), + Status: launchpadpb.Status_STATUS_INCOMPLETE, + } + if err := h.db.Create(project).Error; err != nil { + return errors.Wrap(err, "failed to create project") + } + + h.logger.Info("submited project", zap.Any("symbol", collectionId)) + + return nil +} + +func (h *Handler) handleExecuteUpdateMerkleRoot(e *Message, execMsg *wasmtypes.MsgExecuteContract) error { + var updateMerkleRootMsg UpdateMerkleRootMsg + + if err := json.Unmarshal(execMsg.Msg, &updateMerkleRootMsg); err != nil { + return errors.Wrap(err, "failed to unmarshal merkle root msg") + } + collectionId := updateMerkleRootMsg.CollectionId + merkleRoot := updateMerkleRootMsg.MerkleRoot + + // Update collection_data + if err := h.db.Exec(` + UPDATE launchpad_projects + SET collection_data = jsonb_set(collection_data, '{metadatas_merkle_root}', to_jsonb(?::text)) + WHERE project_id = ? AND network_id = ?`, + merkleRoot, collectionId, h.config.Network.ID, + ).Error; err != nil { + return errors.Wrap(err, "failed to update deployed address in collection_data") + } + + // Update status + if err := + h.db. + Model(&indexerdb.LaunchpadProject{}). + Where("project_id = ?", collectionId). + Where("network_id = ?", h.config.Network.ID). + UpdateColumn("status", launchpadpb.Status_STATUS_COMPLETE). + Error; err != nil { + return errors.Wrap(err, "failed to update project status to COMPLETE") + } + + h.logger.Info("updated merkle root", zap.Any("merkleRoot", merkleRoot)) + + return nil +} + +func (h *Handler) handleExecuteDeployCollection(e *Message, execMsg *wasmtypes.MsgExecuteContract) error { + var deployCollectionMsg DeployCollectionMsg + + if err := json.Unmarshal(execMsg.Msg, &deployCollectionMsg); err != nil { + return errors.Wrap(err, "failed to unmarshal deploy collection msg") + } + collectionId := deployCollectionMsg.CollectionId + + deployedAddress := e.Events["instantiate._contract_address"][0] + if deployedAddress == "" { + return errors.New("failed to get deployed address from reply") + } + + // Update collection_data + if err := h.db.Exec(` + UPDATE launchpad_projects + SET collection_data = jsonb_set(collection_data, '{deployed_address}', to_jsonb(?::text)) + WHERE project_id = ? AND network_id = ?`, + deployedAddress, collectionId, h.config.Network.ID, + ).Error; err != nil { + return errors.Wrap(err, "failed to update deployed address in collection_data") + } + + // Update status + if err := h.db. + Model(&indexerdb.LaunchpadProject{}). + Where("project_id = ?", collectionId). + Where("network_id = ?", h.config.Network.ID). + UpdateColumn("status", launchpadpb.Status_STATUS_CONFIRMED). + Error; err != nil { + return errors.Wrap(err, "failed to update project status to CONFIRMED") + } + + var project indexerdb.LaunchpadProject + if err := h.db.Model(&indexerdb.LaunchpadProject{}). + Where("project_id = ?", collectionId). + Where("network_id = ?", h.config.Network.ID). + Scan(&project).Error; err != nil { + return errors.Wrap(err, "failed to get launchpad_project from database") + } + collectionData := project.CollectionData + + // Create usable collection + // TODO: Use a defined shape for collection_data ? + var collectionDataJSON map[string]json.RawMessage + if err := json.Unmarshal(collectionData, &collectionDataJSON); err != nil { + return errors.Wrap(err, "failed to unmarhsal collection_data") + } + var name string + if raw, ok := collectionDataJSON["name"]; ok { + if err := json.Unmarshal(raw, &name); err != nil { + return errors.Wrap(err, "failed to unmarshal name") + } + } + var coverImgUri string + if raw, ok := collectionDataJSON["cover_img_uri"]; ok { + if err := json.Unmarshal(raw, &coverImgUri); err != nil { + return errors.Wrap(err, "failed to unmarshal cover_img_uri") + } + } + var tokensCount uint64 + if raw, ok := collectionDataJSON["tokens_count"]; ok { + if err := json.Unmarshal(raw, &tokensCount); err != nil { + return errors.Wrap(err, "failed to unmarshal tokens_count") + } + } + + blockTime, err := e.GetBlockTime() + if err != nil { + return errors.Wrap(err, "failed to get block time") + } + + networkCollectionId := h.config.Network.CollectionID(deployedAddress) + if err := h.db.Create(&indexerdb.Collection{ + ID: networkCollectionId, + NetworkID: h.config.Network.ID, + Name: name, + ImageURI: coverImgUri, + MaxSupply: int(tokensCount), + SecondaryDuringMint: true, + Time: blockTime, + TeritoriCollection: &indexerdb.TeritoriCollection{ + NetworkID: h.config.Network.ID, + MintContractAddress: deployedAddress, + NFTContractAddress: deployedAddress, + CreatorAddress: execMsg.Sender, + }, + }).Error; err != nil { + return errors.Wrap(err, "failed to create teritori collection") + } + + h.logger.Info("created teritori collection", zap.String("id", string(networkCollectionId))) + + return nil +} diff --git a/go/pkg/launchpad/helpers.go b/go/pkg/launchpad/helpers.go new file mode 100644 index 0000000000..bdbd91be26 --- /dev/null +++ b/go/pkg/launchpad/helpers.go @@ -0,0 +1,54 @@ +package launchpad + +import ( + "github.com/TERITORI/teritori-dapp/go/pkg/launchpadpb" + "github.com/TERITORI/teritori-dapp/go/pkg/merkletree" + "github.com/pkg/errors" +) + +func (s *Launchpad) getCollectionMerkleTree(collectionID string) (*merkletree.MerkleTree, error) { + return nil, nil +} + +func (s *Launchpad) buildCollectionMerkleTree(metadatas []*launchpadpb.Metadata) (*merkletree.MerkleTree, error) { + // Create merkle tree + leaves := make([]merkletree.Content, len(metadatas)) + + i := 0 + for _, data := range metadatas { + leaves[i] = NewMetadataFromPb(data) + i++ + } + + // NOTE: Don't sort leaves to keep the same order of uploaded file + tree, err := merkletree.New(leaves) + if err != nil { + return nil, errors.Wrap(err, "failed to created merkle tree") + } + + return tree, nil +} + +func (s *Launchpad) buildWhitelistMerkleTree(addresses []string) (*merkletree.MerkleTree, error) { + // Create merkle tree + leaves := make([]merkletree.Content, len(addresses)) + + i := 0 + for _, addr := range addresses { + leaves[i] = NewWhitelistAddress(addr) + i++ + } + + // NOTE: Don't sort leaves to keep the same order of uploaded file + tree, err := merkletree.New(leaves) + if err != nil { + return nil, errors.Wrap(err, "failed to created merkle tree") + } + + return tree, nil +} + +// Verify if sender is allowed to get Token metadata +func (s *Launchpad) verifySender(sender string) error { + return nil +} diff --git a/go/pkg/launchpad/ipfs.go b/go/pkg/launchpad/ipfs.go new file mode 100644 index 0000000000..a74f1226eb --- /dev/null +++ b/go/pkg/launchpad/ipfs.go @@ -0,0 +1,95 @@ +package launchpad + +import ( + "context" + "fmt" + "strings" + + "github.com/pkg/errors" + "golang.org/x/exp/slices" + + remoteClient "github.com/ipfs/boxo/pinning/remote/client" + "github.com/ipfs/go-cid" +) + +type Provider string + +const ( + Pinata Provider = "pinata" + PinataUrl string = "https://api.pinata.cloud/psa" +) + +type PinningService struct { + url string + bearerToken string + client *remoteClient.Client +} + +func NewPinningService(provider Provider, bearerToken string) (*PinningService, error) { + var url string + + switch provider { + case Pinata: + url = PinataUrl + default: + return nil, errors.New(fmt.Sprintf("unknown provider: %s", provider)) + } + + client := remoteClient.NewClient(url, bearerToken) + + return &PinningService{ + url, + bearerToken, + client, + }, nil +} + +func (ps *PinningService) VerifyPinned(cidStrs ...string) (bool, error) { + ctx := context.Background() + cids := make([]cid.Cid, len(cidStrs)) + for idx, cidStr := range cidStrs { + cidObj, err := cid.Decode(cidStr) + if err != nil { + return false, errors.Wrap(err, fmt.Sprintf("fail to parse cid: %s", cidStr)) + } + // LsSync doesn't work with CIDv1, so we convert to CIDv0 to use LsSync + cidv0 := cid.NewCidV0(cidObj.Hash()) + cids[idx] = cidv0 + } + + pinnedItems, err := ps.client.LsSync( + ctx, + remoteClient.PinOpts.FilterCIDs(cids...), + remoteClient.PinOpts.FilterStatus(remoteClient.StatusPinned), + ) + + if err != nil { + return false, errors.Wrap(err, "error while fetching pinned items") + } + if len(pinnedItems) == 0 { + return false, errors.New("no pinned items fetched") + } + + pinnedStrs := make([]string, len(pinnedItems)) + for idx, item := range pinnedItems { + if string(item.GetStatus()) == remoteClient.StatusPinned.String() { + // We convert back to CIDv1 + cidv1 := cid.NewCidV1(0x70, item.GetPin().GetCid().Hash()) + pinnedStrs[idx] = cidv1.String() + } + } + var unpinnedCids []string + + // Veryfing given CIDs and pinned ones + for _, cidStr := range cidStrs { + if !slices.Contains(pinnedStrs, cidStr) { + unpinnedCids = append(unpinnedCids, cidStr) + } + } + + if len(unpinnedCids) != 0 { + return false, errors.New(fmt.Sprintf("there exists some unpinned items: %s", strings.Join(unpinnedCids, ","))) + } + + return true, nil +} diff --git a/go/pkg/launchpad/service.go b/go/pkg/launchpad/service.go new file mode 100644 index 0000000000..fa8538771b --- /dev/null +++ b/go/pkg/launchpad/service.go @@ -0,0 +1,380 @@ +package launchpad + +import ( + "context" + "encoding/json" + "fmt" + "strconv" + + "github.com/TERITORI/teritori-dapp/go/internal/indexerdb" + "github.com/TERITORI/teritori-dapp/go/pkg/launchpadpb" + "github.com/TERITORI/teritori-dapp/go/pkg/networks" + "github.com/pkg/errors" + "go.uber.org/zap" + "golang.org/x/exp/slices" + "gorm.io/datatypes" + "gorm.io/gorm" +) + +type Launchpad struct { + launchpadpb.UnimplementedLaunchpadServiceServer + conf *Config +} + +type Config struct { + Logger *zap.Logger + IndexerDB *gorm.DB + PinataJWT string + NetworkStore networks.NetworkStore +} + +func NewLaunchpadService(ctx context.Context, conf *Config) launchpadpb.LaunchpadServiceServer { + // FIXME: validate config + return &Launchpad{ + conf: conf, + } +} + +// ================================ + +// IMPORTANT !!! TODO !!! +// For now, for simplicity, we upload images to ipfs from client side then this backend will +// only check if images have been pinnned correctly. +// +// This approche has 1 downside: +// User can query ipfs node to get all existing images of collection (AI to detect similar images for example) +// then guest what are the remainning NFT then decide if it's interesting to mint. +// +// For now it's not a big problem but in the future, the more secure solution will be handling image upload by backend. +// We dont do it for now yet because grpc-web does not support bidi stream so handle client send image => backend => ipfs properly can take time + +// Upload collection metadatas and generate corresponding merkle root +// This will delete all existing tokens metadatas and replace by new ones +func (s *Launchpad) UploadMetadatas(ctx context.Context, req *launchpadpb.UploadMetadatasRequest) (*launchpadpb.UploadMetadatasResponse, error) { + if err := s.verifySender(req.Sender); err != nil { + return nil, errors.Wrap(err, "failed to verify sender") + } + + // Check if client sent pinata jwt along with the payload + pinataJwt := req.GetPinataJwt() + if pinataJwt == "" { + // If pinataJwt is not sent then try to use the system key + pinataJwt = s.conf.PinataJWT + + // If system does not have JWT then throw error + if pinataJwt == "" { + return nil, errors.New("JWT key is required for this endpoint") + } + } + + pinnedCIDs := []string{} + for _, metadataItem := range req.Metadatas { + pinnedCIDs = append(pinnedCIDs, extractCID(*metadataItem.Image)) + } + + // Check pinning + pinningSrv, err := NewPinningService(Pinata, pinataJwt) + if err != nil { + return nil, errors.Wrap(err, "failed to get pinning service") + } + + if _, err := pinningSrv.VerifyPinned(pinnedCIDs...); err != nil { + return nil, errors.Wrap(err, "failed to verify pinned images") + } + + // Check if all files have been pinned correctly + for _, metadataItem := range req.Metadatas { + if !slices.Contains(pinnedCIDs, extractCID(*metadataItem.Image)) { + return nil, errors.New(fmt.Sprintf("image %s has not been pinned correctly", *metadataItem.Image)) + } + } + + // We search for the LaunchpadProject + // It has been created by indexer when collection has been submitted on-chain + project := indexerdb.LaunchpadProject{ + ProjectID: req.ProjectId, + NetworkID: req.NetworkId, + } + + if err := s.conf.IndexerDB.First(&project).Error; err != nil { + return nil, errors.Wrap(err, "failed to get the requested project") + } + + var hex_root string + + if err := s.conf.IndexerDB.Transaction(func(tx *gorm.DB) error { + // Delete all existing tokens metadatas + if err := s.conf.IndexerDB.Delete(&indexerdb.LaunchpadToken{}, "network_id = ? AND project_id = ?", req.NetworkId, req.ProjectId).Error; err != nil { + return errors.Wrap(err, "failed to flush existing metatadas") + } + + tokenMetadatas := []indexerdb.LaunchpadToken{} + + for idx, metadata := range req.Metadatas { + metadataJson, err := json.Marshal(metadata) + if err != nil { + return errors.Wrap(err, "failed to marshal metadata to json") + } + + tokenMetadatas = append(tokenMetadatas, indexerdb.LaunchpadToken{ + ProjectID: req.ProjectId, + NetworkID: req.NetworkId, + TokenID: uint32(idx) + 1, + Metadata: datatypes.JSON([]byte(metadataJson)), + }) + } + + if err := s.conf.IndexerDB.Create(tokenMetadatas).Error; err != nil { + return errors.Wrap(err, "failed to save token metadatas") + } + + tree, err := s.buildCollectionMerkleTree(req.Metadatas) + if err != nil { + return errors.Wrap(err, "failed to calculate merkle root") + } + hex_root = tree.GetHexRootWithoutPrefix() + + if err := s.conf.IndexerDB.Save(&project).Error; err != nil { + return errors.Wrap(err, "failed to update project merkle root") + } + + return nil + }); err != nil { + return nil, errors.Wrap(err, "fail to process") + } + + return &launchpadpb.UploadMetadatasResponse{MerkleRoot: hex_root}, nil +} + +// Store the proposal made by the admin DAO at the first "Approve" +func (s *Launchpad) ProposeApproveProject(ctx context.Context, req *launchpadpb.ProposeApproveProjectRequest) (*launchpadpb.ProposeApproveProjectResponse, error) { + if err := s.verifySender(req.Sender); err != nil { + return nil, errors.Wrap(err, "failed to verify sender") + } + + updates := map[string]interface{}{ + "proposal_id": req.ProposalId, + "status": launchpadpb.Status_STATUS_REVIEWING, + } + + if err := + s.conf.IndexerDB. + Model(&indexerdb.LaunchpadProject{}). + Where("project_id = ?", req.ProjectId). + Where("network_id = ?", req.NetworkId). + UpdateColumns(updates). + Error; err != nil { + return nil, errors.Wrap(err, "failed to update propsal id and project status to REVIEWING") + } + + return &launchpadpb.ProposeApproveProjectResponse{ + Approved: true, + }, nil +} + +// ================================ + +// Calculate collection merkle root +func (s *Launchpad) CalculateCollectionMerkleRoot(ctx context.Context, req *launchpadpb.CalculateCollectionMerkleRootRequest) (*launchpadpb.CalculateCollectionMerkleRootResponse, error) { + if err := s.verifySender(req.Sender); err != nil { + return nil, errors.Wrap(err, "failed to verify sender") + } + + tree, err := s.buildCollectionMerkleTree(req.Metadatas) + if err != nil { + return nil, errors.Wrap(err, "failed to calculate merkle root") + } + // Remove 0x at first position because rust does not have that 0x + hex_root := tree.GetHexRootWithoutPrefix() + + return &launchpadpb.CalculateCollectionMerkleRootResponse{MerkleRoot: hex_root}, nil +} + +// Get token metadata, merkle root, merke proof to be used for claiming the on-chain token +func (s *Launchpad) TokenMetadata(ctx context.Context, req *launchpadpb.TokenMetadataRequest) (*launchpadpb.TokenMetadataResponse, error) { + if err := s.verifySender(req.Sender); err != nil { + return nil, errors.Wrap(err, "failed to verify sender") + } + + var tokens []indexerdb.LaunchpadToken + if err := s.conf.IndexerDB.Find(&tokens, "network_id = ? AND project_id = ?", req.NetworkId, req.ProjectId).Error; err != nil { + return nil, errors.Wrap(err, "failed to collection tokens to build merkle tree") + } + + var metadatas []*launchpadpb.Metadata + var tokenMetadata *launchpadpb.Metadata + + for id, token := range tokens { + var metadata launchpadpb.Metadata + if err := json.Unmarshal(token.Metadata, &metadata); err != nil { + return nil, errors.Wrap(err, "failed to parse metadata") + } + metadatas = append(metadatas, &metadata) + + if id == int(req.TokenId) { + tokenMetadata = &metadata + } + } + + if tokenMetadata.Name == nil { + return nil, errors.New("failed to get metadata for given token") + } + + tree, err := s.buildCollectionMerkleTree(metadatas) + if err != nil { + return nil, errors.Wrap(err, "failed to build merke tree") + } + + proof, err := tree.GetHexProofWithoutPrefix(NewMetadataFromPb(tokenMetadata)) + if err != nil { + return nil, errors.Wrap(err, "failed to get proof") + } + + return &launchpadpb.TokenMetadataResponse{ + Metadata: tokenMetadata, + MerkleRoot: tree.GetHexRootWithoutPrefix(), + MerkleProof: proof, + }, nil +} + +// Get all launchpad projects +func (s *Launchpad) LaunchpadProjects(ctx context.Context, req *launchpadpb.LaunchpadProjectsRequest) (*launchpadpb.LaunchpadProjectsResponse, error) { + limit := req.GetLimit() + if limit <= 0 { + return nil, errors.New("limit must be a positive number") + } + + // TODO: Handle offset for pagination + offset := req.GetOffset() + if offset < 0 { + return nil, errors.New("offset must be greater or equal to 0") + } + + networkID := req.GetNetworkId() + if networkID == "" { + return nil, errors.New("missing network id") + } + _, err := s.conf.NetworkStore.GetNetwork(networkID) + if err != nil { + return nil, errors.Wrap(err, fmt.Sprintf("unknown network id '%s'", networkID)) + } + + creatorID := req.GetCreatorId() + + status := req.GetStatus() + if status < 0 { + return nil, errors.New("invalid status") + } + + var projects []indexerdb.LaunchpadProject + + orderDirection := "" + switch req.GetSortDirection() { + case launchpadpb.SortDirection_SORT_DIRECTION_UNSPECIFIED: + orderDirection = "" + case launchpadpb.SortDirection_SORT_DIRECTION_ASCENDING: + orderDirection = " ASC " + case launchpadpb.SortDirection_SORT_DIRECTION_DESCENDING: + orderDirection = " DESC " + } + orderSQL := "" + switch req.GetSort() { + case launchpadpb.Sort_SORT_COLLECTION_NAME: + orderSQL = "ORDER BY lp.collection_data->>'name'" + orderDirection + case launchpadpb.Sort_SORT_UNSPECIFIED: + orderSQL = "" + } + + statusFilterSQL := "AND lp.status = " + strconv.FormatInt(int64(status.Number()), 10) + if status == launchpadpb.Status_STATUS_UNSPECIFIED { + statusFilterSQL = "" + } + + creatorFilterSQL := "AND lp.creator_id = " + creatorID + if creatorID == "" { + creatorFilterSQL = "" + } + + err = s.conf.IndexerDB.Raw(fmt.Sprintf(` + SELECT * FROM launchpad_projects AS lp WHERE lp.network_id = ? %s %s %s LIMIT ? + `, + statusFilterSQL, creatorFilterSQL, orderSQL), networkID, limit).Scan(&projects).Error + if err != nil { + return nil, errors.Wrap(err, "failed to query database") + } + + result := make([]*launchpadpb.LaunchpadProject, len(projects)) + for idx, dbProject := range projects { + result[idx] = &launchpadpb.LaunchpadProject{ + Id: dbProject.ProjectID, + NetworkId: dbProject.NetworkID, + CreatorId: string(dbProject.CreatorID), + CollectionData: string(dbProject.CollectionData), + Status: dbProject.Status, + ProposalId: dbProject.ProposalId, + } + } + + return &launchpadpb.LaunchpadProjectsResponse{ + Projects: result, + }, nil +} + +// Get launchpad project by project_id +func (s *Launchpad) LaunchpadProjectById(ctx context.Context, req *launchpadpb.LaunchpadProjectByIdRequest) (*launchpadpb.LaunchpadProjectByIdResponse, error) { + networkID := req.GetNetworkId() + if networkID == "" { + return nil, errors.New("missing network id") + } + _, err := s.conf.NetworkStore.GetNetwork(networkID) + if err != nil { + return nil, errors.Wrap(err, fmt.Sprintf("unknown network id '%s'", networkID)) + } + + projectID := req.GetProjectId() + if projectID == "" { + return nil, errors.New("missing project id") + } + + var project *indexerdb.LaunchpadProject + + err = s.conf.IndexerDB.Raw(`SELECT * FROM launchpad_projects AS lp WHERE lp.project_id = ? AND lp.network_id = ?`, projectID, networkID).Scan(&project).Error + if err != nil { + return nil, errors.Wrap(err, "failed to query database") + } + + return &launchpadpb.LaunchpadProjectByIdResponse{ + Project: &launchpadpb.LaunchpadProject{ + Id: project.ProjectID, + NetworkId: project.NetworkID, + CreatorId: string(project.CreatorID), + CollectionData: string(project.CollectionData), + Status: project.Status, + ProposalId: project.ProposalId, + }, + }, nil +} + +// Get all launchpad projects counts +func (s *Launchpad) LaunchpadProjectsCounts(ctx context.Context, req *launchpadpb.LaunchpadProjectsCountsRequest) (*launchpadpb.LaunchpadProjectsCountsResponse, error) { + networkID := req.GetNetworkId() + if networkID == "" { + return nil, errors.New("missing network id") + } + _, err := s.conf.NetworkStore.GetNetwork(networkID) + if err != nil { + return nil, errors.Wrap(err, fmt.Sprintf("unknown network id '%s'", networkID)) + } + + var statusCounts []*launchpadpb.StatusCount + if err := s.conf.IndexerDB.Model(&indexerdb.LaunchpadProject{}). + Select("status, COUNT(*) as count"). + Group("status"). + Scan(&statusCounts).Error; err != nil { + return nil, errors.Wrap(err, "failed to query database") + } + + return &launchpadpb.LaunchpadProjectsCountsResponse{ + StatusCounts: statusCounts, + }, nil +} diff --git a/go/pkg/launchpad/utils.go b/go/pkg/launchpad/utils.go new file mode 100644 index 0000000000..f51852106c --- /dev/null +++ b/go/pkg/launchpad/utils.go @@ -0,0 +1,153 @@ +package launchpad + +import ( + "bytes" + "fmt" + + "github.com/TERITORI/teritori-dapp/go/pkg/launchpadpb" + "github.com/TERITORI/teritori-dapp/go/pkg/merkletree" + "github.com/cosmos/gogoproto/proto" + "github.com/ethereum/go-ethereum/crypto" + "github.com/pkg/errors" +) + +type WhitelistAddress struct { + value string +} + +func NewWhitelistAddress(addr string) *WhitelistAddress { + return &WhitelistAddress{value: addr} +} + +func (addr *WhitelistAddress) toStr() string { + return fmt.Sprintf("%s", addr.value) +} + +func (addr *WhitelistAddress) toBytes() []byte { + return []byte(addr.toStr()) +} + +func (addr *WhitelistAddress) GetID() string { + return addr.value +} + +func (addr *WhitelistAddress) CalculateHash() ([]byte, error) { + res := crypto.Keccak256(addr.toBytes()) + return res, nil +} + +func (addr *WhitelistAddress) Equals(other merkletree.Content) (bool, error) { + otherVal := other.(*WhitelistAddress).toStr() + return otherVal == addr.toStr(), nil +} + +func (addr *WhitelistAddress) ToJSONB() interface{} { + return map[string]interface{}{} +} + +type Metadata struct { + launchpadpb.Metadata +} + +func NewMetadataFromPb(data *launchpadpb.Metadata) *Metadata { + return &Metadata{ + Metadata: launchpadpb.Metadata{ + Image: data.Image, + ImageData: data.ImageData, + ExternalUrl: data.ExternalUrl, + Description: data.Description, + Name: data.Name, + Attributes: data.Attributes, + BackgroundColor: data.BackgroundColor, + AnimationUrl: data.AnimationUrl, + YoutubeUrl: data.YoutubeUrl, + RoyaltyPercentage: data.RoyaltyPercentage, + RoyaltyPaymentAddress: data.RoyaltyPaymentAddress, + }, + } +} + +func (m *Metadata) proto_encode() ([]byte, error) { + bytes, err := proto.Marshal(&m.Metadata) + if err != nil { + return nil, errors.Wrap(err, "failed to proto_encode metadata to proto") + } + + return bytes, nil +} + +// Converts the Metadata data into one string +func (m *Metadata) GetID() string { + id := "" + for _, attribute := range m.Attributes { + if attribute.DisplayType != nil { + id += *attribute.DisplayType + } + id += attribute.TraitType + id += attribute.Value + } + id += *m.Image + id += *m.Name + if m.ImageData != nil { + id += *m.ImageData + } + if m.ExternalUrl != nil { + id += *m.ExternalUrl + } + if m.Description != nil { + id += *m.Description + } + if m.BackgroundColor != nil { + id += *m.BackgroundColor + } + if m.AnimationUrl != nil { + id += *m.AnimationUrl + } + if m.YoutubeUrl != nil { + id += *m.YoutubeUrl + } + if m.RoyaltyPercentage != nil { + id += fmt.Sprintf(":%d", *m.RoyaltyPercentage) + } + if m.RoyaltyPaymentAddress != nil { + id += *m.RoyaltyPaymentAddress + } + return id +} + +// CalculateHash hashes the values of a Metadata +func (m *Metadata) CalculateHash() ([]byte, error) { + bytes, err := m.proto_encode() + if err != nil { + return nil, errors.Wrap(err, "failed to calculate hash") + } + + res := crypto.Keccak256(bytes) + return res, nil +} + +// Equals tests for equality of two Metadata +func (m *Metadata) Equals(other merkletree.Content) (bool, error) { + thisBytes, err := m.proto_encode() + if err != nil { + return false, errors.Wrap(err, "failed to proto_encode current metadata to bytes") + } + + otherBytes, err := other.(*Metadata).proto_encode() + if err != nil { + return false, errors.Wrap(err, "failed to proto_encode other metadata to bytes") + } + + return bytes.Equal(thisBytes, otherBytes), nil +} + +func (m *Metadata) ToJSONB() interface{} { + return map[string]interface{}{} +} + +func extractCID(imageURL string) string { + if len(imageURL) >= 7 && imageURL[:7] == "ipfs://" { + return imageURL[7:] + } + return imageURL +} diff --git a/go/pkg/launchpadpb/launchpad.pb.go b/go/pkg/launchpadpb/launchpad.pb.go new file mode 100644 index 0000000000..184b51ce1e --- /dev/null +++ b/go/pkg/launchpadpb/launchpad.pb.go @@ -0,0 +1,1887 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: launchpad/v1/launchpad.proto + +package launchpadpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Sort int32 + +const ( + Sort_SORT_UNSPECIFIED Sort = 0 + Sort_SORT_COLLECTION_NAME Sort = 1 +) + +// Enum value maps for Sort. +var ( + Sort_name = map[int32]string{ + 0: "SORT_UNSPECIFIED", + 1: "SORT_COLLECTION_NAME", + } + Sort_value = map[string]int32{ + "SORT_UNSPECIFIED": 0, + "SORT_COLLECTION_NAME": 1, + } +) + +func (x Sort) Enum() *Sort { + p := new(Sort) + *p = x + return p +} + +func (x Sort) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Sort) Descriptor() protoreflect.EnumDescriptor { + return file_launchpad_v1_launchpad_proto_enumTypes[0].Descriptor() +} + +func (Sort) Type() protoreflect.EnumType { + return &file_launchpad_v1_launchpad_proto_enumTypes[0] +} + +func (x Sort) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Sort.Descriptor instead. +func (Sort) EnumDescriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{0} +} + +type SortDirection int32 + +const ( + SortDirection_SORT_DIRECTION_UNSPECIFIED SortDirection = 0 + SortDirection_SORT_DIRECTION_ASCENDING SortDirection = 1 + SortDirection_SORT_DIRECTION_DESCENDING SortDirection = 2 +) + +// Enum value maps for SortDirection. +var ( + SortDirection_name = map[int32]string{ + 0: "SORT_DIRECTION_UNSPECIFIED", + 1: "SORT_DIRECTION_ASCENDING", + 2: "SORT_DIRECTION_DESCENDING", + } + SortDirection_value = map[string]int32{ + "SORT_DIRECTION_UNSPECIFIED": 0, + "SORT_DIRECTION_ASCENDING": 1, + "SORT_DIRECTION_DESCENDING": 2, + } +) + +func (x SortDirection) Enum() *SortDirection { + p := new(SortDirection) + *p = x + return p +} + +func (x SortDirection) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SortDirection) Descriptor() protoreflect.EnumDescriptor { + return file_launchpad_v1_launchpad_proto_enumTypes[1].Descriptor() +} + +func (SortDirection) Type() protoreflect.EnumType { + return &file_launchpad_v1_launchpad_proto_enumTypes[1] +} + +func (x SortDirection) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SortDirection.Descriptor instead. +func (SortDirection) EnumDescriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{1} +} + +type Status int32 + +const ( + Status_STATUS_UNSPECIFIED Status = 0 + Status_STATUS_INCOMPLETE Status = 1 + Status_STATUS_COMPLETE Status = 2 + Status_STATUS_REVIEWING Status = 3 + Status_STATUS_CONFIRMED Status = 4 +) + +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_INCOMPLETE", + 2: "STATUS_COMPLETE", + 3: "STATUS_REVIEWING", + 4: "STATUS_CONFIRMED", + } + Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_INCOMPLETE": 1, + "STATUS_COMPLETE": 2, + "STATUS_REVIEWING": 3, + "STATUS_CONFIRMED": 4, + } +) + +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p +} + +func (x Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_launchpad_v1_launchpad_proto_enumTypes[2].Descriptor() +} + +func (Status) Type() protoreflect.EnumType { + return &file_launchpad_v1_launchpad_proto_enumTypes[2] +} + +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{2} +} + +type LaunchpadProjectsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NetworkId string `protobuf:"bytes,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` + Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` + Sort Sort `protobuf:"varint,4,opt,name=sort,proto3,enum=launchpad.v1.Sort" json:"sort,omitempty"` + SortDirection SortDirection `protobuf:"varint,5,opt,name=sort_direction,json=sortDirection,proto3,enum=launchpad.v1.SortDirection" json:"sort_direction,omitempty"` + Status Status `protobuf:"varint,6,opt,name=status,proto3,enum=launchpad.v1.Status" json:"status,omitempty"` + CreatorId string `protobuf:"bytes,7,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"` +} + +func (x *LaunchpadProjectsRequest) Reset() { + *x = LaunchpadProjectsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LaunchpadProjectsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LaunchpadProjectsRequest) ProtoMessage() {} + +func (x *LaunchpadProjectsRequest) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LaunchpadProjectsRequest.ProtoReflect.Descriptor instead. +func (*LaunchpadProjectsRequest) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{0} +} + +func (x *LaunchpadProjectsRequest) GetNetworkId() string { + if x != nil { + return x.NetworkId + } + return "" +} + +func (x *LaunchpadProjectsRequest) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *LaunchpadProjectsRequest) GetOffset() int32 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *LaunchpadProjectsRequest) GetSort() Sort { + if x != nil { + return x.Sort + } + return Sort_SORT_UNSPECIFIED +} + +func (x *LaunchpadProjectsRequest) GetSortDirection() SortDirection { + if x != nil { + return x.SortDirection + } + return SortDirection_SORT_DIRECTION_UNSPECIFIED +} + +func (x *LaunchpadProjectsRequest) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *LaunchpadProjectsRequest) GetCreatorId() string { + if x != nil { + return x.CreatorId + } + return "" +} + +type LaunchpadProjectsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Projects []*LaunchpadProject `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` +} + +func (x *LaunchpadProjectsResponse) Reset() { + *x = LaunchpadProjectsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LaunchpadProjectsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LaunchpadProjectsResponse) ProtoMessage() {} + +func (x *LaunchpadProjectsResponse) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LaunchpadProjectsResponse.ProtoReflect.Descriptor instead. +func (*LaunchpadProjectsResponse) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{1} +} + +func (x *LaunchpadProjectsResponse) GetProjects() []*LaunchpadProject { + if x != nil { + return x.Projects + } + return nil +} + +type LaunchpadProjectByIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NetworkId string `protobuf:"bytes,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` +} + +func (x *LaunchpadProjectByIdRequest) Reset() { + *x = LaunchpadProjectByIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LaunchpadProjectByIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LaunchpadProjectByIdRequest) ProtoMessage() {} + +func (x *LaunchpadProjectByIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LaunchpadProjectByIdRequest.ProtoReflect.Descriptor instead. +func (*LaunchpadProjectByIdRequest) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{2} +} + +func (x *LaunchpadProjectByIdRequest) GetNetworkId() string { + if x != nil { + return x.NetworkId + } + return "" +} + +func (x *LaunchpadProjectByIdRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +type LaunchpadProjectByIdResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Project *LaunchpadProject `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` +} + +func (x *LaunchpadProjectByIdResponse) Reset() { + *x = LaunchpadProjectByIdResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LaunchpadProjectByIdResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LaunchpadProjectByIdResponse) ProtoMessage() {} + +func (x *LaunchpadProjectByIdResponse) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LaunchpadProjectByIdResponse.ProtoReflect.Descriptor instead. +func (*LaunchpadProjectByIdResponse) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{3} +} + +func (x *LaunchpadProjectByIdResponse) GetProject() *LaunchpadProject { + if x != nil { + return x.Project + } + return nil +} + +type UploadMetadatasRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + NetworkId string `protobuf:"bytes,2,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Metadatas []*Metadata `protobuf:"bytes,4,rep,name=metadatas,proto3" json:"metadatas,omitempty"` + PinataJwt string `protobuf:"bytes,5,opt,name=pinata_jwt,json=pinataJwt,proto3" json:"pinata_jwt,omitempty"` +} + +func (x *UploadMetadatasRequest) Reset() { + *x = UploadMetadatasRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadMetadatasRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadMetadatasRequest) ProtoMessage() {} + +func (x *UploadMetadatasRequest) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadMetadatasRequest.ProtoReflect.Descriptor instead. +func (*UploadMetadatasRequest) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{4} +} + +func (x *UploadMetadatasRequest) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *UploadMetadatasRequest) GetNetworkId() string { + if x != nil { + return x.NetworkId + } + return "" +} + +func (x *UploadMetadatasRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *UploadMetadatasRequest) GetMetadatas() []*Metadata { + if x != nil { + return x.Metadatas + } + return nil +} + +func (x *UploadMetadatasRequest) GetPinataJwt() string { + if x != nil { + return x.PinataJwt + } + return "" +} + +type UploadMetadatasResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MerkleRoot string `protobuf:"bytes,1,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"` +} + +func (x *UploadMetadatasResponse) Reset() { + *x = UploadMetadatasResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UploadMetadatasResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadMetadatasResponse) ProtoMessage() {} + +func (x *UploadMetadatasResponse) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadMetadatasResponse.ProtoReflect.Descriptor instead. +func (*UploadMetadatasResponse) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{5} +} + +func (x *UploadMetadatasResponse) GetMerkleRoot() string { + if x != nil { + return x.MerkleRoot + } + return "" +} + +type CalculateCollectionMerkleRootRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Metadatas []*Metadata `protobuf:"bytes,2,rep,name=metadatas,proto3" json:"metadatas,omitempty"` +} + +func (x *CalculateCollectionMerkleRootRequest) Reset() { + *x = CalculateCollectionMerkleRootRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CalculateCollectionMerkleRootRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CalculateCollectionMerkleRootRequest) ProtoMessage() {} + +func (x *CalculateCollectionMerkleRootRequest) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CalculateCollectionMerkleRootRequest.ProtoReflect.Descriptor instead. +func (*CalculateCollectionMerkleRootRequest) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{6} +} + +func (x *CalculateCollectionMerkleRootRequest) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *CalculateCollectionMerkleRootRequest) GetMetadatas() []*Metadata { + if x != nil { + return x.Metadatas + } + return nil +} + +type CalculateCollectionMerkleRootResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MerkleRoot string `protobuf:"bytes,1,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"` +} + +func (x *CalculateCollectionMerkleRootResponse) Reset() { + *x = CalculateCollectionMerkleRootResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CalculateCollectionMerkleRootResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CalculateCollectionMerkleRootResponse) ProtoMessage() {} + +func (x *CalculateCollectionMerkleRootResponse) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CalculateCollectionMerkleRootResponse.ProtoReflect.Descriptor instead. +func (*CalculateCollectionMerkleRootResponse) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{7} +} + +func (x *CalculateCollectionMerkleRootResponse) GetMerkleRoot() string { + if x != nil { + return x.MerkleRoot + } + return "" +} + +type TokenMetadataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + NetworkId string `protobuf:"bytes,2,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + TokenId uint32 `protobuf:"varint,4,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` +} + +func (x *TokenMetadataRequest) Reset() { + *x = TokenMetadataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenMetadataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenMetadataRequest) ProtoMessage() {} + +func (x *TokenMetadataRequest) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenMetadataRequest.ProtoReflect.Descriptor instead. +func (*TokenMetadataRequest) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{8} +} + +func (x *TokenMetadataRequest) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *TokenMetadataRequest) GetNetworkId() string { + if x != nil { + return x.NetworkId + } + return "" +} + +func (x *TokenMetadataRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *TokenMetadataRequest) GetTokenId() uint32 { + if x != nil { + return x.TokenId + } + return 0 +} + +type TokenMetadataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MerkleRoot string `protobuf:"bytes,1,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"` + Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + MerkleProof []string `protobuf:"bytes,3,rep,name=merkle_proof,json=merkleProof,proto3" json:"merkle_proof,omitempty"` +} + +func (x *TokenMetadataResponse) Reset() { + *x = TokenMetadataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenMetadataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenMetadataResponse) ProtoMessage() {} + +func (x *TokenMetadataResponse) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenMetadataResponse.ProtoReflect.Descriptor instead. +func (*TokenMetadataResponse) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{9} +} + +func (x *TokenMetadataResponse) GetMerkleRoot() string { + if x != nil { + return x.MerkleRoot + } + return "" +} + +func (x *TokenMetadataResponse) GetMetadata() *Metadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *TokenMetadataResponse) GetMerkleProof() []string { + if x != nil { + return x.MerkleProof + } + return nil +} + +type LaunchpadProjectsCountsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NetworkId string `protobuf:"bytes,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` +} + +func (x *LaunchpadProjectsCountsRequest) Reset() { + *x = LaunchpadProjectsCountsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LaunchpadProjectsCountsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LaunchpadProjectsCountsRequest) ProtoMessage() {} + +func (x *LaunchpadProjectsCountsRequest) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LaunchpadProjectsCountsRequest.ProtoReflect.Descriptor instead. +func (*LaunchpadProjectsCountsRequest) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{10} +} + +func (x *LaunchpadProjectsCountsRequest) GetNetworkId() string { + if x != nil { + return x.NetworkId + } + return "" +} + +type LaunchpadProjectsCountsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatusCounts []*StatusCount `protobuf:"bytes,1,rep,name=status_counts,json=statusCounts,proto3" json:"status_counts,omitempty"` +} + +func (x *LaunchpadProjectsCountsResponse) Reset() { + *x = LaunchpadProjectsCountsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LaunchpadProjectsCountsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LaunchpadProjectsCountsResponse) ProtoMessage() {} + +func (x *LaunchpadProjectsCountsResponse) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LaunchpadProjectsCountsResponse.ProtoReflect.Descriptor instead. +func (*LaunchpadProjectsCountsResponse) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{11} +} + +func (x *LaunchpadProjectsCountsResponse) GetStatusCounts() []*StatusCount { + if x != nil { + return x.StatusCounts + } + return nil +} + +type ProposeApproveProjectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + NetworkId string `protobuf:"bytes,2,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + ProposalId string `protobuf:"bytes,4,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (x *ProposeApproveProjectRequest) Reset() { + *x = ProposeApproveProjectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposeApproveProjectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposeApproveProjectRequest) ProtoMessage() {} + +func (x *ProposeApproveProjectRequest) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProposeApproveProjectRequest.ProtoReflect.Descriptor instead. +func (*ProposeApproveProjectRequest) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{12} +} + +func (x *ProposeApproveProjectRequest) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *ProposeApproveProjectRequest) GetNetworkId() string { + if x != nil { + return x.NetworkId + } + return "" +} + +func (x *ProposeApproveProjectRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ProposeApproveProjectRequest) GetProposalId() string { + if x != nil { + return x.ProposalId + } + return "" +} + +type ProposeApproveProjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Approved bool `protobuf:"varint,1,opt,name=approved,proto3" json:"approved,omitempty"` +} + +func (x *ProposeApproveProjectResponse) Reset() { + *x = ProposeApproveProjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposeApproveProjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposeApproveProjectResponse) ProtoMessage() {} + +func (x *ProposeApproveProjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProposeApproveProjectResponse.ProtoReflect.Descriptor instead. +func (*ProposeApproveProjectResponse) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{13} +} + +func (x *ProposeApproveProjectResponse) GetApproved() bool { + if x != nil { + return x.Approved + } + return false +} + +type StatusCount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=launchpad.v1.Status" json:"status,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *StatusCount) Reset() { + *x = StatusCount{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusCount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusCount) ProtoMessage() {} + +func (x *StatusCount) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusCount.ProtoReflect.Descriptor instead. +func (*StatusCount) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{14} +} + +func (x *StatusCount) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *StatusCount) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +type LaunchpadProject struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + NetworkId string `protobuf:"bytes,2,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` + CreatorId string `protobuf:"bytes,3,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"` + CollectionData string `protobuf:"bytes,4,opt,name=collection_data,json=collectionData,proto3" json:"collection_data,omitempty"` + Status Status `protobuf:"varint,5,opt,name=status,proto3,enum=launchpad.v1.Status" json:"status,omitempty"` + ProposalId string `protobuf:"bytes,6,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (x *LaunchpadProject) Reset() { + *x = LaunchpadProject{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LaunchpadProject) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LaunchpadProject) ProtoMessage() {} + +func (x *LaunchpadProject) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LaunchpadProject.ProtoReflect.Descriptor instead. +func (*LaunchpadProject) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{15} +} + +func (x *LaunchpadProject) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *LaunchpadProject) GetNetworkId() string { + if x != nil { + return x.NetworkId + } + return "" +} + +func (x *LaunchpadProject) GetCreatorId() string { + if x != nil { + return x.CreatorId + } + return "" +} + +func (x *LaunchpadProject) GetCollectionData() string { + if x != nil { + return x.CollectionData + } + return "" +} + +func (x *LaunchpadProject) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *LaunchpadProject) GetProposalId() string { + if x != nil { + return x.ProposalId + } + return "" +} + +type Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Image *string `protobuf:"bytes,1,opt,name=image,proto3,oneof" json:"image,omitempty"` + ImageData *string `protobuf:"bytes,2,opt,name=image_data,json=imageData,proto3,oneof" json:"image_data,omitempty"` + ExternalUrl *string `protobuf:"bytes,3,opt,name=external_url,json=externalUrl,proto3,oneof" json:"external_url,omitempty"` + Description *string `protobuf:"bytes,4,opt,name=description,proto3,oneof" json:"description,omitempty"` + Name *string `protobuf:"bytes,5,opt,name=name,proto3,oneof" json:"name,omitempty"` + Attributes []*Trait `protobuf:"bytes,6,rep,name=attributes,proto3" json:"attributes,omitempty"` + BackgroundColor *string `protobuf:"bytes,7,opt,name=background_color,json=backgroundColor,proto3,oneof" json:"background_color,omitempty"` + AnimationUrl *string `protobuf:"bytes,8,opt,name=animation_url,json=animationUrl,proto3,oneof" json:"animation_url,omitempty"` + YoutubeUrl *string `protobuf:"bytes,9,opt,name=youtube_url,json=youtubeUrl,proto3,oneof" json:"youtube_url,omitempty"` + RoyaltyPercentage *uint64 `protobuf:"varint,10,opt,name=royalty_percentage,json=royaltyPercentage,proto3,oneof" json:"royalty_percentage,omitempty"` + RoyaltyPaymentAddress *string `protobuf:"bytes,11,opt,name=royalty_payment_address,json=royaltyPaymentAddress,proto3,oneof" json:"royalty_payment_address,omitempty"` +} + +func (x *Metadata) Reset() { + *x = Metadata{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metadata) ProtoMessage() {} + +func (x *Metadata) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{16} +} + +func (x *Metadata) GetImage() string { + if x != nil && x.Image != nil { + return *x.Image + } + return "" +} + +func (x *Metadata) GetImageData() string { + if x != nil && x.ImageData != nil { + return *x.ImageData + } + return "" +} + +func (x *Metadata) GetExternalUrl() string { + if x != nil && x.ExternalUrl != nil { + return *x.ExternalUrl + } + return "" +} + +func (x *Metadata) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +func (x *Metadata) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *Metadata) GetAttributes() []*Trait { + if x != nil { + return x.Attributes + } + return nil +} + +func (x *Metadata) GetBackgroundColor() string { + if x != nil && x.BackgroundColor != nil { + return *x.BackgroundColor + } + return "" +} + +func (x *Metadata) GetAnimationUrl() string { + if x != nil && x.AnimationUrl != nil { + return *x.AnimationUrl + } + return "" +} + +func (x *Metadata) GetYoutubeUrl() string { + if x != nil && x.YoutubeUrl != nil { + return *x.YoutubeUrl + } + return "" +} + +func (x *Metadata) GetRoyaltyPercentage() uint64 { + if x != nil && x.RoyaltyPercentage != nil { + return *x.RoyaltyPercentage + } + return 0 +} + +func (x *Metadata) GetRoyaltyPaymentAddress() string { + if x != nil && x.RoyaltyPaymentAddress != nil { + return *x.RoyaltyPaymentAddress + } + return "" +} + +type Trait struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DisplayType *string `protobuf:"bytes,1,opt,name=display_type,json=displayType,proto3,oneof" json:"display_type,omitempty"` + TraitType string `protobuf:"bytes,2,opt,name=trait_type,json=traitType,proto3" json:"trait_type,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Trait) Reset() { + *x = Trait{} + if protoimpl.UnsafeEnabled { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Trait) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Trait) ProtoMessage() {} + +func (x *Trait) ProtoReflect() protoreflect.Message { + mi := &file_launchpad_v1_launchpad_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Trait.ProtoReflect.Descriptor instead. +func (*Trait) Descriptor() ([]byte, []int) { + return file_launchpad_v1_launchpad_proto_rawDescGZIP(), []int{17} +} + +func (x *Trait) GetDisplayType() string { + if x != nil && x.DisplayType != nil { + return *x.DisplayType + } + return "" +} + +func (x *Trait) GetTraitType() string { + if x != nil { + return x.TraitType + } + return "" +} + +func (x *Trait) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_launchpad_v1_launchpad_proto protoreflect.FileDescriptor + +var file_launchpad_v1_launchpad_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x6c, + 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, + 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x22, 0xa0, 0x02, 0x0a, + 0x18, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x42, + 0x0a, 0x0e, 0x73, 0x6f, 0x72, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, + 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x73, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, + 0x57, 0x0a, 0x19, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, + 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x22, 0x5b, 0x0a, 0x1b, 0x4c, 0x61, 0x75, 0x6e, + 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x79, 0x49, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x58, 0x0a, 0x1c, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, + 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, + 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, + 0xc3, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, + 0x12, 0x34, 0x0a, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x09, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x69, 0x6e, 0x61, 0x74, 0x61, + 0x5f, 0x6a, 0x77, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x69, 0x6e, 0x61, + 0x74, 0x61, 0x4a, 0x77, 0x74, 0x22, 0x3a, 0x0a, 0x17, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x6f, 0x6f, + 0x74, 0x22, 0x74, 0x0a, 0x24, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x6f, + 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x12, 0x34, 0x0a, 0x09, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x09, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x22, 0x48, 0x0a, 0x25, 0x43, 0x61, 0x6c, 0x63, 0x75, + 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, + 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x6f, 0x6f, + 0x74, 0x22, 0x87, 0x01, 0x0a, 0x14, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, + 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, + 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x07, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x22, 0x8f, 0x01, 0x0a, 0x15, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x72, 0x6b, + 0x6c, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, + 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, + 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0b, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x3f, 0x0a, + 0x1e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x61, + 0x0a, 0x1f, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, + 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x22, 0x95, 0x01, 0x0a, 0x1c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x41, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x3b, 0x0a, 0x1d, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x51, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd8, 0x01, 0x0a, 0x10, 0x4c, 0x61, + 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x49, 0x64, 0x22, 0x84, 0x05, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x19, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x22, 0x0a, 0x0a, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x01, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, + 0x12, 0x26, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, + 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6c, + 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x69, + 0x74, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2e, 0x0a, + 0x10, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x67, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, + 0x0d, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x0c, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x79, 0x6f, 0x75, 0x74, 0x75, + 0x62, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x07, 0x52, 0x0a, + 0x79, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x32, 0x0a, + 0x12, 0x72, 0x6f, 0x79, 0x61, 0x6c, 0x74, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x48, 0x08, 0x52, 0x11, 0x72, 0x6f, 0x79, + 0x61, 0x6c, 0x74, 0x79, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x72, 0x6f, 0x79, 0x61, 0x6c, 0x74, 0x79, 0x5f, 0x70, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x09, 0x52, 0x15, 0x72, 0x6f, 0x79, 0x61, 0x6c, 0x74, 0x79, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x61, 0x6e, 0x69, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x79, 0x6f, 0x75, + 0x74, 0x75, 0x62, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x72, 0x6f, 0x79, + 0x61, 0x6c, 0x74, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x42, + 0x1a, 0x0a, 0x18, 0x5f, 0x72, 0x6f, 0x79, 0x61, 0x6c, 0x74, 0x79, 0x5f, 0x70, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x75, 0x0a, 0x05, 0x54, + 0x72, 0x61, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x69, + 0x73, 0x70, 0x6c, 0x61, 0x79, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, + 0x74, 0x72, 0x61, 0x69, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x74, 0x72, 0x61, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x2a, 0x36, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x4f, + 0x52, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x18, 0x0a, 0x14, 0x53, 0x4f, 0x52, 0x54, 0x5f, 0x43, 0x4f, 0x4c, 0x4c, 0x45, 0x43, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x2a, 0x6c, 0x0a, 0x0d, 0x53, 0x6f, + 0x72, 0x74, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x53, + 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x53, + 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x53, + 0x43, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x4f, 0x52, + 0x54, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x53, 0x43, + 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x2a, 0x78, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x10, + 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, + 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, + 0x10, 0x04, 0x32, 0x96, 0x06, 0x0a, 0x10, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5e, 0x0a, 0x0f, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x12, 0x24, 0x2e, 0x6c, 0x61, 0x75, + 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x1d, 0x43, 0x61, 0x6c, 0x63, + 0x75, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x32, 0x2e, 0x6c, 0x61, 0x75, 0x6e, + 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x72, 0x6b, + 0x6c, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, + 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, + 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x22, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, + 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x11, + 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x12, 0x26, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6c, 0x61, 0x75, 0x6e, + 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, + 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x14, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x29, 0x2e, 0x6c, 0x61, 0x75, + 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, + 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x76, 0x0a, 0x17, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2c, 0x2e, 0x6c, + 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x75, 0x6e, + 0x63, 0x68, 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6c, 0x61, 0x75, + 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, + 0x70, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x70, 0x0a, 0x15, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x65, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x2a, 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, + 0x2f, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x70, 0x61, 0x64, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_launchpad_v1_launchpad_proto_rawDescOnce sync.Once + file_launchpad_v1_launchpad_proto_rawDescData = file_launchpad_v1_launchpad_proto_rawDesc +) + +func file_launchpad_v1_launchpad_proto_rawDescGZIP() []byte { + file_launchpad_v1_launchpad_proto_rawDescOnce.Do(func() { + file_launchpad_v1_launchpad_proto_rawDescData = protoimpl.X.CompressGZIP(file_launchpad_v1_launchpad_proto_rawDescData) + }) + return file_launchpad_v1_launchpad_proto_rawDescData +} + +var file_launchpad_v1_launchpad_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_launchpad_v1_launchpad_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_launchpad_v1_launchpad_proto_goTypes = []interface{}{ + (Sort)(0), // 0: launchpad.v1.Sort + (SortDirection)(0), // 1: launchpad.v1.SortDirection + (Status)(0), // 2: launchpad.v1.Status + (*LaunchpadProjectsRequest)(nil), // 3: launchpad.v1.LaunchpadProjectsRequest + (*LaunchpadProjectsResponse)(nil), // 4: launchpad.v1.LaunchpadProjectsResponse + (*LaunchpadProjectByIdRequest)(nil), // 5: launchpad.v1.LaunchpadProjectByIdRequest + (*LaunchpadProjectByIdResponse)(nil), // 6: launchpad.v1.LaunchpadProjectByIdResponse + (*UploadMetadatasRequest)(nil), // 7: launchpad.v1.UploadMetadatasRequest + (*UploadMetadatasResponse)(nil), // 8: launchpad.v1.UploadMetadatasResponse + (*CalculateCollectionMerkleRootRequest)(nil), // 9: launchpad.v1.CalculateCollectionMerkleRootRequest + (*CalculateCollectionMerkleRootResponse)(nil), // 10: launchpad.v1.CalculateCollectionMerkleRootResponse + (*TokenMetadataRequest)(nil), // 11: launchpad.v1.TokenMetadataRequest + (*TokenMetadataResponse)(nil), // 12: launchpad.v1.TokenMetadataResponse + (*LaunchpadProjectsCountsRequest)(nil), // 13: launchpad.v1.LaunchpadProjectsCountsRequest + (*LaunchpadProjectsCountsResponse)(nil), // 14: launchpad.v1.LaunchpadProjectsCountsResponse + (*ProposeApproveProjectRequest)(nil), // 15: launchpad.v1.ProposeApproveProjectRequest + (*ProposeApproveProjectResponse)(nil), // 16: launchpad.v1.ProposeApproveProjectResponse + (*StatusCount)(nil), // 17: launchpad.v1.StatusCount + (*LaunchpadProject)(nil), // 18: launchpad.v1.LaunchpadProject + (*Metadata)(nil), // 19: launchpad.v1.Metadata + (*Trait)(nil), // 20: launchpad.v1.Trait +} +var file_launchpad_v1_launchpad_proto_depIdxs = []int32{ + 0, // 0: launchpad.v1.LaunchpadProjectsRequest.sort:type_name -> launchpad.v1.Sort + 1, // 1: launchpad.v1.LaunchpadProjectsRequest.sort_direction:type_name -> launchpad.v1.SortDirection + 2, // 2: launchpad.v1.LaunchpadProjectsRequest.status:type_name -> launchpad.v1.Status + 18, // 3: launchpad.v1.LaunchpadProjectsResponse.projects:type_name -> launchpad.v1.LaunchpadProject + 18, // 4: launchpad.v1.LaunchpadProjectByIdResponse.project:type_name -> launchpad.v1.LaunchpadProject + 19, // 5: launchpad.v1.UploadMetadatasRequest.metadatas:type_name -> launchpad.v1.Metadata + 19, // 6: launchpad.v1.CalculateCollectionMerkleRootRequest.metadatas:type_name -> launchpad.v1.Metadata + 19, // 7: launchpad.v1.TokenMetadataResponse.metadata:type_name -> launchpad.v1.Metadata + 17, // 8: launchpad.v1.LaunchpadProjectsCountsResponse.status_counts:type_name -> launchpad.v1.StatusCount + 2, // 9: launchpad.v1.StatusCount.status:type_name -> launchpad.v1.Status + 2, // 10: launchpad.v1.LaunchpadProject.status:type_name -> launchpad.v1.Status + 20, // 11: launchpad.v1.Metadata.attributes:type_name -> launchpad.v1.Trait + 7, // 12: launchpad.v1.LaunchpadService.UploadMetadatas:input_type -> launchpad.v1.UploadMetadatasRequest + 9, // 13: launchpad.v1.LaunchpadService.CalculateCollectionMerkleRoot:input_type -> launchpad.v1.CalculateCollectionMerkleRootRequest + 11, // 14: launchpad.v1.LaunchpadService.TokenMetadata:input_type -> launchpad.v1.TokenMetadataRequest + 3, // 15: launchpad.v1.LaunchpadService.LaunchpadProjects:input_type -> launchpad.v1.LaunchpadProjectsRequest + 5, // 16: launchpad.v1.LaunchpadService.LaunchpadProjectById:input_type -> launchpad.v1.LaunchpadProjectByIdRequest + 13, // 17: launchpad.v1.LaunchpadService.LaunchpadProjectsCounts:input_type -> launchpad.v1.LaunchpadProjectsCountsRequest + 15, // 18: launchpad.v1.LaunchpadService.ProposeApproveProject:input_type -> launchpad.v1.ProposeApproveProjectRequest + 8, // 19: launchpad.v1.LaunchpadService.UploadMetadatas:output_type -> launchpad.v1.UploadMetadatasResponse + 10, // 20: launchpad.v1.LaunchpadService.CalculateCollectionMerkleRoot:output_type -> launchpad.v1.CalculateCollectionMerkleRootResponse + 12, // 21: launchpad.v1.LaunchpadService.TokenMetadata:output_type -> launchpad.v1.TokenMetadataResponse + 4, // 22: launchpad.v1.LaunchpadService.LaunchpadProjects:output_type -> launchpad.v1.LaunchpadProjectsResponse + 6, // 23: launchpad.v1.LaunchpadService.LaunchpadProjectById:output_type -> launchpad.v1.LaunchpadProjectByIdResponse + 14, // 24: launchpad.v1.LaunchpadService.LaunchpadProjectsCounts:output_type -> launchpad.v1.LaunchpadProjectsCountsResponse + 16, // 25: launchpad.v1.LaunchpadService.ProposeApproveProject:output_type -> launchpad.v1.ProposeApproveProjectResponse + 19, // [19:26] is the sub-list for method output_type + 12, // [12:19] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_launchpad_v1_launchpad_proto_init() } +func file_launchpad_v1_launchpad_proto_init() { + if File_launchpad_v1_launchpad_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_launchpad_v1_launchpad_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LaunchpadProjectsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LaunchpadProjectsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LaunchpadProjectByIdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LaunchpadProjectByIdResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadMetadatasRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UploadMetadatasResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CalculateCollectionMerkleRootRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CalculateCollectionMerkleRootResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TokenMetadataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TokenMetadataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LaunchpadProjectsCountsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LaunchpadProjectsCountsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProposeApproveProjectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProposeApproveProjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusCount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LaunchpadProject); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_launchpad_v1_launchpad_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Trait); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_launchpad_v1_launchpad_proto_msgTypes[16].OneofWrappers = []interface{}{} + file_launchpad_v1_launchpad_proto_msgTypes[17].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_launchpad_v1_launchpad_proto_rawDesc, + NumEnums: 3, + NumMessages: 18, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_launchpad_v1_launchpad_proto_goTypes, + DependencyIndexes: file_launchpad_v1_launchpad_proto_depIdxs, + EnumInfos: file_launchpad_v1_launchpad_proto_enumTypes, + MessageInfos: file_launchpad_v1_launchpad_proto_msgTypes, + }.Build() + File_launchpad_v1_launchpad_proto = out.File + file_launchpad_v1_launchpad_proto_rawDesc = nil + file_launchpad_v1_launchpad_proto_goTypes = nil + file_launchpad_v1_launchpad_proto_depIdxs = nil +} diff --git a/go/pkg/launchpadpb/launchpad_grpc.pb.go b/go/pkg/launchpadpb/launchpad_grpc.pb.go new file mode 100644 index 0000000000..f8571582c4 --- /dev/null +++ b/go/pkg/launchpadpb/launchpad_grpc.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: launchpad/v1/launchpad.proto + +package launchpadpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// LaunchpadServiceClient is the client API for LaunchpadService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type LaunchpadServiceClient interface { + UploadMetadatas(ctx context.Context, in *UploadMetadatasRequest, opts ...grpc.CallOption) (*UploadMetadatasResponse, error) + CalculateCollectionMerkleRoot(ctx context.Context, in *CalculateCollectionMerkleRootRequest, opts ...grpc.CallOption) (*CalculateCollectionMerkleRootResponse, error) + TokenMetadata(ctx context.Context, in *TokenMetadataRequest, opts ...grpc.CallOption) (*TokenMetadataResponse, error) + LaunchpadProjects(ctx context.Context, in *LaunchpadProjectsRequest, opts ...grpc.CallOption) (*LaunchpadProjectsResponse, error) + LaunchpadProjectById(ctx context.Context, in *LaunchpadProjectByIdRequest, opts ...grpc.CallOption) (*LaunchpadProjectByIdResponse, error) + LaunchpadProjectsCounts(ctx context.Context, in *LaunchpadProjectsCountsRequest, opts ...grpc.CallOption) (*LaunchpadProjectsCountsResponse, error) + ProposeApproveProject(ctx context.Context, in *ProposeApproveProjectRequest, opts ...grpc.CallOption) (*ProposeApproveProjectResponse, error) +} + +type launchpadServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLaunchpadServiceClient(cc grpc.ClientConnInterface) LaunchpadServiceClient { + return &launchpadServiceClient{cc} +} + +func (c *launchpadServiceClient) UploadMetadatas(ctx context.Context, in *UploadMetadatasRequest, opts ...grpc.CallOption) (*UploadMetadatasResponse, error) { + out := new(UploadMetadatasResponse) + err := c.cc.Invoke(ctx, "/launchpad.v1.LaunchpadService/UploadMetadatas", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *launchpadServiceClient) CalculateCollectionMerkleRoot(ctx context.Context, in *CalculateCollectionMerkleRootRequest, opts ...grpc.CallOption) (*CalculateCollectionMerkleRootResponse, error) { + out := new(CalculateCollectionMerkleRootResponse) + err := c.cc.Invoke(ctx, "/launchpad.v1.LaunchpadService/CalculateCollectionMerkleRoot", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *launchpadServiceClient) TokenMetadata(ctx context.Context, in *TokenMetadataRequest, opts ...grpc.CallOption) (*TokenMetadataResponse, error) { + out := new(TokenMetadataResponse) + err := c.cc.Invoke(ctx, "/launchpad.v1.LaunchpadService/TokenMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *launchpadServiceClient) LaunchpadProjects(ctx context.Context, in *LaunchpadProjectsRequest, opts ...grpc.CallOption) (*LaunchpadProjectsResponse, error) { + out := new(LaunchpadProjectsResponse) + err := c.cc.Invoke(ctx, "/launchpad.v1.LaunchpadService/LaunchpadProjects", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *launchpadServiceClient) LaunchpadProjectById(ctx context.Context, in *LaunchpadProjectByIdRequest, opts ...grpc.CallOption) (*LaunchpadProjectByIdResponse, error) { + out := new(LaunchpadProjectByIdResponse) + err := c.cc.Invoke(ctx, "/launchpad.v1.LaunchpadService/LaunchpadProjectById", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *launchpadServiceClient) LaunchpadProjectsCounts(ctx context.Context, in *LaunchpadProjectsCountsRequest, opts ...grpc.CallOption) (*LaunchpadProjectsCountsResponse, error) { + out := new(LaunchpadProjectsCountsResponse) + err := c.cc.Invoke(ctx, "/launchpad.v1.LaunchpadService/LaunchpadProjectsCounts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *launchpadServiceClient) ProposeApproveProject(ctx context.Context, in *ProposeApproveProjectRequest, opts ...grpc.CallOption) (*ProposeApproveProjectResponse, error) { + out := new(ProposeApproveProjectResponse) + err := c.cc.Invoke(ctx, "/launchpad.v1.LaunchpadService/ProposeApproveProject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LaunchpadServiceServer is the server API for LaunchpadService service. +// All implementations must embed UnimplementedLaunchpadServiceServer +// for forward compatibility +type LaunchpadServiceServer interface { + UploadMetadatas(context.Context, *UploadMetadatasRequest) (*UploadMetadatasResponse, error) + CalculateCollectionMerkleRoot(context.Context, *CalculateCollectionMerkleRootRequest) (*CalculateCollectionMerkleRootResponse, error) + TokenMetadata(context.Context, *TokenMetadataRequest) (*TokenMetadataResponse, error) + LaunchpadProjects(context.Context, *LaunchpadProjectsRequest) (*LaunchpadProjectsResponse, error) + LaunchpadProjectById(context.Context, *LaunchpadProjectByIdRequest) (*LaunchpadProjectByIdResponse, error) + LaunchpadProjectsCounts(context.Context, *LaunchpadProjectsCountsRequest) (*LaunchpadProjectsCountsResponse, error) + ProposeApproveProject(context.Context, *ProposeApproveProjectRequest) (*ProposeApproveProjectResponse, error) + mustEmbedUnimplementedLaunchpadServiceServer() +} + +// UnimplementedLaunchpadServiceServer must be embedded to have forward compatible implementations. +type UnimplementedLaunchpadServiceServer struct { +} + +func (UnimplementedLaunchpadServiceServer) UploadMetadatas(context.Context, *UploadMetadatasRequest) (*UploadMetadatasResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadMetadatas not implemented") +} +func (UnimplementedLaunchpadServiceServer) CalculateCollectionMerkleRoot(context.Context, *CalculateCollectionMerkleRootRequest) (*CalculateCollectionMerkleRootResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CalculateCollectionMerkleRoot not implemented") +} +func (UnimplementedLaunchpadServiceServer) TokenMetadata(context.Context, *TokenMetadataRequest) (*TokenMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenMetadata not implemented") +} +func (UnimplementedLaunchpadServiceServer) LaunchpadProjects(context.Context, *LaunchpadProjectsRequest) (*LaunchpadProjectsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LaunchpadProjects not implemented") +} +func (UnimplementedLaunchpadServiceServer) LaunchpadProjectById(context.Context, *LaunchpadProjectByIdRequest) (*LaunchpadProjectByIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LaunchpadProjectById not implemented") +} +func (UnimplementedLaunchpadServiceServer) LaunchpadProjectsCounts(context.Context, *LaunchpadProjectsCountsRequest) (*LaunchpadProjectsCountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LaunchpadProjectsCounts not implemented") +} +func (UnimplementedLaunchpadServiceServer) ProposeApproveProject(context.Context, *ProposeApproveProjectRequest) (*ProposeApproveProjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProposeApproveProject not implemented") +} +func (UnimplementedLaunchpadServiceServer) mustEmbedUnimplementedLaunchpadServiceServer() {} + +// UnsafeLaunchpadServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LaunchpadServiceServer will +// result in compilation errors. +type UnsafeLaunchpadServiceServer interface { + mustEmbedUnimplementedLaunchpadServiceServer() +} + +func RegisterLaunchpadServiceServer(s grpc.ServiceRegistrar, srv LaunchpadServiceServer) { + s.RegisterService(&LaunchpadService_ServiceDesc, srv) +} + +func _LaunchpadService_UploadMetadatas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadMetadatasRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LaunchpadServiceServer).UploadMetadatas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/launchpad.v1.LaunchpadService/UploadMetadatas", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LaunchpadServiceServer).UploadMetadatas(ctx, req.(*UploadMetadatasRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LaunchpadService_CalculateCollectionMerkleRoot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CalculateCollectionMerkleRootRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LaunchpadServiceServer).CalculateCollectionMerkleRoot(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/launchpad.v1.LaunchpadService/CalculateCollectionMerkleRoot", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LaunchpadServiceServer).CalculateCollectionMerkleRoot(ctx, req.(*CalculateCollectionMerkleRootRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LaunchpadService_TokenMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TokenMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LaunchpadServiceServer).TokenMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/launchpad.v1.LaunchpadService/TokenMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LaunchpadServiceServer).TokenMetadata(ctx, req.(*TokenMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LaunchpadService_LaunchpadProjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LaunchpadProjectsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LaunchpadServiceServer).LaunchpadProjects(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/launchpad.v1.LaunchpadService/LaunchpadProjects", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LaunchpadServiceServer).LaunchpadProjects(ctx, req.(*LaunchpadProjectsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LaunchpadService_LaunchpadProjectById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LaunchpadProjectByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LaunchpadServiceServer).LaunchpadProjectById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/launchpad.v1.LaunchpadService/LaunchpadProjectById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LaunchpadServiceServer).LaunchpadProjectById(ctx, req.(*LaunchpadProjectByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LaunchpadService_LaunchpadProjectsCounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LaunchpadProjectsCountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LaunchpadServiceServer).LaunchpadProjectsCounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/launchpad.v1.LaunchpadService/LaunchpadProjectsCounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LaunchpadServiceServer).LaunchpadProjectsCounts(ctx, req.(*LaunchpadProjectsCountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LaunchpadService_ProposeApproveProject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProposeApproveProjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LaunchpadServiceServer).ProposeApproveProject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/launchpad.v1.LaunchpadService/ProposeApproveProject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LaunchpadServiceServer).ProposeApproveProject(ctx, req.(*ProposeApproveProjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// LaunchpadService_ServiceDesc is the grpc.ServiceDesc for LaunchpadService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LaunchpadService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "launchpad.v1.LaunchpadService", + HandlerType: (*LaunchpadServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UploadMetadatas", + Handler: _LaunchpadService_UploadMetadatas_Handler, + }, + { + MethodName: "CalculateCollectionMerkleRoot", + Handler: _LaunchpadService_CalculateCollectionMerkleRoot_Handler, + }, + { + MethodName: "TokenMetadata", + Handler: _LaunchpadService_TokenMetadata_Handler, + }, + { + MethodName: "LaunchpadProjects", + Handler: _LaunchpadService_LaunchpadProjects_Handler, + }, + { + MethodName: "LaunchpadProjectById", + Handler: _LaunchpadService_LaunchpadProjectById_Handler, + }, + { + MethodName: "LaunchpadProjectsCounts", + Handler: _LaunchpadService_LaunchpadProjectsCounts_Handler, + }, + { + MethodName: "ProposeApproveProject", + Handler: _LaunchpadService_ProposeApproveProject_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "launchpad/v1/launchpad.proto", +} diff --git a/go/pkg/merkletree/merkletree.go b/go/pkg/merkletree/merkletree.go index 261f13940a..b1fd54ead2 100644 --- a/go/pkg/merkletree/merkletree.go +++ b/go/pkg/merkletree/merkletree.go @@ -3,12 +3,13 @@ package merkletree import ( "bytes" "encoding/hex" - "errors" "fmt" "hash" "math/big" "sort" + "github.com/pkg/errors" + "golang.org/x/crypto/sha3" ) @@ -193,3 +194,18 @@ func (m *MerkleTree) GetRoot() []byte { func (m *MerkleTree) GetHexRoot() string { return toHex(m.GetRoot()) } + +func (m *MerkleTree) GetHexRootWithoutPrefix() string { + return m.GetHexRoot()[2:] +} +func (m *MerkleTree) GetHexProofWithoutPrefix(content Content) ([]string, error) { + proof, err := m.GetHexProof(content) + if err != nil { + return nil, errors.Wrap(err, "failed to get prefixed hex proof") + } + var proofWithoutPrefix []string + for _, item := range proof { + proofWithoutPrefix = append(proofWithoutPrefix, item[2:]) + } + return proofWithoutPrefix, nil +} diff --git a/packages/api/launchpad/v1/launchpad.ts b/packages/api/launchpad/v1/launchpad.ts new file mode 100644 index 0000000000..13ebcd7831 --- /dev/null +++ b/packages/api/launchpad/v1/launchpad.ts @@ -0,0 +1,2280 @@ +/* eslint-disable */ +import { grpc } from "@improbable-eng/grpc-web"; +import { BrowserHeaders } from "browser-headers"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "launchpad.v1"; + +export enum Sort { + SORT_UNSPECIFIED = 0, + SORT_COLLECTION_NAME = 1, + UNRECOGNIZED = -1, +} + +export function sortFromJSON(object: any): Sort { + switch (object) { + case 0: + case "SORT_UNSPECIFIED": + return Sort.SORT_UNSPECIFIED; + case 1: + case "SORT_COLLECTION_NAME": + return Sort.SORT_COLLECTION_NAME; + case -1: + case "UNRECOGNIZED": + default: + return Sort.UNRECOGNIZED; + } +} + +export function sortToJSON(object: Sort): string { + switch (object) { + case Sort.SORT_UNSPECIFIED: + return "SORT_UNSPECIFIED"; + case Sort.SORT_COLLECTION_NAME: + return "SORT_COLLECTION_NAME"; + case Sort.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum SortDirection { + SORT_DIRECTION_UNSPECIFIED = 0, + SORT_DIRECTION_ASCENDING = 1, + SORT_DIRECTION_DESCENDING = 2, + UNRECOGNIZED = -1, +} + +export function sortDirectionFromJSON(object: any): SortDirection { + switch (object) { + case 0: + case "SORT_DIRECTION_UNSPECIFIED": + return SortDirection.SORT_DIRECTION_UNSPECIFIED; + case 1: + case "SORT_DIRECTION_ASCENDING": + return SortDirection.SORT_DIRECTION_ASCENDING; + case 2: + case "SORT_DIRECTION_DESCENDING": + return SortDirection.SORT_DIRECTION_DESCENDING; + case -1: + case "UNRECOGNIZED": + default: + return SortDirection.UNRECOGNIZED; + } +} + +export function sortDirectionToJSON(object: SortDirection): string { + switch (object) { + case SortDirection.SORT_DIRECTION_UNSPECIFIED: + return "SORT_DIRECTION_UNSPECIFIED"; + case SortDirection.SORT_DIRECTION_ASCENDING: + return "SORT_DIRECTION_ASCENDING"; + case SortDirection.SORT_DIRECTION_DESCENDING: + return "SORT_DIRECTION_DESCENDING"; + case SortDirection.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum Status { + STATUS_UNSPECIFIED = 0, + STATUS_INCOMPLETE = 1, + STATUS_COMPLETE = 2, + STATUS_REVIEWING = 3, + STATUS_CONFIRMED = 4, + UNRECOGNIZED = -1, +} + +export function statusFromJSON(object: any): Status { + switch (object) { + case 0: + case "STATUS_UNSPECIFIED": + return Status.STATUS_UNSPECIFIED; + case 1: + case "STATUS_INCOMPLETE": + return Status.STATUS_INCOMPLETE; + case 2: + case "STATUS_COMPLETE": + return Status.STATUS_COMPLETE; + case 3: + case "STATUS_REVIEWING": + return Status.STATUS_REVIEWING; + case 4: + case "STATUS_CONFIRMED": + return Status.STATUS_CONFIRMED; + case -1: + case "UNRECOGNIZED": + default: + return Status.UNRECOGNIZED; + } +} + +export function statusToJSON(object: Status): string { + switch (object) { + case Status.STATUS_UNSPECIFIED: + return "STATUS_UNSPECIFIED"; + case Status.STATUS_INCOMPLETE: + return "STATUS_INCOMPLETE"; + case Status.STATUS_COMPLETE: + return "STATUS_COMPLETE"; + case Status.STATUS_REVIEWING: + return "STATUS_REVIEWING"; + case Status.STATUS_CONFIRMED: + return "STATUS_CONFIRMED"; + case Status.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface LaunchpadProjectsRequest { + networkId: string; + limit: number; + offset: number; + sort: Sort; + sortDirection: SortDirection; + status: Status; + creatorId: string; +} + +export interface LaunchpadProjectsResponse { + projects: LaunchpadProject[]; +} + +export interface LaunchpadProjectByIdRequest { + networkId: string; + projectId: string; +} + +export interface LaunchpadProjectByIdResponse { + project: LaunchpadProject | undefined; +} + +export interface UploadMetadatasRequest { + sender: string; + networkId: string; + projectId: string; + metadatas: Metadata[]; + pinataJwt: string; +} + +export interface UploadMetadatasResponse { + merkleRoot: string; +} + +export interface CalculateCollectionMerkleRootRequest { + sender: string; + metadatas: Metadata[]; +} + +export interface CalculateCollectionMerkleRootResponse { + merkleRoot: string; +} + +export interface TokenMetadataRequest { + sender: string; + networkId: string; + projectId: string; + tokenId: number; +} + +export interface TokenMetadataResponse { + merkleRoot: string; + metadata: Metadata | undefined; + merkleProof: string[]; +} + +export interface LaunchpadProjectsCountsRequest { + networkId: string; +} + +export interface LaunchpadProjectsCountsResponse { + statusCounts: StatusCount[]; +} + +export interface ProposeApproveProjectRequest { + sender: string; + networkId: string; + projectId: string; + proposalId: string; +} + +export interface ProposeApproveProjectResponse { + approved: boolean; +} + +export interface StatusCount { + status: Status; + count: number; +} + +export interface LaunchpadProject { + id: string; + networkId: string; + creatorId: string; + collectionData: string; + status: Status; + proposalId: string; +} + +export interface Metadata { + image?: string | undefined; + imageData?: string | undefined; + externalUrl?: string | undefined; + description?: string | undefined; + name?: string | undefined; + attributes: Trait[]; + backgroundColor?: string | undefined; + animationUrl?: string | undefined; + youtubeUrl?: string | undefined; + royaltyPercentage?: number | undefined; + royaltyPaymentAddress?: string | undefined; +} + +export interface Trait { + displayType?: string | undefined; + traitType: string; + value: string; +} + +function createBaseLaunchpadProjectsRequest(): LaunchpadProjectsRequest { + return { networkId: "", limit: 0, offset: 0, sort: 0, sortDirection: 0, status: 0, creatorId: "" }; +} + +export const LaunchpadProjectsRequest = { + encode(message: LaunchpadProjectsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.networkId !== "") { + writer.uint32(10).string(message.networkId); + } + if (message.limit !== 0) { + writer.uint32(16).int32(message.limit); + } + if (message.offset !== 0) { + writer.uint32(24).int32(message.offset); + } + if (message.sort !== 0) { + writer.uint32(32).int32(message.sort); + } + if (message.sortDirection !== 0) { + writer.uint32(40).int32(message.sortDirection); + } + if (message.status !== 0) { + writer.uint32(48).int32(message.status); + } + if (message.creatorId !== "") { + writer.uint32(58).string(message.creatorId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LaunchpadProjectsRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLaunchpadProjectsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.networkId = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.limit = reader.int32(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.offset = reader.int32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.sort = reader.int32() as any; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.sortDirection = reader.int32() as any; + continue; + case 6: + if (tag !== 48) { + break; + } + + message.status = reader.int32() as any; + continue; + case 7: + if (tag !== 58) { + break; + } + + message.creatorId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LaunchpadProjectsRequest { + return { + networkId: isSet(object.networkId) ? globalThis.String(object.networkId) : "", + limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0, + offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0, + sort: isSet(object.sort) ? sortFromJSON(object.sort) : 0, + sortDirection: isSet(object.sortDirection) ? sortDirectionFromJSON(object.sortDirection) : 0, + status: isSet(object.status) ? statusFromJSON(object.status) : 0, + creatorId: isSet(object.creatorId) ? globalThis.String(object.creatorId) : "", + }; + }, + + toJSON(message: LaunchpadProjectsRequest): unknown { + const obj: any = {}; + if (message.networkId !== "") { + obj.networkId = message.networkId; + } + if (message.limit !== 0) { + obj.limit = Math.round(message.limit); + } + if (message.offset !== 0) { + obj.offset = Math.round(message.offset); + } + if (message.sort !== 0) { + obj.sort = sortToJSON(message.sort); + } + if (message.sortDirection !== 0) { + obj.sortDirection = sortDirectionToJSON(message.sortDirection); + } + if (message.status !== 0) { + obj.status = statusToJSON(message.status); + } + if (message.creatorId !== "") { + obj.creatorId = message.creatorId; + } + return obj; + }, + + create, I>>(base?: I): LaunchpadProjectsRequest { + return LaunchpadProjectsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): LaunchpadProjectsRequest { + const message = createBaseLaunchpadProjectsRequest(); + message.networkId = object.networkId ?? ""; + message.limit = object.limit ?? 0; + message.offset = object.offset ?? 0; + message.sort = object.sort ?? 0; + message.sortDirection = object.sortDirection ?? 0; + message.status = object.status ?? 0; + message.creatorId = object.creatorId ?? ""; + return message; + }, +}; + +function createBaseLaunchpadProjectsResponse(): LaunchpadProjectsResponse { + return { projects: [] }; +} + +export const LaunchpadProjectsResponse = { + encode(message: LaunchpadProjectsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.projects) { + LaunchpadProject.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LaunchpadProjectsResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLaunchpadProjectsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.projects.push(LaunchpadProject.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LaunchpadProjectsResponse { + return { + projects: globalThis.Array.isArray(object?.projects) + ? object.projects.map((e: any) => LaunchpadProject.fromJSON(e)) + : [], + }; + }, + + toJSON(message: LaunchpadProjectsResponse): unknown { + const obj: any = {}; + if (message.projects?.length) { + obj.projects = message.projects.map((e) => LaunchpadProject.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): LaunchpadProjectsResponse { + return LaunchpadProjectsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): LaunchpadProjectsResponse { + const message = createBaseLaunchpadProjectsResponse(); + message.projects = object.projects?.map((e) => LaunchpadProject.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseLaunchpadProjectByIdRequest(): LaunchpadProjectByIdRequest { + return { networkId: "", projectId: "" }; +} + +export const LaunchpadProjectByIdRequest = { + encode(message: LaunchpadProjectByIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.networkId !== "") { + writer.uint32(10).string(message.networkId); + } + if (message.projectId !== "") { + writer.uint32(18).string(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LaunchpadProjectByIdRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLaunchpadProjectByIdRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.networkId = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.projectId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LaunchpadProjectByIdRequest { + return { + networkId: isSet(object.networkId) ? globalThis.String(object.networkId) : "", + projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "", + }; + }, + + toJSON(message: LaunchpadProjectByIdRequest): unknown { + const obj: any = {}; + if (message.networkId !== "") { + obj.networkId = message.networkId; + } + if (message.projectId !== "") { + obj.projectId = message.projectId; + } + return obj; + }, + + create, I>>(base?: I): LaunchpadProjectByIdRequest { + return LaunchpadProjectByIdRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): LaunchpadProjectByIdRequest { + const message = createBaseLaunchpadProjectByIdRequest(); + message.networkId = object.networkId ?? ""; + message.projectId = object.projectId ?? ""; + return message; + }, +}; + +function createBaseLaunchpadProjectByIdResponse(): LaunchpadProjectByIdResponse { + return { project: undefined }; +} + +export const LaunchpadProjectByIdResponse = { + encode(message: LaunchpadProjectByIdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.project !== undefined) { + LaunchpadProject.encode(message.project, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LaunchpadProjectByIdResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLaunchpadProjectByIdResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.project = LaunchpadProject.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LaunchpadProjectByIdResponse { + return { project: isSet(object.project) ? LaunchpadProject.fromJSON(object.project) : undefined }; + }, + + toJSON(message: LaunchpadProjectByIdResponse): unknown { + const obj: any = {}; + if (message.project !== undefined) { + obj.project = LaunchpadProject.toJSON(message.project); + } + return obj; + }, + + create, I>>(base?: I): LaunchpadProjectByIdResponse { + return LaunchpadProjectByIdResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): LaunchpadProjectByIdResponse { + const message = createBaseLaunchpadProjectByIdResponse(); + message.project = (object.project !== undefined && object.project !== null) + ? LaunchpadProject.fromPartial(object.project) + : undefined; + return message; + }, +}; + +function createBaseUploadMetadatasRequest(): UploadMetadatasRequest { + return { sender: "", networkId: "", projectId: "", metadatas: [], pinataJwt: "" }; +} + +export const UploadMetadatasRequest = { + encode(message: UploadMetadatasRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.networkId !== "") { + writer.uint32(18).string(message.networkId); + } + if (message.projectId !== "") { + writer.uint32(26).string(message.projectId); + } + for (const v of message.metadatas) { + Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.pinataJwt !== "") { + writer.uint32(42).string(message.pinataJwt); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UploadMetadatasRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadMetadatasRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.sender = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.networkId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.projectId = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.metadatas.push(Metadata.decode(reader, reader.uint32())); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.pinataJwt = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): UploadMetadatasRequest { + return { + sender: isSet(object.sender) ? globalThis.String(object.sender) : "", + networkId: isSet(object.networkId) ? globalThis.String(object.networkId) : "", + projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "", + metadatas: globalThis.Array.isArray(object?.metadatas) + ? object.metadatas.map((e: any) => Metadata.fromJSON(e)) + : [], + pinataJwt: isSet(object.pinataJwt) ? globalThis.String(object.pinataJwt) : "", + }; + }, + + toJSON(message: UploadMetadatasRequest): unknown { + const obj: any = {}; + if (message.sender !== "") { + obj.sender = message.sender; + } + if (message.networkId !== "") { + obj.networkId = message.networkId; + } + if (message.projectId !== "") { + obj.projectId = message.projectId; + } + if (message.metadatas?.length) { + obj.metadatas = message.metadatas.map((e) => Metadata.toJSON(e)); + } + if (message.pinataJwt !== "") { + obj.pinataJwt = message.pinataJwt; + } + return obj; + }, + + create, I>>(base?: I): UploadMetadatasRequest { + return UploadMetadatasRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UploadMetadatasRequest { + const message = createBaseUploadMetadatasRequest(); + message.sender = object.sender ?? ""; + message.networkId = object.networkId ?? ""; + message.projectId = object.projectId ?? ""; + message.metadatas = object.metadatas?.map((e) => Metadata.fromPartial(e)) || []; + message.pinataJwt = object.pinataJwt ?? ""; + return message; + }, +}; + +function createBaseUploadMetadatasResponse(): UploadMetadatasResponse { + return { merkleRoot: "" }; +} + +export const UploadMetadatasResponse = { + encode(message: UploadMetadatasResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.merkleRoot !== "") { + writer.uint32(10).string(message.merkleRoot); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UploadMetadatasResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadMetadatasResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.merkleRoot = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): UploadMetadatasResponse { + return { merkleRoot: isSet(object.merkleRoot) ? globalThis.String(object.merkleRoot) : "" }; + }, + + toJSON(message: UploadMetadatasResponse): unknown { + const obj: any = {}; + if (message.merkleRoot !== "") { + obj.merkleRoot = message.merkleRoot; + } + return obj; + }, + + create, I>>(base?: I): UploadMetadatasResponse { + return UploadMetadatasResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UploadMetadatasResponse { + const message = createBaseUploadMetadatasResponse(); + message.merkleRoot = object.merkleRoot ?? ""; + return message; + }, +}; + +function createBaseCalculateCollectionMerkleRootRequest(): CalculateCollectionMerkleRootRequest { + return { sender: "", metadatas: [] }; +} + +export const CalculateCollectionMerkleRootRequest = { + encode(message: CalculateCollectionMerkleRootRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + for (const v of message.metadatas) { + Metadata.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CalculateCollectionMerkleRootRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCalculateCollectionMerkleRootRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.sender = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.metadatas.push(Metadata.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CalculateCollectionMerkleRootRequest { + return { + sender: isSet(object.sender) ? globalThis.String(object.sender) : "", + metadatas: globalThis.Array.isArray(object?.metadatas) + ? object.metadatas.map((e: any) => Metadata.fromJSON(e)) + : [], + }; + }, + + toJSON(message: CalculateCollectionMerkleRootRequest): unknown { + const obj: any = {}; + if (message.sender !== "") { + obj.sender = message.sender; + } + if (message.metadatas?.length) { + obj.metadatas = message.metadatas.map((e) => Metadata.toJSON(e)); + } + return obj; + }, + + create, I>>( + base?: I, + ): CalculateCollectionMerkleRootRequest { + return CalculateCollectionMerkleRootRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CalculateCollectionMerkleRootRequest { + const message = createBaseCalculateCollectionMerkleRootRequest(); + message.sender = object.sender ?? ""; + message.metadatas = object.metadatas?.map((e) => Metadata.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCalculateCollectionMerkleRootResponse(): CalculateCollectionMerkleRootResponse { + return { merkleRoot: "" }; +} + +export const CalculateCollectionMerkleRootResponse = { + encode(message: CalculateCollectionMerkleRootResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.merkleRoot !== "") { + writer.uint32(10).string(message.merkleRoot); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CalculateCollectionMerkleRootResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCalculateCollectionMerkleRootResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.merkleRoot = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): CalculateCollectionMerkleRootResponse { + return { merkleRoot: isSet(object.merkleRoot) ? globalThis.String(object.merkleRoot) : "" }; + }, + + toJSON(message: CalculateCollectionMerkleRootResponse): unknown { + const obj: any = {}; + if (message.merkleRoot !== "") { + obj.merkleRoot = message.merkleRoot; + } + return obj; + }, + + create, I>>( + base?: I, + ): CalculateCollectionMerkleRootResponse { + return CalculateCollectionMerkleRootResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): CalculateCollectionMerkleRootResponse { + const message = createBaseCalculateCollectionMerkleRootResponse(); + message.merkleRoot = object.merkleRoot ?? ""; + return message; + }, +}; + +function createBaseTokenMetadataRequest(): TokenMetadataRequest { + return { sender: "", networkId: "", projectId: "", tokenId: 0 }; +} + +export const TokenMetadataRequest = { + encode(message: TokenMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.networkId !== "") { + writer.uint32(18).string(message.networkId); + } + if (message.projectId !== "") { + writer.uint32(26).string(message.projectId); + } + if (message.tokenId !== 0) { + writer.uint32(32).uint32(message.tokenId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TokenMetadataRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTokenMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.sender = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.networkId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.projectId = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.tokenId = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): TokenMetadataRequest { + return { + sender: isSet(object.sender) ? globalThis.String(object.sender) : "", + networkId: isSet(object.networkId) ? globalThis.String(object.networkId) : "", + projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "", + tokenId: isSet(object.tokenId) ? globalThis.Number(object.tokenId) : 0, + }; + }, + + toJSON(message: TokenMetadataRequest): unknown { + const obj: any = {}; + if (message.sender !== "") { + obj.sender = message.sender; + } + if (message.networkId !== "") { + obj.networkId = message.networkId; + } + if (message.projectId !== "") { + obj.projectId = message.projectId; + } + if (message.tokenId !== 0) { + obj.tokenId = Math.round(message.tokenId); + } + return obj; + }, + + create, I>>(base?: I): TokenMetadataRequest { + return TokenMetadataRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): TokenMetadataRequest { + const message = createBaseTokenMetadataRequest(); + message.sender = object.sender ?? ""; + message.networkId = object.networkId ?? ""; + message.projectId = object.projectId ?? ""; + message.tokenId = object.tokenId ?? 0; + return message; + }, +}; + +function createBaseTokenMetadataResponse(): TokenMetadataResponse { + return { merkleRoot: "", metadata: undefined, merkleProof: [] }; +} + +export const TokenMetadataResponse = { + encode(message: TokenMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.merkleRoot !== "") { + writer.uint32(10).string(message.merkleRoot); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.merkleProof) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TokenMetadataResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTokenMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.merkleRoot = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.metadata = Metadata.decode(reader, reader.uint32()); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.merkleProof.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): TokenMetadataResponse { + return { + merkleRoot: isSet(object.merkleRoot) ? globalThis.String(object.merkleRoot) : "", + metadata: isSet(object.metadata) ? Metadata.fromJSON(object.metadata) : undefined, + merkleProof: globalThis.Array.isArray(object?.merkleProof) + ? object.merkleProof.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: TokenMetadataResponse): unknown { + const obj: any = {}; + if (message.merkleRoot !== "") { + obj.merkleRoot = message.merkleRoot; + } + if (message.metadata !== undefined) { + obj.metadata = Metadata.toJSON(message.metadata); + } + if (message.merkleProof?.length) { + obj.merkleProof = message.merkleProof; + } + return obj; + }, + + create, I>>(base?: I): TokenMetadataResponse { + return TokenMetadataResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): TokenMetadataResponse { + const message = createBaseTokenMetadataResponse(); + message.merkleRoot = object.merkleRoot ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? Metadata.fromPartial(object.metadata) + : undefined; + message.merkleProof = object.merkleProof?.map((e) => e) || []; + return message; + }, +}; + +function createBaseLaunchpadProjectsCountsRequest(): LaunchpadProjectsCountsRequest { + return { networkId: "" }; +} + +export const LaunchpadProjectsCountsRequest = { + encode(message: LaunchpadProjectsCountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.networkId !== "") { + writer.uint32(10).string(message.networkId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LaunchpadProjectsCountsRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLaunchpadProjectsCountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.networkId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LaunchpadProjectsCountsRequest { + return { networkId: isSet(object.networkId) ? globalThis.String(object.networkId) : "" }; + }, + + toJSON(message: LaunchpadProjectsCountsRequest): unknown { + const obj: any = {}; + if (message.networkId !== "") { + obj.networkId = message.networkId; + } + return obj; + }, + + create, I>>(base?: I): LaunchpadProjectsCountsRequest { + return LaunchpadProjectsCountsRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): LaunchpadProjectsCountsRequest { + const message = createBaseLaunchpadProjectsCountsRequest(); + message.networkId = object.networkId ?? ""; + return message; + }, +}; + +function createBaseLaunchpadProjectsCountsResponse(): LaunchpadProjectsCountsResponse { + return { statusCounts: [] }; +} + +export const LaunchpadProjectsCountsResponse = { + encode(message: LaunchpadProjectsCountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.statusCounts) { + StatusCount.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LaunchpadProjectsCountsResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLaunchpadProjectsCountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.statusCounts.push(StatusCount.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LaunchpadProjectsCountsResponse { + return { + statusCounts: globalThis.Array.isArray(object?.statusCounts) + ? object.statusCounts.map((e: any) => StatusCount.fromJSON(e)) + : [], + }; + }, + + toJSON(message: LaunchpadProjectsCountsResponse): unknown { + const obj: any = {}; + if (message.statusCounts?.length) { + obj.statusCounts = message.statusCounts.map((e) => StatusCount.toJSON(e)); + } + return obj; + }, + + create, I>>(base?: I): LaunchpadProjectsCountsResponse { + return LaunchpadProjectsCountsResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): LaunchpadProjectsCountsResponse { + const message = createBaseLaunchpadProjectsCountsResponse(); + message.statusCounts = object.statusCounts?.map((e) => StatusCount.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseProposeApproveProjectRequest(): ProposeApproveProjectRequest { + return { sender: "", networkId: "", projectId: "", proposalId: "" }; +} + +export const ProposeApproveProjectRequest = { + encode(message: ProposeApproveProjectRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.networkId !== "") { + writer.uint32(18).string(message.networkId); + } + if (message.projectId !== "") { + writer.uint32(26).string(message.projectId); + } + if (message.proposalId !== "") { + writer.uint32(34).string(message.proposalId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProposeApproveProjectRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposeApproveProjectRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.sender = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.networkId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.projectId = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.proposalId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProposeApproveProjectRequest { + return { + sender: isSet(object.sender) ? globalThis.String(object.sender) : "", + networkId: isSet(object.networkId) ? globalThis.String(object.networkId) : "", + projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "", + proposalId: isSet(object.proposalId) ? globalThis.String(object.proposalId) : "", + }; + }, + + toJSON(message: ProposeApproveProjectRequest): unknown { + const obj: any = {}; + if (message.sender !== "") { + obj.sender = message.sender; + } + if (message.networkId !== "") { + obj.networkId = message.networkId; + } + if (message.projectId !== "") { + obj.projectId = message.projectId; + } + if (message.proposalId !== "") { + obj.proposalId = message.proposalId; + } + return obj; + }, + + create, I>>(base?: I): ProposeApproveProjectRequest { + return ProposeApproveProjectRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): ProposeApproveProjectRequest { + const message = createBaseProposeApproveProjectRequest(); + message.sender = object.sender ?? ""; + message.networkId = object.networkId ?? ""; + message.projectId = object.projectId ?? ""; + message.proposalId = object.proposalId ?? ""; + return message; + }, +}; + +function createBaseProposeApproveProjectResponse(): ProposeApproveProjectResponse { + return { approved: false }; +} + +export const ProposeApproveProjectResponse = { + encode(message: ProposeApproveProjectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.approved === true) { + writer.uint32(8).bool(message.approved); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProposeApproveProjectResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposeApproveProjectResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.approved = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProposeApproveProjectResponse { + return { approved: isSet(object.approved) ? globalThis.Boolean(object.approved) : false }; + }, + + toJSON(message: ProposeApproveProjectResponse): unknown { + const obj: any = {}; + if (message.approved === true) { + obj.approved = message.approved; + } + return obj; + }, + + create, I>>(base?: I): ProposeApproveProjectResponse { + return ProposeApproveProjectResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): ProposeApproveProjectResponse { + const message = createBaseProposeApproveProjectResponse(); + message.approved = object.approved ?? false; + return message; + }, +}; + +function createBaseStatusCount(): StatusCount { + return { status: 0, count: 0 }; +} + +export const StatusCount = { + encode(message: StatusCount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + if (message.count !== 0) { + writer.uint32(16).uint32(message.count); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StatusCount { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatusCount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.status = reader.int32() as any; + continue; + case 2: + if (tag !== 16) { + break; + } + + message.count = reader.uint32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): StatusCount { + return { + status: isSet(object.status) ? statusFromJSON(object.status) : 0, + count: isSet(object.count) ? globalThis.Number(object.count) : 0, + }; + }, + + toJSON(message: StatusCount): unknown { + const obj: any = {}; + if (message.status !== 0) { + obj.status = statusToJSON(message.status); + } + if (message.count !== 0) { + obj.count = Math.round(message.count); + } + return obj; + }, + + create, I>>(base?: I): StatusCount { + return StatusCount.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): StatusCount { + const message = createBaseStatusCount(); + message.status = object.status ?? 0; + message.count = object.count ?? 0; + return message; + }, +}; + +function createBaseLaunchpadProject(): LaunchpadProject { + return { id: "", networkId: "", creatorId: "", collectionData: "", status: 0, proposalId: "" }; +} + +export const LaunchpadProject = { + encode(message: LaunchpadProject, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.networkId !== "") { + writer.uint32(18).string(message.networkId); + } + if (message.creatorId !== "") { + writer.uint32(26).string(message.creatorId); + } + if (message.collectionData !== "") { + writer.uint32(34).string(message.collectionData); + } + if (message.status !== 0) { + writer.uint32(40).int32(message.status); + } + if (message.proposalId !== "") { + writer.uint32(50).string(message.proposalId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LaunchpadProject { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLaunchpadProject(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.networkId = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.creatorId = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.collectionData = reader.string(); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.status = reader.int32() as any; + continue; + case 6: + if (tag !== 50) { + break; + } + + message.proposalId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): LaunchpadProject { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + networkId: isSet(object.networkId) ? globalThis.String(object.networkId) : "", + creatorId: isSet(object.creatorId) ? globalThis.String(object.creatorId) : "", + collectionData: isSet(object.collectionData) ? globalThis.String(object.collectionData) : "", + status: isSet(object.status) ? statusFromJSON(object.status) : 0, + proposalId: isSet(object.proposalId) ? globalThis.String(object.proposalId) : "", + }; + }, + + toJSON(message: LaunchpadProject): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.networkId !== "") { + obj.networkId = message.networkId; + } + if (message.creatorId !== "") { + obj.creatorId = message.creatorId; + } + if (message.collectionData !== "") { + obj.collectionData = message.collectionData; + } + if (message.status !== 0) { + obj.status = statusToJSON(message.status); + } + if (message.proposalId !== "") { + obj.proposalId = message.proposalId; + } + return obj; + }, + + create, I>>(base?: I): LaunchpadProject { + return LaunchpadProject.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): LaunchpadProject { + const message = createBaseLaunchpadProject(); + message.id = object.id ?? ""; + message.networkId = object.networkId ?? ""; + message.creatorId = object.creatorId ?? ""; + message.collectionData = object.collectionData ?? ""; + message.status = object.status ?? 0; + message.proposalId = object.proposalId ?? ""; + return message; + }, +}; + +function createBaseMetadata(): Metadata { + return { + image: undefined, + imageData: undefined, + externalUrl: undefined, + description: undefined, + name: undefined, + attributes: [], + backgroundColor: undefined, + animationUrl: undefined, + youtubeUrl: undefined, + royaltyPercentage: undefined, + royaltyPaymentAddress: undefined, + }; +} + +export const Metadata = { + encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.image !== undefined) { + writer.uint32(10).string(message.image); + } + if (message.imageData !== undefined) { + writer.uint32(18).string(message.imageData); + } + if (message.externalUrl !== undefined) { + writer.uint32(26).string(message.externalUrl); + } + if (message.description !== undefined) { + writer.uint32(34).string(message.description); + } + if (message.name !== undefined) { + writer.uint32(42).string(message.name); + } + for (const v of message.attributes) { + Trait.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.backgroundColor !== undefined) { + writer.uint32(58).string(message.backgroundColor); + } + if (message.animationUrl !== undefined) { + writer.uint32(66).string(message.animationUrl); + } + if (message.youtubeUrl !== undefined) { + writer.uint32(74).string(message.youtubeUrl); + } + if (message.royaltyPercentage !== undefined) { + writer.uint32(80).uint64(message.royaltyPercentage); + } + if (message.royaltyPaymentAddress !== undefined) { + writer.uint32(90).string(message.royaltyPaymentAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.image = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.imageData = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.externalUrl = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.description = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.name = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.attributes.push(Trait.decode(reader, reader.uint32())); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.backgroundColor = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.animationUrl = reader.string(); + continue; + case 9: + if (tag !== 74) { + break; + } + + message.youtubeUrl = reader.string(); + continue; + case 10: + if (tag !== 80) { + break; + } + + message.royaltyPercentage = longToNumber(reader.uint64() as Long); + continue; + case 11: + if (tag !== 90) { + break; + } + + message.royaltyPaymentAddress = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Metadata { + return { + image: isSet(object.image) ? globalThis.String(object.image) : undefined, + imageData: isSet(object.imageData) ? globalThis.String(object.imageData) : undefined, + externalUrl: isSet(object.externalUrl) ? globalThis.String(object.externalUrl) : undefined, + description: isSet(object.description) ? globalThis.String(object.description) : undefined, + name: isSet(object.name) ? globalThis.String(object.name) : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Trait.fromJSON(e)) + : [], + backgroundColor: isSet(object.backgroundColor) ? globalThis.String(object.backgroundColor) : undefined, + animationUrl: isSet(object.animationUrl) ? globalThis.String(object.animationUrl) : undefined, + youtubeUrl: isSet(object.youtubeUrl) ? globalThis.String(object.youtubeUrl) : undefined, + royaltyPercentage: isSet(object.royaltyPercentage) ? globalThis.Number(object.royaltyPercentage) : undefined, + royaltyPaymentAddress: isSet(object.royaltyPaymentAddress) + ? globalThis.String(object.royaltyPaymentAddress) + : undefined, + }; + }, + + toJSON(message: Metadata): unknown { + const obj: any = {}; + if (message.image !== undefined) { + obj.image = message.image; + } + if (message.imageData !== undefined) { + obj.imageData = message.imageData; + } + if (message.externalUrl !== undefined) { + obj.externalUrl = message.externalUrl; + } + if (message.description !== undefined) { + obj.description = message.description; + } + if (message.name !== undefined) { + obj.name = message.name; + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Trait.toJSON(e)); + } + if (message.backgroundColor !== undefined) { + obj.backgroundColor = message.backgroundColor; + } + if (message.animationUrl !== undefined) { + obj.animationUrl = message.animationUrl; + } + if (message.youtubeUrl !== undefined) { + obj.youtubeUrl = message.youtubeUrl; + } + if (message.royaltyPercentage !== undefined) { + obj.royaltyPercentage = Math.round(message.royaltyPercentage); + } + if (message.royaltyPaymentAddress !== undefined) { + obj.royaltyPaymentAddress = message.royaltyPaymentAddress; + } + return obj; + }, + + create, I>>(base?: I): Metadata { + return Metadata.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Metadata { + const message = createBaseMetadata(); + message.image = object.image ?? undefined; + message.imageData = object.imageData ?? undefined; + message.externalUrl = object.externalUrl ?? undefined; + message.description = object.description ?? undefined; + message.name = object.name ?? undefined; + message.attributes = object.attributes?.map((e) => Trait.fromPartial(e)) || []; + message.backgroundColor = object.backgroundColor ?? undefined; + message.animationUrl = object.animationUrl ?? undefined; + message.youtubeUrl = object.youtubeUrl ?? undefined; + message.royaltyPercentage = object.royaltyPercentage ?? undefined; + message.royaltyPaymentAddress = object.royaltyPaymentAddress ?? undefined; + return message; + }, +}; + +function createBaseTrait(): Trait { + return { displayType: undefined, traitType: "", value: "" }; +} + +export const Trait = { + encode(message: Trait, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.displayType !== undefined) { + writer.uint32(10).string(message.displayType); + } + if (message.traitType !== "") { + writer.uint32(18).string(message.traitType); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Trait { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTrait(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.displayType = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.traitType = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Trait { + return { + displayType: isSet(object.displayType) ? globalThis.String(object.displayType) : undefined, + traitType: isSet(object.traitType) ? globalThis.String(object.traitType) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: Trait): unknown { + const obj: any = {}; + if (message.displayType !== undefined) { + obj.displayType = message.displayType; + } + if (message.traitType !== "") { + obj.traitType = message.traitType; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Trait { + return Trait.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Trait { + const message = createBaseTrait(); + message.displayType = object.displayType ?? undefined; + message.traitType = object.traitType ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +export interface LaunchpadService { + UploadMetadatas( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; + CalculateCollectionMerkleRoot( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; + TokenMetadata(request: DeepPartial, metadata?: grpc.Metadata): Promise; + LaunchpadProjects( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; + LaunchpadProjectById( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; + LaunchpadProjectsCounts( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; + ProposeApproveProject( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise; +} + +export class LaunchpadServiceClientImpl implements LaunchpadService { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.UploadMetadatas = this.UploadMetadatas.bind(this); + this.CalculateCollectionMerkleRoot = this.CalculateCollectionMerkleRoot.bind(this); + this.TokenMetadata = this.TokenMetadata.bind(this); + this.LaunchpadProjects = this.LaunchpadProjects.bind(this); + this.LaunchpadProjectById = this.LaunchpadProjectById.bind(this); + this.LaunchpadProjectsCounts = this.LaunchpadProjectsCounts.bind(this); + this.ProposeApproveProject = this.ProposeApproveProject.bind(this); + } + + UploadMetadatas( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary(LaunchpadServiceUploadMetadatasDesc, UploadMetadatasRequest.fromPartial(request), metadata); + } + + CalculateCollectionMerkleRoot( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary( + LaunchpadServiceCalculateCollectionMerkleRootDesc, + CalculateCollectionMerkleRootRequest.fromPartial(request), + metadata, + ); + } + + TokenMetadata(request: DeepPartial, metadata?: grpc.Metadata): Promise { + return this.rpc.unary(LaunchpadServiceTokenMetadataDesc, TokenMetadataRequest.fromPartial(request), metadata); + } + + LaunchpadProjects( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary( + LaunchpadServiceLaunchpadProjectsDesc, + LaunchpadProjectsRequest.fromPartial(request), + metadata, + ); + } + + LaunchpadProjectById( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary( + LaunchpadServiceLaunchpadProjectByIdDesc, + LaunchpadProjectByIdRequest.fromPartial(request), + metadata, + ); + } + + LaunchpadProjectsCounts( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary( + LaunchpadServiceLaunchpadProjectsCountsDesc, + LaunchpadProjectsCountsRequest.fromPartial(request), + metadata, + ); + } + + ProposeApproveProject( + request: DeepPartial, + metadata?: grpc.Metadata, + ): Promise { + return this.rpc.unary( + LaunchpadServiceProposeApproveProjectDesc, + ProposeApproveProjectRequest.fromPartial(request), + metadata, + ); + } +} + +export const LaunchpadServiceDesc = { serviceName: "launchpad.v1.LaunchpadService" }; + +export const LaunchpadServiceUploadMetadatasDesc: UnaryMethodDefinitionish = { + methodName: "UploadMetadatas", + service: LaunchpadServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return UploadMetadatasRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + const value = UploadMetadatasResponse.decode(data); + return { + ...value, + toObject() { + return value; + }, + }; + }, + } as any, +}; + +export const LaunchpadServiceCalculateCollectionMerkleRootDesc: UnaryMethodDefinitionish = { + methodName: "CalculateCollectionMerkleRoot", + service: LaunchpadServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return CalculateCollectionMerkleRootRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + const value = CalculateCollectionMerkleRootResponse.decode(data); + return { + ...value, + toObject() { + return value; + }, + }; + }, + } as any, +}; + +export const LaunchpadServiceTokenMetadataDesc: UnaryMethodDefinitionish = { + methodName: "TokenMetadata", + service: LaunchpadServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return TokenMetadataRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + const value = TokenMetadataResponse.decode(data); + return { + ...value, + toObject() { + return value; + }, + }; + }, + } as any, +}; + +export const LaunchpadServiceLaunchpadProjectsDesc: UnaryMethodDefinitionish = { + methodName: "LaunchpadProjects", + service: LaunchpadServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return LaunchpadProjectsRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + const value = LaunchpadProjectsResponse.decode(data); + return { + ...value, + toObject() { + return value; + }, + }; + }, + } as any, +}; + +export const LaunchpadServiceLaunchpadProjectByIdDesc: UnaryMethodDefinitionish = { + methodName: "LaunchpadProjectById", + service: LaunchpadServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return LaunchpadProjectByIdRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + const value = LaunchpadProjectByIdResponse.decode(data); + return { + ...value, + toObject() { + return value; + }, + }; + }, + } as any, +}; + +export const LaunchpadServiceLaunchpadProjectsCountsDesc: UnaryMethodDefinitionish = { + methodName: "LaunchpadProjectsCounts", + service: LaunchpadServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return LaunchpadProjectsCountsRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + const value = LaunchpadProjectsCountsResponse.decode(data); + return { + ...value, + toObject() { + return value; + }, + }; + }, + } as any, +}; + +export const LaunchpadServiceProposeApproveProjectDesc: UnaryMethodDefinitionish = { + methodName: "ProposeApproveProject", + service: LaunchpadServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return ProposeApproveProjectRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + const value = ProposeApproveProjectResponse.decode(data); + return { + ...value, + toObject() { + return value; + }, + }; + }, + } as any, +}; + +interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition { + requestStream: any; + responseStream: any; +} + +type UnaryMethodDefinitionish = UnaryMethodDefinitionishR; + +interface Rpc { + unary( + methodDesc: T, + request: any, + metadata: grpc.Metadata | undefined, + ): Promise; +} + +export class GrpcWebImpl { + private host: string; + private options: { + transport?: grpc.TransportFactory; + + debug?: boolean; + metadata?: grpc.Metadata; + upStreamRetryCodes?: number[]; + }; + + constructor( + host: string, + options: { + transport?: grpc.TransportFactory; + + debug?: boolean; + metadata?: grpc.Metadata; + upStreamRetryCodes?: number[]; + }, + ) { + this.host = host; + this.options = options; + } + + unary( + methodDesc: T, + _request: any, + metadata: grpc.Metadata | undefined, + ): Promise { + const request = { ..._request, ...methodDesc.requestType }; + const maybeCombinedMetadata = metadata && this.options.metadata + ? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap }) + : metadata ?? this.options.metadata; + return new Promise((resolve, reject) => { + grpc.unary(methodDesc, { + request, + host: this.host, + metadata: maybeCombinedMetadata ?? {}, + ...(this.options.transport !== undefined ? { transport: this.options.transport } : {}), + debug: this.options.debug ?? false, + onEnd: function (response) { + if (response.status === grpc.Code.OK) { + resolve(response.message!.toObject()); + } else { + const err = new GrpcWebError(response.statusMessage, response.status, response.trailers); + reject(err); + } + }, + }); + }); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export class GrpcWebError extends globalThis.Error { + constructor(message: string, public code: grpc.Code, public metadata: grpc.Metadata) { + super(message); + } +}