Skip to content

Commit

Permalink
refactor: update nekoton_repository@0.51.0-dev.4 (#792)
Browse files Browse the repository at this point in the history
Co-authored-by: Egor Komarov <e.komarov.bf@gmail.com>
  • Loading branch information
AndreyMolochko and Egor Komarov authored Feb 27, 2025
1 parent b2e38c3 commit 5033a66
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 85 deletions.
4 changes: 0 additions & 4 deletions lib/app/service/assets_service.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:convert';

import 'package:app/app/service/connection/connection_factory.dart';
import 'package:app/app/service/presets_connection/presets_connection_service.dart';
import 'package:app/app/service/service.dart';
import 'package:app/data/models/models.dart';
Expand All @@ -24,7 +23,6 @@ class AssetsService {
this.presetsConnectionService,
this.httpService,
this.storage,
this.connectionFactory,
this.tonRepository,
);

Expand All @@ -36,7 +34,6 @@ class AssetsService {
final PresetsConnectionService presetsConnectionService;
final HttpService httpService;
final GeneralStorageService storage;
final ConnectionFactory connectionFactory;
final TonRepository tonRepository;

StreamSubscription<TransportStrategy>? _currentTransportSubscription;
Expand Down Expand Up @@ -232,7 +229,6 @@ class AssetsService {
if (transport.networkType == 'ton') {
final details = await JettonWallet.getJettonRootDetails(
transport: transport.transport,
gqlConnection: connectionFactory.getTonGqlConnection(),
tokenRoot: rootTokenContract,
);
final info = await tonRepository.getTokenInfo(
Expand Down
1 change: 0 additions & 1 deletion lib/app/service/connection/connection.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export 'connection_factory.dart';
export 'connection_service.dart';
export 'data/data.dart';
export 'default_network.dart';
Expand Down
32 changes: 0 additions & 32 deletions lib/app/service/connection/connection_factory.dart

This file was deleted.

4 changes: 0 additions & 4 deletions lib/app/service/connection/generic_token_subscriber.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:app/app/service/connection/connection_factory.dart';
import 'package:app/http/repository/ton_repository.dart';
import 'package:nekoton_repository/nekoton_repository.dart';

Expand Down Expand Up @@ -27,11 +26,9 @@ class Tip3TokenWalletSubscriber extends GenericTokenSubscriber {
class JettonTokenWalletSubscriber extends GenericTokenSubscriber {
JettonTokenWalletSubscriber(
this._tonRepository,
this._connectionFactory,
);

final TonRepository _tonRepository;
final ConnectionFactory _connectionFactory;
final Map<Address, Symbol> _symbolCache = {};

@override
Expand All @@ -42,7 +39,6 @@ class JettonTokenWalletSubscriber extends GenericTokenSubscriber {
}) async =>
JettonTokenWallet.subscribe(
transport: transport,
gqlConnection: _connectionFactory.getTonGqlConnection(),
owner: owner,
rootTokenContract: rootTokenContract,
symbol: await _getSymbol(rootTokenContract),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class CommonTransportStrategy extends AppTransportStrategy {

late final _subscriber = switch (genericTokenType) {
GenericTokenType.tip3 => Tip3TokenWalletSubscriber(),
GenericTokenType.jetton => JettonTokenWalletSubscriber(inject(), inject()),
GenericTokenType.jetton => JettonTokenWalletSubscriber(inject()),
};

NetworkGroup get networkGroup => transport.group;
Expand Down
30 changes: 12 additions & 18 deletions lib/di/di.config.dart

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

Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ class SendMessageModel extends ElementaryModel {
return _nekotonRepository.prepareTransfer(
address: address,
publicKey: publicKey,
destination: destination,
amount: amount,
body: body,
bounce: bounce,
expiration: defaultSendTimeout,
params: [
TonWalletTransferParams(
destination: destination,
amount: amount,
body: body,
bounce: defaultMessageBounce,
),
],
);
}

Expand Down
36 changes: 24 additions & 12 deletions lib/feature/browser/inpage_provider/inpage_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,16 @@ class InpageProvider extends ProviderApi {
}

final unsignedMessage = await nekotonRepository.prepareTransfer(
destination: repackedRecipient,
amount: amount,
body: body,
bounce: defaultMessageBounce,
address: sender,
expiration: defaultSendTimeout,
params: [
nr.TonWalletTransferParams(
destination: repackedRecipient,
amount: amount,
body: body,
bounce: defaultMessageBounce,
),
],
);

final fees = await nekotonRepository.estimateFees(
Expand Down Expand Up @@ -1168,12 +1172,16 @@ class InpageProvider extends ProviderApi {

final unsignedMessage = await nekotonRepository.prepareTransfer(
address: sender,
destination: repackedRecipient,
amount: amount,
body: body,
bounce: defaultMessageBounce,
expiration: defaultSendTimeout,
publicKey: key,
params: [
nr.TonWalletTransferParams(
destination: repackedRecipient,
amount: amount,
body: body,
bounce: defaultMessageBounce,
),
],
);

await unsignedMessage.message.refreshTimeout();
Expand Down Expand Up @@ -1270,12 +1278,16 @@ class InpageProvider extends ProviderApi {

final unsignedMessage = await nekotonRepository.prepareTransfer(
address: sender,
destination: repackedRecipient,
amount: amount,
body: body,
bounce: defaultMessageBounce,
expiration: defaultSendTimeout,
publicKey: key,
params: [
nr.TonWalletTransferParams(
destination: repackedRecipient,
amount: amount,
body: body,
bounce: defaultMessageBounce,
),
],
);

await unsignedMessage.message.refreshTimeout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,15 @@ class TokenWalletSendBloc
final unsignedMessage = await nekotonRepository.prepareTransfer(
address: owner,
publicKey: publicKey,
destination: internalMessage.destination,
amount: internalMessage.amount,
body: internalMessage.body,
bounce: defaultMessageBounce,
expiration: defaultSendTimeout,
params: [
TonWalletTransferParams(
destination: internalMessage.destination,
amount: internalMessage.amount,
body: internalMessage.body,
bounce: defaultMessageBounce,
),
],
);

return (internalMessage, unsignedMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,14 @@ class TonWalletSendBloc extends Bloc<TonWalletSendEvent, TonWalletSendState>
nekotonRepository.prepareTransfer(
address: address,
publicKey: publicKey,
destination: repackAddress(destination),
amount: amount,
body: comment,
bounce: defaultMessageBounce,
expiration: defaultSendTimeout,
params: [
TonWalletTransferParams(
destination: repackAddress(destination),
amount: amount,
body: comment,
bounce: defaultMessageBounce,
),
],
);
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies:
mobile_scanner: 5.2.3
money2: 5.3.0 # do not update to 5.4.0 due to json serialization issues
money2_fixer: 2.0.0
nekoton_repository: 0.51.0-dev.2
nekoton_repository: 0.51.0-dev.4
nekoton_webview: 0.1.8
ntp: 2.0.0
package_info_plus: 8.1.3
Expand Down

0 comments on commit 5033a66

Please sign in to comment.