Skip to content

Commit

Permalink
Merge branch 'master' into akhil-deriv-feat---DERG-2450]-akhil/2450/c…
Browse files Browse the repository at this point in the history
…rypto_transaction_details_page
  • Loading branch information
ayaan-deriv authored Jul 3, 2024
2 parents 3dd91bb + b29d222 commit 2ddb377
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 62 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check_versioning_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
check-version-pr:
runs-on: ubuntu-latest
if: ${{ ! startsWith(github.event.pull_request.title , 'chore(version)') }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,48 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2024-07-02

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_auth` - `v6.7.9`](#deriv_auth---v679)

---

#### `deriv_auth` - `v6.7.9`

- **REFACTOR**(deriv_auth): Replace uni_links2 with app_links ([#664](https://github.com/regentmarkets/flutter-deriv-packages/issues/664)). ([f99554bc](https://github.com/regentmarkets/flutter-deriv-packages/commit/f99554bc134b7fe7fe0b3f5bf7555728868176c9))


## 2024-07-02

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`deriv_auth` - `v6.7.8`](#deriv_auth---v678)

---

#### `deriv_auth` - `v6.7.8`

- **FIX**(deriv_auth): fix_error_when_initializing_mock_auth_service ([#660](https://github.com/regentmarkets/flutter-deriv-packages/issues/660)). ([30aa969f](https://github.com/regentmarkets/flutter-deriv-packages/commit/30aa969f7ed3f083ab1610518eded103d0aa2eb7))


## 2024-07-01

### Changes
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ This repository contains private packages & plugins that are used by the company

### <span style="color:green">GIT HOOK</span>

<span style="color:orange">Please run the below command to have the git hook installed.</span></br>
<span style="color:orange">This Hook will check for Semantic versioning commit convention</span></br>
1- Please download commit-msg file from githooks/commit-msg.</br>
2- Run the command below.</br>

```BASH
curl --fail -o $HOME/.git/hooks/commit-msg https://raw.githubusercontent.com/regentmarkets/flutter-deriv-packages/master/githooks/commit-msg \
cp $HOME/Downloads/commit-msg $HOME/.git/hooks/commit-msg \
&& chmod +x $HOME/.git/hooks/commit-msg
```

## Using the packages

Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.7)`. To use the package, add the following to your pubspec.yaml file:

Each package has been released as git tag with convention as **packageName-vVersionNumber**`(Example: deriv_auth-v6.7.9)`. To use the package, add the following to your pubspec.yaml file:

```yaml
deriv_ui:
Expand All @@ -30,7 +30,7 @@ deriv_ui:
| Name | Description | Version |
| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [analytics](./packages/analytics) | Used to collect and send analytical information to 'Firebase' and 'Segment'. | [v2.1.0](./packages/analytics/CHANGELOG.md) |
| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.7 ](./packages/deriv_auth/CHANGELOG.md) |
| [deriv_auth](./packages/deriv_auth) | A Dart package that provides Authentication logic for Deriv applications. | [v6.7.9 ](./packages/deriv_auth/CHANGELOG.md) |
| [deriv_banner](./packages/deriv_banner) | A widget to show banner in apps. | [v0.0.1+1](./packages/deriv_banner/CHANGELOG.md) |
| [deriv_bloc_manager](./packages/deriv_bloc_manager) | Provides some tools to manage blocs. | [v0.0.1](./packages/deriv_bloc_manager/CHANGELOG.md) |
| [deriv_datadog](./packages/deriv_datadog) | A package that helps you monitor the performance and user interactions of your Flutter app by sending data to Datadog. | [v0.0.1](./packages/deriv_datadog/CHANGELOG.md) |
Expand All @@ -41,8 +41,8 @@ deriv_ui:
| [deriv_http_client](./packages/deriv_http_client) | A package that provides a wrapper for http package. | [v2.0.0](./packages/deriv_http_client/CHANGELOG.md) |
| [deriv_lint](./packages/deriv_lint) | A Dart package that provides lint rules for Dart and Flutter. | [v1.0.0](./packages/deriv_lint/CHANGELOG.md) |
| [deriv_live_chat](./packages/deriv_live_chat) | A plugin for live chat SDK support to dart. | [v0.0.1+2](./packages/deriv_live_chat/CHANGELOG.md) |
| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./packages/deriv_language_selector/CHANGELOG.md) |
| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.1.1](./packages/deriv_localizations/CHANGELOG.md) | | [v1.5.1](./packages/deriv_localizations/CHANGELOG.md) |
| [deriv_language_selector](./packages/deriv_language_selector) | A package to handle language change of the app. | [v0.0.2+7](./packages/deriv_language_selector/CHANGELOG.md) |
| [deriv_localizations](./packages/deriv_localizations) | A Package that contains the localization arb(coming from Crowdin) and dart generated files for flutter_deriv_packages. | [v1.1.1](./packages/deriv_localizations/CHANGELOG.md) |
| [deriv_numpad](./packages/deriv_numpad) | Number Pad Widget for number input. | [v1.1.5](./packages/deriv_numpad/CHANGELOG.md) |
| [deriv_rudderstack](./packages/deriv_rudderstack) | A plugin that add RudderStack SDK support to Flutter. | [v1.1.0](./packages/deriv_rudderstack/CHANGELOG.md) |
| [deriv_store_launcher](./packages/deriv_store_launcher) | A plugin to launch app stores base on platform and manufacturer. | [v0.0.1+1](./packages/deriv_store_launcher/CHANGELOG.md) |
Expand All @@ -51,38 +51,38 @@ deriv_ui:
| [deriv_ui](./packages/deriv_ui) | A package that contains the UI components used by Deriv products. | [v0.0.7+9](./packages/deriv_ui/CHANGELOG.md) |
| [deriv_utilities](./packages/deriv_utilities) | A package that contains the utilities including helper functions, mixins, and extensions. | [v1.0.0](./packages/deriv_utilities/CHANGELOG.md) |
| [deriv_websocket](./packages/deriv_web_socket_client) | A package that provides a easy to use websocket client. | [v1.0.1](./packages/deriv_web_socket_client/CHANGELOG.md) |
| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2+3](./packages/deriv_web_view/CHANGELOG.md) |
| [deriv_widgetbook](./packages/deriv_widgetbook) |Storybook for Deriv UI Widgets and Components | [v0.0.2+9](./packages/deriv_widgetbook/CHANGELOG.md) |
| [deriv_web_view](./packages/deriv_web_view) | Deriv web view package. | [v0.2.2+3](./packages/deriv_web_view/CHANGELOG.md) |
| [deriv_widgetbook](./packages/deriv_widgetbook) | Storybook for Deriv UI Widgets and Components | [v0.0.2+9](./packages/deriv_widgetbook/CHANGELOG.md) |
| [form_builder](./packages/form_builder) | A simpler and cleaner way to create, validate and submit forms. | [v1.0.0+1](./packages/form_builder/CHANGELOG.md) |
| [update_checker](./packages/update_checker) | Check and retrieve update information from the server for the given package. | [v1.4.0](./packages/update_checker/CHANGELOG.md) |
| [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) |
| [deriv_feature_flag](./packages/deriv_feature_flag) | A package to provide feature flag functionality for apps. | [v0.1.1](./packages/deriv_feature_flag/CHANGELOG.md) |
## Environment Setup
We use [Melos](https://pub.dev/packages/melos) to manage the multiple packages in this repository. To get started, install Melos globally:
```bash
$ dart pub global activate melos
dart pub global activate melos
```

Running `pub get` on all packages, run:

```bash
$ melos bootstrap
melos bootstrap
```

`Analyze` and `Test` has already been configured in `melos.yaml` so you can do the following:

<b>Running `flutter analyze` on all packages:</b>

```bash
$ melos run analyze
melos run analyze
```

<b>Running `flutter test` on all packages: </b>

```bash
$ melos run test --no-select
melos run test --no-select
```

If you'd like to run any other command on all packages, you can configure it in `melos.yaml` or run it directly with melos:
Expand Down
8 changes: 8 additions & 0 deletions packages/deriv_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 6.7.9

- **REFACTOR**(deriv_auth): Replace uni_links2 with app_links ([#664](https://github.com/regentmarkets/flutter-deriv-packages/issues/664)). ([f99554bc](https://github.com/regentmarkets/flutter-deriv-packages/commit/f99554bc134b7fe7fe0b3f5bf7555728868176c9))

## 6.7.8

- **FIX**(deriv_auth): fix_error_when_initializing_mock_auth_service ([#660](https://github.com/regentmarkets/flutter-deriv-packages/issues/660)). ([30aa969f](https://github.com/regentmarkets/flutter-deriv-packages/commit/30aa969f7ed3f083ab1610518eded103d0aa2eb7))

## 6.7.7

- **REFACTOR**(deriv_passkeys): update deriv api dependency ([#656](https://github.com/regentmarkets/flutter-deriv-packages/issues/656)). ([3425078b](https://github.com/regentmarkets/flutter-deriv-packages/commit/3425078b52baac4f387504c9d41063bda1dba249))
Expand Down
3 changes: 2 additions & 1 deletion packages/deriv_auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ DerivAuthCubit(

Some usage examples:


- First, start by getting the `DerivAuthCubit` instance.

```dart
Expand Down Expand Up @@ -341,4 +342,4 @@ Some usage examples:
```dart
/// Call the [getSocialAuthProviders] method.
_cubit.getSocialAuthProviders();
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ class ExampleLoginRepository implements BaseAuthRepository {
Future.value(const AuthorizeResponseEntity());

@override
Future<AccountModel?> getDefaultAccount() => Future.value(AccountModel(
accountId: "accountId",
));
Future<AccountModel?> getDefaultAccount() => Future.value(
AccountModel(
accountId: "accountId",
),
);

@override
Future<List<AccountModel>> getLatestAccounts() => Future.value([
AccountModel(
accountId: "accountId",
)
),
]);

@override
Expand All @@ -32,5 +34,7 @@ class ExampleLoginRepository implements BaseAuthRepository {

@override
Future<LandingCompanyEntity> getLandingCompany(String? countryCode) =>
Future.value(const LandingCompanyEntity());
Future.value(
const LandingCompanyEntity(),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ import 'package:deriv_auth/core/models/account_model.dart';
import 'package:deriv_auth/core/models/authorize_model.dart';
import 'package:deriv_auth/core/models/landig_comany_model.dart';
import 'package:deriv_auth/core/services/token/models/login_request.dart';
import 'package:deriv_auth/features/auth/repository/base_auth_repository.dart';
import 'package:deriv_auth/features/auth/services/base_auth_service.dart';

/// `DerivGO` implementation of [BaseAuthService].
class ExampleLoginService extends BaseAuthService {
/// Initializes a [ExampleLoginService] class.
ExampleLoginService({
required this.authRepository,
required super.authRepository,
required super.jwtService,
required super.connectionInfo,
required super.tokenService,
});

/// Interface of all client related functions.
final BaseAuthRepository authRepository;

@override
Future<AuthorizeEntity> onLoginRequest(
{required GetTokensRequestModel request, String? userAgent}) async =>
Future<AuthorizeEntity> onLoginRequest({
required GetTokensRequestModel request,
String? userAgent,
}) async =>
const AuthorizeEntity();

@override
Expand Down
9 changes: 9 additions & 0 deletions packages/deriv_auth/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ class MyApp extends StatelessWidget {
create: (context) => DerivAuthCubit(
authService: ExampleLoginService(
authRepository: ExampleLoginRepository(),
jwtService: DerivJwtService(
repository: DerivJwtRepository(
client: HttpClient(),
connectionInfo: DerivAuthConnectionInfo(),
appToken: 'test_app_token',
),
),
connectionInfo: DerivAuthConnectionInfo(),
tokenService: DerivTokenService(),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:deriv_auth/core/analytics/enums.dart';
Map<String, dynamic> getUserTrackingData(
LoginAction action,
String appId, {
LoginProvider? provider,
required LoginProvider provider,
String? errorMessage,
}) =>
switch (action) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ class AuthTrackingRepository implements AuthUserTrackingInterface {

@override
void trackUserOpenedLoginForm() {
if (_loginProvider == null) {
return;
}

final Map<String, dynamic> data = getUserTrackingData(
LoginAction.openLoginForm,
_appId,
provider: _loginProvider!,
);

_derivRudderstack.track(
eventName: data['event'] as String,
properties: data['properties'] as Map<String, dynamic>,
Expand All @@ -51,10 +55,14 @@ class AuthTrackingRepository implements AuthUserTrackingInterface {

@override
void trackError(String errorMessage) {
if (_loginProvider == null) {
return;
}

final Map<String, dynamic> data = getUserTrackingData(
LoginAction.loginError,
_appId,
provider: _loginProvider,
provider: _loginProvider!,
errorMessage: errorMessage,
);

Expand Down Expand Up @@ -107,7 +115,7 @@ class AuthTrackingRepository implements AuthUserTrackingInterface {
final Map<String, dynamic> data = getUserTrackingData(
LoginAction.startLogin,
_appId,
provider: _loginProvider,
provider: _loginProvider!,
);

_derivRudderstack.track(
Expand All @@ -118,10 +126,14 @@ class AuthTrackingRepository implements AuthUserTrackingInterface {

@override
void trackLoginFinished() {
if (_loginProvider == null) {
return;
}

final Map<String, dynamic> data = getUserTrackingData(
LoginAction.finishLogin,
_appId,
provider: _loginProvider,
provider: _loginProvider!,
);

_derivRudderstack.track(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:deriv_auth/core/services/token/models/enums.dart';
import 'package:deriv_auth/core/services/token/models/login_request.dart';
import 'package:deriv_auth/features/auth/deriv_auth_io.dart';
import 'package:deriv_auth/features/auth/services/base_auth_service.dart';
import 'package:deriv_auth/features/auth/services/deriv_auth_service.dart';
import 'package:deriv_auth/features/social_auth/models/social_auth_dto.dart';

part 'deriv_auth_state.dart';
Expand All @@ -27,9 +26,7 @@ class DerivAuthCubit extends Cubit<DerivAuthState>
required this.authService,
}) : super(DerivAuthLoadingState()) {
AuthTrackingRepository.init(
authService is DerivAuthService
? (authService as DerivAuthService).connectionInfo.appId
: (throw Exception('Connection Info is not provided.')),
authService.connectionInfo.appId,
derivRudderstack: DerivRudderstack(),
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
import 'package:deriv_auth/core/connection_info.dart';
import 'package:deriv_auth/core/models/account_model.dart';
import 'package:deriv_auth/core/models/authorize_model.dart';
import 'package:deriv_auth/core/models/landig_comany_model.dart';
import 'package:deriv_auth/core/services/jwt/services/base_jwt_service.dart';
import 'package:deriv_auth/core/services/token/models/login_request.dart';
import 'package:deriv_auth/core/services/token/services/base_token_service.dart';
import 'package:deriv_auth/features/auth/repository/base_auth_repository.dart';

/// Interface to define all authentication-related functionality.
abstract class BaseAuthService {
/// Constructor for [BaseAuthService].
BaseAuthService();
BaseAuthService({
required this.connectionInfo,
required this.jwtService,
required this.authRepository,
required this.tokenService,
});

/// Client connection info.
final AuthConnectionInfo connectionInfo;

/// Interface for all jwtRelated functions.
final BaseJwtService jwtService;

/// Interface of all client related functions.
final BaseAuthRepository authRepository;

/// Token service.
final BaseTokenService tokenService;

/// Function before logging user in.
Future<AuthorizeEntity> onLoginRequest({
Expand Down
Loading

0 comments on commit 2ddb377

Please sign in to comment.