feat(macaroon): add transaction allowlist/denylist caveats

This commit is contained in:
Prad Nukala
2024-10-08 16:26:21 -04:00
parent 8ac1ccaa34
commit c3e8fcc3d3
34 changed files with 1032 additions and 4497 deletions
+12 -1
View File
@@ -3,6 +3,7 @@ package macaroon.v1;
import "amino/amino.proto";
import "gogoproto/gogo.proto";
import "did/v1/tx.proto";
option go_package = "github.com/onsonr/sonr/x/macaroon/types";
@@ -46,9 +47,19 @@ message Scopes {
// Caveats defines the available caveats
message Caveats {
option (amino.name) = "macaroon/caveat";
option (amino.name) = "macaroon/caveats";
option (gogoproto.equal) = true;
repeated string supported_first_party = 1;
repeated string supported_third_party = 2;
}
// Transactions defines the allowlist,denylist for transactions which can be
// broadcasted to the network with the Sonr DWN Signed macaroon.
message Transactions {
option (amino.name) = "macaroon/transactions";
option (gogoproto.equal) = true;
repeated string allowlist = 1;
repeated string denylist = 2;
}
-13
View File
@@ -1,13 +0,0 @@
syntax = "proto3";
package oracle.module.v1;
import "cosmos/app/v1alpha1/module.proto";
// Module is the app config object of the module.
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import : "github.com/onsonr/sonr"
};
}
-53
View File
@@ -1,53 +0,0 @@
syntax = "proto3";
package oracle.v1;
import "amino/amino.proto";
import "gogoproto/gogo.proto";
option go_package = "github.com/onsonr/sonr/x/oracle/types";
// GenesisState defines the module genesis state
message GenesisState {
// Params defines all the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false];
}
// Params defines the set of module parameters.
message Params {
option (amino.name) = "oracle/params";
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
Assets assets = 1;
}
message Assets {
option (amino.name) = "oracle/assets";
option (gogoproto.equal) = true;
repeated AssetInfo assets = 1;
}
// AssetInfo defines the asset info
message AssetInfo {
option (amino.name) = "oracle/asset_info";
option (gogoproto.equal) = true;
// The coin type index for bip44 path
int64 index = 1;
// The hrp for bech32 address
string hrp = 2;
// The coin symbol
string symbol = 3;
// The coin name
string asset_type = 4;
// The name of the asset
string name = 5;
// The icon url
string icon_url = 6;
}
-24
View File
@@ -1,24 +0,0 @@
syntax = "proto3";
package oracle.v1;
import "google/api/annotations.proto";
import "oracle/v1/genesis.proto";
option go_package = "github.com/onsonr/sonr/x/oracle/types";
// Query provides defines the gRPC querier service.
service Query {
// Params queries all parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/oracle/v1/params";
}
}
// QueryParamsRequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1;
}
-39
View File
@@ -1,39 +0,0 @@
syntax = "proto3";
package oracle.v1;
import "cosmos/orm/v1/orm.proto";
option go_package = "github.com/onsonr/sonr/x/oracle/types";
// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md
message Balance {
option (cosmos.orm.v1.table) = {
id: 1
primary_key: {fields: "account"}
index: {
id: 1
fields: "amount"
}
};
string account = 1;
uint64 amount = 2;
}
message Account {
option (cosmos.orm.v1.table) = {
id: 2
primary_key: {fields: "id"}
index: {
id: 1
fields: "address,chain,network"
unique: true
}
};
uint64 id = 1;
string address = 2;
string chain = 3;
string network = 4;
}
-40
View File
@@ -1,40 +0,0 @@
syntax = "proto3";
package oracle.v1;
import "cosmos/msg/v1/msg.proto";
import "oracle/v1/genesis.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
option go_package = "github.com/onsonr/sonr/x/oracle/types";
// Msg defines the Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;
// UpdateParams defines a governance operation for updating the parameters.
//
// Since: cosmos-sdk 0.47
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}
// MsgUpdateParams is the Msg/UpdateParams request type.
//
// Since: cosmos-sdk 0.47
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// params defines the parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2 [(gogoproto.nullable) = false];
}
// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
//
// Since: cosmos-sdk 0.47
message MsgUpdateParamsResponse {}