@ecency/wallets 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -122,7 +122,10 @@ declare function useImportWallet(username: string, currency: EcencyWalletCurrenc
122
122
  * Basically, this mutation is a convenient wrapper for update profile operation
123
123
  */
124
124
  type SaveWalletInformationOptions = Pick<UseMutationOptions<unknown, Error, EcencyTokenMetadata[]>, "onSuccess" | "onError">;
125
- declare function useSaveWalletInformationToMetadata(username: string, options?: SaveWalletInformationOptions): _tanstack_react_query.UseMutationResult<unknown, Error, EcencyTokenMetadata[], unknown>;
125
+ declare function useSaveWalletInformationToMetadata(username: string, accessToken?: string, auth?: {
126
+ postingKey?: string | null;
127
+ loginType?: string | null;
128
+ }, options?: SaveWalletInformationOptions): _tanstack_react_query.UseMutationResult<unknown, Error, EcencyTokenMetadata[], unknown>;
126
129
 
127
130
  declare function getHiveAssetGeneralInfoQueryOptions(username: string): _tanstack_react_query.OmitKeyof<_tanstack_react_query.UseQueryOptions<{
128
131
  name: string;
@@ -876,7 +879,7 @@ declare function withdrawVestingRouteHive<T extends HiveBasedAssetSignType>(payl
876
879
  key: PrivateKey;
877
880
  } : Payload<T>): Promise<unknown>;
878
881
 
879
- declare function useClaimRewards(username: string, onSuccess: () => void): ReturnType<typeof useBroadcastMutation<void>>;
882
+ declare function useClaimRewards(username: string, accessToken: string | undefined, onSuccess: () => void): ReturnType<typeof useBroadcastMutation<void>>;
880
883
 
881
884
  interface PayloadBase {
882
885
  from: string;
@@ -185,7 +185,14 @@ function useGetExternalWalletBalanceQuery(currency, address) {
185
185
  function useSeedPhrase(username) {
186
186
  return useQuery({
187
187
  queryKey: ["ecency-wallets", "seed", username],
188
- queryFn: async () => bip39.generateMnemonic(128)
188
+ queryFn: async () => bip39.generateMnemonic(128),
189
+ // CRITICAL: Prevent seed regeneration - cache forever
190
+ // Once generated, the seed must NEVER change to ensure consistency between:
191
+ // 1. Displayed seed phrase
192
+ // 2. Downloaded seed file
193
+ // 3. Keys sent to API for account creation
194
+ staleTime: Infinity,
195
+ gcTime: Infinity
189
196
  });
190
197
  }
191
198
  var options = {
@@ -1426,12 +1433,13 @@ async function withdrawVestingRouteHive(payload) {
1426
1433
  return hs.sendOperation(operation, { callback: `https://ecency.com/@${params.from_account}/wallet` }, () => {
1427
1434
  });
1428
1435
  }
1429
- function useClaimRewards(username, onSuccess) {
1436
+ function useClaimRewards(username, accessToken, onSuccess) {
1430
1437
  const { data } = useQuery(getAccountFullQueryOptions(username));
1431
1438
  const queryClient = useQueryClient();
1432
1439
  return useBroadcastMutation(
1433
1440
  ["assets", "hive", "claim-rewards", data?.name],
1434
1441
  username,
1442
+ accessToken,
1435
1443
  () => {
1436
1444
  if (!data) {
1437
1445
  throw new Error("Failed to fetch account while claiming balance");
@@ -4184,10 +4192,14 @@ function getGroupedChainTokens(tokens, defaultShow) {
4184
4192
  )
4185
4193
  );
4186
4194
  }
4187
- function useSaveWalletInformationToMetadata(username, options2) {
4195
+ function useSaveWalletInformationToMetadata(username, accessToken, auth, options2) {
4188
4196
  const queryClient = useQueryClient();
4189
4197
  const { data: accountData } = useQuery(getAccountFullQueryOptions(username));
4190
- const { mutateAsync: updateProfile } = useAccountUpdate(username);
4198
+ const { mutateAsync: updateProfile } = useAccountUpdate(
4199
+ username,
4200
+ accessToken,
4201
+ auth
4202
+ );
4191
4203
  return useMutation({
4192
4204
  mutationKey: [
4193
4205
  "ecency-wallets",