-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhanced compatibility with the latest features of the Osmosis network.
- Loading branch information
1 parent
5578430
commit 9067ef4
Showing
220 changed files
with
10,262 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
lib/src/models/networks/osmosis/osmosis_concentrated_liquidity_v1beta1/.DS_Store
Binary file not shown.
108 changes: 108 additions & 0 deletions
108
lib/src/models/networks/osmosis/osmosis_concentrated_liquidity_v1beta1/messages/pool.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import 'package:cosmos_sdk/src/models/networks/osmosis/osmosis_concentrated_liquidity_v1beta1/types/types.dart'; | ||
import 'package:cosmos_sdk/src/protobuf/protobuf.dart'; | ||
|
||
/// PoolIdToTickSpacingRecord is a struct that contains a pool id to new tick spacing pair. | ||
class OsmosisConcentratedLiquidityPool extends CosmosMessage { | ||
/// pool's address holding all liquidity tokens. | ||
final String? address; | ||
|
||
/// address holding the incentives liquidity. | ||
final String? incentivesAddress; | ||
|
||
/// address holding spread rewards from swaps. | ||
final String? spreadRewardsAddress; | ||
final BigInt? id; | ||
|
||
/// Amount of total liquidity | ||
final String currentTickLiquidity; | ||
final String? token0; | ||
final String? token1; | ||
final String currentSqrtPrice; | ||
final BigInt? currentTick; | ||
|
||
/// tick_spacing must be one of the authorized_tick_spacing values set in the | ||
/// concentrated-liquidity parameters | ||
final BigInt? tickSpacing; | ||
final BigInt? exponentAtPriceOne; | ||
|
||
/// spread_factor is the ratio that is charged on the amount of token in. | ||
final String spreadFactor; | ||
|
||
/// last_liquidity_update is the last time either the pool liquidity or the | ||
/// active tick changed | ||
final ProtobufTimestamp lastLiquidityUpdate; | ||
OsmosisConcentratedLiquidityPool( | ||
{this.address, | ||
this.incentivesAddress, | ||
this.spreadRewardsAddress, | ||
this.id, | ||
required this.currentTickLiquidity, | ||
this.token0, | ||
this.token1, | ||
required this.currentSqrtPrice, | ||
this.currentTick, | ||
this.tickSpacing, | ||
this.exponentAtPriceOne, | ||
required this.spreadFactor, | ||
required this.lastLiquidityUpdate}); | ||
factory OsmosisConcentratedLiquidityPool.deserialize(List<int> bytes) { | ||
final decode = CosmosProtocolBuffer.decode(bytes); | ||
return OsmosisConcentratedLiquidityPool( | ||
address: decode.getField(1), | ||
incentivesAddress: decode.getField(2), | ||
spreadRewardsAddress: decode.getField(3), | ||
id: decode.getField(4), | ||
currentTickLiquidity: decode.getField(5), | ||
token0: decode.getField(6), | ||
token1: decode.getField(7), | ||
currentSqrtPrice: decode.getField(8), | ||
currentTick: decode.getField(9), | ||
tickSpacing: decode.getField(10), | ||
exponentAtPriceOne: decode.getField(11), | ||
spreadFactor: decode.getField(12), | ||
lastLiquidityUpdate: | ||
ProtobufTimestamp.deserialize(decode.getField(13))); | ||
} | ||
|
||
@override | ||
List<int> get fieldIds => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]; | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
return { | ||
"address": address, | ||
"incentives_address": incentivesAddress, | ||
"spread_rewards_address": spreadRewardsAddress, | ||
"id": id?.toString(), | ||
"current_tick_liquidity": currentTickLiquidity, | ||
"token0": token0, | ||
"token1": token1, | ||
"current_sqrt_price": currentSqrtPrice, | ||
"current_tick": currentTick?.toString(), | ||
"tick_spacing": tickSpacing?.toString(), | ||
"exponent_at_price_one": exponentAtPriceOne?.toString(), | ||
"spread_factor": spreadFactor, | ||
"last_liquidity_update": lastLiquidityUpdate.toJson() | ||
}; | ||
} | ||
|
||
@override | ||
List get values => [ | ||
address, | ||
incentivesAddress, | ||
spreadRewardsAddress, | ||
id, | ||
currentTickLiquidity, | ||
token0, | ||
token1, | ||
currentSqrtPrice, | ||
currentTick, | ||
tickSpacing, | ||
exponentAtPriceOne, | ||
spreadFactor, | ||
lastLiquidityUpdate | ||
]; | ||
|
||
@override | ||
String get typeUrl => OsmosisConcentratedLiquidityV1beta1Types.pool.typeUrl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...smosis/osmosis_concentrated_liquidity_v1beta1/osmosis_concentrated_liquidity_v1beta1.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
export 'messages/accum_object.dart'; | ||
export 'messages/full_position_breakdown.dart'; | ||
export 'messages/full_tick.dart'; | ||
export 'messages/genesis_state.dart'; | ||
export 'messages/incentive_record.dart'; | ||
export 'messages/incentive_record_body.dart'; | ||
export 'messages/liquidity_depth_with_range.dart'; | ||
export 'messages/pool_data.dart'; | ||
export 'messages/pool_id_to_tick_spacing_record.dart'; | ||
export 'messages/pool_record.dart'; | ||
export 'messages/position.dart'; | ||
export 'messages/position_data.dart'; | ||
export 'messages/position_with_period_lock.dart'; | ||
export 'messages/tick_info.dart'; | ||
export 'messages/tick_liquidity_net.dart'; | ||
export 'messages/tick_spacing_decrease_proposal.dart'; | ||
export 'messages/uptime_tracker.dart'; | ||
export 'messages/uptime_trackers.dart'; | ||
|
||
export 'query/cfmm_pool_id_link_from_concentrated_pool_id_request.dart'; | ||
export 'query/cfmm_pool_id_link_from_concentrated_pool_id_response.dart'; | ||
export 'query/claimable_incentives_request.dart'; | ||
export 'query/claimable_incentives_response.dart'; | ||
export 'query/claimable_spread_rewards_request.dart'; | ||
export 'query/claimable_spread_rewards_response.dart'; | ||
export 'query/get_total_liquidity_request.dart'; | ||
export 'query/get_total_liquidity_response.dart'; | ||
export 'query/incentive_records_request.dart'; | ||
export 'query/incentive_records_response.dart'; | ||
export 'query/liquidity_net_in_direction_request.dart'; | ||
export 'query/liquidity_net_in_direction_response.dart'; | ||
export 'query/liquidity_per_tick_range_request.dart'; | ||
export 'query/liquidity_per_tick_range_response.dart'; | ||
export 'query/num_next_initialized_ticks_request.dart'; | ||
export 'query/num_next_initialized_ticks_response.dart'; | ||
export 'query/params_request.dart'; | ||
export 'query/params_response.dart'; | ||
export 'query/pool_accumulator_rewards_request.dart'; | ||
export 'query/pool_accumulator_rewards_response.dart'; | ||
export 'query/pools_request.dart'; | ||
export 'query/pools_response.dart'; | ||
export 'query/position_by_id_request.dart'; | ||
export 'query/position_by_id_response.dart'; | ||
export 'query/tick_accumulator_trackers_request.dart'; | ||
export 'query/tick_accumulator_trackers_response.dart'; | ||
export 'query/user_positions_request.dart'; | ||
export 'query/user_positions_response.dart'; | ||
export 'query/user_unbonding_positions_request.dart'; | ||
export 'query/user_unbonding_positions_response.dart'; | ||
|
||
export 'services/msg_add_to_position.dart'; | ||
export 'services/msg_add_to_position_response.dart'; | ||
export 'services/msg_collect_incentives.dart'; | ||
export 'services/msg_collect_incentives_response.dart'; | ||
export 'services/msg_collect_spread_rewards.dart'; | ||
export 'services/msg_collect_spread_rewards_response.dart'; | ||
export 'services/msg_create_position.dart'; | ||
export 'services/msg_create_position_response.dart'; | ||
export 'services/msg_transfer_positions.dart'; | ||
export 'services/msg_withdraw_position.dart'; | ||
export 'services/msg_withdraw_position_response.dart'; |
63 changes: 63 additions & 0 deletions
63
...entrated_liquidity_v1beta1/query/cfmm_pool_id_link_from_concentrated_pool_id_request.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import 'package:cosmos_sdk/src/models/networks/osmosis/osmosis_concentrated_liquidity_v1beta1/types/types.dart'; | ||
import 'package:cosmos_sdk/src/protobuf/protobuf.dart'; | ||
import 'cfmm_pool_id_link_from_concentrated_pool_id_response.dart'; | ||
|
||
class OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdRequest | ||
extends CosmosMessage | ||
with | ||
QueryMessage< | ||
OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse>, | ||
RPCMessage< | ||
OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse> { | ||
final BigInt? concentratedPoolId; | ||
|
||
const OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdRequest( | ||
{this.concentratedPoolId}); | ||
factory OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdRequest.deserialize( | ||
List<int> bytes) { | ||
final decode = CosmosProtocolBuffer.decode(bytes); | ||
return OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdRequest( | ||
concentratedPoolId: decode.getField(1)); | ||
} | ||
|
||
@override | ||
List<int> get fieldIds => [1]; | ||
|
||
@override | ||
Map<String, String?> get queryParameters => {}; | ||
|
||
@override | ||
String get queryPath => OsmosisConcentratedLiquidityV1beta1Types | ||
.cFMMPoolIdLinkFromConcentratedPoolId.typeUrl; | ||
|
||
@override | ||
String get rpcPath => OsmosisConcentratedLiquidityV1beta1Types | ||
.cFMMPoolIdLinkFromConcentratedPoolId | ||
.rpcUrl(pathParameters: [concentratedPoolId?.toString()]); | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
return {"concentrated_pool_id": concentratedPoolId?.toString()}; | ||
} | ||
|
||
@override | ||
String get typeUrl => OsmosisConcentratedLiquidityV1beta1Types | ||
.cFMMPoolIdLinkFromConcentratedPoolIdRequest.typeUrl; | ||
|
||
@override | ||
List get values => [concentratedPoolId]; | ||
|
||
@override | ||
OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse | ||
onJsonResponse(Map<String, dynamic> json) { | ||
return OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse | ||
.fromRpc(json); | ||
} | ||
|
||
@override | ||
OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse | ||
onResponse(List<int> bytes) { | ||
return OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse | ||
.deserialize(bytes); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...ntrated_liquidity_v1beta1/query/cfmm_pool_id_link_from_concentrated_pool_id_response.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import 'package:blockchain_utils/numbers/numbers.dart'; | ||
import 'package:cosmos_sdk/src/models/networks/osmosis/osmosis_concentrated_liquidity_v1beta1/types/types.dart'; | ||
import 'package:cosmos_sdk/src/protobuf/protobuf.dart'; | ||
|
||
class OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse | ||
extends CosmosMessage { | ||
final BigInt? cfmmPoolId; | ||
|
||
OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse( | ||
{this.cfmmPoolId}); | ||
factory OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse.deserialize( | ||
List<int> bytes) { | ||
final decode = CosmosProtocolBuffer.decode(bytes); | ||
return OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse( | ||
cfmmPoolId: decode.getField(1)); | ||
} | ||
factory OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse.fromRpc( | ||
Map<String, dynamic> json) { | ||
return OsmosisConcentratedLiquidityCFMMPoolIdLinkFromConcentratedPoolIdResponse( | ||
cfmmPoolId: BigintUtils.tryParse(json["cfmm_pool_id"])); | ||
} | ||
|
||
@override | ||
List<int> get fieldIds => [1]; | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
return {"cfmm_pool_id": cfmmPoolId?.toString()}; | ||
} | ||
|
||
@override | ||
String get typeUrl => OsmosisConcentratedLiquidityV1beta1Types | ||
.cFMMPoolIdLinkFromConcentratedPoolIdResponse.typeUrl; | ||
|
||
@override | ||
List get values => [cfmmPoolId]; | ||
} |
Oops, something went wrong.