Skip to content

Commit

Permalink
upd endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
justinenerio committed Jan 28, 2025
1 parent 1ee1cd7 commit bbec6a9
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/espressocash_api/lib/espressocash_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export 'src/dto/get_rates.dart';
export 'src/dto/get_tokens.dart';
export 'src/dto/moneygram.dart';
export 'src/dto/priority_fees.dart';
export 'src/dto/ramp.dart';
export 'src/dto/scalex.dart';
export 'src/dto/shorten_link.dart';
export 'src/dto/swap.dart';
Expand Down
5 changes: 5 additions & 0 deletions packages/espressocash_api/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ abstract class EspressoCashClient {
@POST('/scalex/fees')
Future<ScalexRateFeeResponseDto> fetchScalexFeesAndRate();

@POST('/scalex/brij/fees')
Future<ScalexBrijFeeResponseDto> fetchScalexBrijFees(
@Body() ScalexBrijFeeRequestDto request,
);

@POST('/updateUserWalletCountry')
Future<void> updateUserWalletCountry(
@Body() WalletCountryRequestDto request,
Expand Down
3 changes: 1 addition & 2 deletions packages/espressocash_api/lib/src/dto/moneygram.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:espressocash_api/src/dto/ramp.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'moneygram.freezed.dart';
Expand Down Expand Up @@ -88,8 +89,6 @@ class MoneygramFeeResponseDto with _$MoneygramFeeResponseDto {
_$MoneygramFeeResponseDtoFromJson(json);
}

enum RampTypeDto { onRamp, offRamp }

@freezed
class FundXlmRequestDto with _$FundXlmRequestDto {
const factory FundXlmRequestDto({
Expand Down
1 change: 1 addition & 0 deletions packages/espressocash_api/lib/src/dto/ramp.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enum RampTypeDto { onRamp, offRamp }
38 changes: 38 additions & 0 deletions packages/espressocash_api/lib/src/dto/scalex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,44 @@ class ScalexRateFeeResponseDto with _$ScalexRateFeeResponseDto {
_$ScalexRateFeeResponseDtoFromJson(json);
}

@freezed
class ScalexBrijFeeRequestDto with _$ScalexBrijFeeRequestDto {
const factory ScalexBrijFeeRequestDto({
required String amount,
required RampTypeDto type,
}) = _ScalexBrijFeeRequestDto;

factory ScalexBrijFeeRequestDto.fromJson(Map<String, dynamic> json) =>
_$ScalexBrijFeeRequestDtoFromJson(json);
}

@freezed
class ScalexFees with _$ScalexFees {
const factory ScalexFees({
required double fixedFee,
required double marginFee,
required double percentageFee,
required double percentageFeeAmount,
required double totalFee,
}) = _ScalexFees;

factory ScalexFees.fromJson(Map<String, dynamic> json) =>
_$ScalexFeesFromJson(json);
}

@freezed
class ScalexBrijFeeResponseDto with _$ScalexBrijFeeResponseDto {
const factory ScalexBrijFeeResponseDto({
required int fiatAmount,
required double cryptoAmount,
required double rate,
required ScalexFees scalexFees,
}) = _ScalexBrijFeeResponseDto;

factory ScalexBrijFeeResponseDto.fromJson(Map<String, dynamic> json) =>
_$ScalexBrijFeeResponseDtoFromJson(json);
}

@JsonEnum()
enum ScalexOrderStatus {
pending,
Expand Down

0 comments on commit bbec6a9

Please sign in to comment.