implemented backend wallet service connection
Some checks failed
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
Some checks failed
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
This commit is contained in:
@@ -7,6 +7,7 @@ class Services {
|
||||
static const String organization = 'organizations';
|
||||
static const String permission = 'permissions';
|
||||
static const String storage = 'storage';
|
||||
static const String chainWallets = 'chain_wallets';
|
||||
|
||||
static const String amplitude = 'amplitude';
|
||||
static const String clients = 'clients';
|
||||
|
||||
31
frontend/pshared/lib/service/wallet.dart
Normal file
31
frontend/pshared/lib/service/wallet.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
import 'package:pshared/api/responses/wallet_balance.dart';
|
||||
import 'package:pshared/api/responses/wallets.dart';
|
||||
import 'package:pshared/data/mapper/wallet/response.dart';
|
||||
import 'package:pshared/models/wallet/balance.dart';
|
||||
import 'package:pshared/models/wallet/wallet.dart';
|
||||
import 'package:pshared/service/authorization/service.dart';
|
||||
import 'package:pshared/service/services.dart';
|
||||
|
||||
|
||||
class WalletService {
|
||||
static const String _objectType = Services.chainWallets;
|
||||
|
||||
static Future<List<WalletModel>> list(String organizationRef) async {
|
||||
final json = await AuthorizationService.getGETResponse(
|
||||
_objectType,
|
||||
'/$organizationRef',
|
||||
);
|
||||
return WalletsResponse.fromJson(json).toDomain();
|
||||
}
|
||||
|
||||
static Future<WalletBalance> getBalance({
|
||||
required String organizationRef,
|
||||
required String walletRef,
|
||||
}) async {
|
||||
final json = await AuthorizationService.getGETResponse(
|
||||
_objectType,
|
||||
'/$organizationRef/$walletRef/balance',
|
||||
);
|
||||
return WalletBalanceResponse.fromJson(json).toDomain();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user