@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.
- package/dist/browser/index.d.ts +5 -2
- package/dist/browser/index.js +16 -4
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +16 -4
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +16 -4
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -183,7 +183,14 @@ function useGetExternalWalletBalanceQuery(currency, address) {
|
|
|
183
183
|
function useSeedPhrase(username) {
|
|
184
184
|
return useQuery({
|
|
185
185
|
queryKey: ["ecency-wallets", "seed", username],
|
|
186
|
-
queryFn: async () => bip39.generateMnemonic(128)
|
|
186
|
+
queryFn: async () => bip39.generateMnemonic(128),
|
|
187
|
+
// CRITICAL: Prevent seed regeneration - cache forever
|
|
188
|
+
// Once generated, the seed must NEVER change to ensure consistency between:
|
|
189
|
+
// 1. Displayed seed phrase
|
|
190
|
+
// 2. Downloaded seed file
|
|
191
|
+
// 3. Keys sent to API for account creation
|
|
192
|
+
staleTime: Infinity,
|
|
193
|
+
gcTime: Infinity
|
|
187
194
|
});
|
|
188
195
|
}
|
|
189
196
|
var options = {
|
|
@@ -1424,12 +1431,13 @@ async function withdrawVestingRouteHive(payload) {
|
|
|
1424
1431
|
return hs.sendOperation(operation, { callback: `https://ecency.com/@${params.from_account}/wallet` }, () => {
|
|
1425
1432
|
});
|
|
1426
1433
|
}
|
|
1427
|
-
function useClaimRewards(username, onSuccess) {
|
|
1434
|
+
function useClaimRewards(username, accessToken, onSuccess) {
|
|
1428
1435
|
const { data } = useQuery(getAccountFullQueryOptions(username));
|
|
1429
1436
|
const queryClient = useQueryClient();
|
|
1430
1437
|
return useBroadcastMutation(
|
|
1431
1438
|
["assets", "hive", "claim-rewards", data?.name],
|
|
1432
1439
|
username,
|
|
1440
|
+
accessToken,
|
|
1433
1441
|
() => {
|
|
1434
1442
|
if (!data) {
|
|
1435
1443
|
throw new Error("Failed to fetch account while claiming balance");
|
|
@@ -4182,10 +4190,14 @@ function getGroupedChainTokens(tokens, defaultShow) {
|
|
|
4182
4190
|
)
|
|
4183
4191
|
);
|
|
4184
4192
|
}
|
|
4185
|
-
function useSaveWalletInformationToMetadata(username, options2) {
|
|
4193
|
+
function useSaveWalletInformationToMetadata(username, accessToken, auth, options2) {
|
|
4186
4194
|
const queryClient = useQueryClient();
|
|
4187
4195
|
const { data: accountData } = useQuery(getAccountFullQueryOptions(username));
|
|
4188
|
-
const { mutateAsync: updateProfile } = useAccountUpdate(
|
|
4196
|
+
const { mutateAsync: updateProfile } = useAccountUpdate(
|
|
4197
|
+
username,
|
|
4198
|
+
accessToken,
|
|
4199
|
+
auth
|
|
4200
|
+
);
|
|
4189
4201
|
return useMutation({
|
|
4190
4202
|
mutationKey: [
|
|
4191
4203
|
"ecency-wallets",
|