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 25, 2024
1 parent 6dbe60b commit 89dad33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/stacking/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function _poxAddressToBtcAddress_Values(
): string {
if (!StacksNetworks.includes(network)) throw new Error('Invalid network.');

hash = typeof hash === 'string' ? hexToBytes(hash) : hash;
if (typeof hash === 'string') hash = hexToBytes(hash);

switch (version) {
case PoXAddressVersion.P2PKH:
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 89dad33

Please sign in to comment.