Skip to content

Commit

Permalink
fix: add deprecated message (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyyconsensys authored Jan 17, 2025
1 parent d1da20f commit 4e76a73
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/get-starknet/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export class MetaMaskSnapWallet implements StarknetWindowObject {

icon: string;

/**
* Determines whether the wallet is connected.
* @deprecated This property is deprecated and will be removed in a future release.
*/
isConnected: boolean;

snap: MetaMaskSnap;
Expand Down Expand Up @@ -146,6 +150,10 @@ export class MetaMaskSnapWallet implements StarknetWindowObject {
return accountResponse.address;
}

/**
* Starknet.js Account interface.
* @deprecated This property is deprecated and will be removed in a future release.
*/
get account() {
if (!this.#account) {
if (!this.selectedAddress) {
Expand All @@ -159,6 +167,10 @@ export class MetaMaskSnapWallet implements StarknetWindowObject {
return this.#account;
}

/**
* Starknet.js Provider interface.
* @deprecated This property is deprecated and will be removed in a future release.
*/
get provider(): ProviderInterface {
if (!this.#provider) {
if (!this.#network) {
Expand All @@ -172,10 +184,18 @@ export class MetaMaskSnapWallet implements StarknetWindowObject {
return this.#provider;
}

/**
* The selected account's address of the wallet.
* @deprecated This property is deprecated and will be removed in a future release. Use RPC `wallet_requestAccounts` instead.
*/
get selectedAddress(): string {
return this.#selectedAddress;
}

/**
* The selected chain id of the wallet.
* @deprecated This property is deprecated and will be removed in a future release. Use RPC `wallet_requestChainId` instead.
*/
get chainId(): string {
return this.#chainId;
}
Expand Down Expand Up @@ -231,12 +251,17 @@ export class MetaMaskSnapWallet implements StarknetWindowObject {
* accommodate potential support for multiple addresses in the future.
*
* @returns An array of address.
* @deprecated This property is deprecated and will be removed in a future release.
*/
async enable() {
await this.init();
return [this.selectedAddress];
}

/**
* Checks if the wallet is preauthorized.
* @deprecated This property is deprecated and will be removed in a future release.
*/
async isPreauthorized() {
return true;
}
Expand Down

0 comments on commit 4e76a73

Please sign in to comment.