Skip to content

Commit

Permalink
Merge branch 'feat/cardano-wallet-api' into feat/cardano-wallet-api-e…
Browse files Browse the repository at this point in the history
…xample
  • Loading branch information
dtscalac committed Jun 3, 2024
2 parents ce7c58a + a833dfa commit 0c60c75
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CatalystCardano {

/// Returns available wallet extensions exposed under
/// cardano.{walletName} according to CIP-30 standard.
Future<List<CardanoWallet>> getCardanoWallets() async {
return CatalystCardanoPlatform.instance.getCardanoWallets();
Future<List<CardanoWallet>> getWallets() async {
return CatalystCardanoPlatform.instance.getWallets();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract class CatalystCardanoPlatform extends PlatformInterface {

/// Returns available wallet extensions exposed under
/// cardano.{walletName} according to CIP-30 standard.
Future<List<CardanoWallet>> getCardanoWallets() {
throw UnimplementedError('getCardanoWallets() has not been implemented.');
Future<List<CardanoWallet>> getWallets() {
throw UnimplementedError('getWallets() has not been implemented.');
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Returns available wallet extensions exposed under
// cardano.{walletName} according to CIP-30 standard.
function _getCardanoWallets() {
function _getWallets() {
const cardano = window.cardano;
if (cardano) {
const keys = Object.keys(window.cardano);
Expand All @@ -14,7 +14,7 @@ function _getCardanoWallets() {
// A namespace containing the JS functions that
// can be executed from dart side
const catalyst_cardano = {
getCardanoWallets: _getCardanoWallets,
getWallets: _getWallets,
}

// Expose cardano multiplatform as globally accessible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class CatalystCardanoWeb extends CatalystCardanoPlatform {
CatalystCardanoWeb();

@override
Future<List<CardanoWallet>> getCardanoWallets() async {
final wallets = interop.getCardanoWallets().toDart;
Future<List<CardanoWallet>> getWallets() async {
final wallets = interop.getWallets().toDart;
return wallets.map((e) => e.toDart).toList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:catalyst_cardano_web/src/interop/catalyst_cardano_wallet_proxy.d
/// Lists all injected Cardano wallet extensions that are reachable
/// via window.cardano.{walletName} in javascript.
@JS()
external JSArray<JSCardanoWallet> getCardanoWallets();
external JSArray<JSCardanoWallet> getWallets();

/// The JS representation of the [CardanoWallet].
extension type JSCardanoWallet(JSObject _) implements JSObject {
Expand Down

0 comments on commit 0c60c75

Please sign in to comment.