Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
720c394
Add SwapManager with orderbook and swap trading capabilities
cursoragent Aug 10, 2025
8901f51
chore: apply formatting
CharlVS Aug 11, 2025
25d6c9b
Merge branch 'dev' of https://github.com/KomodoPlatform/komodo-defi-s…
CharlVS Aug 12, 2025
684c6a2
Merge branch 'dev' of https://github.com/KomodoPlatform/komodo-defi-s…
CharlVS Aug 13, 2025
7d8e054
Resolve merge: both-added identical files in rpc_methods (order_statu…
CharlVS Aug 13, 2025
d7e6057
Merge branch 'dev' of https://github.com/KomodoPlatform/komodo-defi-s…
CharlVS Aug 13, 2025
df8c161
Merge branch 'dev' of https://github.com/KomodoPlatform/komodo-defi-s…
CharlVS Aug 13, 2025
3426a52
feat: add missing trading RPCs
CharlVS Aug 13, 2025
4ba6bf0
fix(rpc): fix trading RPCs to match Postman collection
CharlVS Aug 13, 2025
495b275
docs: add comprehensive dartdoc to public APIs in swap manager and ne…
CharlVS Aug 13, 2025
0cc8b7f
style: insert empty lines between documented class fields for readabi…
CharlVS Aug 13, 2025
98a64cc
refactor(active_swaps): declarative toJson map literal with inline co…
CharlVS Aug 13, 2025
2162e7e
refactor(rpc_methods): use declarative toJson() across trading, order…
CharlVS Aug 13, 2025
097c0ed
chore(rpc): format trading RPCs
CharlVS Aug 13, 2025
4355461
refactor(sdk): change sdk swap manager to higher-level types
CharlVS Aug 13, 2025
d4085a9
refactor(rpc): enhance trading-related RPC type safety
CharlVS Aug 13, 2025
d08a26b
feat(trading): implement SDK placeholder trading functionality
CharlVS Aug 13, 2025
7599034
feat: expand swap functionality
CharlVS Aug 13, 2025
3366dbc
Create swap manager interface with documentation (#189)
CharlVS Aug 15, 2025
b600252
Keep only types (packages/komodo_defi_types) and RPC library (package…
CharlVS Aug 15, 2025
87d5f57
fix(rpc): further reconciliation between RPC library and docs
CharlVS Aug 15, 2025
86c1929
fix(rpc): use RecentSwapsFilter in RecentSwapsRequest; fix recentSwap…
CharlVS Aug 17, 2025
594700c
Make isMine parameter required in PlacedOrderSummary constructor
cursoragent Aug 17, 2025
8b61a07
chore: update pubspec files
CharlVS Aug 17, 2025
6951ba3
Add support for fraction and rational number representations
cursoragent Aug 17, 2025
0642423
Update cancel orders type to use lowercase and adjust coin key
cursoragent Aug 17, 2025
21f2290
docs(trading): clarify trade_with parameter in max_taker_vol; note pa…
CharlVS Aug 18, 2025
ae30d4a
Merge branch 'cursor/ensure-trading-field-precision-in-rpc-and-types-…
CharlVS Aug 18, 2025
65df8fd
chore: generate indexes
CharlVS Aug 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/dragon_charts_flutter/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,26 +102,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
url: "https://pub.dev"
source: hosted
version: "10.0.9"
version: "11.0.1"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -227,18 +227,18 @@ packages:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.4"
version: "0.7.6"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vm_service:
dependency: transitive
description:
Expand All @@ -248,5 +248,5 @@ packages:
source: hosted
version: "15.0.0"
sdks:
dart: ">=3.7.0-0 <4.0.0"
dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
4 changes: 4 additions & 0 deletions packages/dragon_charts_flutter/example/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# melos_managed_dependency_overrides: dragon_charts_flutter
dependency_overrides:
dragon_charts_flutter:
path: ..
20 changes: 10 additions & 10 deletions packages/dragon_logs/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
url: "https://pub.dev"
source: hosted
version: "10.0.9"
version: "11.0.1"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
source: hosted
version: "3.0.9"
version: "3.0.10"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -341,10 +341,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
url: "https://pub.dev"
source: hosted
version: "0.7.4"
version: "0.7.6"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -397,10 +397,10 @@ packages:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.2.0"
vm_service:
dependency: transitive
description:
Expand Down
4 changes: 4 additions & 0 deletions packages/dragon_logs/example/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# melos_managed_dependency_overrides: dragon_logs
dependency_overrides:
dragon_logs:
path: ..

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,13 @@ class ActivationRpcData {
/// Creates [ActivationRpcData] from JSON configuration
factory ActivationRpcData.fromJson(JsonMap json) {
return ActivationRpcData(
lightWalletDServers:
json
.valueOrNull<List<dynamic>>('light_wallet_d_servers')
?.cast<String>(),
lightWalletDServers: json.valueOrNull<List<String>>(
'light_wallet_d_servers',
),
electrum:
json
.valueOrNull<List<dynamic>>('electrum')
?.map((e) => ActivationServers.fromJsonConfig(e as JsonMap))
.valueOrNull<JsonList>('electrum')
?.map(ActivationServers.fromJsonConfig)
.toList(),
syncParams: json.valueOrNull<dynamic>('sync_params'),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class TendermintActivationParams extends ActivationParams {
.toList();
final tokensParams =
json
.valueOrNull<List<dynamic>>('tokens_params')
?.map((e) => TokensRequest.fromJson(e as JsonMap))
.valueOrNull<JsonList>('tokens_params')
?.map(TokensRequest.fromJson)
.toList() ??
[];
final getBalances = json.valueOrNull<bool>('get_balances') ?? true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ export 'nft/nft_transfer_filter.dart';
export 'nft/withdraw_nft_data.dart';
export 'orderbook/order_info.dart';
export 'orderbook/order_type.dart';
export 'orderbook/request_by.dart';
export 'pagination/history_target.dart';
export 'pagination/pagination.dart';
export 'primitive/fraction.dart';
export 'primitive/mm2_rational.dart';
export 'primitive/numeric_value.dart';
export 'trading/match_by.dart';
export 'trading/order_status.dart';
export 'trading/recent_swaps_filter.dart';
export 'trading/swap_info.dart';
export 'trading/swap_method.dart';
export 'transaction_history/transaction_info.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@

export 'lightning_closed_channels_filter.dart';
export 'lightning_open_channels_filter.dart';
export 'lightning_channel_amount.dart';
export 'lightning_channel_options.dart';
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import 'package:komodo_defi_types/komodo_defi_type_utils.dart';
import 'package:rational/rational.dart';
import '../primitive/mm2_rational.dart';
import '../primitive/fraction.dart';

/// Represents information about an order in the orderbook.
///
Expand Down Expand Up @@ -28,6 +31,12 @@ class OrderInfo {
required this.zcredits,
required this.coin,
required this.address,
this.priceFraction,
this.priceRat,
this.maxVolumeFraction,
this.maxVolumeRat,
this.minVolumeFraction,
this.minVolumeRat,
});

/// Creates an [OrderInfo] instance from a JSON map.
Expand All @@ -53,6 +62,30 @@ class OrderInfo {
zcredits: json.value<int>('zcredits'),
coin: json.value<String>('coin'),
address: json.value<String>('address'),
priceFraction:
json.valueOrNull<JsonMap>('price_fraction') != null
? Fraction.fromJson(json.value<JsonMap>('price_fraction'))
: null,
priceRat:
json.valueOrNull<List<dynamic>>('price_rat') != null
? rationalFromMm2(json.value<List<dynamic>>('price_rat'))
: null,
maxVolumeFraction:
json.valueOrNull<JsonMap>('max_volume_fraction') != null
? Fraction.fromJson(json.value<JsonMap>('max_volume_fraction'))
: null,
maxVolumeRat:
json.valueOrNull<List<dynamic>>('max_volume_rat') != null
? rationalFromMm2(json.value<List<dynamic>>('max_volume_rat'))
: null,
minVolumeFraction:
json.valueOrNull<JsonMap>('min_volume_fraction') != null
? Fraction.fromJson(json.value<JsonMap>('min_volume_fraction'))
: null,
minVolumeRat:
json.valueOrNull<List<dynamic>>('min_volume_rat') != null
? rationalFromMm2(json.value<List<dynamic>>('min_volume_rat'))
: null,
);
}

Expand Down Expand Up @@ -110,6 +143,24 @@ class OrderInfo {
/// involving this order.
final String address;

/// Optional fractional representation of the price
final Fraction? priceFraction;

/// Optional rational representation of the price
final Rational? priceRat;

/// Optional fractional representation of the maximum volume
final Fraction? maxVolumeFraction;

/// Optional rational representation of the maximum volume
final Rational? maxVolumeRat;

/// Optional fractional representation of the minimum volume
final Fraction? minVolumeFraction;

/// Optional rational representation of the minimum volume
final Rational? minVolumeRat;

/// Converts this [OrderInfo] instance to a JSON map.
///
/// The resulting map can be serialized to JSON and will contain all
Expand All @@ -124,5 +175,13 @@ class OrderInfo {
'zcredits': zcredits,
'coin': coin,
'address': address,
if (priceFraction != null) 'price_fraction': priceFraction!.toJson(),
if (priceRat != null) 'price_rat': rationalToMm2(priceRat!),
if (maxVolumeFraction != null)
'max_volume_fraction': maxVolumeFraction!.toJson(),
if (maxVolumeRat != null) 'max_volume_rat': rationalToMm2(maxVolumeRat!),
if (minVolumeFraction != null)
'min_volume_fraction': minVolumeFraction!.toJson(),
if (minVolumeRat != null) 'min_volume_rat': rationalToMm2(minVolumeRat!),
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/// Defines the request_by object for best_orders.
///
/// Mirrors the KDF API structure:
/// - type: "volume" | "number"
/// - value: Decimal (as string) when type == volume, Unsigned int when type == number
class RequestBy {
RequestBy._(this.type, this.volumeValue, this.numberValue);

/// Create a volume-based request_by with a decimal value represented as string.
factory RequestBy.volume(String value) => RequestBy._('volume', value, null);

/// Create a number-based request_by with an unsigned integer value.
factory RequestBy.number(int value) => RequestBy._('number', null, value);

final String type;
final String? volumeValue;
final int? numberValue;

Map<String, dynamic> toJson() {
return <String, dynamic>{
'type': type,
'value': type == 'volume' ? volumeValue! : numberValue!,
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:komodo_defi_types/komodo_defi_type_utils.dart';

class Fraction {
Fraction({required this.numer, required this.denom});

factory Fraction.fromJson(JsonMap json) {
return Fraction(
numer: json.value<String>('numer'),
denom: json.value<String>('denom'),
);
}

/// Numerator of the fraction
final String numer;

/// Denominator of the fraction
final String denom;

Map<String, dynamic> toJson() => {'numer': numer, 'denom': denom};
}
Loading
Loading