Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Minor refactoring to match common theme #1749

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: Deprecate wallet config
  • Loading branch information
janniks committed Oct 25, 2024
commit fa9be4843cfaf84b6767b92e3a3b73dbf2ba0c50
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
Loading