Skip to content

Commit

Permalink
add updated protos and generated types
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 committed Oct 17, 2023
1 parent 92cbf93 commit 3928a0a
Show file tree
Hide file tree
Showing 10 changed files with 2,258 additions and 240 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ require (
cosmossdk.io/math v1.0.1
github.com/cometbft/cometbft v0.37.2
github.com/cometbft/cometbft-db v0.8.0
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.47.3
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v7 v7.2.0
github.com/golang/protobuf v1.5.3
github.com/google/uuid v1.3.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
Expand Down Expand Up @@ -51,7 +53,6 @@ require (
github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v0.20.0 // indirect
Expand Down Expand Up @@ -124,7 +125,6 @@ require (
github.com/mtibben/percent v0.2.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KP
github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y=
Expand Down Expand Up @@ -755,7 +756,6 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down
8 changes: 8 additions & 0 deletions keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func (k Keeper) Collection(c context.Context, request *types.QueryCollectionRequ
}, nil
}

func (k Keeper) IBCCollection(c context.Context, request *types.QueryIBCCollectionRequest) (*types.QueryCollectionResponse, error) {
return nil, nil
}

func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error) {
denom := strings.ToLower(strings.TrimSpace(request.DenomId))
ctx := sdk.UnwrapSDKContext(c)
Expand All @@ -64,6 +68,10 @@ func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*typ
}, nil
}

func (k Keeper) IBCDenom(c context.Context, request *types.QueryIBCDenomRequest) (*types.QueryDenomResponse, error) {
return nil, nil
}

func (k Keeper) Denoms(c context.Context, request *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
var (
Expand Down
37 changes: 37 additions & 0 deletions proto/OmniFlix/onft/v1beta1/onft.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ message Denom {
(gogoproto.moretags) = "yaml:\"preview_uri\"",
(gogoproto.customname) = "PreviewURI"
];
string uri = 8;
string uri_hash = 9;
string data = 10;
}

message DenomMetadata {
string creator = 1;
string schema = 2;
string description = 3;
string preview_uri = 4;
string data = 5;
string uri_hash = 6;
}

//ASSET or ONFT
Expand Down Expand Up @@ -73,6 +85,31 @@ message Metadata {
(gogoproto.moretags) = "yaml:\"preview_uri\"",
(gogoproto.customname) = "PreviewURI"
];
string uri_hash = 5;
}

message ONFTMetadata {
string name = 1;
string description =2;
string preview_uri = 3 [
(gogoproto.moretags) = "yaml:\"preview_uri\"",
(gogoproto.customname) = "PreviewURI"
];
string data = 4;
bool transferable = 5;
bool extensible = 6;
google.protobuf.Timestamp created_at = 7 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true,
(gogoproto.moretags) = "yaml:\"created_at\""
];
bool nsfw = 8;
string royalty_share = 9 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"royalty_share\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"
];
string uri_hash = 10;
}

message Owner {
Expand Down
17 changes: 17 additions & 0 deletions proto/OmniFlix/onft/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ service Query {
option (google.api.http).get = "/omniflix/onft/v1beta1/collections/{denom_id}";
}

rpc IBCCollection(QueryIBCCollectionRequest) returns (QueryCollectionResponse) {
option (google.api.http).get = "/omniflix/onft/v1beta1/collections/ibc/{hash}";
}

rpc Denom(QueryDenomRequest) returns (QueryDenomResponse) {
option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}";
}

rpc IBCDenom(QueryIBCDenomRequest) returns (QueryDenomResponse) {
option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/ibc/{hash}";
}

rpc Denoms(QueryDenomsRequest) returns (QueryDenomsResponse) {
option (google.api.http).get = "/omniflix/onft/v1beta1/denoms";
}
Expand Down Expand Up @@ -45,6 +53,11 @@ message QueryCollectionResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryIBCCollectionRequest {
string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""];
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

message QueryDenomRequest {
string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""];
}
Expand All @@ -53,6 +66,10 @@ message QueryDenomResponse {
Denom denom = 1;
}

message QueryIBCDenomRequest {
string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""];
}

message QueryDenomsRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
Expand Down
3 changes: 3 additions & 0 deletions proto/OmniFlix/onft/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ message MsgCreateDenom {
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"
];
string uri = 9;
string uri_hash = 10;
string data = 11;
}

message MsgCreateDenomResponse {}
Expand Down
Loading

0 comments on commit 3928a0a

Please sign in to comment.