Skip to main content

Extensions

The extensions refer to the plugins that can be installed in supported browsers such as Google Chrome. This section of the SDK is designed to gather information about these extensions.

*You should have to use those functions

getDisabledExtensionNames()

This function retrieves the list of wallet names that are disabled.

import { anvil } from "@ada-anvil/sdk-client";

try {
await anvil.extensions.getDisabledExtensionNames();
// Output: ['eternl', 'nami']
await anvil.wallet.connect("eternl");
await anvil.extensions.getDisabledExtensionNames();
// Output: ['nami']
} catch {
console.log("YOUR ERROR HANDLING");
}

getEnabledExtensionNames()

This function retrieves the list of wallet names that are enabled.

import { anvil } from "@ada-anvil/sdk-client";

try {
await anvil.extensions.getEnabledExtensionNames();
// Output: []
await anvil.wallet.connect("eternl");
await anvil.extensions.getEnabledExtensionNames();
// Output: ['eternl']
} catch {
console.log("YOUR ERROR HANDLING");
}

getWalletExtensionNames()

This function retrieves the list of wallet names that are supported.

import { anvil } from "@ada-anvil/sdk-client";

try {
await anvil.extensions.getWalletExtensionNames();
// Output: ['nami', 'eternl', ...]
} catch {
console.log("YOUR ERROR HANDLING");
}

getWalletExtensions()

This function retrieves the list of wallet IDs that are supported.

import { anvil } from "@ada-anvil/sdk-client";

try {
await anvil.extensions.getWalletExtensions();
// Output: ['nami', 'eternl', ...]
} catch {
console.log("YOUR ERROR HANDLING");
}

getCardano()

This function retrieves the dApp API associated with the specified wallet id.

Avoid Direct Access

This function is intended for internal use within the wallet service and should rarely be accessed directly.

enableWallet()

This function allows manual activation of a dApp API.

Avoid Direct Access

This function is intended for internal use within the wallet service and should rarely be accessed directly.