Skip to content

Commit

Permalink
feat: add multiple tokens and update transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-A4 committed Nov 13, 2023
1 parent 244a673 commit 5af8a13
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@ abstract class AccountRepository {
required Address rootTokenContract,
});

/// Add list of tokens to [address] with [rootTokenContracts].
Future<void> addTokenWallets({
required Address address,
required List<Address> rootTokenContracts,
});

/// Remove token with [rootTokenContract] from [address].
Future<void> removeTokenWallet({
required Address address,
required Address rootTokenContract,
});

/// Remove list of tokens with [rootTokenContracts] from [address].
Future<void> removeTokenWallets({
required Address address,
required List<Address> rootTokenContracts,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,17 @@ mixin AccountRepositoryImpl on TransportRepository
networkGroup: currentTransport.transport.group,
);

@override
Future<void> addTokenWallets({
required Address address,
required List<Address> rootTokenContracts,
}) =>
accountsStorage.addTokenWallets(
address: address,
rootTokenContracts: rootTokenContracts,
networkGroup: currentTransport.transport.group,
);

@override
Future<void> removeTokenWallet({
required Address address,
Expand All @@ -174,4 +185,14 @@ mixin AccountRepositoryImpl on TransportRepository
rootTokenContract: rootTokenContract,
networkGroup: currentTransport.transport.group,
);
@override
Future<void> removeTokenWallets({
required Address address,
required List<Address> rootTokenContracts,
}) =>
accountsStorage.removeTokenWallets(
address: address,
rootTokenContracts: rootTokenContracts,
networkGroup: currentTransport.transport.group,
);
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
equatable: ^2.0.5
flutter:
sdk: flutter
flutter_nekoton_bridge: ^1.25.2
flutter_nekoton_bridge: ^1.26.1
freezed_annotation: ^2.2.0
get_it: ^7.6.0
injectable: ^2.1.0
Expand Down
1 change: 1 addition & 0 deletions test/src/generic_contract_repository_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ void main() {
origStatus: AccountStatus.active,
endStatus: AccountStatus.active,
totalFees: amount,
boc: '',
inMessage: Message(
hash: 'messageHash',
value: amount,
Expand Down
1 change: 1 addition & 0 deletions test/src/ton_wallet_repository_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ void main() {
origStatus: AccountStatus.active,
endStatus: AccountStatus.active,
totalFees: amount,
boc: '',
inMessage: Message(
hash: 'messageHash',
value: amount,
Expand Down

0 comments on commit 5af8a13

Please sign in to comment.