Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
3fab8c3
fix(trezor,activation): add PrivateKeyPolicy to AuthOptions and beyond
takenagain Jun 5, 2025
9bcc6c8
feat(rpc): add trezor init task RPCs
takenagain Jun 5, 2025
39fd604
feat(sdk): trezor manager for init and user input requests
takenagain Jun 5, 2025
b0e7a7e
feat(rpc): add task-based address generation RPCs
takenagain Jun 6, 2025
f911376
feat(rpc): add trezor pubkey strategy with task-based address creation
takenagain Jun 6, 2025
68d534d
WIP: trezor login option in SDK example
takenagain Jun 6, 2025
1565fe7
refactor(example): trezor auth mixin and remove previous trezor ui code
takenagain Jun 9, 2025
b02fe9f
Merge branch 'dev' into feat/trezor-support
takenagain Jun 9, 2025
c3b5cc6
fix(trezor): device info parsing and example auth state transitions
takenagain Jun 9, 2025
4c1a956
refactor(trezor): add auth listener & implement coderabbitai suggestions
takenagain Jun 9, 2025
b803459
fix(example): auth restoration and listener order
takenagain Jun 10, 2025
455d5db
fix(trezor): workaround for trezor-specifc scan issue
takenagain Jun 10, 2025
db797af
fix(rpc): get new address task status response parsing
takenagain Jun 13, 2025
a48c150
refactor(trezor): move authentication and initialization logic to SDK…
takenagain Jun 18, 2025
f6b839c
Merge remote-tracking branch 'origin/dev' into feat/trezor-support
takenagain Jun 18, 2025
75228d7
refactor(trezor): migrate auth options and state models to freezed (#90)
takenagain Jun 23, 2025
007ce9f
Merge branch 'dev' into feat/trezor-support
takenagain Jun 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,12 @@ class KdfOperationsWasm implements IKdfOperations {
}

if (KdfLoggingConfig.debugLogging) {
_log('Raw JS response: $jsResponse');
try {
final stringified = jsResponse.dartify().toString();
_log('Raw JS response: $stringified');
} catch (e) {
_log('Raw JS response: $jsResponse (stringify failed: $e)');
}
}
return jsResponse as js_interop.JSObject;
}
Expand Down
32 changes: 32 additions & 0 deletions packages/komodo_defi_local_auth/index_generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Used to generate Dart index file. Can be ran with `dart run index_generator`
# from this package's root directory.
# See https://pub.dev/packages/index_generator for more information.
index_generator:
page_width: 80
exclude:
- "**.g.dart"
- "**.freezed.dart"
- "**_extension.dart"

libraries:
- directory_path: lib/src/auth
file_name: _auth_index
name: _auth
exclude:
- "{_,**/_}*.dart"
comments: |
(Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file.
docs: |
Internal/private classes related to the Auth integration of the Komodo DeFi Framework ecosystem.
disclaimer: false

- directory_path: lib/src/trezor
file_name: _trezor_index
name: _trezor
exclude:
- "{_,**/_}*.dart"
comments: |
(Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file.
docs: |
Internal/private classes related to the Trezor integration of the Komodo DeFi Framework ecosystem.
disclaimer: false
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/// A package responsible for managing and abstracting out an authentication service on top of the API's methods
library;
/// A package responsible for managing and abstracting out an authentication
/// service on top of the API's methods
library komodo_defi_local_auth;

export 'src/auth/models/user.dart';
export 'src/auth/_auth_index.dart'
show AuthenticationState, AuthenticationStatus;
export 'src/komodo_defi_local_auth.dart';
export 'src/trezor/_trezor_index.dart';
8 changes: 8 additions & 0 deletions packages/komodo_defi_local_auth/lib/src/auth/_auth_index.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// (Internal/private) Generated by the `index_generator` package with the `index_generator.yaml` configuration file.

/// Internal/private classes related to the Auth integration of the Komodo DeFi Framework ecosystem.
library _auth;

export 'auth_service.dart';
export 'auth_state.dart';
export 'storage/secure_storage.dart';
163 changes: 0 additions & 163 deletions packages/komodo_defi_local_auth/lib/src/auth/auth_bloc.dart

This file was deleted.

40 changes: 0 additions & 40 deletions packages/komodo_defi_local_auth/lib/src/auth/auth_repository.dart

This file was deleted.

34 changes: 34 additions & 0 deletions packages/komodo_defi_local_auth/lib/src/auth/auth_state.dart
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:komodo_defi_types/komodo_defi_types.dart';

part 'auth_state.freezed.dart';

/// Represents the current state of an authentication process
@freezed
abstract class AuthenticationState with _$AuthenticationState {
const factory AuthenticationState({
required AuthenticationStatus status,
String? message,
int? taskId,
String? error,
KdfUser? user,
}) = _AuthenticationState;

factory AuthenticationState.completed(KdfUser user) =>
AuthenticationState(status: AuthenticationStatus.completed, user: user);

factory AuthenticationState.error(String error) =>
AuthenticationState(status: AuthenticationStatus.error, error: error);
}

/// General authentication status that can be used for any wallet type
enum AuthenticationStatus {
initializing,
waitingForDevice,
waitingForDeviceConfirmation,
pinRequired,
passphraseRequired,
authenticating,
completed,
error,
cancelled,
}
Loading
Loading