From 0676a065c3809371ada9c9e02c86ec851ec8eb4f Mon Sep 17 00:00:00 2001 From: janniks Date: Tue, 22 Oct 2024 21:31:28 +0200 Subject: [PATCH] refactor: Deprecate wallet config --- packages/stacking/src/utils.ts | 2 +- packages/wallet-sdk/src/models/wallet-config.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/stacking/src/utils.ts b/packages/stacking/src/utils.ts index b12e9eba1..e3b2e1749 100644 --- a/packages/stacking/src/utils.ts +++ b/packages/stacking/src/utils.ts @@ -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: diff --git a/packages/wallet-sdk/src/models/wallet-config.ts b/packages/wallet-sdk/src/models/wallet-config.ts index 2f7f2fbcd..fcc49376a 100644 --- a/packages/wallet-sdk/src/models/wallet-config.ts +++ b/packages/wallet-sdk/src/models/wallet-config.ts @@ -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[]; @@ -11,6 +12,7 @@ export interface ConfigApp { name: string; } +/** @deprecated */ export interface ConfigAccount { username?: string; apps: { @@ -18,6 +20,7 @@ export interface ConfigAccount { }; } +/** @deprecated */ export interface WalletConfig { accounts: ConfigAccount[]; meta?: { @@ -25,6 +28,7 @@ export interface WalletConfig { }; } +/** @deprecated */ export const createWalletGaiaConfig = async ({ gaiaHubUrl, wallet, @@ -107,6 +111,7 @@ export const updateWalletConfig = async ({ return walletConfig; }; +/** @deprecated */ export function makeWalletConfig(wallet: Wallet): WalletConfig { return { accounts: wallet.accounts.map(account => ({ @@ -116,6 +121,7 @@ export function makeWalletConfig(wallet: Wallet): WalletConfig { }; } +/** @deprecated */ export const encryptWalletConfig = async ({ wallet, walletConfig, @@ -128,6 +134,7 @@ export const encryptWalletConfig = async ({ return encrypted; }; +/** @deprecated */ export const updateWalletConfigWithApp = async ({ wallet, account,