Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding new modules and update the proto of umee #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ npm-debug.log*
pids
*.pid
*.seed
.vscode/*

# out
out
Expand Down Expand Up @@ -48,4 +49,4 @@ package-lock.json
yarn.lock

# others
.DS_Store
.DS_Store
44 changes: 43 additions & 1 deletion .telescope.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,56 @@
],
"outPath": "./src/codegen",
"options": {
"interfaces": {
"enabled": false,
"useByDefault": false,
"useUnionTypes": false
},
"prototypes": {
"enabled": true,
"parser": {
"keepCase": false
},
"methods": {
"fromJSON": false,
"toJSON": false,
"encode": true,
"decode": true,
"fromPartial": true,
"toAmino": true,
"fromAmino": true,
"fromProto": true,
"toProto": true
},
"addTypeUrlToObjects": true,
"addTypeUrlToDecoders": true,
"typingsFormat": {
"duration": "duration",
"timestamp": "date",
"useExact": false,
"useDeepPartial": false,
"num64": "bigint",
"customTypes": {
"useCosmosSDKDec": true
}
}
},
"bundle": {
"enabled": true
},
"stargateClients": {
"enabled": true,
"includeCosmosDefaultTypes": true
},
"aminoEncoding": {
"enabled": true
},
"lcdClients": {
"enabled": true
},
"rpcClients": {
"enabled": true
"enabled": true,
"camelCase": true
}
}
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"editor.formatOnSave": false
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"eslint.validate": [
"javascript",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.3",
"description": "interact with the umee blockchain",
"author": "Ebrahim Elbagory <[email protected]>",
"homepage": "https://github.com/ebrahimUmee/umeejs#readme",
"homepage": "https://github.com/umee-network/umeejs#readme",
"license": "SEE LICENSE IN LICENSE",
"main": "main/index.js",
"module": "module/index.js",
Expand Down Expand Up @@ -85,8 +85,8 @@
"@babel/runtime": "^7.19.4",
"@cosmjs/amino": "^0.29.3",
"@cosmjs/proto-signing": "^0.29.3",
"@cosmjs/stargate": "^0.29.3",
"@cosmjs/tendermint-rpc": "^0.29.3",
"@cosmjs/stargate": "^0.32.1",
"@cosmjs/tendermint-rpc": "^0.32.1",
"protobufjs": "^6.11.2"
}
}
}
75 changes: 75 additions & 0 deletions proto/umee/incentive/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
syntax = "proto3";
package umee.incentive.v1;

option go_package = "github.com/umee-network/umee/v6/x/incentive";

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "umee/incentive/v1/incentive.proto";

// GenesisState defines the x/incentive module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
uint32 next_program_id = 2;
int64 last_rewards_time = 3;
repeated RewardTracker reward_trackers = 4 [(gogoproto.nullable) = false];
repeated RewardAccumulator reward_accumulators = 5 [(gogoproto.nullable) = false];
repeated IncentiveProgram upcoming_programs = 6 [(gogoproto.nullable) = false];
repeated IncentiveProgram ongoing_programs = 7 [(gogoproto.nullable) = false];
repeated IncentiveProgram completed_programs = 8 [(gogoproto.nullable) = false];
repeated Bond bonds = 9 [(gogoproto.nullable) = false];
repeated AccountUnbondings account_unbondings = 10 [(gogoproto.nullable) = false];
}

// Bond tracks the amount of coins of one uToken denomination bonded
// by a single account.
message Bond {
string account = 1;
cosmos.base.v1beta1.Coin uToken = 2 [(gogoproto.nullable) = false];
}

// RewardTracker tracks the value of a given lock denom's RewardAccumulator at the
// last time a specific account calculated pending rewards for it. When calculating
// available rewards, this value is used to determine the difference between the current
// RewardAccumulator for a uToken and the last value at which the user updated bonds or claimed
// tokens. Their pending rewards increase by only the rewards accrued in that time period.
message RewardTracker {
string account = 1;
string uToken = 2;
repeated cosmos.base.v1beta1.DecCoin rewards = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"
];
}

// RewardAccumulator is a global reward tracking struct that indicates the amount
// of rewards that a reference amount of a bonded uToken denom would have accumulated
// if it was bonded since genesis. To prevent rounding issues, the reference amount is
// 10^exponent of the uToken's smallest possible amount, generally matching the exponent
// of the associated base token registered with the leverage module.
message RewardAccumulator {
string uToken = 1;
repeated cosmos.base.v1beta1.DecCoin rewards = 2 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"
];
uint32 exponent = 3;
}

// Unbonding is a structure that tracks an in-progress token unbonding.
// It tracks both its start time and end time, so that if the module's
// unbonding time changes, the unbonding can complete at the earlier of
// its original end time or its new one based on the new parameter.
message Unbonding {
int64 start = 1;
int64 end = 2;
cosmos.base.v1beta1.Coin uToken = 3 [(gogoproto.nullable) = false];
}

// AccountUnbondings is a structure that is used to store all of an account's unbondings
// for a single bonded uToken denom in both KVStore and genesis state.
message AccountUnbondings {
string account = 1;
string uToken = 2;
repeated Unbonding unbondings = 3 [(gogoproto.nullable) = false];
}
69 changes: 69 additions & 0 deletions proto/umee/incentive/v1/incentive.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
syntax = "proto3";
package umee.incentive.v1;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/umee-network/umee/v6/x/incentive";

// Params defines the parameters for the incentive module.
message Params {
option (gogoproto.equal) = true;

// max_unbondings is the maximum amount of concurrent unbondings an address can have
// of each bonded uToken denom. Zero is interpreted as no limit.
uint32 max_unbondings = 1;

// unbonding_duration is the unbonding duration (in seconds).
int64 unbonding_duration = 2;

// emergency_unbond_fee is the portion of a bond that is paid when it is instantly
// released using MsgEmergencyUnbond. For example, 0.01 is a 1% fee. Ranges 0-1.
string emergency_unbond_fee = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}

// IncentiveProgram defines a liquidity mining incentive program on a single
// locked uToken denom that will run for a set amount of time.
message IncentiveProgram {
option (gogoproto.equal) = true;

// ID uniquely identifies the incentive program after it has been created.
// It is zero when the program is being proposed by governance, and is set
// to its final value when the proposal passes.
uint32 ID = 1;

// start_time is the unix time (in seconds) at which the incentives begin.
// If a program is passed after its intended start time, its start time
// will be increased to the current time, with program duration unchanged.
int64 start_time = 2;

// duration is the length of the incentive program from start time to
// completion in seconds.
int64 duration = 3;

// uToken is the incentivized uToken collateral denom. Suppliers who collateralize
// this asset then bond it to the incentive module are eligible for this program's
// rewards.
string uToken = 4;

// funded indicates whether a program bas been funded. This can happen when
// a program passes if funding from community fund, or any time before the
// program's start time if funding with MsgSponsor. A program that reaches
// its start time without being funded is cancelled.
bool funded = 5;

// total_rewards are total amount of rewards which can be distributed to
// suppliers by this program. This is set to its final value when the program
// is proposed by governance.
cosmos.base.v1beta1.Coin total_rewards = 6 [(gogoproto.nullable) = false];

// remaining_rewards are total amount of this program's funded rewards
// which have not yet been allocated to suppliers. This is zero until the
// program is both passed by governance and funded, at which point it
// starts at the same value as total_rewards then begins decreasing
// to zero as the program runs to completion.
cosmos.base.v1beta1.Coin remaining_rewards = 7 [(gogoproto.nullable) = false];
}
Loading