Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions packages/api-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@regen-network/api-demo",
"version": "v1.0.0-alpha7",
"version": "v1.0.0-alpha8",
"author": "admin@regen.network",
"description": "Demo application using @regen-network/api",
"license": "Apache-2.0",
"private": true,
"repository": "https://github.com/regen-network/regen-js",
"dependencies": {
"@keplr-wallet/types": "^0.12.15",
"@regen-network/api": "^1.0.0-alpha7",
"@regen-network/api": "^1.0.0-alpha8",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
Expand Down
1 change: 1 addition & 0 deletions packages/api-demo/src/examples/LCDCosmos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function LCDCosmos(): React.ReactElement {
.allBalances({
address: 'regen1df675r9vnf7pdedn4sf26svdsem3ugavgxmy46',
pagination: { countTotal: true } as PageRequest,
resolveDenom: true,
})
.then(setResult)
.catch(setError);
Expand Down
1 change: 1 addition & 0 deletions packages/api-demo/src/examples/RPCCosmos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function RPCCosmos(): React.ReactElement {
limit: BigInt(0),
offset: BigInt(0),
} as PageRequest,
resolveDenom: true,
})
.then(setResult)
.catch(setError);
Expand Down
2 changes: 1 addition & 1 deletion packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const client = await createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT });

// now you can query the cosmos modules
const balance = await client.cosmos.bank.v1beta1
.allBalances({ address: 'regen1addresshere' });
.allBalances({ address: 'regen1addresshere', resolveDenom: true });

// you can also query the regen modules
const balances = await client.regen.exchange.v1beta1
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@regen-network/api",
"version": "v1.0.0-alpha7",
"version": "v1.0.0-alpha8",
"author": "admin@regen.network",
"description": "Javascript API for Regen Ledger",
"main": "index.js",
Expand Down
13 changes: 0 additions & 13 deletions packages/api/proto/cosmos/app/module/v1alpha1/module.proto

This file was deleted.

75 changes: 75 additions & 0 deletions packages/api/proto/cosmos/app/runtime/v1alpha1/module.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
syntax = "proto3";

package cosmos.app.runtime.v1alpha1;

import "cosmos/app/v1alpha1/module.proto";

// Module is the config object for the runtime module.
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "github.com/cosmos/cosmos-sdk/runtime"
use_package: {name: "cosmos.app.v1alpha1"}
};

// app_name is the name of the app.
string app_name = 1;

// begin_blockers specifies the module names of begin blockers
// to call in the order in which they should be called. If this is left empty
// no begin blocker will be registered.
repeated string begin_blockers = 2;

// end_blockers specifies the module names of the end blockers
// to call in the order in which they should be called. If this is left empty
// no end blocker will be registered.
repeated string end_blockers = 3;

// init_genesis specifies the module names of init genesis functions
// to call in the order in which they should be called. If this is left empty
// no init genesis function will be registered.
repeated string init_genesis = 4;

// export_genesis specifies the order in which to export module genesis data.
// If this is left empty, the init_genesis order will be used for export genesis
// if it is specified.
repeated string export_genesis = 5;

// override_store_keys is an optional list of overrides for the module store keys
// to be used in keeper construction.
repeated StoreKeyConfig override_store_keys = 6;

// skip_store_keys is an optional list of store keys to skip when constructing the
// module's keeper. This is useful when a module does not have a store key.
// NOTE: the provided environment variable will have a fake store service.
repeated string skip_store_keys = 11;

// order_migrations defines the order in which module migrations are performed.
// If this is left empty, it uses the default migration order.
// https://pkg.go.dev/github.com/cosmos/cosmos-sdk/types/module#DefaultMigrationsOrder
repeated string order_migrations = 7;

// precommiters specifies the module names of the precommiters
// to call in the order in which they should be called. If this is left empty
// no precommit function will be registered.
repeated string precommiters = 8;

// prepare_check_staters specifies the module names of the prepare_check_staters
// to call in the order in which they should be called. If this is left empty
// no preparecheckstate function will be registered.
repeated string prepare_check_staters = 9;

// pre_blockers specifies the module names of pre blockers
// to call in the order in which they should be called. If this is left empty
// no pre blocker will be registered.
repeated string pre_blockers = 10;
}

// StoreKeyConfig may be supplied to override the default module store key, which
// is the module name.
message StoreKeyConfig {
// name of the module to override the store key of
string module_name = 1;

// the kv store key to use instead of the module name.
string kv_store_key = 2;
}
21 changes: 21 additions & 0 deletions packages/api/proto/cosmos/app/v1alpha1/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package cosmos.app.v1alpha1;

import "google/protobuf/any.proto";

option go_package = "cosmossdk.io/depinject/appconfig/v1alpha1";

// Config represents the configuration for a Cosmos SDK ABCI app.
// It is intended that all state machine logic including the version of
// baseapp and tx handlers (and possibly even Tendermint) that an app needs
Expand All @@ -14,6 +16,11 @@ import "google/protobuf/any.proto";
message Config {
// modules are the module configurations for the app.
repeated ModuleConfig modules = 1;

// golang_bindings specifies explicit interface to implementation type bindings which
// depinject uses to resolve interface inputs to provider functions. The scope of this
// field's configuration is global (not module specific).
repeated GolangBinding golang_bindings = 2;
}

// ModuleConfig is a module configuration for an app.
Expand All @@ -33,4 +40,18 @@ message ModuleConfig {
// config is the config object for the module. Module config messages should
// define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension.
google.protobuf.Any config = 2;

// golang_bindings specifies explicit interface to implementation type bindings which
// depinject uses to resolve interface inputs to provider functions. The scope of this
// field's configuration is module specific.
repeated GolangBinding golang_bindings = 3;
}

// GolangBinding is an explicit interface type to implementing type binding for dependency injection.
message GolangBinding {
// interface_type is the interface type which will be bound to a specific implementation type
string interface_type = 1;

// implementation is the implementing type which will be supplied when an input of type interface is requested
string implementation = 2;
}
4 changes: 3 additions & 1 deletion packages/api/proto/cosmos/app/v1alpha1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package cosmos.app.v1alpha1;

import "google/protobuf/descriptor.proto";

option go_package = "cosmossdk.io/depinject/appconfig/v1alpha1";

extend google.protobuf.MessageOptions {
// module indicates that this proto type is a config object for an app module
// and optionally provides other descriptive information about the module.
Expand Down Expand Up @@ -57,7 +59,7 @@ message PackageReference {
//
// When a new version of a module is released and items are added to existing
// .proto files, these definitions should contain comments of the form
// "Since Revision N" where N is an integer revision.
// "Since: Revision N" where N is an integer revision.
//
// When the module runtime starts up, it will check the pinned proto
// image and panic if there are runtime protobuf definitions that are not
Expand Down
8 changes: 6 additions & 2 deletions packages/api/proto/cosmos/app/v1alpha1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ package cosmos.app.v1alpha1;

import "cosmos/app/v1alpha1/config.proto";

option go_package = "cosmossdk.io/depinject/appconfig/v1alpha1";

// Query is the app module query service.
service Query {

// Config returns the current app config.
rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {}
rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {
option deprecated = true;
}
}

// QueryConfigRequest is the Query/Config request type.
message QueryConfigRequest {}

// QueryConfigRequest is the Query/Config response type.
// QueryConfigResponse is the Query/Config response type.
message QueryConfigResponse {

// config is the current app config.
Expand Down
36 changes: 36 additions & 0 deletions packages/api/proto/cosmos/auth/module/v1/module.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
syntax = "proto3";

package cosmos.auth.module.v1;

import "cosmos/app/v1alpha1/module.proto";

// Module is the config object for the auth module.
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "github.com/cosmos/cosmos-sdk/x/auth"
};

// bech32_prefix is the bech32 account prefix for the app.
string bech32_prefix = 1;

// module_account_permissions are module account permissions.
repeated ModuleAccountPermission module_account_permissions = 2;

// authority defines the custom module authority. If not set, defaults to the governance module.
string authority = 3;

// enable_unordered_transactions determines whether unordered transactions should be supported or not.
// When true, unordered transactions will be validated and processed.
// When false, unordered transactions will be rejected.
bool enable_unordered_transactions = 4;
}

// ModuleAccountPermission represents permissions for a module account.
message ModuleAccountPermission {
// account is the name of the module.
string account = 1;

// permissions are the permissions this module has. Currently recognized
// values are minter, burner and staking.
repeated string permissions = 2;
}
39 changes: 27 additions & 12 deletions packages/api/proto/cosmos/auth/v1beta1/auth.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
syntax = "proto3";
package cosmos.auth.v1beta1;

import "amino/amino.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
Expand All @@ -11,33 +12,47 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
// for basic account functionality. Any custom account type should extend this
// type for additional functionality (e.g. vesting).
message BaseAccount {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (gogoproto.equal) = false;
option (amino.name) = "cosmos-sdk/BaseAccount";
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = false;

option (cosmos_proto.implements_interface) = "AccountI";
option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI";

string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"];
uint64 account_number = 3;
uint64 sequence = 4;
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (amino.field_name) = "public_key"];

uint64 account_number = 3;
uint64 sequence = 4;
}

// ModuleAccount defines an account for modules that holds coins on a pool.
message ModuleAccount {
option (amino.name) = "cosmos-sdk/ModuleAccount";
option (amino.message_encoding) = "module_account";
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (cosmos_proto.implements_interface) = "ModuleAccountI";
option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.ModuleAccountI";

BaseAccount base_account = 1 [(gogoproto.embed) = true];
string name = 2;
repeated string permissions = 3;
}

// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules.
message ModuleCredential {
option (amino.name) = "cosmos-sdk/GroupAccountCredential";
option (cosmos_proto.message_added_in) = "cosmos-sdk 0.47";
// module_name is the name of the module used for address derivation (passed into address.Module).
string module_name = 1;
// derivation_keys is for deriving a module account address (passed into address.Module)
// adding more keys creates sub-account addresses (passed into address.Derive)
repeated bytes derivation_keys = 2;
}

// Params defines the parameters for the auth module.
message Params {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
option (amino.name) = "cosmos-sdk/x/auth/Params";
option (gogoproto.equal) = true;

uint64 max_memo_characters = 1;
uint64 tx_sig_limit = 2;
Expand Down
5 changes: 3 additions & 2 deletions packages/api/proto/cosmos/auth/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ package cosmos.auth.v1beta1;
import "google/protobuf/any.proto";
import "gogoproto/gogo.proto";
import "cosmos/auth/v1beta1/auth.proto";
import "amino/amino.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";

// GenesisState defines the auth module's genesis state.
message GenesisState {
// params defines all the paramaters of the module.
Params params = 1 [(gogoproto.nullable) = false];
// params defines all the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// accounts are the accounts present at genesis.
repeated google.protobuf.Any accounts = 2;
Expand Down
Loading