Skip to content

Commit

Permalink
feat: add referral api (#1608)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinenerio authored Nov 18, 2024
1 parent 694debb commit 53bee06
Show file tree
Hide file tree
Showing 10 changed files with 457 additions and 76 deletions.
1 change: 1 addition & 0 deletions packages/espressocash_api/lib/espressocash_api.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export 'package:jupiter_aggregator/jupiter_aggregator.dart';

export 'src/client.dart';
export 'src/dto/ambassador_referral.dart';
export 'src/dto/create_payment.dart';
export 'src/dto/dln_payment.dart';
export 'src/dto/durable_transactions.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 @@ -176,6 +176,11 @@ abstract class EspressoCashClient {

@POST('/tokens/meta')
Future<GetTokensMetaResponseDto> getTokensMeta();

@POST('/ambassador/addReferral')
Future<void> addAmbassadorReferral(
@Body() AmbassadorReferralRequestDto request,
);
}

extension EspressoCashClientExt on EspressoCashClient {
Expand Down
98 changes: 62 additions & 36 deletions packages/espressocash_api/lib/src/client.g.dart

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

14 changes: 14 additions & 0 deletions packages/espressocash_api/lib/src/dto/ambassador_referral.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'ambassador_referral.freezed.dart';
part 'ambassador_referral.g.dart';

@freezed
class AmbassadorReferralRequestDto with _$AmbassadorReferralRequestDto {
const factory AmbassadorReferralRequestDto({
required String ambassadorAddress,
}) = _AmbassadorReferralRequestDto;

factory AmbassadorReferralRequestDto.fromJson(Map<String, dynamic> json) =>
_$AmbassadorReferralRequestDtoFromJson(json);
}
Loading

0 comments on commit 53bee06

Please sign in to comment.