Skip to content

Commit

Permalink
refactor: Deprecate wallet config
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Oct 22, 2024
1 parent 5172bce commit 991a12b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ This likely was a misunderstood and unused feature.
- `encrypt` and `decrypt` in `@stacks/wallet-sdk` (aliases of `encryptMnemonic` and `decryptMnemonic` in the `@stacks/encryption` package respectively) were removed.
- `makeECPrivateKey` in `@stacks/encryption` was deprecated, use `randomPrivateKey` instead.
- `makeSigHashPreSign` was renamed to `sigHashPreSign` and marked as internal.
- `@stacks/wallet-sdk` `WalletConfig` types and helpers were marked as deprecated.

## Stacks.js (<=4.x.x) → (5.x.x)

Expand Down
7 changes: 7 additions & 0 deletions packages/wallet-sdk/src/models/wallet-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { GaiaHubConfig, connectToGaiaHub, uploadToGaiaHub } from '@stacks/storag
import { decryptContent, encryptContent, getPublicKeyFromPrivate } from '@stacks/encryption';
import { createFetchFn, FetchFn } from '@stacks/common';

/** @deprecated */
export interface ConfigApp {
origin: string;
scopes: string[];
Expand All @@ -11,20 +12,23 @@ export interface ConfigApp {
name: string;
}

/** @deprecated */
export interface ConfigAccount {
username?: string;
apps: {
[origin: string]: ConfigApp;
};
}

/** @deprecated */
export interface WalletConfig {
accounts: ConfigAccount[];
meta?: {
[key: string]: any;
};
}

/** @deprecated */
export const createWalletGaiaConfig = async ({
gaiaHubUrl,
wallet,
Expand Down Expand Up @@ -107,6 +111,7 @@ export const updateWalletConfig = async ({
return walletConfig;
};

/** @deprecated */
export function makeWalletConfig(wallet: Wallet): WalletConfig {
return {
accounts: wallet.accounts.map(account => ({
Expand All @@ -116,6 +121,7 @@ export function makeWalletConfig(wallet: Wallet): WalletConfig {
};
}

/** @deprecated */
export const encryptWalletConfig = async ({
wallet,
walletConfig,
Expand All @@ -128,6 +134,7 @@ export const encryptWalletConfig = async ({
return encrypted;
};

/** @deprecated */
export const updateWalletConfigWithApp = async ({
wallet,
account,
Expand Down

0 comments on commit 991a12b

Please sign in to comment.