From 61ccf48be93cc58bc6ab6bc84e6beec1dfc99b93 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Thu, 18 Aug 2022 11:44:22 +1200 Subject: [PATCH] chore: rebuild generated protobuf encoders/decoders --- core/package.json | 4 +- core/proto/sifnode/admin/v1/types.proto | 1 + core/proto/sifnode/clp/v1/README.md | 12 + core/proto/sifnode/clp/v1/genesis.proto | 1 + core/proto/sifnode/clp/v1/params.proto | 5 +- core/proto/sifnode/clp/v1/pool.proto | 65 + core/proto/sifnode/clp/v1/querier.proto | 1 + core/proto/sifnode/clp/v1/tx.proto | 9 + core/proto/sifnode/clp/v1/types.proto | 42 +- core/proto/sifnode/margin/v1/query.proto | 113 ++ core/proto/sifnode/margin/v1/tx.proto | 78 + core/proto/sifnode/margin/v1/types.proto | 112 ++ core/src/generated/proto/cosmos/base/coin.ts | 9 +- .../cosmos/base/query/v1beta1/pagination.ts | 51 +- core/src/generated/proto/gogoproto/gogo.ts | 8 - .../generated/proto/google/api/annotations.ts | 8 - core/src/generated/proto/google/api/http.ts | 9 +- .../proto/google/protobuf/descriptor.ts | 123 +- .../generated/proto/sifnode/admin/v1/query.ts | 11 +- .../generated/proto/sifnode/admin/v1/tx.ts | 11 +- .../generated/proto/sifnode/admin/v1/types.ts | 18 +- .../generated/proto/sifnode/clp/v1/genesis.ts | 14 +- .../generated/proto/sifnode/clp/v1/params.ts | 50 +- .../generated/proto/sifnode/clp/v1/pool.ts | 292 ++++ .../generated/proto/sifnode/clp/v1/querier.ts | 43 +- core/src/generated/proto/sifnode/clp/v1/tx.ts | 117 +- .../generated/proto/sifnode/clp/v1/types.ts | 267 ++- .../proto/sifnode/dispensation/v1/query.ts | 21 +- .../proto/sifnode/dispensation/v1/tx.ts | 15 +- .../proto/sifnode/dispensation/v1/types.ts | 21 +- .../proto/sifnode/ethbridge/v1/query.ts | 17 +- .../proto/sifnode/ethbridge/v1/tx.ts | 15 +- .../proto/sifnode/ethbridge/v1/types.ts | 16 +- .../proto/sifnode/margin/v1/query.ts | 1451 +++++++++++++++++ .../generated/proto/sifnode/margin/v1/tx.ts | 1062 ++++++++++++ .../proto/sifnode/margin/v1/types.ts | 714 ++++++++ .../proto/sifnode/oracle/v1/types.ts | 46 +- .../proto/sifnode/tokenregistry/v1/query.ts | 11 +- .../proto/sifnode/tokenregistry/v1/tx.ts | 14 +- .../proto/sifnode/tokenregistry/v1/types.ts | 14 +- yarn.lock | 10 +- 41 files changed, 4405 insertions(+), 496 deletions(-) create mode 100644 core/proto/sifnode/clp/v1/README.md create mode 100644 core/proto/sifnode/clp/v1/pool.proto create mode 100644 core/proto/sifnode/margin/v1/query.proto create mode 100644 core/proto/sifnode/margin/v1/tx.proto create mode 100644 core/proto/sifnode/margin/v1/types.proto create mode 100644 core/src/generated/proto/sifnode/clp/v1/pool.ts create mode 100644 core/src/generated/proto/sifnode/margin/v1/query.ts create mode 100644 core/src/generated/proto/sifnode/margin/v1/tx.ts create mode 100644 core/src/generated/proto/sifnode/margin/v1/types.ts diff --git a/core/package.json b/core/package.json index 4ea05add2..f411e07b7 100644 --- a/core/package.json +++ b/core/package.json @@ -15,7 +15,7 @@ "test": "yarn jest --passWithNoTests --collect-coverage --projects jest-unit.config.js", "test:integration": "yarn jest --projects --collect-coverage jest-integration.config.js", "syncProto": "rm -rf proto && degit Sifchain/sifnode/proto/sifnode#${TAG:-'develop'} proto/sifnode && degit Sifchain/sifnode/third_party/proto#${TAG:-'develop'} proto/third_party", - "codegen": "protoc -I=proto -I=proto/third_party proto/sifnode/**/*.proto --plugin=../node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=src/generated/proto --ts_proto_opt='esModuleInterop=true,forceLong=long,useOptionals=true'" + "codegen": "protoc -I=proto -I=proto/third_party proto/sifnode/**/**/*.proto --plugin=../node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=src/generated/proto --ts_proto_opt='esModuleInterop=true,forceLong=long,useOptionals=messages'" }, "files": [ "build" @@ -69,7 +69,7 @@ "jest-websocket-mock": "^2.3.0", "prettier": "^2.7.1", "pretty-quick": "^3.1.3", - "ts-proto": "^1.118.0", + "ts-proto": "^1.121.5", "typedoc": "^0.22.18", "typescript": "^4.7.4", "vite-compatible-readable-stream": "^3.6.1", diff --git a/core/proto/sifnode/admin/v1/types.proto b/core/proto/sifnode/admin/v1/types.proto index 33928f5a7..d77183194 100644 --- a/core/proto/sifnode/admin/v1/types.proto +++ b/core/proto/sifnode/admin/v1/types.proto @@ -14,6 +14,7 @@ enum AdminType { TOKENREGISTRY = 2; ETHBRIDGE = 3; ADMIN = 4; + MARGIN = 5; } message AdminAccount { diff --git a/core/proto/sifnode/clp/v1/README.md b/core/proto/sifnode/clp/v1/README.md new file mode 100644 index 000000000..01e80e9cc --- /dev/null +++ b/core/proto/sifnode/clp/v1/README.md @@ -0,0 +1,12 @@ +# pool.proto + +The Feature Toggle `FEATURE_TOGGLE_MARGIN_CLI_ALPHA` as described in `docs/general/FeatureToggles.md`, introduces additional fields to the `Pool` message that should not be exposed to the mainline. + +To avoid having those fields exposed in the mainline code, we generated two versions of the `pool.pb.go` file: + +- `pool_FEATURE_TOGGLE_MARGIN_CLI_ALPHA.pb.go`: generated protobuf code that contains the `FEATURE_TOGGLE_MARGIN_CLI_ALPHA` additional fields of the Pool message +- `pool_NO_FEATURE_TOGGLE_MARGIN_CLI_ALPHA.pb.go`: generated protobuf code that contains the original Pool message without the additional fields from `FEATURE_TOGGLE_MARGIN_CLI_ALPHA` + +Whenever the protobuf files need to be re-generated, we should make sure to include the relevant changes of the Pool message generated codes to one of those files. + +Also please make sure that the `pool.pb.go` file is not added and commited to the repository. diff --git a/core/proto/sifnode/clp/v1/genesis.proto b/core/proto/sifnode/clp/v1/genesis.proto index 57fea2a46..ac07d2af5 100644 --- a/core/proto/sifnode/clp/v1/genesis.proto +++ b/core/proto/sifnode/clp/v1/genesis.proto @@ -7,6 +7,7 @@ option go_package = "github.com/Sifchain/sifnode/x/clp/types"; import "sifnode/clp/v1/params.proto"; import "sifnode/clp/v1/types.proto"; +import "sifnode/clp/v1/pool.proto"; // GenesisState - all clp state that must be provided at genesis // TODO: Add parameters to Genesis state ,such as minimum liquidity required to diff --git a/core/proto/sifnode/clp/v1/params.proto b/core/proto/sifnode/clp/v1/params.proto index d518d65c8..d23d92631 100644 --- a/core/proto/sifnode/clp/v1/params.proto +++ b/core/proto/sifnode/clp/v1/params.proto @@ -6,7 +6,10 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/Sifchain/sifnode/x/clp/types"; // Params - used for initializing default parameter for clp at genesis -message Params { uint64 min_create_pool_threshold = 1; } +message Params { + uint64 min_create_pool_threshold = 1; + bool enable_removal_queue = 2; +} message RewardParams { uint64 liquidity_removal_lock_period = 1; // in blocks diff --git a/core/proto/sifnode/clp/v1/pool.proto b/core/proto/sifnode/clp/v1/pool.proto new file mode 100644 index 000000000..86122bba4 --- /dev/null +++ b/core/proto/sifnode/clp/v1/pool.proto @@ -0,0 +1,65 @@ + +syntax = "proto3"; +package sifnode.clp.v1; + +import "gogoproto/gogo.proto"; +import "sifnode/clp/v1/types.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/clp/types"; + +message Pool { + Asset external_asset = 1; + string native_asset_balance = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"native_asset_balance\"" + ]; + string external_asset_balance = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"external_asset_balance\"" + ]; + string pool_units = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"pool_units\"" + ]; + string swap_price_native = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"swap_price_native \"" + ]; + string swap_price_external = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"swap_price_external \"" + ]; + string reward_period_native_distributed = 7 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"reward_period_native_distributed\"" + ]; + string external_liabilities = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string external_custody = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string native_liabilities = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string native_custody = 11 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string health = 12 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + int64 last_height_interest_rate_computed = 14; +} \ No newline at end of file diff --git a/core/proto/sifnode/clp/v1/querier.proto b/core/proto/sifnode/clp/v1/querier.proto index 99f4f976b..1bed28e0e 100644 --- a/core/proto/sifnode/clp/v1/querier.proto +++ b/core/proto/sifnode/clp/v1/querier.proto @@ -3,6 +3,7 @@ package sifnode.clp.v1; import "gogoproto/gogo.proto"; import "sifnode/clp/v1/types.proto"; +import "sifnode/clp/v1/pool.proto"; import "sifnode/clp/v1/params.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "google/api/annotations.proto"; diff --git a/core/proto/sifnode/clp/v1/tx.proto b/core/proto/sifnode/clp/v1/tx.proto index de59100e2..a5ca4adfa 100644 --- a/core/proto/sifnode/clp/v1/tx.proto +++ b/core/proto/sifnode/clp/v1/tx.proto @@ -3,6 +3,7 @@ package sifnode.clp.v1; import "gogoproto/gogo.proto"; import "sifnode/clp/v1/types.proto"; +import "sifnode/clp/v1/pool.proto"; import "sifnode/clp/v1/params.proto"; option go_package = "github.com/Sifchain/sifnode/x/clp/types"; @@ -234,6 +235,14 @@ message MsgCancelUnlock { message MsgCancelUnlockResponse {} +message RemovalRequest { + int64 id = 1; + string value = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + MsgRemoveLiquidity msg = 3; +} message MsgModifyLiquidityProtectionRates { string signer = 1 [ (gogoproto.moretags) = "yaml:\"signer\"" ]; string current_rowan_liquidity_threshold = 2 [ diff --git a/core/proto/sifnode/clp/v1/types.proto b/core/proto/sifnode/clp/v1/types.proto index f16f114f5..222710fe5 100644 --- a/core/proto/sifnode/clp/v1/types.proto +++ b/core/proto/sifnode/clp/v1/types.proto @@ -8,38 +8,6 @@ option go_package = "github.com/Sifchain/sifnode/x/clp/types"; message Asset { string symbol = 1; } -message Pool { - Asset external_asset = 1; - string native_asset_balance = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"native_asset_balance\"" - ]; - string external_asset_balance = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"external_asset_balance\"" - ]; - string pool_units = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"pool_units\"" - ]; - string swap_price_native = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"swap_price_native \"" - ]; - string swap_price_external = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"swap_price_external \"" - ]; - string reward_period_native_distributed = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"reward_period_native_distributed\"" - ]; -} - message LiquidityProvider { Asset asset = 1; string liquidity_provider_units = 2 [ @@ -76,4 +44,14 @@ message EventPolicy { string event_type = 1; string pmtp_period_start_block = 2; string pmtp_period_end_block = 3; +} + +message RemovalQueue { + int64 count = 1; + int64 id = 2; + int64 start_height = 3; + string total_value = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; } \ No newline at end of file diff --git a/core/proto/sifnode/margin/v1/query.proto b/core/proto/sifnode/margin/v1/query.proto new file mode 100644 index 000000000..fc864ae9a --- /dev/null +++ b/core/proto/sifnode/margin/v1/query.proto @@ -0,0 +1,113 @@ +syntax = "proto3"; +package sifnode.margin.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "sifnode/margin/v1/types.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/margin/types"; + +service Query { + rpc GetMTP(MTPRequest) returns (MTPResponse) {} + rpc GetPositions(PositionsRequest) returns (PositionsResponse) { + option (google.api.http).get = "/sifchain/margin/v1/positions/{pagination.key}"; + } + rpc GetPositionsForAddress(PositionsForAddressRequest) + returns (PositionsForAddressResponse) { + option (google.api.http).get = "/sifchain/margin/v1/mtps-for-address/{address}/{pagination.key}"; + } + rpc GetPositionsByPool(PositionsByPoolRequest) returns (PositionsByPoolResponse) { + option (google.api.http).get = "/sifchain/margin/v1/mtps-by-pool/{asset}/{pagination.key}"; + } + rpc GetParams(ParamsRequest) returns (ParamsResponse) { + option (google.api.http).get = "/sifchain/margin/v1/params"; + } + rpc GetStatus(StatusRequest) returns (StatusResponse) { + option (google.api.http).get = "/sifchain/margin/v1/status"; + } + rpc GetSQParams(GetSQParamsRequest) returns (GetSQParamsResponse) {} + rpc GetWhitelist(WhitelistRequest) returns (WhitelistResponse) { + option (google.api.http).get = "/sifchain/margin/v1/whitelist"; + } + rpc IsWhitelisted(IsWhitelistedRequest) returns (IsWhitelistedResponse) { + option (google.api.http).get = "/sifchain/margin/v1/is-whitelisted"; + } +} + +message MTPRequest { + string address = 1; + uint64 id = 2; +} + +message MTPResponse { MTP mtp = 1; } + +message PositionsForAddressRequest { + string address = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message PositionsForAddressResponse { + repeated MTP mtps = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message PositionsByPoolRequest { + string asset = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message PositionsByPoolResponse { + repeated MTP mtps = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message PositionsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message PositionsResponse { + repeated MTP mtps = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message ParamsRequest {} + +message ParamsResponse { + Params params = 1; +} + +message StatusRequest { + +} + +message StatusResponse { + uint64 open_mtp_count = 1; + uint64 lifetime_mtp_count = 2; +} + +message WhitelistRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message WhitelistResponse { + repeated string whitelist = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message GetSQParamsRequest { + string pool = 1; +} + +message GetSQParamsResponse { + int64 begin_block = 1; +} + +message IsWhitelistedRequest { + string address = 1; +} + +message IsWhitelistedResponse { + string address = 1; + bool is_whitelisted = 2; +} \ No newline at end of file diff --git a/core/proto/sifnode/margin/v1/tx.proto b/core/proto/sifnode/margin/v1/tx.proto new file mode 100644 index 000000000..1d4e6d4a3 --- /dev/null +++ b/core/proto/sifnode/margin/v1/tx.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package sifnode.margin.v1; + +import "gogoproto/gogo.proto"; +import "sifnode/margin/v1/types.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/margin/types"; + +service Msg { + rpc Open(MsgOpen) returns (MsgOpenResponse) {} + rpc Close(MsgClose) returns (MsgCloseResponse) {} + rpc ForceClose(MsgForceClose) returns (MsgForceCloseResponse) {} + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {} + rpc UpdatePools(MsgUpdatePools) returns (MsgUpdatePoolsResponse) {} + rpc Whitelist(MsgWhitelist) returns (MsgWhitelistResponse) {} + rpc Dewhitelist(MsgDewhitelist) returns (MsgDewhitelistResponse) {} +} + +message MsgOpen { + string signer = 1; + string collateral_asset = 2; + string collateral_amount = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string borrow_asset = 4; + Position position = 5; + string leverage = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +message MsgOpenResponse {} + +message MsgClose { + string signer = 1; + uint64 id = 2; +} + +message MsgCloseResponse {} + +message MsgForceClose { + string signer = 1; + string mtp_address = 2; + uint64 id = 3; +} + +message MsgForceCloseResponse {} + +message MsgUpdateParams { + string signer = 1; + Params params = 2; +} + +message MsgUpdateParamsResponse {} + +message MsgUpdatePools { + string signer = 1; + repeated string pools = 2; + repeated string closed_pools = 3; +} + +message MsgUpdatePoolsResponse {} + +message MsgWhitelist { + string signer = 1; + string whitelisted_address = 2; +} + +message MsgWhitelistResponse {} + +message MsgDewhitelist { + string signer = 1; + string whitelisted_address = 2; +} + +message MsgDewhitelistResponse {} \ No newline at end of file diff --git a/core/proto/sifnode/margin/v1/types.proto b/core/proto/sifnode/margin/v1/types.proto new file mode 100644 index 000000000..6882d9d6d --- /dev/null +++ b/core/proto/sifnode/margin/v1/types.proto @@ -0,0 +1,112 @@ +syntax = "proto3"; +package sifnode.margin.v1; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/margin/types"; + +message GenesisState { Params params = 1; } + +message Params { + string leverage_max = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate_max = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate_min = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate_increase = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate_decrease = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string health_gain_factor = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + int64 epoch_length = 7; + repeated string pools = 8; + string force_close_threshold = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string removal_queue_threshold = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 max_open_positions = 11; + string pool_open_threshold = 12 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string force_close_fund_percentage = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string force_close_insurance_fund_address = 14; + string incremental_interest_payment_fund_percentage = 15 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string incremental_interest_payment_insurance_fund_address = 16; + string sq_modifier = 17 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string safety_factor = 18 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + repeated string closed_pools = 19; + bool incremental_interest_payment_enabled = 20; + bool whitelisting_enabled = 21; +} + +enum Position { + UNSPECIFIED = 0; + LONG = 1; + SHORT = 2; +} + +message MTP { + string address = 1; + string collateral_asset = 2; + string collateral_amount = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string liabilities = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string interest_paid = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string interest_unpaid = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string custody_asset = 7; + string custody_amount = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", + (gogoproto.nullable) = false + ]; + string leverage = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string mtp_health = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + Position position = 11; + uint64 id = 12; +} \ No newline at end of file diff --git a/core/src/generated/proto/cosmos/base/coin.ts b/core/src/generated/proto/cosmos/base/coin.ts index 661d0d6dd..96821a7f3 100644 --- a/core/src/generated/proto/cosmos/base/coin.ts +++ b/core/src/generated/proto/cosmos/base/coin.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.v1beta1"; @@ -283,10 +283,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/cosmos/base/query/v1beta1/pagination.ts b/core/src/generated/proto/cosmos/base/query/v1beta1/pagination.ts index 94cb60654..c2760e181 100644 --- a/core/src/generated/proto/cosmos/base/query/v1beta1/pagination.ts +++ b/core/src/generated/proto/cosmos/base/query/v1beta1/pagination.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.query.v1beta1"; @@ -121,10 +121,8 @@ export const PageRequest = { fromJSON(object: any): PageRequest { return { key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(), - offset: isSet(object.offset) - ? Long.fromString(object.offset) - : Long.UZERO, - limit: isSet(object.limit) ? Long.fromString(object.limit) : Long.UZERO, + offset: isSet(object.offset) ? Long.fromValue(object.offset) : Long.UZERO, + limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO, countTotal: isSet(object.countTotal) ? Boolean(object.countTotal) : false, }; }, @@ -205,7 +203,7 @@ export const PageResponse = { nextKey: isSet(object.nextKey) ? bytesFromBase64(object.nextKey) : new Uint8Array(), - total: isSet(object.total) ? Long.fromString(object.total) : Long.UZERO, + total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO, }; }, @@ -244,27 +242,29 @@ var globalThis: any = (() => { throw "Unable to locate global object"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + if (globalThis.Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return btoa(bin.join("")); + if (globalThis.Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } } type Builtin = @@ -291,10 +291,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/gogoproto/gogo.ts b/core/src/generated/proto/gogoproto/gogo.ts index 2d66a277c..3f41a047a 100644 --- a/core/src/generated/proto/gogoproto/gogo.ts +++ b/core/src/generated/proto/gogoproto/gogo.ts @@ -1,10 +1,2 @@ /* eslint-disable */ -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - export const protobufPackage = "gogoproto"; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/core/src/generated/proto/google/api/annotations.ts b/core/src/generated/proto/google/api/annotations.ts index 6e6ca0147..aace4787f 100644 --- a/core/src/generated/proto/google/api/annotations.ts +++ b/core/src/generated/proto/google/api/annotations.ts @@ -1,10 +1,2 @@ /* eslint-disable */ -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; - export const protobufPackage = "google.api"; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/core/src/generated/proto/google/api/http.ts b/core/src/generated/proto/google/api/http.ts index b455e03b5..6ab293d73 100644 --- a/core/src/generated/proto/google/api/http.ts +++ b/core/src/generated/proto/google/api/http.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.api"; @@ -625,10 +625,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/google/protobuf/descriptor.ts b/core/src/generated/proto/google/protobuf/descriptor.ts index b9290cfcc..578e982ce 100644 --- a/core/src/generated/proto/google/protobuf/descriptor.ts +++ b/core/src/generated/proto/google/protobuf/descriptor.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "google.protobuf"; @@ -118,6 +118,7 @@ export interface FieldDescriptorProto { * For booleans, "true" or "false". * For strings, contains the default text contents (not escaped in any way). * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? */ defaultValue: string; /** @@ -308,8 +309,9 @@ export function fieldDescriptorProto_TypeToJSON( return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -351,8 +353,9 @@ export function fieldDescriptorProto_LabelToJSON( return "LABEL_REQUIRED"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -434,18 +437,18 @@ export interface FileOptions { */ javaPackage: string; /** - * Controls the name of the wrapper Java class generated for the .proto file. - * That class will always contain the .proto file's getDescriptor() method as - * well as any top-level extensions defined in the .proto file. - * If java_multiple_files is disabled, then all the other classes from the - * .proto file will be nested inside the single wrapper outer class. + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). */ javaOuterClassname: string; /** - * If enabled, then the Java code generator will generate a separate .java + * If set true, then the Java code generator will generate a separate .java * file for each top-level message, enum, and service defined in the .proto - * file. Thus, these types will *not* be nested inside the wrapper class - * named by java_outer_classname. However, the wrapper class will still be + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be * generated to contain the file's getDescriptor() method as well as any * top-level extensions defined in the file. */ @@ -587,8 +590,9 @@ export function fileOptions_OptimizeModeToJSON( return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -714,20 +718,8 @@ export interface FieldOptions { * implementation must either *always* check its required fields, or *never* * check its required fields, regardless of whether or not the message has * been parsed. - * - * As of 2021, lazy does no correctness checks on the byte stream during - * parsing. This may lead to crashes if and when an invalid byte stream is - * finally parsed upon access. - * - * TODO(b/211906113): Enable validation on lazy fields. */ lazy: boolean; - /** - * unverified_lazy does no correctness checks on the byte stream. This should - * only be used where lazy with verification is prohibitive for performance - * reasons. - */ - unverifiedLazy: boolean; /** * Is this field deprecated? * Depending on the target platform, this can emit Deprecated annotations @@ -775,8 +767,9 @@ export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -816,8 +809,9 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -924,8 +918,9 @@ export function methodOptions_IdempotencyLevelToJSON( return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -955,8 +950,8 @@ export interface UninterpretedOption { * The name of the uninterpreted option. Each string represents a segment in * a dot-separated name. is_extension is true iff a segment represents an * extension (denoted with parentheses in options specs in .proto files). - * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - * "foo.(bar.baz).moo". + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". */ export interface UninterpretedOption_NamePart { namePart: string; @@ -1022,8 +1017,8 @@ export interface SourceCodeInfo_Location { * location. * * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition occurs. - * For example, this path: + * the root FileDescriptorProto to the place where the definition. For + * example, this path: * [ 4, 3, 2, 7, 1 ] * refers to: * file.message_type(3) // 4, 3 @@ -1079,13 +1074,13 @@ export interface SourceCodeInfo_Location { * // Comment attached to baz. * // Another line attached to baz. * - * // Comment attached to moo. + * // Comment attached to qux. * // - * // Another line attached to moo. - * optional double moo = 4; + * // Another line attached to qux. + * optional double qux = 4; * * // Detached comment for corge. This is not leading or trailing comments - * // to moo or corge because there are blank lines separating it from + * // to qux or corge because there are blank lines separating it from * // both. * * // Detached comment for corge paragraph 2. @@ -3159,7 +3154,6 @@ function createBaseFieldOptions(): FieldOptions { packed: false, jstype: 0, lazy: false, - unverifiedLazy: false, deprecated: false, weak: false, uninterpretedOption: [], @@ -3183,9 +3177,6 @@ export const FieldOptions = { if (message.lazy === true) { writer.uint32(40).bool(message.lazy); } - if (message.unverifiedLazy === true) { - writer.uint32(120).bool(message.unverifiedLazy); - } if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } @@ -3217,9 +3208,6 @@ export const FieldOptions = { case 5: message.lazy = reader.bool(); break; - case 15: - message.unverifiedLazy = reader.bool(); - break; case 3: message.deprecated = reader.bool(); break; @@ -3247,9 +3235,6 @@ export const FieldOptions = { ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, - unverifiedLazy: isSet(object.unverifiedLazy) - ? Boolean(object.unverifiedLazy) - : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, uninterpretedOption: Array.isArray(object?.uninterpretedOption) @@ -3268,8 +3253,6 @@ export const FieldOptions = { message.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); message.lazy !== undefined && (obj.lazy = message.lazy); - message.unverifiedLazy !== undefined && - (obj.unverifiedLazy = message.unverifiedLazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); if (message.uninterpretedOption) { @@ -3290,7 +3273,6 @@ export const FieldOptions = { message.packed = object.packed ?? false; message.jstype = object.jstype ?? 0; message.lazy = object.lazy ?? false; - message.unverifiedLazy = object.unverifiedLazy ?? false; message.deprecated = object.deprecated ?? false; message.weak = object.weak ?? false; message.uninterpretedOption = @@ -3796,10 +3778,10 @@ export const UninterpretedOption = { ? String(object.identifierValue) : "", positiveIntValue: isSet(object.positiveIntValue) - ? Long.fromString(object.positiveIntValue) + ? Long.fromValue(object.positiveIntValue) : Long.UZERO, negativeIntValue: isSet(object.negativeIntValue) - ? Long.fromString(object.negativeIntValue) + ? Long.fromValue(object.negativeIntValue) : Long.ZERO, doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0, stringValue: isSet(object.stringValue) @@ -4326,27 +4308,29 @@ var globalThis: any = (() => { throw "Unable to locate global object"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + if (globalThis.Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return btoa(bin.join("")); + if (globalThis.Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } } type Builtin = @@ -4373,10 +4357,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/admin/v1/query.ts b/core/src/generated/proto/sifnode/admin/v1/query.ts index 5a5c3f1ce..123d22fca 100644 --- a/core/src/generated/proto/sifnode/admin/v1/query.ts +++ b/core/src/generated/proto/sifnode/admin/v1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; -import { AdminAccount } from "../../../sifnode/admin/v1/types"; +import { AdminAccount } from "./types"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.admin.v1"; @@ -176,10 +176,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/admin/v1/tx.ts b/core/src/generated/proto/sifnode/admin/v1/tx.ts index 52dc9af6c..271e15e77 100644 --- a/core/src/generated/proto/sifnode/admin/v1/tx.ts +++ b/core/src/generated/proto/sifnode/admin/v1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ +import { AdminAccount } from "./types"; import Long from "long"; -import * as _m0 from "protobufjs/minimal"; -import { AdminAccount } from "../../../sifnode/admin/v1/types"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.admin.v1"; @@ -324,10 +324,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/admin/v1/types.ts b/core/src/generated/proto/sifnode/admin/v1/types.ts index 13ad5066f..451020603 100644 --- a/core/src/generated/proto/sifnode/admin/v1/types.ts +++ b/core/src/generated/proto/sifnode/admin/v1/types.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.admin.v1"; @@ -10,6 +10,7 @@ export enum AdminType { TOKENREGISTRY = 2, ETHBRIDGE = 3, ADMIN = 4, + MARGIN = 5, UNRECOGNIZED = -1, } @@ -30,6 +31,9 @@ export function adminTypeFromJSON(object: any): AdminType { case 4: case "ADMIN": return AdminType.ADMIN; + case 5: + case "MARGIN": + return AdminType.MARGIN; case -1: case "UNRECOGNIZED": default: @@ -49,8 +53,11 @@ export function adminTypeToJSON(object: AdminType): string { return "ETHBRIDGE"; case AdminType.ADMIN: return "ADMIN"; + case AdminType.MARGIN: + return "MARGIN"; + case AdminType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -221,10 +228,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/clp/v1/genesis.ts b/core/src/generated/proto/sifnode/clp/v1/genesis.ts index 74d15e2f1..2d5278c3f 100644 --- a/core/src/generated/proto/sifnode/clp/v1/genesis.ts +++ b/core/src/generated/proto/sifnode/clp/v1/genesis.ts @@ -1,8 +1,9 @@ /* eslint-disable */ +import { Params } from "./params"; import Long from "long"; -import * as _m0 from "protobufjs/minimal"; -import { Params } from "../../../sifnode/clp/v1/params"; -import { Pool, LiquidityProvider } from "../../../sifnode/clp/v1/types"; +import { Pool } from "./pool"; +import { LiquidityProvider } from "./types"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.clp.v1"; @@ -160,10 +161,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/clp/v1/params.ts b/core/src/generated/proto/sifnode/clp/v1/params.ts index b4ea50be0..4477c4906 100644 --- a/core/src/generated/proto/sifnode/clp/v1/params.ts +++ b/core/src/generated/proto/sifnode/clp/v1/params.ts @@ -1,12 +1,13 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.clp.v1"; /** Params - used for initializing default parameter for clp at genesis */ export interface Params { minCreatePoolThreshold: Long; + enableRemovalQueue: boolean; } export interface RewardParams { @@ -72,7 +73,7 @@ export interface ProviderDistributionParams { } function createBaseParams(): Params { - return { minCreatePoolThreshold: Long.UZERO }; + return { minCreatePoolThreshold: Long.UZERO, enableRemovalQueue: false }; } export const Params = { @@ -83,6 +84,9 @@ export const Params = { if (!message.minCreatePoolThreshold.isZero()) { writer.uint32(8).uint64(message.minCreatePoolThreshold); } + if (message.enableRemovalQueue === true) { + writer.uint32(16).bool(message.enableRemovalQueue); + } return writer; }, @@ -96,6 +100,9 @@ export const Params = { case 1: message.minCreatePoolThreshold = reader.uint64() as Long; break; + case 2: + message.enableRemovalQueue = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -107,8 +114,11 @@ export const Params = { fromJSON(object: any): Params { return { minCreatePoolThreshold: isSet(object.minCreatePoolThreshold) - ? Long.fromString(object.minCreatePoolThreshold) + ? Long.fromValue(object.minCreatePoolThreshold) : Long.UZERO, + enableRemovalQueue: isSet(object.enableRemovalQueue) + ? Boolean(object.enableRemovalQueue) + : false, }; }, @@ -118,6 +128,8 @@ export const Params = { (obj.minCreatePoolThreshold = ( message.minCreatePoolThreshold || Long.UZERO ).toString()); + message.enableRemovalQueue !== undefined && + (obj.enableRemovalQueue = message.enableRemovalQueue); return obj; }, @@ -128,6 +140,7 @@ export const Params = { object.minCreatePoolThreshold !== null ? Long.fromValue(object.minCreatePoolThreshold) : Long.UZERO; + message.enableRemovalQueue = object.enableRemovalQueue ?? false; return message; }, }; @@ -193,10 +206,10 @@ export const RewardParams = { fromJSON(object: any): RewardParams { return { liquidityRemovalLockPeriod: isSet(object.liquidityRemovalLockPeriod) - ? Long.fromString(object.liquidityRemovalLockPeriod) + ? Long.fromValue(object.liquidityRemovalLockPeriod) : Long.UZERO, liquidityRemovalCancelPeriod: isSet(object.liquidityRemovalCancelPeriod) - ? Long.fromString(object.liquidityRemovalCancelPeriod) + ? Long.fromValue(object.liquidityRemovalCancelPeriod) : Long.UZERO, rewardPeriods: Array.isArray(object?.rewardPeriods) ? object.rewardPeriods.map((e: any) => RewardPeriod.fromJSON(e)) @@ -397,13 +410,13 @@ export const PmtpParams = { ? String(object.pmtpPeriodGovernanceRate) : "", pmtpPeriodEpochLength: isSet(object.pmtpPeriodEpochLength) - ? Long.fromString(object.pmtpPeriodEpochLength) + ? Long.fromValue(object.pmtpPeriodEpochLength) : Long.ZERO, pmtpPeriodStartBlock: isSet(object.pmtpPeriodStartBlock) - ? Long.fromString(object.pmtpPeriodStartBlock) + ? Long.fromValue(object.pmtpPeriodStartBlock) : Long.ZERO, pmtpPeriodEndBlock: isSet(object.pmtpPeriodEndBlock) - ? Long.fromString(object.pmtpPeriodEndBlock) + ? Long.fromValue(object.pmtpPeriodEndBlock) : Long.ZERO, }; }, @@ -543,10 +556,10 @@ export const RewardPeriod = { ? String(object.rewardPeriodId) : "", rewardPeriodStartBlock: isSet(object.rewardPeriodStartBlock) - ? Long.fromString(object.rewardPeriodStartBlock) + ? Long.fromValue(object.rewardPeriodStartBlock) : Long.UZERO, rewardPeriodEndBlock: isSet(object.rewardPeriodEndBlock) - ? Long.fromString(object.rewardPeriodEndBlock) + ? Long.fromValue(object.rewardPeriodEndBlock) : Long.UZERO, rewardPeriodAllocation: isSet(object.rewardPeriodAllocation) ? String(object.rewardPeriodAllocation) @@ -565,7 +578,7 @@ export const RewardPeriod = { ? Boolean(object.rewardPeriodDistribute) : false, rewardPeriodMod: isSet(object.rewardPeriodMod) - ? Long.fromString(object.rewardPeriodMod) + ? Long.fromValue(object.rewardPeriodMod) : Long.UZERO, }; }, @@ -770,7 +783,7 @@ export const LiquidityProtectionParams = { ? String(object.maxRowanLiquidityThresholdAsset) : "", epochLength: isSet(object.epochLength) - ? Long.fromString(object.epochLength) + ? Long.fromValue(object.epochLength) : Long.UZERO, isActive: isSet(object.isActive) ? Boolean(object.isActive) : false, }; @@ -935,13 +948,13 @@ export const ProviderDistributionPeriod = { ? String(object.distributionPeriodBlockRate) : "", distributionPeriodStartBlock: isSet(object.distributionPeriodStartBlock) - ? Long.fromString(object.distributionPeriodStartBlock) + ? Long.fromValue(object.distributionPeriodStartBlock) : Long.UZERO, distributionPeriodEndBlock: isSet(object.distributionPeriodEndBlock) - ? Long.fromString(object.distributionPeriodEndBlock) + ? Long.fromValue(object.distributionPeriodEndBlock) : Long.UZERO, distributionPeriodMod: isSet(object.distributionPeriodMod) - ? Long.fromString(object.distributionPeriodMod) + ? Long.fromValue(object.distributionPeriodMod) : Long.UZERO, }; }, @@ -1086,10 +1099,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/clp/v1/pool.ts b/core/src/generated/proto/sifnode/clp/v1/pool.ts new file mode 100644 index 000000000..7a82ce7e8 --- /dev/null +++ b/core/src/generated/proto/sifnode/clp/v1/pool.ts @@ -0,0 +1,292 @@ +/* eslint-disable */ +import { Asset } from "./types"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "sifnode.clp.v1"; + +export interface Pool { + externalAsset?: Asset; + nativeAssetBalance: string; + externalAssetBalance: string; + poolUnits: string; + swapPriceNative: string; + swapPriceExternal: string; + rewardPeriodNativeDistributed: string; + externalLiabilities: string; + externalCustody: string; + nativeLiabilities: string; + nativeCustody: string; + health: string; + interestRate: string; + lastHeightInterestRateComputed: Long; +} + +function createBasePool(): Pool { + return { + externalAsset: undefined, + nativeAssetBalance: "", + externalAssetBalance: "", + poolUnits: "", + swapPriceNative: "", + swapPriceExternal: "", + rewardPeriodNativeDistributed: "", + externalLiabilities: "", + externalCustody: "", + nativeLiabilities: "", + nativeCustody: "", + health: "", + interestRate: "", + lastHeightInterestRateComputed: Long.ZERO, + }; +} + +export const Pool = { + encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.externalAsset !== undefined) { + Asset.encode(message.externalAsset, writer.uint32(10).fork()).ldelim(); + } + if (message.nativeAssetBalance !== "") { + writer.uint32(18).string(message.nativeAssetBalance); + } + if (message.externalAssetBalance !== "") { + writer.uint32(26).string(message.externalAssetBalance); + } + if (message.poolUnits !== "") { + writer.uint32(34).string(message.poolUnits); + } + if (message.swapPriceNative !== "") { + writer.uint32(42).string(message.swapPriceNative); + } + if (message.swapPriceExternal !== "") { + writer.uint32(50).string(message.swapPriceExternal); + } + if (message.rewardPeriodNativeDistributed !== "") { + writer.uint32(58).string(message.rewardPeriodNativeDistributed); + } + if (message.externalLiabilities !== "") { + writer.uint32(66).string(message.externalLiabilities); + } + if (message.externalCustody !== "") { + writer.uint32(74).string(message.externalCustody); + } + if (message.nativeLiabilities !== "") { + writer.uint32(82).string(message.nativeLiabilities); + } + if (message.nativeCustody !== "") { + writer.uint32(90).string(message.nativeCustody); + } + if (message.health !== "") { + writer.uint32(98).string(message.health); + } + if (message.interestRate !== "") { + writer.uint32(106).string(message.interestRate); + } + if (!message.lastHeightInterestRateComputed.isZero()) { + writer.uint32(112).int64(message.lastHeightInterestRateComputed); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Pool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.externalAsset = Asset.decode(reader, reader.uint32()); + break; + case 2: + message.nativeAssetBalance = reader.string(); + break; + case 3: + message.externalAssetBalance = reader.string(); + break; + case 4: + message.poolUnits = reader.string(); + break; + case 5: + message.swapPriceNative = reader.string(); + break; + case 6: + message.swapPriceExternal = reader.string(); + break; + case 7: + message.rewardPeriodNativeDistributed = reader.string(); + break; + case 8: + message.externalLiabilities = reader.string(); + break; + case 9: + message.externalCustody = reader.string(); + break; + case 10: + message.nativeLiabilities = reader.string(); + break; + case 11: + message.nativeCustody = reader.string(); + break; + case 12: + message.health = reader.string(); + break; + case 13: + message.interestRate = reader.string(); + break; + case 14: + message.lastHeightInterestRateComputed = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Pool { + return { + externalAsset: isSet(object.externalAsset) + ? Asset.fromJSON(object.externalAsset) + : undefined, + nativeAssetBalance: isSet(object.nativeAssetBalance) + ? String(object.nativeAssetBalance) + : "", + externalAssetBalance: isSet(object.externalAssetBalance) + ? String(object.externalAssetBalance) + : "", + poolUnits: isSet(object.poolUnits) ? String(object.poolUnits) : "", + swapPriceNative: isSet(object.swapPriceNative) + ? String(object.swapPriceNative) + : "", + swapPriceExternal: isSet(object.swapPriceExternal) + ? String(object.swapPriceExternal) + : "", + rewardPeriodNativeDistributed: isSet(object.rewardPeriodNativeDistributed) + ? String(object.rewardPeriodNativeDistributed) + : "", + externalLiabilities: isSet(object.externalLiabilities) + ? String(object.externalLiabilities) + : "", + externalCustody: isSet(object.externalCustody) + ? String(object.externalCustody) + : "", + nativeLiabilities: isSet(object.nativeLiabilities) + ? String(object.nativeLiabilities) + : "", + nativeCustody: isSet(object.nativeCustody) + ? String(object.nativeCustody) + : "", + health: isSet(object.health) ? String(object.health) : "", + interestRate: isSet(object.interestRate) + ? String(object.interestRate) + : "", + lastHeightInterestRateComputed: isSet( + object.lastHeightInterestRateComputed, + ) + ? Long.fromValue(object.lastHeightInterestRateComputed) + : Long.ZERO, + }; + }, + + toJSON(message: Pool): unknown { + const obj: any = {}; + message.externalAsset !== undefined && + (obj.externalAsset = message.externalAsset + ? Asset.toJSON(message.externalAsset) + : undefined); + message.nativeAssetBalance !== undefined && + (obj.nativeAssetBalance = message.nativeAssetBalance); + message.externalAssetBalance !== undefined && + (obj.externalAssetBalance = message.externalAssetBalance); + message.poolUnits !== undefined && (obj.poolUnits = message.poolUnits); + message.swapPriceNative !== undefined && + (obj.swapPriceNative = message.swapPriceNative); + message.swapPriceExternal !== undefined && + (obj.swapPriceExternal = message.swapPriceExternal); + message.rewardPeriodNativeDistributed !== undefined && + (obj.rewardPeriodNativeDistributed = + message.rewardPeriodNativeDistributed); + message.externalLiabilities !== undefined && + (obj.externalLiabilities = message.externalLiabilities); + message.externalCustody !== undefined && + (obj.externalCustody = message.externalCustody); + message.nativeLiabilities !== undefined && + (obj.nativeLiabilities = message.nativeLiabilities); + message.nativeCustody !== undefined && + (obj.nativeCustody = message.nativeCustody); + message.health !== undefined && (obj.health = message.health); + message.interestRate !== undefined && + (obj.interestRate = message.interestRate); + message.lastHeightInterestRateComputed !== undefined && + (obj.lastHeightInterestRateComputed = ( + message.lastHeightInterestRateComputed || Long.ZERO + ).toString()); + return obj; + }, + + fromPartial, I>>(object: I): Pool { + const message = createBasePool(); + message.externalAsset = + object.externalAsset !== undefined && object.externalAsset !== null + ? Asset.fromPartial(object.externalAsset) + : undefined; + message.nativeAssetBalance = object.nativeAssetBalance ?? ""; + message.externalAssetBalance = object.externalAssetBalance ?? ""; + message.poolUnits = object.poolUnits ?? ""; + message.swapPriceNative = object.swapPriceNative ?? ""; + message.swapPriceExternal = object.swapPriceExternal ?? ""; + message.rewardPeriodNativeDistributed = + object.rewardPeriodNativeDistributed ?? ""; + message.externalLiabilities = object.externalLiabilities ?? ""; + message.externalCustody = object.externalCustody ?? ""; + message.nativeLiabilities = object.nativeLiabilities ?? ""; + message.nativeCustody = object.nativeCustody ?? ""; + message.health = object.health ?? ""; + message.interestRate = object.interestRate ?? ""; + message.lastHeightInterestRateComputed = + object.lastHeightInterestRateComputed !== undefined && + object.lastHeightInterestRateComputed !== null + ? Long.fromValue(object.lastHeightInterestRateComputed) + : Long.ZERO; + return message; + }, +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? 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; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/core/src/generated/proto/sifnode/clp/v1/querier.ts b/core/src/generated/proto/sifnode/clp/v1/querier.ts index 055f50d15..defb5c119 100644 --- a/core/src/generated/proto/sifnode/clp/v1/querier.ts +++ b/core/src/generated/proto/sifnode/clp/v1/querier.ts @@ -1,17 +1,15 @@ /* eslint-disable */ -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import { Pool } from "./pool"; +import { + PageRequest, + PageResponse, +} from "../../../cosmos/base/query/v1beta1/pagination"; import { - Pool, LiquidityProvider, PmtpEpoch, Asset, LiquidityProviderData, -} from "../../../sifnode/clp/v1/types"; -import { - PageRequest, - PageResponse, -} from "../../../cosmos/base/query/v1beta1/pagination"; +} from "./types"; import { Params, RewardParams, @@ -20,7 +18,9 @@ import { LiquidityProtectionParams, LiquidityProtectionRateParams, ProviderDistributionParams, -} from "../../../sifnode/clp/v1/params"; +} from "./params"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.clp.v1"; @@ -242,7 +242,7 @@ export const PoolRes = { clpModuleAddress: isSet(object.clpModuleAddress) ? String(object.clpModuleAddress) : "", - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, }; }, @@ -399,7 +399,7 @@ export const PoolsRes = { clpModuleAddress: isSet(object.clpModuleAddress) ? String(object.clpModuleAddress) : "", - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, @@ -582,7 +582,7 @@ export const LiquidityProviderRes = { externalAssetBalance: isSet(object.externalAssetBalance) ? String(object.externalAssetBalance) : "", - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, }; }, @@ -744,7 +744,7 @@ export const AssetListRes = { assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => Asset.fromJSON(e)) : [], - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, @@ -919,7 +919,7 @@ export const LiquidityProviderDataRes = { LiquidityProviderData.fromJSON(e), ) : [], - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, @@ -1098,7 +1098,7 @@ export const LiquidityProviderListRes = { LiquidityProvider.fromJSON(e), ) : [], - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, @@ -1267,7 +1267,7 @@ export const LiquidityProvidersRes = { LiquidityProvider.fromJSON(e), ) : [], - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, @@ -1659,7 +1659,7 @@ export const PmtpParamsRes = { pmtpEpoch: isSet(object.pmtpEpoch) ? PmtpEpoch.fromJSON(object.pmtpEpoch) : undefined, - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, }; }, @@ -1821,7 +1821,7 @@ export const LiquidityProtectionParamsRes = { rateParams: isSet(object.rateParams) ? LiquidityProtectionRateParams.fromJSON(object.rateParams) : undefined, - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, }; }, @@ -2189,10 +2189,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/clp/v1/tx.ts b/core/src/generated/proto/sifnode/clp/v1/tx.ts index 1984233ff..7b611df4d 100644 --- a/core/src/generated/proto/sifnode/clp/v1/tx.ts +++ b/core/src/generated/proto/sifnode/clp/v1/tx.ts @@ -1,11 +1,8 @@ /* eslint-disable */ +import { Asset } from "./types"; import Long from "long"; -import * as _m0 from "protobufjs/minimal"; -import { Asset } from "../../../sifnode/clp/v1/types"; -import { - RewardPeriod, - ProviderDistributionPeriod, -} from "../../../sifnode/clp/v1/params"; +import { RewardPeriod, ProviderDistributionPeriod } from "./params"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.clp.v1"; @@ -129,6 +126,12 @@ export interface MsgCancelUnlock { export interface MsgCancelUnlockResponse {} +export interface RemovalRequest { + id: Long; + value: string; + msg?: MsgRemoveLiquidity; +} + export interface MsgModifyLiquidityProtectionRates { signer: string; currentRowanLiquidityThreshold: string; @@ -1045,13 +1048,13 @@ export const MsgUpdatePmtpParams = { ? String(object.pmtpPeriodGovernanceRate) : "", pmtpPeriodEpochLength: isSet(object.pmtpPeriodEpochLength) - ? Long.fromString(object.pmtpPeriodEpochLength) + ? Long.fromValue(object.pmtpPeriodEpochLength) : Long.ZERO, pmtpPeriodStartBlock: isSet(object.pmtpPeriodStartBlock) - ? Long.fromString(object.pmtpPeriodStartBlock) + ? Long.fromValue(object.pmtpPeriodStartBlock) : Long.ZERO, pmtpPeriodEndBlock: isSet(object.pmtpPeriodEndBlock) - ? Long.fromString(object.pmtpPeriodEndBlock) + ? Long.fromValue(object.pmtpPeriodEndBlock) : Long.ZERO, }; }, @@ -1601,10 +1604,10 @@ export const MsgUpdateRewardsParamsRequest = { return { signer: isSet(object.signer) ? String(object.signer) : "", liquidityRemovalLockPeriod: isSet(object.liquidityRemovalLockPeriod) - ? Long.fromString(object.liquidityRemovalLockPeriod) + ? Long.fromValue(object.liquidityRemovalLockPeriod) : Long.UZERO, liquidityRemovalCancelPeriod: isSet(object.liquidityRemovalCancelPeriod) - ? Long.fromString(object.liquidityRemovalCancelPeriod) + ? Long.fromValue(object.liquidityRemovalCancelPeriod) : Long.UZERO, }; }, @@ -2062,6 +2065,89 @@ export const MsgCancelUnlockResponse = { }, }; +function createBaseRemovalRequest(): RemovalRequest { + return { id: Long.ZERO, value: "", msg: undefined }; +} + +export const RemovalRequest = { + encode( + message: RemovalRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (!message.id.isZero()) { + writer.uint32(8).int64(message.id); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + if (message.msg !== undefined) { + MsgRemoveLiquidity.encode(message.msg, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RemovalRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRemovalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.int64() as Long; + break; + case 2: + message.value = reader.string(); + break; + case 3: + message.msg = MsgRemoveLiquidity.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RemovalRequest { + return { + id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO, + value: isSet(object.value) ? String(object.value) : "", + msg: isSet(object.msg) + ? MsgRemoveLiquidity.fromJSON(object.msg) + : undefined, + }; + }, + + toJSON(message: RemovalRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = (message.id || Long.ZERO).toString()); + message.value !== undefined && (obj.value = message.value); + message.msg !== undefined && + (obj.msg = message.msg + ? MsgRemoveLiquidity.toJSON(message.msg) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): RemovalRequest { + const message = createBaseRemovalRequest(); + message.id = + object.id !== undefined && object.id !== null + ? Long.fromValue(object.id) + : Long.ZERO; + message.value = object.value ?? ""; + message.msg = + object.msg !== undefined && object.msg !== null + ? MsgRemoveLiquidity.fromPartial(object.msg) + : undefined; + return message; + }, +}; + function createBaseMsgModifyLiquidityProtectionRates(): MsgModifyLiquidityProtectionRates { return { signer: "", currentRowanLiquidityThreshold: "" }; } @@ -2260,7 +2346,7 @@ export const MsgUpdateLiquidityProtectionParams = { ? String(object.maxRowanLiquidityThresholdAsset) : "", epochLength: isSet(object.epochLength) - ? Long.fromString(object.epochLength) + ? Long.fromValue(object.epochLength) : Long.UZERO, isActive: isSet(object.isActive) ? Boolean(object.isActive) : false, }; @@ -2802,10 +2888,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/clp/v1/types.ts b/core/src/generated/proto/sifnode/clp/v1/types.ts index 4bc20439b..ceff5b8eb 100644 --- a/core/src/generated/proto/sifnode/clp/v1/types.ts +++ b/core/src/generated/proto/sifnode/clp/v1/types.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.clp.v1"; @@ -8,16 +8,6 @@ export interface Asset { symbol: string; } -export interface Pool { - externalAsset?: Asset; - nativeAssetBalance: string; - externalAssetBalance: string; - poolUnits: string; - swapPriceNative: string; - swapPriceExternal: string; - rewardPeriodNativeDistributed: string; -} - export interface LiquidityProvider { asset?: Asset; liquidityProviderUnits: string; @@ -51,6 +41,13 @@ export interface EventPolicy { pmtpPeriodEndBlock: string; } +export interface RemovalQueue { + count: Long; + id: Long; + startHeight: Long; + totalValue: string; +} + function createBaseAsset(): Asset { return { symbol: "" }; } @@ -100,142 +97,6 @@ export const Asset = { }, }; -function createBasePool(): Pool { - return { - externalAsset: undefined, - nativeAssetBalance: "", - externalAssetBalance: "", - poolUnits: "", - swapPriceNative: "", - swapPriceExternal: "", - rewardPeriodNativeDistributed: "", - }; -} - -export const Pool = { - encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.externalAsset !== undefined) { - Asset.encode(message.externalAsset, writer.uint32(10).fork()).ldelim(); - } - if (message.nativeAssetBalance !== "") { - writer.uint32(18).string(message.nativeAssetBalance); - } - if (message.externalAssetBalance !== "") { - writer.uint32(26).string(message.externalAssetBalance); - } - if (message.poolUnits !== "") { - writer.uint32(34).string(message.poolUnits); - } - if (message.swapPriceNative !== "") { - writer.uint32(42).string(message.swapPriceNative); - } - if (message.swapPriceExternal !== "") { - writer.uint32(50).string(message.swapPriceExternal); - } - if (message.rewardPeriodNativeDistributed !== "") { - writer.uint32(58).string(message.rewardPeriodNativeDistributed); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Pool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePool(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.externalAsset = Asset.decode(reader, reader.uint32()); - break; - case 2: - message.nativeAssetBalance = reader.string(); - break; - case 3: - message.externalAssetBalance = reader.string(); - break; - case 4: - message.poolUnits = reader.string(); - break; - case 5: - message.swapPriceNative = reader.string(); - break; - case 6: - message.swapPriceExternal = reader.string(); - break; - case 7: - message.rewardPeriodNativeDistributed = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): Pool { - return { - externalAsset: isSet(object.externalAsset) - ? Asset.fromJSON(object.externalAsset) - : undefined, - nativeAssetBalance: isSet(object.nativeAssetBalance) - ? String(object.nativeAssetBalance) - : "", - externalAssetBalance: isSet(object.externalAssetBalance) - ? String(object.externalAssetBalance) - : "", - poolUnits: isSet(object.poolUnits) ? String(object.poolUnits) : "", - swapPriceNative: isSet(object.swapPriceNative) - ? String(object.swapPriceNative) - : "", - swapPriceExternal: isSet(object.swapPriceExternal) - ? String(object.swapPriceExternal) - : "", - rewardPeriodNativeDistributed: isSet(object.rewardPeriodNativeDistributed) - ? String(object.rewardPeriodNativeDistributed) - : "", - }; - }, - - toJSON(message: Pool): unknown { - const obj: any = {}; - message.externalAsset !== undefined && - (obj.externalAsset = message.externalAsset - ? Asset.toJSON(message.externalAsset) - : undefined); - message.nativeAssetBalance !== undefined && - (obj.nativeAssetBalance = message.nativeAssetBalance); - message.externalAssetBalance !== undefined && - (obj.externalAssetBalance = message.externalAssetBalance); - message.poolUnits !== undefined && (obj.poolUnits = message.poolUnits); - message.swapPriceNative !== undefined && - (obj.swapPriceNative = message.swapPriceNative); - message.swapPriceExternal !== undefined && - (obj.swapPriceExternal = message.swapPriceExternal); - message.rewardPeriodNativeDistributed !== undefined && - (obj.rewardPeriodNativeDistributed = - message.rewardPeriodNativeDistributed); - return obj; - }, - - fromPartial, I>>(object: I): Pool { - const message = createBasePool(); - message.externalAsset = - object.externalAsset !== undefined && object.externalAsset !== null - ? Asset.fromPartial(object.externalAsset) - : undefined; - message.nativeAssetBalance = object.nativeAssetBalance ?? ""; - message.externalAssetBalance = object.externalAssetBalance ?? ""; - message.poolUnits = object.poolUnits ?? ""; - message.swapPriceNative = object.swapPriceNative ?? ""; - message.swapPriceExternal = object.swapPriceExternal ?? ""; - message.rewardPeriodNativeDistributed = - object.rewardPeriodNativeDistributed ?? ""; - return message; - }, -}; - function createBaseLiquidityProvider(): LiquidityProvider { return { asset: undefined, @@ -383,7 +244,7 @@ export const LiquidityUnlock = { fromJSON(object: any): LiquidityUnlock { return { requestHeight: isSet(object.requestHeight) - ? Long.fromString(object.requestHeight) + ? Long.fromValue(object.requestHeight) : Long.ZERO, units: isSet(object.units) ? String(object.units) : "", }; @@ -452,10 +313,10 @@ export const PmtpEpoch = { fromJSON(object: any): PmtpEpoch { return { epochCounter: isSet(object.epochCounter) - ? Long.fromString(object.epochCounter) + ? Long.fromValue(object.epochCounter) : Long.ZERO, blockCounter: isSet(object.blockCounter) - ? Long.fromString(object.blockCounter) + ? Long.fromValue(object.blockCounter) : Long.ZERO, }; }, @@ -723,6 +584,105 @@ export const EventPolicy = { }, }; +function createBaseRemovalQueue(): RemovalQueue { + return { + count: Long.ZERO, + id: Long.ZERO, + startHeight: Long.ZERO, + totalValue: "", + }; +} + +export const RemovalQueue = { + encode( + message: RemovalQueue, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (!message.count.isZero()) { + writer.uint32(8).int64(message.count); + } + if (!message.id.isZero()) { + writer.uint32(16).int64(message.id); + } + if (!message.startHeight.isZero()) { + writer.uint32(24).int64(message.startHeight); + } + if (message.totalValue !== "") { + writer.uint32(34).string(message.totalValue); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RemovalQueue { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRemovalQueue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = reader.int64() as Long; + break; + case 2: + message.id = reader.int64() as Long; + break; + case 3: + message.startHeight = reader.int64() as Long; + break; + case 4: + message.totalValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RemovalQueue { + return { + count: isSet(object.count) ? Long.fromValue(object.count) : Long.ZERO, + id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO, + startHeight: isSet(object.startHeight) + ? Long.fromValue(object.startHeight) + : Long.ZERO, + totalValue: isSet(object.totalValue) ? String(object.totalValue) : "", + }; + }, + + toJSON(message: RemovalQueue): unknown { + const obj: any = {}; + message.count !== undefined && + (obj.count = (message.count || Long.ZERO).toString()); + message.id !== undefined && (obj.id = (message.id || Long.ZERO).toString()); + message.startHeight !== undefined && + (obj.startHeight = (message.startHeight || Long.ZERO).toString()); + message.totalValue !== undefined && (obj.totalValue = message.totalValue); + return obj; + }, + + fromPartial, I>>( + object: I, + ): RemovalQueue { + const message = createBaseRemovalQueue(); + message.count = + object.count !== undefined && object.count !== null + ? Long.fromValue(object.count) + : Long.ZERO; + message.id = + object.id !== undefined && object.id !== null + ? Long.fromValue(object.id) + : Long.ZERO; + message.startHeight = + object.startHeight !== undefined && object.startHeight !== null + ? Long.fromValue(object.startHeight) + : Long.ZERO; + message.totalValue = object.totalValue ?? ""; + return message; + }, +}; + type Builtin = | Date | Function @@ -747,10 +707,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/dispensation/v1/query.ts b/core/src/generated/proto/sifnode/dispensation/v1/query.ts index d29898d37..d749a2c4d 100644 --- a/core/src/generated/proto/sifnode/dispensation/v1/query.ts +++ b/core/src/generated/proto/sifnode/dispensation/v1/query.ts @@ -1,6 +1,4 @@ /* eslint-disable */ -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; import { DistributionStatus, DistributionRecords, @@ -11,7 +9,9 @@ import { distributionStatusToJSON, distributionTypeFromJSON, distributionTypeToJSON, -} from "../../../sifnode/dispensation/v1/types"; +} from "./types"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.dispensation.v1"; @@ -146,7 +146,7 @@ export const QueryAllDistributionsResponse = { distributions: Array.isArray(object?.distributions) ? object.distributions.map((e: any) => Distribution.fromJSON(e)) : [], - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, }; }, @@ -303,7 +303,7 @@ export const QueryRecordsByDistributionNameResponse = { distributionRecords: isSet(object.distributionRecords) ? DistributionRecords.fromJSON(object.distributionRecords) : undefined, - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, }; }, @@ -445,7 +445,7 @@ export const QueryRecordsByRecipientAddrResponse = { distributionRecords: isSet(object.distributionRecords) ? DistributionRecords.fromJSON(object.distributionRecords) : undefined, - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, }; }, @@ -581,7 +581,7 @@ export const QueryClaimsResponse = { claims: Array.isArray(object?.claims) ? object.claims.map((e: any) => UserClaim.fromJSON(e)) : [], - height: isSet(object.height) ? Long.fromString(object.height) : Long.ZERO, + height: isSet(object.height) ? Long.fromValue(object.height) : Long.ZERO, }; }, @@ -723,10 +723,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/dispensation/v1/tx.ts b/core/src/generated/proto/sifnode/dispensation/v1/tx.ts index fe9839c2b..5e938fc52 100644 --- a/core/src/generated/proto/sifnode/dispensation/v1/tx.ts +++ b/core/src/generated/proto/sifnode/dispensation/v1/tx.ts @@ -1,11 +1,11 @@ /* eslint-disable */ -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; import { DistributionType, distributionTypeFromJSON, distributionTypeToJSON, -} from "../../../sifnode/dispensation/v1/types"; +} from "./types"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.dispensation.v1"; @@ -414,7 +414,7 @@ export const MsgRunDistribution = { ? distributionTypeFromJSON(object.distributionType) : 0, distributionCount: isSet(object.distributionCount) - ? Long.fromString(object.distributionCount) + ? Long.fromValue(object.distributionCount) : Long.ZERO, }; }, @@ -543,10 +543,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/dispensation/v1/types.ts b/core/src/generated/proto/sifnode/dispensation/v1/types.ts index 24b45868c..d02862511 100644 --- a/core/src/generated/proto/sifnode/dispensation/v1/types.ts +++ b/core/src/generated/proto/sifnode/dispensation/v1/types.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import Long from "long"; -import * as _m0 from "protobufjs/minimal"; import { Coin } from "../../../cosmos/base/coin"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.dispensation.v1"; @@ -49,8 +49,9 @@ export function distributionTypeToJSON(object: DistributionType): string { return "DISTRIBUTION_TYPE_VALIDATOR_SUBSIDY"; case DistributionType.DISTRIBUTION_TYPE_LIQUIDITY_MINING: return "DISTRIBUTION_TYPE_LIQUIDITY_MINING"; + case DistributionType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -98,8 +99,9 @@ export function distributionStatusToJSON(object: DistributionStatus): string { return "DISTRIBUTION_STATUS_COMPLETED"; case DistributionStatus.DISTRIBUTION_STATUS_FAILED: return "DISTRIBUTION_STATUS_FAILED"; + case DistributionStatus.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -360,10 +362,10 @@ export const DistributionRecord = { ? object.coins.map((e: any) => Coin.fromJSON(e)) : [], distributionStartHeight: isSet(object.distributionStartHeight) - ? Long.fromString(object.distributionStartHeight) + ? Long.fromValue(object.distributionStartHeight) : Long.ZERO, distributionCompletedHeight: isSet(object.distributionCompletedHeight) - ? Long.fromString(object.distributionCompletedHeight) + ? Long.fromValue(object.distributionCompletedHeight) : Long.ZERO, authorizedRunner: isSet(object.authorizedRunner) ? String(object.authorizedRunner) @@ -865,10 +867,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/ethbridge/v1/query.ts b/core/src/generated/proto/sifnode/ethbridge/v1/query.ts index e7566314f..b41252bee 100644 --- a/core/src/generated/proto/sifnode/ethbridge/v1/query.ts +++ b/core/src/generated/proto/sifnode/ethbridge/v1/query.ts @@ -1,8 +1,8 @@ /* eslint-disable */ +import { Status } from "../../oracle/v1/types"; import Long from "long"; -import * as _m0 from "protobufjs/minimal"; -import { Status } from "../../../sifnode/oracle/v1/types"; -import { EthBridgeClaim } from "../../../sifnode/ethbridge/v1/types"; +import { EthBridgeClaim } from "./types"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.ethbridge.v1"; @@ -108,12 +108,12 @@ export const QueryEthProphecyRequest = { fromJSON(object: any): QueryEthProphecyRequest { return { ethereumChainId: isSet(object.ethereumChainId) - ? Long.fromString(object.ethereumChainId) + ? Long.fromValue(object.ethereumChainId) : Long.ZERO, bridgeContractAddress: isSet(object.bridgeContractAddress) ? String(object.bridgeContractAddress) : "", - nonce: isSet(object.nonce) ? Long.fromString(object.nonce) : Long.ZERO, + nonce: isSet(object.nonce) ? Long.fromValue(object.nonce) : Long.ZERO, symbol: isSet(object.symbol) ? String(object.symbol) : "", tokenContractAddress: isSet(object.tokenContractAddress) ? String(object.tokenContractAddress) @@ -435,10 +435,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/ethbridge/v1/tx.ts b/core/src/generated/proto/sifnode/ethbridge/v1/tx.ts index b8d2f2f7f..0289100d8 100644 --- a/core/src/generated/proto/sifnode/ethbridge/v1/tx.ts +++ b/core/src/generated/proto/sifnode/ethbridge/v1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ +import { EthBridgeClaim } from "./types"; import Long from "long"; -import * as _m0 from "protobufjs/minimal"; -import { EthBridgeClaim } from "../../../sifnode/ethbridge/v1/types"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.ethbridge.v1"; @@ -144,7 +144,7 @@ export const MsgLock = { amount: isSet(object.amount) ? String(object.amount) : "", symbol: isSet(object.symbol) ? String(object.symbol) : "", ethereumChainId: isSet(object.ethereumChainId) - ? Long.fromString(object.ethereumChainId) + ? Long.fromValue(object.ethereumChainId) : Long.ZERO, ethereumReceiver: isSet(object.ethereumReceiver) ? String(object.ethereumReceiver) @@ -304,7 +304,7 @@ export const MsgBurn = { amount: isSet(object.amount) ? String(object.amount) : "", symbol: isSet(object.symbol) ? String(object.symbol) : "", ethereumChainId: isSet(object.ethereumChainId) - ? Long.fromString(object.ethereumChainId) + ? Long.fromValue(object.ethereumChainId) : Long.ZERO, ethereumReceiver: isSet(object.ethereumReceiver) ? String(object.ethereumReceiver) @@ -1132,10 +1132,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/ethbridge/v1/types.ts b/core/src/generated/proto/sifnode/ethbridge/v1/types.ts index f3d3f5b23..5efc74ab6 100644 --- a/core/src/generated/proto/sifnode/ethbridge/v1/types.ts +++ b/core/src/generated/proto/sifnode/ethbridge/v1/types.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.ethbridge.v1"; @@ -41,8 +41,9 @@ export function claimTypeToJSON(object: ClaimType): string { return "CLAIM_TYPE_BURN"; case ClaimType.CLAIM_TYPE_LOCK: return "CLAIM_TYPE_LOCK"; + case ClaimType.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -179,12 +180,12 @@ export const EthBridgeClaim = { fromJSON(object: any): EthBridgeClaim { return { ethereumChainId: isSet(object.ethereumChainId) - ? Long.fromString(object.ethereumChainId) + ? Long.fromValue(object.ethereumChainId) : Long.ZERO, bridgeContractAddress: isSet(object.bridgeContractAddress) ? String(object.bridgeContractAddress) : "", - nonce: isSet(object.nonce) ? Long.fromString(object.nonce) : Long.ZERO, + nonce: isSet(object.nonce) ? Long.fromValue(object.nonce) : Long.ZERO, symbol: isSet(object.symbol) ? String(object.symbol) : "", tokenContractAddress: isSet(object.tokenContractAddress) ? String(object.tokenContractAddress) @@ -408,10 +409,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/margin/v1/query.ts b/core/src/generated/proto/sifnode/margin/v1/query.ts new file mode 100644 index 000000000..9d152e362 --- /dev/null +++ b/core/src/generated/proto/sifnode/margin/v1/query.ts @@ -0,0 +1,1451 @@ +/* eslint-disable */ +import { MTP, Params } from "./types"; +import { + PageRequest, + PageResponse, +} from "../../../cosmos/base/query/v1beta1/pagination"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "sifnode.margin.v1"; + +export interface MTPRequest { + address: string; + id: Long; +} + +export interface MTPResponse { + mtp?: MTP; +} + +export interface PositionsForAddressRequest { + address: string; + pagination?: PageRequest; +} + +export interface PositionsForAddressResponse { + mtps: MTP[]; + pagination?: PageResponse; +} + +export interface PositionsByPoolRequest { + asset: string; + pagination?: PageRequest; +} + +export interface PositionsByPoolResponse { + mtps: MTP[]; + pagination?: PageResponse; +} + +export interface PositionsRequest { + pagination?: PageRequest; +} + +export interface PositionsResponse { + mtps: MTP[]; + pagination?: PageResponse; +} + +export interface ParamsRequest {} + +export interface ParamsResponse { + params?: Params; +} + +export interface StatusRequest {} + +export interface StatusResponse { + openMtpCount: Long; + lifetimeMtpCount: Long; +} + +export interface WhitelistRequest { + pagination?: PageRequest; +} + +export interface WhitelistResponse { + whitelist: string[]; + pagination?: PageResponse; +} + +export interface GetSQParamsRequest { + pool: string; +} + +export interface GetSQParamsResponse { + beginBlock: Long; +} + +export interface IsWhitelistedRequest { + address: string; +} + +export interface IsWhitelistedResponse { + address: string; + isWhitelisted: boolean; +} + +function createBaseMTPRequest(): MTPRequest { + return { address: "", id: Long.UZERO }; +} + +export const MTPRequest = { + encode( + message: MTPRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (!message.id.isZero()) { + writer.uint32(16).uint64(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MTPRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMTPRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.id = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MTPRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + }; + }, + + toJSON(message: MTPRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.id !== undefined && + (obj.id = (message.id || Long.UZERO).toString()); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MTPRequest { + const message = createBaseMTPRequest(); + message.address = object.address ?? ""; + message.id = + object.id !== undefined && object.id !== null + ? Long.fromValue(object.id) + : Long.UZERO; + return message; + }, +}; + +function createBaseMTPResponse(): MTPResponse { + return { mtp: undefined }; +} + +export const MTPResponse = { + encode( + message: MTPResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.mtp !== undefined) { + MTP.encode(message.mtp, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MTPResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMTPResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mtp = MTP.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MTPResponse { + return { + mtp: isSet(object.mtp) ? MTP.fromJSON(object.mtp) : undefined, + }; + }, + + toJSON(message: MTPResponse): unknown { + const obj: any = {}; + message.mtp !== undefined && + (obj.mtp = message.mtp ? MTP.toJSON(message.mtp) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MTPResponse { + const message = createBaseMTPResponse(); + message.mtp = + object.mtp !== undefined && object.mtp !== null + ? MTP.fromPartial(object.mtp) + : undefined; + return message; + }, +}; + +function createBasePositionsForAddressRequest(): PositionsForAddressRequest { + return { address: "", pagination: undefined }; +} + +export const PositionsForAddressRequest = { + encode( + message: PositionsForAddressRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): PositionsForAddressRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsForAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PositionsForAddressRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: PositionsForAddressRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): PositionsForAddressRequest { + const message = createBasePositionsForAddressRequest(); + message.address = object.address ?? ""; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBasePositionsForAddressResponse(): PositionsForAddressResponse { + return { mtps: [], pagination: undefined }; +} + +export const PositionsForAddressResponse = { + encode( + message: PositionsForAddressResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.mtps) { + MTP.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): PositionsForAddressResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsForAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mtps.push(MTP.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PositionsForAddressResponse { + return { + mtps: Array.isArray(object?.mtps) + ? object.mtps.map((e: any) => MTP.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: PositionsForAddressResponse): unknown { + const obj: any = {}; + if (message.mtps) { + obj.mtps = message.mtps.map((e) => (e ? MTP.toJSON(e) : undefined)); + } else { + obj.mtps = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): PositionsForAddressResponse { + const message = createBasePositionsForAddressResponse(); + message.mtps = object.mtps?.map((e) => MTP.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBasePositionsByPoolRequest(): PositionsByPoolRequest { + return { asset: "", pagination: undefined }; +} + +export const PositionsByPoolRequest = { + encode( + message: PositionsByPoolRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.asset !== "") { + writer.uint32(10).string(message.asset); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): PositionsByPoolRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsByPoolRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PositionsByPoolRequest { + return { + asset: isSet(object.asset) ? String(object.asset) : "", + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: PositionsByPoolRequest): unknown { + const obj: any = {}; + message.asset !== undefined && (obj.asset = message.asset); + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): PositionsByPoolRequest { + const message = createBasePositionsByPoolRequest(); + message.asset = object.asset ?? ""; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBasePositionsByPoolResponse(): PositionsByPoolResponse { + return { mtps: [], pagination: undefined }; +} + +export const PositionsByPoolResponse = { + encode( + message: PositionsByPoolResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.mtps) { + MTP.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): PositionsByPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsByPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mtps.push(MTP.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PositionsByPoolResponse { + return { + mtps: Array.isArray(object?.mtps) + ? object.mtps.map((e: any) => MTP.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: PositionsByPoolResponse): unknown { + const obj: any = {}; + if (message.mtps) { + obj.mtps = message.mtps.map((e) => (e ? MTP.toJSON(e) : undefined)); + } else { + obj.mtps = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): PositionsByPoolResponse { + const message = createBasePositionsByPoolResponse(); + message.mtps = object.mtps?.map((e) => MTP.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBasePositionsRequest(): PositionsRequest { + return { pagination: undefined }; +} + +export const PositionsRequest = { + encode( + message: PositionsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PositionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PositionsRequest { + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: PositionsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): PositionsRequest { + const message = createBasePositionsRequest(); + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBasePositionsResponse(): PositionsResponse { + return { mtps: [], pagination: undefined }; +} + +export const PositionsResponse = { + encode( + message: PositionsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.mtps) { + MTP.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PositionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mtps.push(MTP.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PositionsResponse { + return { + mtps: Array.isArray(object?.mtps) + ? object.mtps.map((e: any) => MTP.fromJSON(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: PositionsResponse): unknown { + const obj: any = {}; + if (message.mtps) { + obj.mtps = message.mtps.map((e) => (e ? MTP.toJSON(e) : undefined)); + } else { + obj.mtps = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): PositionsResponse { + const message = createBasePositionsResponse(); + message.mtps = object.mtps?.map((e) => MTP.fromPartial(e)) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseParamsRequest(): ParamsRequest { + return {}; +} + +export const ParamsRequest = { + encode( + _: ParamsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ParamsRequest { + return {}; + }, + + toJSON(_: ParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, +}; + +function createBaseParamsResponse(): ParamsResponse { + return { params: undefined }; +} + +export const ParamsResponse = { + encode( + message: ParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: ParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): ParamsResponse { + const message = createBaseParamsResponse(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseStatusRequest(): StatusRequest { + return {}; +} + +export const StatusRequest = { + encode( + _: StatusRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StatusRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatusRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): StatusRequest { + return {}; + }, + + toJSON(_: StatusRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): StatusRequest { + const message = createBaseStatusRequest(); + return message; + }, +}; + +function createBaseStatusResponse(): StatusResponse { + return { openMtpCount: Long.UZERO, lifetimeMtpCount: Long.UZERO }; +} + +export const StatusResponse = { + encode( + message: StatusResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (!message.openMtpCount.isZero()) { + writer.uint32(8).uint64(message.openMtpCount); + } + if (!message.lifetimeMtpCount.isZero()) { + writer.uint32(16).uint64(message.lifetimeMtpCount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StatusResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatusResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.openMtpCount = reader.uint64() as Long; + break; + case 2: + message.lifetimeMtpCount = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StatusResponse { + return { + openMtpCount: isSet(object.openMtpCount) + ? Long.fromValue(object.openMtpCount) + : Long.UZERO, + lifetimeMtpCount: isSet(object.lifetimeMtpCount) + ? Long.fromValue(object.lifetimeMtpCount) + : Long.UZERO, + }; + }, + + toJSON(message: StatusResponse): unknown { + const obj: any = {}; + message.openMtpCount !== undefined && + (obj.openMtpCount = (message.openMtpCount || Long.UZERO).toString()); + message.lifetimeMtpCount !== undefined && + (obj.lifetimeMtpCount = ( + message.lifetimeMtpCount || Long.UZERO + ).toString()); + return obj; + }, + + fromPartial, I>>( + object: I, + ): StatusResponse { + const message = createBaseStatusResponse(); + message.openMtpCount = + object.openMtpCount !== undefined && object.openMtpCount !== null + ? Long.fromValue(object.openMtpCount) + : Long.UZERO; + message.lifetimeMtpCount = + object.lifetimeMtpCount !== undefined && object.lifetimeMtpCount !== null + ? Long.fromValue(object.lifetimeMtpCount) + : Long.UZERO; + return message; + }, +}; + +function createBaseWhitelistRequest(): WhitelistRequest { + return { pagination: undefined }; +} + +export const WhitelistRequest = { + encode( + message: WhitelistRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WhitelistRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWhitelistRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WhitelistRequest { + return { + pagination: isSet(object.pagination) + ? PageRequest.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: WhitelistRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageRequest.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): WhitelistRequest { + const message = createBaseWhitelistRequest(); + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseWhitelistResponse(): WhitelistResponse { + return { whitelist: [], pagination: undefined }; +} + +export const WhitelistResponse = { + encode( + message: WhitelistResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.whitelist) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageResponse.encode( + message.pagination, + writer.uint32(18).fork(), + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WhitelistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWhitelistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.whitelist.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WhitelistResponse { + return { + whitelist: Array.isArray(object?.whitelist) + ? object.whitelist.map((e: any) => String(e)) + : [], + pagination: isSet(object.pagination) + ? PageResponse.fromJSON(object.pagination) + : undefined, + }; + }, + + toJSON(message: WhitelistResponse): unknown { + const obj: any = {}; + if (message.whitelist) { + obj.whitelist = message.whitelist.map((e) => e); + } else { + obj.whitelist = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination + ? PageResponse.toJSON(message.pagination) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): WhitelistResponse { + const message = createBaseWhitelistResponse(); + message.whitelist = object.whitelist?.map((e) => e) || []; + message.pagination = + object.pagination !== undefined && object.pagination !== null + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseGetSQParamsRequest(): GetSQParamsRequest { + return { pool: "" }; +} + +export const GetSQParamsRequest = { + encode( + message: GetSQParamsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pool !== "") { + writer.uint32(10).string(message.pool); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetSQParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetSQParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetSQParamsRequest { + return { + pool: isSet(object.pool) ? String(object.pool) : "", + }; + }, + + toJSON(message: GetSQParamsRequest): unknown { + const obj: any = {}; + message.pool !== undefined && (obj.pool = message.pool); + return obj; + }, + + fromPartial, I>>( + object: I, + ): GetSQParamsRequest { + const message = createBaseGetSQParamsRequest(); + message.pool = object.pool ?? ""; + return message; + }, +}; + +function createBaseGetSQParamsResponse(): GetSQParamsResponse { + return { beginBlock: Long.ZERO }; +} + +export const GetSQParamsResponse = { + encode( + message: GetSQParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (!message.beginBlock.isZero()) { + writer.uint32(8).int64(message.beginBlock); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetSQParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetSQParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.beginBlock = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetSQParamsResponse { + return { + beginBlock: isSet(object.beginBlock) + ? Long.fromValue(object.beginBlock) + : Long.ZERO, + }; + }, + + toJSON(message: GetSQParamsResponse): unknown { + const obj: any = {}; + message.beginBlock !== undefined && + (obj.beginBlock = (message.beginBlock || Long.ZERO).toString()); + return obj; + }, + + fromPartial, I>>( + object: I, + ): GetSQParamsResponse { + const message = createBaseGetSQParamsResponse(); + message.beginBlock = + object.beginBlock !== undefined && object.beginBlock !== null + ? Long.fromValue(object.beginBlock) + : Long.ZERO; + return message; + }, +}; + +function createBaseIsWhitelistedRequest(): IsWhitelistedRequest { + return { address: "" }; +} + +export const IsWhitelistedRequest = { + encode( + message: IsWhitelistedRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): IsWhitelistedRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIsWhitelistedRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IsWhitelistedRequest { + return { + address: isSet(object.address) ? String(object.address) : "", + }; + }, + + toJSON(message: IsWhitelistedRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, + + fromPartial, I>>( + object: I, + ): IsWhitelistedRequest { + const message = createBaseIsWhitelistedRequest(); + message.address = object.address ?? ""; + return message; + }, +}; + +function createBaseIsWhitelistedResponse(): IsWhitelistedResponse { + return { address: "", isWhitelisted: false }; +} + +export const IsWhitelistedResponse = { + encode( + message: IsWhitelistedResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.isWhitelisted === true) { + writer.uint32(16).bool(message.isWhitelisted); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): IsWhitelistedResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIsWhitelistedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.isWhitelisted = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IsWhitelistedResponse { + return { + address: isSet(object.address) ? String(object.address) : "", + isWhitelisted: isSet(object.isWhitelisted) + ? Boolean(object.isWhitelisted) + : false, + }; + }, + + toJSON(message: IsWhitelistedResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.isWhitelisted !== undefined && + (obj.isWhitelisted = message.isWhitelisted); + return obj; + }, + + fromPartial, I>>( + object: I, + ): IsWhitelistedResponse { + const message = createBaseIsWhitelistedResponse(); + message.address = object.address ?? ""; + message.isWhitelisted = object.isWhitelisted ?? false; + return message; + }, +}; + +export interface Query { + GetMTP(request: MTPRequest): Promise; + GetPositions(request: PositionsRequest): Promise; + GetPositionsForAddress( + request: PositionsForAddressRequest, + ): Promise; + GetPositionsByPool( + request: PositionsByPoolRequest, + ): Promise; + GetParams(request: ParamsRequest): Promise; + GetStatus(request: StatusRequest): Promise; + GetSQParams(request: GetSQParamsRequest): Promise; + GetWhitelist(request: WhitelistRequest): Promise; + IsWhitelisted(request: IsWhitelistedRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.GetMTP = this.GetMTP.bind(this); + this.GetPositions = this.GetPositions.bind(this); + this.GetPositionsForAddress = this.GetPositionsForAddress.bind(this); + this.GetPositionsByPool = this.GetPositionsByPool.bind(this); + this.GetParams = this.GetParams.bind(this); + this.GetStatus = this.GetStatus.bind(this); + this.GetSQParams = this.GetSQParams.bind(this); + this.GetWhitelist = this.GetWhitelist.bind(this); + this.IsWhitelisted = this.IsWhitelisted.bind(this); + } + GetMTP(request: MTPRequest): Promise { + const data = MTPRequest.encode(request).finish(); + const promise = this.rpc.request("sifnode.margin.v1.Query", "GetMTP", data); + return promise.then((data) => MTPResponse.decode(new _m0.Reader(data))); + } + + GetPositions(request: PositionsRequest): Promise { + const data = PositionsRequest.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Query", + "GetPositions", + data, + ); + return promise.then((data) => + PositionsResponse.decode(new _m0.Reader(data)), + ); + } + + GetPositionsForAddress( + request: PositionsForAddressRequest, + ): Promise { + const data = PositionsForAddressRequest.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Query", + "GetPositionsForAddress", + data, + ); + return promise.then((data) => + PositionsForAddressResponse.decode(new _m0.Reader(data)), + ); + } + + GetPositionsByPool( + request: PositionsByPoolRequest, + ): Promise { + const data = PositionsByPoolRequest.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Query", + "GetPositionsByPool", + data, + ); + return promise.then((data) => + PositionsByPoolResponse.decode(new _m0.Reader(data)), + ); + } + + GetParams(request: ParamsRequest): Promise { + const data = ParamsRequest.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Query", + "GetParams", + data, + ); + return promise.then((data) => ParamsResponse.decode(new _m0.Reader(data))); + } + + GetStatus(request: StatusRequest): Promise { + const data = StatusRequest.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Query", + "GetStatus", + data, + ); + return promise.then((data) => StatusResponse.decode(new _m0.Reader(data))); + } + + GetSQParams(request: GetSQParamsRequest): Promise { + const data = GetSQParamsRequest.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Query", + "GetSQParams", + data, + ); + return promise.then((data) => + GetSQParamsResponse.decode(new _m0.Reader(data)), + ); + } + + GetWhitelist(request: WhitelistRequest): Promise { + const data = WhitelistRequest.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Query", + "GetWhitelist", + data, + ); + return promise.then((data) => + WhitelistResponse.decode(new _m0.Reader(data)), + ); + } + + IsWhitelisted(request: IsWhitelistedRequest): Promise { + const data = IsWhitelistedRequest.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Query", + "IsWhitelisted", + data, + ); + return promise.then((data) => + IsWhitelistedResponse.decode(new _m0.Reader(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? 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; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/core/src/generated/proto/sifnode/margin/v1/tx.ts b/core/src/generated/proto/sifnode/margin/v1/tx.ts new file mode 100644 index 000000000..d4d7fad5e --- /dev/null +++ b/core/src/generated/proto/sifnode/margin/v1/tx.ts @@ -0,0 +1,1062 @@ +/* eslint-disable */ +import { Position, Params, positionFromJSON, positionToJSON } from "./types"; +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "sifnode.margin.v1"; + +export interface MsgOpen { + signer: string; + collateralAsset: string; + collateralAmount: string; + borrowAsset: string; + position: Position; + leverage: string; +} + +export interface MsgOpenResponse {} + +export interface MsgClose { + signer: string; + id: Long; +} + +export interface MsgCloseResponse {} + +export interface MsgForceClose { + signer: string; + mtpAddress: string; + id: Long; +} + +export interface MsgForceCloseResponse {} + +export interface MsgUpdateParams { + signer: string; + params?: Params; +} + +export interface MsgUpdateParamsResponse {} + +export interface MsgUpdatePools { + signer: string; + pools: string[]; + closedPools: string[]; +} + +export interface MsgUpdatePoolsResponse {} + +export interface MsgWhitelist { + signer: string; + whitelistedAddress: string; +} + +export interface MsgWhitelistResponse {} + +export interface MsgDewhitelist { + signer: string; + whitelistedAddress: string; +} + +export interface MsgDewhitelistResponse {} + +function createBaseMsgOpen(): MsgOpen { + return { + signer: "", + collateralAsset: "", + collateralAmount: "", + borrowAsset: "", + position: 0, + leverage: "", + }; +} + +export const MsgOpen = { + encode( + message: MsgOpen, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.collateralAsset !== "") { + writer.uint32(18).string(message.collateralAsset); + } + if (message.collateralAmount !== "") { + writer.uint32(26).string(message.collateralAmount); + } + if (message.borrowAsset !== "") { + writer.uint32(34).string(message.borrowAsset); + } + if (message.position !== 0) { + writer.uint32(40).int32(message.position); + } + if (message.leverage !== "") { + writer.uint32(50).string(message.leverage); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgOpen { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgOpen(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.collateralAsset = reader.string(); + break; + case 3: + message.collateralAmount = reader.string(); + break; + case 4: + message.borrowAsset = reader.string(); + break; + case 5: + message.position = reader.int32() as any; + break; + case 6: + message.leverage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgOpen { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + collateralAsset: isSet(object.collateralAsset) + ? String(object.collateralAsset) + : "", + collateralAmount: isSet(object.collateralAmount) + ? String(object.collateralAmount) + : "", + borrowAsset: isSet(object.borrowAsset) ? String(object.borrowAsset) : "", + position: isSet(object.position) ? positionFromJSON(object.position) : 0, + leverage: isSet(object.leverage) ? String(object.leverage) : "", + }; + }, + + toJSON(message: MsgOpen): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.collateralAsset !== undefined && + (obj.collateralAsset = message.collateralAsset); + message.collateralAmount !== undefined && + (obj.collateralAmount = message.collateralAmount); + message.borrowAsset !== undefined && + (obj.borrowAsset = message.borrowAsset); + message.position !== undefined && + (obj.position = positionToJSON(message.position)); + message.leverage !== undefined && (obj.leverage = message.leverage); + return obj; + }, + + fromPartial, I>>(object: I): MsgOpen { + const message = createBaseMsgOpen(); + message.signer = object.signer ?? ""; + message.collateralAsset = object.collateralAsset ?? ""; + message.collateralAmount = object.collateralAmount ?? ""; + message.borrowAsset = object.borrowAsset ?? ""; + message.position = object.position ?? 0; + message.leverage = object.leverage ?? ""; + return message; + }, +}; + +function createBaseMsgOpenResponse(): MsgOpenResponse { + return {}; +} + +export const MsgOpenResponse = { + encode( + _: MsgOpenResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgOpenResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgOpenResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgOpenResponse { + return {}; + }, + + toJSON(_: MsgOpenResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgOpenResponse { + const message = createBaseMsgOpenResponse(); + return message; + }, +}; + +function createBaseMsgClose(): MsgClose { + return { signer: "", id: Long.UZERO }; +} + +export const MsgClose = { + encode( + message: MsgClose, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (!message.id.isZero()) { + writer.uint32(16).uint64(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgClose { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClose(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.id = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgClose { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + }; + }, + + toJSON(message: MsgClose): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.id !== undefined && + (obj.id = (message.id || Long.UZERO).toString()); + return obj; + }, + + fromPartial, I>>(object: I): MsgClose { + const message = createBaseMsgClose(); + message.signer = object.signer ?? ""; + message.id = + object.id !== undefined && object.id !== null + ? Long.fromValue(object.id) + : Long.UZERO; + return message; + }, +}; + +function createBaseMsgCloseResponse(): MsgCloseResponse { + return {}; +} + +export const MsgCloseResponse = { + encode( + _: MsgCloseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCloseResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCloseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgCloseResponse { + return {}; + }, + + toJSON(_: MsgCloseResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgCloseResponse { + const message = createBaseMsgCloseResponse(); + return message; + }, +}; + +function createBaseMsgForceClose(): MsgForceClose { + return { signer: "", mtpAddress: "", id: Long.UZERO }; +} + +export const MsgForceClose = { + encode( + message: MsgForceClose, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.mtpAddress !== "") { + writer.uint32(18).string(message.mtpAddress); + } + if (!message.id.isZero()) { + writer.uint32(24).uint64(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgForceClose { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceClose(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.mtpAddress = reader.string(); + break; + case 3: + message.id = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgForceClose { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + mtpAddress: isSet(object.mtpAddress) ? String(object.mtpAddress) : "", + id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + }; + }, + + toJSON(message: MsgForceClose): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.mtpAddress !== undefined && (obj.mtpAddress = message.mtpAddress); + message.id !== undefined && + (obj.id = (message.id || Long.UZERO).toString()); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgForceClose { + const message = createBaseMsgForceClose(); + message.signer = object.signer ?? ""; + message.mtpAddress = object.mtpAddress ?? ""; + message.id = + object.id !== undefined && object.id !== null + ? Long.fromValue(object.id) + : Long.UZERO; + return message; + }, +}; + +function createBaseMsgForceCloseResponse(): MsgForceCloseResponse { + return {}; +} + +export const MsgForceCloseResponse = { + encode( + _: MsgForceCloseResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgForceCloseResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceCloseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgForceCloseResponse { + return {}; + }, + + toJSON(_: MsgForceCloseResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgForceCloseResponse { + const message = createBaseMsgForceCloseResponse(); + return message; + }, +}; + +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { signer: "", params: undefined }; +} + +export const MsgUpdateParams = { + encode( + message: MsgUpdateParams, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateParams { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: MsgUpdateParams): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} + +export const MsgUpdateParamsResponse = { + encode( + _: MsgUpdateParamsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgUpdateParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + + toJSON(_: MsgUpdateParamsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, +}; + +function createBaseMsgUpdatePools(): MsgUpdatePools { + return { signer: "", pools: [], closedPools: [] }; +} + +export const MsgUpdatePools = { + encode( + message: MsgUpdatePools, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + for (const v of message.pools) { + writer.uint32(18).string(v!); + } + for (const v of message.closedPools) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdatePools { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePools(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.pools.push(reader.string()); + break; + case 3: + message.closedPools.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdatePools { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + pools: Array.isArray(object?.pools) + ? object.pools.map((e: any) => String(e)) + : [], + closedPools: Array.isArray(object?.closedPools) + ? object.closedPools.map((e: any) => String(e)) + : [], + }; + }, + + toJSON(message: MsgUpdatePools): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + if (message.pools) { + obj.pools = message.pools.map((e) => e); + } else { + obj.pools = []; + } + if (message.closedPools) { + obj.closedPools = message.closedPools.map((e) => e); + } else { + obj.closedPools = []; + } + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgUpdatePools { + const message = createBaseMsgUpdatePools(); + message.signer = object.signer ?? ""; + message.pools = object.pools?.map((e) => e) || []; + message.closedPools = object.closedPools?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMsgUpdatePoolsResponse(): MsgUpdatePoolsResponse { + return {}; +} + +export const MsgUpdatePoolsResponse = { + encode( + _: MsgUpdatePoolsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgUpdatePoolsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdatePoolsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdatePoolsResponse { + return {}; + }, + + toJSON(_: MsgUpdatePoolsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgUpdatePoolsResponse { + const message = createBaseMsgUpdatePoolsResponse(); + return message; + }, +}; + +function createBaseMsgWhitelist(): MsgWhitelist { + return { signer: "", whitelistedAddress: "" }; +} + +export const MsgWhitelist = { + encode( + message: MsgWhitelist, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.whitelistedAddress !== "") { + writer.uint32(18).string(message.whitelistedAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWhitelist { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWhitelist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.whitelistedAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgWhitelist { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + whitelistedAddress: isSet(object.whitelistedAddress) + ? String(object.whitelistedAddress) + : "", + }; + }, + + toJSON(message: MsgWhitelist): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.whitelistedAddress !== undefined && + (obj.whitelistedAddress = message.whitelistedAddress); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgWhitelist { + const message = createBaseMsgWhitelist(); + message.signer = object.signer ?? ""; + message.whitelistedAddress = object.whitelistedAddress ?? ""; + return message; + }, +}; + +function createBaseMsgWhitelistResponse(): MsgWhitelistResponse { + return {}; +} + +export const MsgWhitelistResponse = { + encode( + _: MsgWhitelistResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgWhitelistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWhitelistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgWhitelistResponse { + return {}; + }, + + toJSON(_: MsgWhitelistResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgWhitelistResponse { + const message = createBaseMsgWhitelistResponse(); + return message; + }, +}; + +function createBaseMsgDewhitelist(): MsgDewhitelist { + return { signer: "", whitelistedAddress: "" }; +} + +export const MsgDewhitelist = { + encode( + message: MsgDewhitelist, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.whitelistedAddress !== "") { + writer.uint32(18).string(message.whitelistedAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDewhitelist { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDewhitelist(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.whitelistedAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgDewhitelist { + return { + signer: isSet(object.signer) ? String(object.signer) : "", + whitelistedAddress: isSet(object.whitelistedAddress) + ? String(object.whitelistedAddress) + : "", + }; + }, + + toJSON(message: MsgDewhitelist): unknown { + const obj: any = {}; + message.signer !== undefined && (obj.signer = message.signer); + message.whitelistedAddress !== undefined && + (obj.whitelistedAddress = message.whitelistedAddress); + return obj; + }, + + fromPartial, I>>( + object: I, + ): MsgDewhitelist { + const message = createBaseMsgDewhitelist(); + message.signer = object.signer ?? ""; + message.whitelistedAddress = object.whitelistedAddress ?? ""; + return message; + }, +}; + +function createBaseMsgDewhitelistResponse(): MsgDewhitelistResponse { + return {}; +} + +export const MsgDewhitelistResponse = { + encode( + _: MsgDewhitelistResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): MsgDewhitelistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDewhitelistResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgDewhitelistResponse { + return {}; + }, + + toJSON(_: MsgDewhitelistResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial, I>>( + _: I, + ): MsgDewhitelistResponse { + const message = createBaseMsgDewhitelistResponse(); + return message; + }, +}; + +export interface Msg { + Open(request: MsgOpen): Promise; + Close(request: MsgClose): Promise; + ForceClose(request: MsgForceClose): Promise; + UpdateParams(request: MsgUpdateParams): Promise; + UpdatePools(request: MsgUpdatePools): Promise; + Whitelist(request: MsgWhitelist): Promise; + Dewhitelist(request: MsgDewhitelist): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Open = this.Open.bind(this); + this.Close = this.Close.bind(this); + this.ForceClose = this.ForceClose.bind(this); + this.UpdateParams = this.UpdateParams.bind(this); + this.UpdatePools = this.UpdatePools.bind(this); + this.Whitelist = this.Whitelist.bind(this); + this.Dewhitelist = this.Dewhitelist.bind(this); + } + Open(request: MsgOpen): Promise { + const data = MsgOpen.encode(request).finish(); + const promise = this.rpc.request("sifnode.margin.v1.Msg", "Open", data); + return promise.then((data) => MsgOpenResponse.decode(new _m0.Reader(data))); + } + + Close(request: MsgClose): Promise { + const data = MsgClose.encode(request).finish(); + const promise = this.rpc.request("sifnode.margin.v1.Msg", "Close", data); + return promise.then((data) => + MsgCloseResponse.decode(new _m0.Reader(data)), + ); + } + + ForceClose(request: MsgForceClose): Promise { + const data = MsgForceClose.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Msg", + "ForceClose", + data, + ); + return promise.then((data) => + MsgForceCloseResponse.decode(new _m0.Reader(data)), + ); + } + + UpdateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Msg", + "UpdateParams", + data, + ); + return promise.then((data) => + MsgUpdateParamsResponse.decode(new _m0.Reader(data)), + ); + } + + UpdatePools(request: MsgUpdatePools): Promise { + const data = MsgUpdatePools.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Msg", + "UpdatePools", + data, + ); + return promise.then((data) => + MsgUpdatePoolsResponse.decode(new _m0.Reader(data)), + ); + } + + Whitelist(request: MsgWhitelist): Promise { + const data = MsgWhitelist.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Msg", + "Whitelist", + data, + ); + return promise.then((data) => + MsgWhitelistResponse.decode(new _m0.Reader(data)), + ); + } + + Dewhitelist(request: MsgDewhitelist): Promise { + const data = MsgDewhitelist.encode(request).finish(); + const promise = this.rpc.request( + "sifnode.margin.v1.Msg", + "Dewhitelist", + data, + ); + return promise.then((data) => + MsgDewhitelistResponse.decode(new _m0.Reader(data)), + ); + } +} + +interface Rpc { + request( + service: string, + method: string, + data: Uint8Array, + ): Promise; +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? 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; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/core/src/generated/proto/sifnode/margin/v1/types.ts b/core/src/generated/proto/sifnode/margin/v1/types.ts new file mode 100644 index 000000000..465f0e52a --- /dev/null +++ b/core/src/generated/proto/sifnode/margin/v1/types.ts @@ -0,0 +1,714 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "sifnode.margin.v1"; + +export enum Position { + UNSPECIFIED = 0, + LONG = 1, + SHORT = 2, + UNRECOGNIZED = -1, +} + +export function positionFromJSON(object: any): Position { + switch (object) { + case 0: + case "UNSPECIFIED": + return Position.UNSPECIFIED; + case 1: + case "LONG": + return Position.LONG; + case 2: + case "SHORT": + return Position.SHORT; + case -1: + case "UNRECOGNIZED": + default: + return Position.UNRECOGNIZED; + } +} + +export function positionToJSON(object: Position): string { + switch (object) { + case Position.UNSPECIFIED: + return "UNSPECIFIED"; + case Position.LONG: + return "LONG"; + case Position.SHORT: + return "SHORT"; + case Position.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface GenesisState { + params?: Params; +} + +export interface Params { + leverageMax: string; + interestRateMax: string; + interestRateMin: string; + interestRateIncrease: string; + interestRateDecrease: string; + healthGainFactor: string; + epochLength: Long; + pools: string[]; + forceCloseThreshold: string; + removalQueueThreshold: string; + maxOpenPositions: Long; + poolOpenThreshold: string; + forceCloseFundPercentage: string; + forceCloseInsuranceFundAddress: string; + incrementalInterestPaymentFundPercentage: string; + incrementalInterestPaymentInsuranceFundAddress: string; + sqModifier: string; + safetyFactor: string; + closedPools: string[]; + incrementalInterestPaymentEnabled: boolean; + whitelistingEnabled: boolean; +} + +export interface MTP { + address: string; + collateralAsset: string; + collateralAmount: string; + liabilities: string; + interestPaid: string; + interestUnpaid: string; + custodyAsset: string; + custodyAmount: string; + leverage: string; + mtpHealth: string; + position: Position; + id: Long; +} + +function createBaseGenesisState(): GenesisState { + return { params: undefined }; +} + +export const GenesisState = { + encode( + message: GenesisState, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && + (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): GenesisState { + const message = createBaseGenesisState(); + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined; + return message; + }, +}; + +function createBaseParams(): Params { + return { + leverageMax: "", + interestRateMax: "", + interestRateMin: "", + interestRateIncrease: "", + interestRateDecrease: "", + healthGainFactor: "", + epochLength: Long.ZERO, + pools: [], + forceCloseThreshold: "", + removalQueueThreshold: "", + maxOpenPositions: Long.UZERO, + poolOpenThreshold: "", + forceCloseFundPercentage: "", + forceCloseInsuranceFundAddress: "", + incrementalInterestPaymentFundPercentage: "", + incrementalInterestPaymentInsuranceFundAddress: "", + sqModifier: "", + safetyFactor: "", + closedPools: [], + incrementalInterestPaymentEnabled: false, + whitelistingEnabled: false, + }; +} + +export const Params = { + encode( + message: Params, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.leverageMax !== "") { + writer.uint32(10).string(message.leverageMax); + } + if (message.interestRateMax !== "") { + writer.uint32(18).string(message.interestRateMax); + } + if (message.interestRateMin !== "") { + writer.uint32(26).string(message.interestRateMin); + } + if (message.interestRateIncrease !== "") { + writer.uint32(34).string(message.interestRateIncrease); + } + if (message.interestRateDecrease !== "") { + writer.uint32(42).string(message.interestRateDecrease); + } + if (message.healthGainFactor !== "") { + writer.uint32(50).string(message.healthGainFactor); + } + if (!message.epochLength.isZero()) { + writer.uint32(56).int64(message.epochLength); + } + for (const v of message.pools) { + writer.uint32(66).string(v!); + } + if (message.forceCloseThreshold !== "") { + writer.uint32(74).string(message.forceCloseThreshold); + } + if (message.removalQueueThreshold !== "") { + writer.uint32(82).string(message.removalQueueThreshold); + } + if (!message.maxOpenPositions.isZero()) { + writer.uint32(88).uint64(message.maxOpenPositions); + } + if (message.poolOpenThreshold !== "") { + writer.uint32(98).string(message.poolOpenThreshold); + } + if (message.forceCloseFundPercentage !== "") { + writer.uint32(106).string(message.forceCloseFundPercentage); + } + if (message.forceCloseInsuranceFundAddress !== "") { + writer.uint32(114).string(message.forceCloseInsuranceFundAddress); + } + if (message.incrementalInterestPaymentFundPercentage !== "") { + writer + .uint32(122) + .string(message.incrementalInterestPaymentFundPercentage); + } + if (message.incrementalInterestPaymentInsuranceFundAddress !== "") { + writer + .uint32(130) + .string(message.incrementalInterestPaymentInsuranceFundAddress); + } + if (message.sqModifier !== "") { + writer.uint32(138).string(message.sqModifier); + } + if (message.safetyFactor !== "") { + writer.uint32(146).string(message.safetyFactor); + } + for (const v of message.closedPools) { + writer.uint32(154).string(v!); + } + if (message.incrementalInterestPaymentEnabled === true) { + writer.uint32(160).bool(message.incrementalInterestPaymentEnabled); + } + if (message.whitelistingEnabled === true) { + writer.uint32(168).bool(message.whitelistingEnabled); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.leverageMax = reader.string(); + break; + case 2: + message.interestRateMax = reader.string(); + break; + case 3: + message.interestRateMin = reader.string(); + break; + case 4: + message.interestRateIncrease = reader.string(); + break; + case 5: + message.interestRateDecrease = reader.string(); + break; + case 6: + message.healthGainFactor = reader.string(); + break; + case 7: + message.epochLength = reader.int64() as Long; + break; + case 8: + message.pools.push(reader.string()); + break; + case 9: + message.forceCloseThreshold = reader.string(); + break; + case 10: + message.removalQueueThreshold = reader.string(); + break; + case 11: + message.maxOpenPositions = reader.uint64() as Long; + break; + case 12: + message.poolOpenThreshold = reader.string(); + break; + case 13: + message.forceCloseFundPercentage = reader.string(); + break; + case 14: + message.forceCloseInsuranceFundAddress = reader.string(); + break; + case 15: + message.incrementalInterestPaymentFundPercentage = reader.string(); + break; + case 16: + message.incrementalInterestPaymentInsuranceFundAddress = + reader.string(); + break; + case 17: + message.sqModifier = reader.string(); + break; + case 18: + message.safetyFactor = reader.string(); + break; + case 19: + message.closedPools.push(reader.string()); + break; + case 20: + message.incrementalInterestPaymentEnabled = reader.bool(); + break; + case 21: + message.whitelistingEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + return { + leverageMax: isSet(object.leverageMax) ? String(object.leverageMax) : "", + interestRateMax: isSet(object.interestRateMax) + ? String(object.interestRateMax) + : "", + interestRateMin: isSet(object.interestRateMin) + ? String(object.interestRateMin) + : "", + interestRateIncrease: isSet(object.interestRateIncrease) + ? String(object.interestRateIncrease) + : "", + interestRateDecrease: isSet(object.interestRateDecrease) + ? String(object.interestRateDecrease) + : "", + healthGainFactor: isSet(object.healthGainFactor) + ? String(object.healthGainFactor) + : "", + epochLength: isSet(object.epochLength) + ? Long.fromValue(object.epochLength) + : Long.ZERO, + pools: Array.isArray(object?.pools) + ? object.pools.map((e: any) => String(e)) + : [], + forceCloseThreshold: isSet(object.forceCloseThreshold) + ? String(object.forceCloseThreshold) + : "", + removalQueueThreshold: isSet(object.removalQueueThreshold) + ? String(object.removalQueueThreshold) + : "", + maxOpenPositions: isSet(object.maxOpenPositions) + ? Long.fromValue(object.maxOpenPositions) + : Long.UZERO, + poolOpenThreshold: isSet(object.poolOpenThreshold) + ? String(object.poolOpenThreshold) + : "", + forceCloseFundPercentage: isSet(object.forceCloseFundPercentage) + ? String(object.forceCloseFundPercentage) + : "", + forceCloseInsuranceFundAddress: isSet( + object.forceCloseInsuranceFundAddress, + ) + ? String(object.forceCloseInsuranceFundAddress) + : "", + incrementalInterestPaymentFundPercentage: isSet( + object.incrementalInterestPaymentFundPercentage, + ) + ? String(object.incrementalInterestPaymentFundPercentage) + : "", + incrementalInterestPaymentInsuranceFundAddress: isSet( + object.incrementalInterestPaymentInsuranceFundAddress, + ) + ? String(object.incrementalInterestPaymentInsuranceFundAddress) + : "", + sqModifier: isSet(object.sqModifier) ? String(object.sqModifier) : "", + safetyFactor: isSet(object.safetyFactor) + ? String(object.safetyFactor) + : "", + closedPools: Array.isArray(object?.closedPools) + ? object.closedPools.map((e: any) => String(e)) + : [], + incrementalInterestPaymentEnabled: isSet( + object.incrementalInterestPaymentEnabled, + ) + ? Boolean(object.incrementalInterestPaymentEnabled) + : false, + whitelistingEnabled: isSet(object.whitelistingEnabled) + ? Boolean(object.whitelistingEnabled) + : false, + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.leverageMax !== undefined && + (obj.leverageMax = message.leverageMax); + message.interestRateMax !== undefined && + (obj.interestRateMax = message.interestRateMax); + message.interestRateMin !== undefined && + (obj.interestRateMin = message.interestRateMin); + message.interestRateIncrease !== undefined && + (obj.interestRateIncrease = message.interestRateIncrease); + message.interestRateDecrease !== undefined && + (obj.interestRateDecrease = message.interestRateDecrease); + message.healthGainFactor !== undefined && + (obj.healthGainFactor = message.healthGainFactor); + message.epochLength !== undefined && + (obj.epochLength = (message.epochLength || Long.ZERO).toString()); + if (message.pools) { + obj.pools = message.pools.map((e) => e); + } else { + obj.pools = []; + } + message.forceCloseThreshold !== undefined && + (obj.forceCloseThreshold = message.forceCloseThreshold); + message.removalQueueThreshold !== undefined && + (obj.removalQueueThreshold = message.removalQueueThreshold); + message.maxOpenPositions !== undefined && + (obj.maxOpenPositions = ( + message.maxOpenPositions || Long.UZERO + ).toString()); + message.poolOpenThreshold !== undefined && + (obj.poolOpenThreshold = message.poolOpenThreshold); + message.forceCloseFundPercentage !== undefined && + (obj.forceCloseFundPercentage = message.forceCloseFundPercentage); + message.forceCloseInsuranceFundAddress !== undefined && + (obj.forceCloseInsuranceFundAddress = + message.forceCloseInsuranceFundAddress); + message.incrementalInterestPaymentFundPercentage !== undefined && + (obj.incrementalInterestPaymentFundPercentage = + message.incrementalInterestPaymentFundPercentage); + message.incrementalInterestPaymentInsuranceFundAddress !== undefined && + (obj.incrementalInterestPaymentInsuranceFundAddress = + message.incrementalInterestPaymentInsuranceFundAddress); + message.sqModifier !== undefined && (obj.sqModifier = message.sqModifier); + message.safetyFactor !== undefined && + (obj.safetyFactor = message.safetyFactor); + if (message.closedPools) { + obj.closedPools = message.closedPools.map((e) => e); + } else { + obj.closedPools = []; + } + message.incrementalInterestPaymentEnabled !== undefined && + (obj.incrementalInterestPaymentEnabled = + message.incrementalInterestPaymentEnabled); + message.whitelistingEnabled !== undefined && + (obj.whitelistingEnabled = message.whitelistingEnabled); + return obj; + }, + + fromPartial, I>>(object: I): Params { + const message = createBaseParams(); + message.leverageMax = object.leverageMax ?? ""; + message.interestRateMax = object.interestRateMax ?? ""; + message.interestRateMin = object.interestRateMin ?? ""; + message.interestRateIncrease = object.interestRateIncrease ?? ""; + message.interestRateDecrease = object.interestRateDecrease ?? ""; + message.healthGainFactor = object.healthGainFactor ?? ""; + message.epochLength = + object.epochLength !== undefined && object.epochLength !== null + ? Long.fromValue(object.epochLength) + : Long.ZERO; + message.pools = object.pools?.map((e) => e) || []; + message.forceCloseThreshold = object.forceCloseThreshold ?? ""; + message.removalQueueThreshold = object.removalQueueThreshold ?? ""; + message.maxOpenPositions = + object.maxOpenPositions !== undefined && object.maxOpenPositions !== null + ? Long.fromValue(object.maxOpenPositions) + : Long.UZERO; + message.poolOpenThreshold = object.poolOpenThreshold ?? ""; + message.forceCloseFundPercentage = object.forceCloseFundPercentage ?? ""; + message.forceCloseInsuranceFundAddress = + object.forceCloseInsuranceFundAddress ?? ""; + message.incrementalInterestPaymentFundPercentage = + object.incrementalInterestPaymentFundPercentage ?? ""; + message.incrementalInterestPaymentInsuranceFundAddress = + object.incrementalInterestPaymentInsuranceFundAddress ?? ""; + message.sqModifier = object.sqModifier ?? ""; + message.safetyFactor = object.safetyFactor ?? ""; + message.closedPools = object.closedPools?.map((e) => e) || []; + message.incrementalInterestPaymentEnabled = + object.incrementalInterestPaymentEnabled ?? false; + message.whitelistingEnabled = object.whitelistingEnabled ?? false; + return message; + }, +}; + +function createBaseMTP(): MTP { + return { + address: "", + collateralAsset: "", + collateralAmount: "", + liabilities: "", + interestPaid: "", + interestUnpaid: "", + custodyAsset: "", + custodyAmount: "", + leverage: "", + mtpHealth: "", + position: 0, + id: Long.UZERO, + }; +} + +export const MTP = { + encode(message: MTP, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.collateralAsset !== "") { + writer.uint32(18).string(message.collateralAsset); + } + if (message.collateralAmount !== "") { + writer.uint32(26).string(message.collateralAmount); + } + if (message.liabilities !== "") { + writer.uint32(34).string(message.liabilities); + } + if (message.interestPaid !== "") { + writer.uint32(42).string(message.interestPaid); + } + if (message.interestUnpaid !== "") { + writer.uint32(50).string(message.interestUnpaid); + } + if (message.custodyAsset !== "") { + writer.uint32(58).string(message.custodyAsset); + } + if (message.custodyAmount !== "") { + writer.uint32(66).string(message.custodyAmount); + } + if (message.leverage !== "") { + writer.uint32(74).string(message.leverage); + } + if (message.mtpHealth !== "") { + writer.uint32(82).string(message.mtpHealth); + } + if (message.position !== 0) { + writer.uint32(88).int32(message.position); + } + if (!message.id.isZero()) { + writer.uint32(96).uint64(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MTP { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMTP(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.collateralAsset = reader.string(); + break; + case 3: + message.collateralAmount = reader.string(); + break; + case 4: + message.liabilities = reader.string(); + break; + case 5: + message.interestPaid = reader.string(); + break; + case 6: + message.interestUnpaid = reader.string(); + break; + case 7: + message.custodyAsset = reader.string(); + break; + case 8: + message.custodyAmount = reader.string(); + break; + case 9: + message.leverage = reader.string(); + break; + case 10: + message.mtpHealth = reader.string(); + break; + case 11: + message.position = reader.int32() as any; + break; + case 12: + message.id = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MTP { + return { + address: isSet(object.address) ? String(object.address) : "", + collateralAsset: isSet(object.collateralAsset) + ? String(object.collateralAsset) + : "", + collateralAmount: isSet(object.collateralAmount) + ? String(object.collateralAmount) + : "", + liabilities: isSet(object.liabilities) ? String(object.liabilities) : "", + interestPaid: isSet(object.interestPaid) + ? String(object.interestPaid) + : "", + interestUnpaid: isSet(object.interestUnpaid) + ? String(object.interestUnpaid) + : "", + custodyAsset: isSet(object.custodyAsset) + ? String(object.custodyAsset) + : "", + custodyAmount: isSet(object.custodyAmount) + ? String(object.custodyAmount) + : "", + leverage: isSet(object.leverage) ? String(object.leverage) : "", + mtpHealth: isSet(object.mtpHealth) ? String(object.mtpHealth) : "", + position: isSet(object.position) ? positionFromJSON(object.position) : 0, + id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, + }; + }, + + toJSON(message: MTP): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.collateralAsset !== undefined && + (obj.collateralAsset = message.collateralAsset); + message.collateralAmount !== undefined && + (obj.collateralAmount = message.collateralAmount); + message.liabilities !== undefined && + (obj.liabilities = message.liabilities); + message.interestPaid !== undefined && + (obj.interestPaid = message.interestPaid); + message.interestUnpaid !== undefined && + (obj.interestUnpaid = message.interestUnpaid); + message.custodyAsset !== undefined && + (obj.custodyAsset = message.custodyAsset); + message.custodyAmount !== undefined && + (obj.custodyAmount = message.custodyAmount); + message.leverage !== undefined && (obj.leverage = message.leverage); + message.mtpHealth !== undefined && (obj.mtpHealth = message.mtpHealth); + message.position !== undefined && + (obj.position = positionToJSON(message.position)); + message.id !== undefined && + (obj.id = (message.id || Long.UZERO).toString()); + return obj; + }, + + fromPartial, I>>(object: I): MTP { + const message = createBaseMTP(); + message.address = object.address ?? ""; + message.collateralAsset = object.collateralAsset ?? ""; + message.collateralAmount = object.collateralAmount ?? ""; + message.liabilities = object.liabilities ?? ""; + message.interestPaid = object.interestPaid ?? ""; + message.interestUnpaid = object.interestUnpaid ?? ""; + message.custodyAsset = object.custodyAsset ?? ""; + message.custodyAmount = object.custodyAmount ?? ""; + message.leverage = object.leverage ?? ""; + message.mtpHealth = object.mtpHealth ?? ""; + message.position = object.position ?? 0; + message.id = + object.id !== undefined && object.id !== null + ? Long.fromValue(object.id) + : Long.UZERO; + return message; + }, +}; + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; + +export type DeepPartial = T extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? 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; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/core/src/generated/proto/sifnode/oracle/v1/types.ts b/core/src/generated/proto/sifnode/oracle/v1/types.ts index 69a87a72c..cdbf780d7 100644 --- a/core/src/generated/proto/sifnode/oracle/v1/types.ts +++ b/core/src/generated/proto/sifnode/oracle/v1/types.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.oracle.v1"; @@ -48,8 +48,9 @@ export function statusTextToJSON(object: StatusText): string { return "STATUS_TEXT_SUCCESS"; case StatusText.STATUS_TEXT_FAILED: return "STATUS_TEXT_FAILED"; + case StatusText.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -423,27 +424,29 @@ var globalThis: any = (() => { throw "Unable to locate global object"; })(); -const atob: (b64: string) => string = - globalThis.atob || - ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); function bytesFromBase64(b64: string): Uint8Array { - const bin = atob(b64); - const arr = new Uint8Array(bin.length); - for (let i = 0; i < bin.length; ++i) { - arr[i] = bin.charCodeAt(i); + if (globalThis.Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; } - return arr; } -const btoa: (bin: string) => string = - globalThis.btoa || - ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); function base64FromBytes(arr: Uint8Array): string { - const bin: string[] = []; - arr.forEach((byte) => { - bin.push(String.fromCharCode(byte)); - }); - return btoa(bin.join("")); + if (globalThis.Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } } type Builtin = @@ -470,10 +473,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/tokenregistry/v1/query.ts b/core/src/generated/proto/sifnode/tokenregistry/v1/query.ts index 17094af5d..2109b3596 100644 --- a/core/src/generated/proto/sifnode/tokenregistry/v1/query.ts +++ b/core/src/generated/proto/sifnode/tokenregistry/v1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ +import { Registry } from "./types"; import Long from "long"; -import * as _m0 from "protobufjs/minimal"; -import { Registry } from "../../../sifnode/tokenregistry/v1/types"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.tokenregistry.v1"; @@ -176,10 +176,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/tokenregistry/v1/tx.ts b/core/src/generated/proto/sifnode/tokenregistry/v1/tx.ts index 2d5a55922..3a3650273 100644 --- a/core/src/generated/proto/sifnode/tokenregistry/v1/tx.ts +++ b/core/src/generated/proto/sifnode/tokenregistry/v1/tx.ts @@ -1,10 +1,7 @@ /* eslint-disable */ +import { RegistryEntry, Registry } from "./types"; import Long from "long"; -import * as _m0 from "protobufjs/minimal"; -import { - RegistryEntry, - Registry, -} from "../../../sifnode/tokenregistry/v1/types"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.tokenregistry.v1"; @@ -455,10 +452,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/core/src/generated/proto/sifnode/tokenregistry/v1/types.ts b/core/src/generated/proto/sifnode/tokenregistry/v1/types.ts index d6a3d4dc5..5de89f134 100644 --- a/core/src/generated/proto/sifnode/tokenregistry/v1/types.ts +++ b/core/src/generated/proto/sifnode/tokenregistry/v1/types.ts @@ -1,6 +1,6 @@ /* eslint-disable */ import Long from "long"; -import * as _m0 from "protobufjs/minimal"; +import _m0 from "protobufjs/minimal"; export const protobufPackage = "sifnode.tokenregistry.v1"; @@ -55,8 +55,9 @@ export function permissionToJSON(object: Permission): string { return "DISABLE_BUY"; case Permission.DISABLE_SELL: return "DISABLE_SELL"; + case Permission.UNRECOGNIZED: default: - return "UNKNOWN"; + return "UNRECOGNIZED"; } } @@ -381,7 +382,7 @@ export const RegistryEntry = { fromJSON(object: any): RegistryEntry { return { decimals: isSet(object.decimals) - ? Long.fromString(object.decimals) + ? Long.fromValue(object.decimals) : Long.ZERO, denom: isSet(object.denom) ? String(object.denom) : "", baseDenom: isSet(object.baseDenom) ? String(object.baseDenom) : "", @@ -502,10 +503,9 @@ export type DeepPartial = T extends Builtin type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & Record< - Exclude>, - never - >; + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; diff --git a/yarn.lock b/yarn.lock index 0e7ab5bc2..b86bb2207 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5459,7 +5459,7 @@ __metadata: query-string: ^7.1.1 tiny-invariant: ^1.2.0 toformat: ^2.0.0 - ts-proto: ^1.118.0 + ts-proto: ^1.121.5 typed-emitter: ^2.1.0 typedoc: ^0.22.18 typescript: ^4.7.4 @@ -26293,9 +26293,9 @@ __metadata: languageName: node linkType: hard -"ts-proto@npm:^1.118.0": - version: 1.118.0 - resolution: "ts-proto@npm:1.118.0" +"ts-proto@npm:^1.121.5": + version: 1.122.0 + resolution: "ts-proto@npm:1.122.0" dependencies: "@types/object-hash": ^1.3.0 dataloader: ^1.4.0 @@ -26305,7 +26305,7 @@ __metadata: ts-proto-descriptors: 1.7.1 bin: protoc-gen-ts_proto: protoc-gen-ts_proto - checksum: 3f735db4e8bcc565ad1eabdd93a7012f75a39e58cd103471074f04e7160d3eda3ee02b3877f529adb28262029412747fb62e12a95ef7069c4659542dc69890c7 + checksum: ebf92402f3829d4a852cac90b75235e1402b13fd973fa97b955308f98ae8f75b4d2c46bd86eb166e378fe5a4d73d08ab51073574b698878ba625e2d5847252a9 languageName: node linkType: hard