@ecency/sdk 2.3.76 → 2.3.78
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
CHANGED
|
@@ -634,8 +634,28 @@ interface AuthContext {
|
|
|
634
634
|
/** Login method used ('key', 'hivesigner', 'keychain', 'hiveauth') */
|
|
635
635
|
loginType?: string | null;
|
|
636
636
|
/**
|
|
637
|
-
*
|
|
638
|
-
*
|
|
637
|
+
* A caller-supplied broadcaster for signing operations that the platform adapter cannot perform.
|
|
638
|
+
*
|
|
639
|
+
* NOT deprecated, and not a legacy path. `useBroadcastMutation` reaches it as
|
|
640
|
+
* `case 'custom'`, the last link of the default fallback chain, and two call
|
|
641
|
+
* sites in the web app need it because no adapter method fits:
|
|
642
|
+
*
|
|
643
|
+
* - `use-login-by-key.ts` grants posting permission DURING login, before the
|
|
644
|
+
* user exists to the adapter, so the key comes from a ref instead.
|
|
645
|
+
* - `wallet-operations-sign.tsx` dispatches on a signing method the user picks
|
|
646
|
+
* mid-flow, which is a decision the adapter has no way to know about.
|
|
647
|
+
*
|
|
648
|
+
* It carried an `@deprecated` tag pointing at `broadcastWithKeychain`, and
|
|
649
|
+
* that reading is what went wrong: four SDK mutations treated this as "the
|
|
650
|
+
* keychain path", checked it, and threw when a caller passed an
|
|
651
|
+
* `AuthContextV2` that legitimately has no `broadcast`. Every field here is
|
|
652
|
+
* optional, so V2 satisfies `AuthContext` structurally and the type checker
|
|
653
|
+
* saw nothing; each site failed only when a real user reached it. Migrated in
|
|
654
|
+
* #1376.
|
|
655
|
+
*
|
|
656
|
+
* So: reach for the adapter when you mean "sign with the user's wallet". Reach
|
|
657
|
+
* for this only when you are supplying the signing yourself, and never as a
|
|
658
|
+
* way to detect Keychain.
|
|
639
659
|
*/
|
|
640
660
|
broadcast?: (operations: Operation[], authority?: "active" | "posting" | "owner" | "memo") => Promise<unknown>;
|
|
641
661
|
}
|
|
@@ -990,7 +1010,7 @@ declare function useBroadcastMutation<T>(mutationKey: MutationKey | undefined, u
|
|
|
990
1010
|
broadcastMode?: BroadcastMode;
|
|
991
1011
|
}): _tanstack_react_query.UseMutationResult<unknown, Error, T, unknown>;
|
|
992
1012
|
|
|
993
|
-
declare function broadcastJson<T>(username: string | undefined, id: string, payload: T, auth?:
|
|
1013
|
+
declare function broadcastJson<T>(username: string | undefined, id: string, payload: T, auth?: AuthContextV2): Promise<any>;
|
|
994
1014
|
|
|
995
1015
|
/**
|
|
996
1016
|
* Delay (ms) before invalidating chain-derived queries after an async
|
|
@@ -2255,7 +2275,7 @@ interface CommonPayload$1 {
|
|
|
2255
2275
|
type RevokePostingOptions = Pick<UseMutationOptions<unknown, Error, CommonPayload$1>, "onSuccess" | "onError"> & {
|
|
2256
2276
|
hsCallbackUrl?: string;
|
|
2257
2277
|
};
|
|
2258
|
-
declare function useAccountRevokePosting(username: string | undefined, options: RevokePostingOptions, auth?:
|
|
2278
|
+
declare function useAccountRevokePosting(username: string | undefined, options: RevokePostingOptions, auth?: AuthContextV2): _tanstack_react_query.UseMutationResult<string | void | TransactionConfirmation, Error, CommonPayload$1, unknown>;
|
|
2259
2279
|
|
|
2260
2280
|
type SignType = "key" | "keychain" | "hivesigner" | "ecency";
|
|
2261
2281
|
interface CommonPayload {
|
|
@@ -2267,7 +2287,7 @@ interface CommonPayload {
|
|
|
2267
2287
|
type UpdateRecoveryOptions = Pick<UseMutationOptions<unknown, Error, CommonPayload>, "onSuccess" | "onError"> & {
|
|
2268
2288
|
hsCallbackUrl?: string;
|
|
2269
2289
|
};
|
|
2270
|
-
declare function useAccountUpdateRecovery(username: string | undefined, code: string | undefined, options: UpdateRecoveryOptions, auth?:
|
|
2290
|
+
declare function useAccountUpdateRecovery(username: string | undefined, code: string | undefined, options: UpdateRecoveryOptions, auth?: AuthContextV2): _tanstack_react_query.UseMutationResult<string | void | Response | TransactionConfirmation, Error, CommonPayload, unknown>;
|
|
2271
2291
|
|
|
2272
2292
|
interface Payload {
|
|
2273
2293
|
currentKey: PrivateKey;
|
|
@@ -3028,7 +3048,7 @@ declare function useSignOperationByKey(username: string | undefined): _tanstack_
|
|
|
3028
3048
|
keyOrSeed: string;
|
|
3029
3049
|
}, unknown>;
|
|
3030
3050
|
|
|
3031
|
-
declare function useSignOperationByKeychain(username: string | undefined, auth?:
|
|
3051
|
+
declare function useSignOperationByKeychain(username: string | undefined, auth?: AuthContextV2, keyType?: "owner" | "active" | "posting" | "memo"): _tanstack_react_query.UseMutationResult<TransactionConfirmation, Error, {
|
|
3032
3052
|
operation: Operation;
|
|
3033
3053
|
}, unknown>;
|
|
3034
3054
|
|