refactor of money utils with new money2 package

This commit is contained in:
Arseni
2026-03-13 03:17:29 +03:00
parent b4eb1437f6
commit 0091191d97
72 changed files with 453 additions and 982 deletions

View File

@@ -5,14 +5,16 @@ import 'package:flutter/foundation.dart';
import 'package:collection/collection.dart';
import 'package:pshared/models/currency.dart';
import 'package:pshared/models/describable.dart';
import 'package:pshared/models/payment/chain_network.dart';
import 'package:pshared/models/payment/wallet.dart';
import 'package:pshared/models/wallet/chain_asset.dart';
import 'package:pshared/provider/organizations.dart';
import 'package:pshared/provider/resource.dart';
import 'package:pshared/service/payment/wallets.dart';
import 'package:pshared/utils/exception.dart';
class WalletsProvider with ChangeNotifier {
final WalletsService _service;
OrganizationsProvider? _organizations;
@@ -180,7 +182,8 @@ class WalletsProvider with ChangeNotifier {
Future<void> create({
required Describable describable,
required ChainAsset asset,
required ChainNetwork chain,
required CurrencyCode currency,
required String? ownerRef,
}) async {
final org = _organizations;
@@ -195,7 +198,8 @@ class WalletsProvider with ChangeNotifier {
await _service.create(
organizationRef: org.current.id,
describable: describable,
asset: asset,
chain: chain,
currency: currency,
ownerRef: ownerRef,
);
await loadWalletsWithBalances();