@dynamic-labs-sdk/react-hooks 1.27.2 → 1.29.0

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.
Files changed (71) hide show
  1. package/dist/core.cjs +1 -1
  2. package/dist/core.esm.js +1 -1
  3. package/dist/exports/index.d.ts +13 -0
  4. package/dist/exports/index.d.ts.map +1 -1
  5. package/dist/hooks/wrappers/functions/useAddBusinessAccountSigner/useAddBusinessAccountSigner.d.ts +1 -1
  6. package/dist/hooks/wrappers/functions/useCreatePolicy/index.d.ts +3 -0
  7. package/dist/hooks/wrappers/functions/useCreatePolicy/index.d.ts.map +1 -0
  8. package/dist/hooks/wrappers/functions/useCreatePolicy/useCreatePolicy.d.ts +57 -0
  9. package/dist/hooks/wrappers/functions/useCreatePolicy/useCreatePolicy.d.ts.map +1 -0
  10. package/dist/hooks/wrappers/functions/useGetAccountPolicyLayer/index.d.ts +2 -0
  11. package/dist/hooks/wrappers/functions/useGetAccountPolicyLayer/index.d.ts.map +1 -0
  12. package/dist/hooks/wrappers/functions/useGetAccountPolicyLayer/useGetAccountPolicyLayer.d.ts +38 -0
  13. package/dist/hooks/wrappers/functions/useGetAccountPolicyLayer/useGetAccountPolicyLayer.d.ts.map +1 -0
  14. package/dist/hooks/wrappers/functions/useGetPolicy/index.d.ts +2 -0
  15. package/dist/hooks/wrappers/functions/useGetPolicy/index.d.ts.map +1 -0
  16. package/dist/hooks/wrappers/functions/useGetPolicy/useGetPolicy.d.ts +43 -0
  17. package/dist/hooks/wrappers/functions/useGetPolicy/useGetPolicy.d.ts.map +1 -0
  18. package/dist/hooks/wrappers/functions/useGetSignerPolicyLayer/index.d.ts +2 -0
  19. package/dist/hooks/wrappers/functions/useGetSignerPolicyLayer/index.d.ts.map +1 -0
  20. package/dist/hooks/wrappers/functions/useGetSignerPolicyLayer/useGetSignerPolicyLayer.d.ts +51 -0
  21. package/dist/hooks/wrappers/functions/useGetSignerPolicyLayer/useGetSignerPolicyLayer.d.ts.map +1 -0
  22. package/dist/hooks/wrappers/functions/useGetWalletPolicyLayer/index.d.ts +2 -0
  23. package/dist/hooks/wrappers/functions/useGetWalletPolicyLayer/index.d.ts.map +1 -0
  24. package/dist/hooks/wrappers/functions/useGetWalletPolicyLayer/useGetWalletPolicyLayer.d.ts +47 -0
  25. package/dist/hooks/wrappers/functions/useGetWalletPolicyLayer/useGetWalletPolicyLayer.d.ts.map +1 -0
  26. package/dist/hooks/wrappers/functions/useRemoveAccountPolicyRule/index.d.ts +3 -0
  27. package/dist/hooks/wrappers/functions/useRemoveAccountPolicyRule/index.d.ts.map +1 -0
  28. package/dist/hooks/wrappers/functions/useRemoveAccountPolicyRule/useRemoveAccountPolicyRule.d.ts +52 -0
  29. package/dist/hooks/wrappers/functions/useRemoveAccountPolicyRule/useRemoveAccountPolicyRule.d.ts.map +1 -0
  30. package/dist/hooks/wrappers/functions/useRemovePolicyRules/index.d.ts +3 -0
  31. package/dist/hooks/wrappers/functions/useRemovePolicyRules/index.d.ts.map +1 -0
  32. package/dist/hooks/wrappers/functions/useRemovePolicyRules/useRemovePolicyRules.d.ts +56 -0
  33. package/dist/hooks/wrappers/functions/useRemovePolicyRules/useRemovePolicyRules.d.ts.map +1 -0
  34. package/dist/hooks/wrappers/functions/useRemoveSignerPolicyRule/index.d.ts +3 -0
  35. package/dist/hooks/wrappers/functions/useRemoveSignerPolicyRule/index.d.ts.map +1 -0
  36. package/dist/hooks/wrappers/functions/useRemoveSignerPolicyRule/useRemoveSignerPolicyRule.d.ts +55 -0
  37. package/dist/hooks/wrappers/functions/useRemoveSignerPolicyRule/useRemoveSignerPolicyRule.d.ts.map +1 -0
  38. package/dist/hooks/wrappers/functions/useRemoveWalletPolicyRule/index.d.ts +3 -0
  39. package/dist/hooks/wrappers/functions/useRemoveWalletPolicyRule/index.d.ts.map +1 -0
  40. package/dist/hooks/wrappers/functions/useRemoveWalletPolicyRule/useRemoveWalletPolicyRule.d.ts +54 -0
  41. package/dist/hooks/wrappers/functions/useRemoveWalletPolicyRule/useRemoveWalletPolicyRule.d.ts.map +1 -0
  42. package/dist/hooks/wrappers/functions/useSignSerializedTransaction/index.d.ts +2 -0
  43. package/dist/hooks/wrappers/functions/useSignSerializedTransaction/index.d.ts.map +1 -0
  44. package/dist/hooks/wrappers/functions/useSignSerializedTransaction/useSignSerializedTransaction.d.ts +55 -0
  45. package/dist/hooks/wrappers/functions/useSignSerializedTransaction/useSignSerializedTransaction.d.ts.map +1 -0
  46. package/dist/hooks/wrappers/functions/useUpsertAccountPolicyRule/index.d.ts +3 -0
  47. package/dist/hooks/wrappers/functions/useUpsertAccountPolicyRule/index.d.ts.map +1 -0
  48. package/dist/hooks/wrappers/functions/useUpsertAccountPolicyRule/useUpsertAccountPolicyRule.d.ts +55 -0
  49. package/dist/hooks/wrappers/functions/useUpsertAccountPolicyRule/useUpsertAccountPolicyRule.d.ts.map +1 -0
  50. package/dist/hooks/wrappers/functions/useUpsertSignerPolicyRule/index.d.ts +3 -0
  51. package/dist/hooks/wrappers/functions/useUpsertSignerPolicyRule/index.d.ts.map +1 -0
  52. package/dist/hooks/wrappers/functions/useUpsertSignerPolicyRule/useUpsertSignerPolicyRule.d.ts +57 -0
  53. package/dist/hooks/wrappers/functions/useUpsertSignerPolicyRule/useUpsertSignerPolicyRule.d.ts.map +1 -0
  54. package/dist/hooks/wrappers/functions/useUpsertWalletPolicyRule/index.d.ts +2 -0
  55. package/dist/hooks/wrappers/functions/useUpsertWalletPolicyRule/index.d.ts.map +1 -0
  56. package/dist/hooks/wrappers/functions/useUpsertWalletPolicyRule/useUpsertWalletPolicyRule.d.ts +54 -0
  57. package/dist/hooks/wrappers/functions/useUpsertWalletPolicyRule/useUpsertWalletPolicyRule.d.ts.map +1 -0
  58. package/dist/index.cjs +399 -1
  59. package/dist/index.cjs.map +1 -1
  60. package/dist/index.esm.js +388 -3
  61. package/dist/index.esm.js.map +1 -1
  62. package/dist/modules/DynamicContext/DynamicProvider.d.ts +10 -0
  63. package/dist/modules/DynamicContext/DynamicProvider.d.ts.map +1 -1
  64. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  65. package/dist/{useBaseState-BUx66eUl.esm.js → useBaseState-D9ib5b9h.esm.js} +12 -2
  66. package/dist/useBaseState-D9ib5b9h.esm.js.map +1 -0
  67. package/dist/{useBaseState-CjysRsBw.cjs → useBaseState-KNM6v5iX.cjs} +12 -2
  68. package/dist/useBaseState-KNM6v5iX.cjs.map +1 -0
  69. package/package.json +4 -4
  70. package/dist/useBaseState-BUx66eUl.esm.js.map +0 -1
  71. package/dist/useBaseState-CjysRsBw.cjs.map +0 -1
@@ -0,0 +1,55 @@
1
+ import { removeSignerPolicyRule } from '@dynamic-labs-sdk/client/waas';
2
+ import type { UseBaseMutationParams } from '../../../../foundation/useBaseMutation';
3
+ type RemoveSignerPolicyRuleVariables = Parameters<typeof removeSignerPolicyRule>[0];
4
+ type RemoveSignerPolicyRuleResult = Awaited<ReturnType<typeof removeSignerPolicyRule>>;
5
+ /**
6
+ * Parameters for {@link useRemoveSignerPolicyRule}: an optional override of
7
+ * the underlying react-query mutation options.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const params: UseRemoveSignerPolicyRuleParams = {
12
+ * mutateParams: { onSuccess: () => console.log('removed') },
13
+ * };
14
+ * ```
15
+ * @see useRemoveSignerPolicyRule
16
+ * @see removeSignerPolicyRule
17
+ */
18
+ export type UseRemoveSignerPolicyRuleParams = {
19
+ /**
20
+ * Optional override of any react-query `UseMutationOptions`
21
+ * (`onSuccess`, `onError`, `retry`, etc.).
22
+ */
23
+ mutateParams?: NonNullable<UseBaseMutationParams<RemoveSignerPolicyRuleResult, RemoveSignerPolicyRuleVariables>['mutateParams']>;
24
+ };
25
+ /**
26
+ * Removes a single rule from a signer's policy layer.
27
+ *
28
+ * Wraps `removeSignerPolicyRule` from `@dynamic-labs-sdk/client/waas`. Call
29
+ * `mutate({ ruleId, walletAccount })`; the resolved `data` is the
30
+ * signer-Layer as it stands after the rule is removed. On success,
31
+ * invalidates {@link useGetSignerPolicyLayer} so mounted consumers refetch
32
+ * the updated rules.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * const { mutate: removeRule, isPending } = useRemoveSignerPolicyRule();
37
+ * <button
38
+ * onClick={() => removeRule({ ruleId, walletAccount })}
39
+ * disabled={isPending}
40
+ * >
41
+ * Remove rule
42
+ * </button>
43
+ * ```
44
+ *
45
+ * @returns A react-query mutation result whose `mutate`/`mutateAsync` removes the rule; the resolved `data` is the signer-Layer after the rule is removed.
46
+ * @see removeSignerPolicyRule
47
+ * @see UseRemoveSignerPolicyRuleParams
48
+ */
49
+ export declare const useRemoveSignerPolicyRule: ({ mutateParams, }?: UseRemoveSignerPolicyRuleParams) => import("@tanstack/react-query").UseMutationResult<import("@dynamic-labs/sdk-api-core").WaasPolicyLayerResponse, Error, {
50
+ ruleId: string;
51
+ shareSetId?: string;
52
+ walletAccount: import("@dynamic-labs-sdk/client").WalletAccount;
53
+ }>;
54
+ export {};
55
+ //# sourceMappingURL=useRemoveSignerPolicyRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRemoveSignerPolicyRule.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useRemoveSignerPolicyRule/useRemoveSignerPolicyRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAIpF,KAAK,+BAA+B,GAAG,UAAU,CAC/C,OAAO,sBAAsB,CAC9B,CAAC,CAAC,CAAC,CAAC;AACL,KAAK,4BAA4B,GAAG,OAAO,CACzC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAC1C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CACxB,qBAAqB,CACnB,4BAA4B,EAC5B,+BAA+B,CAChC,CAAC,cAAc,CAAC,CAClB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,yBAAyB,uBAEnC,+BAA+B;;;;EAM9B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useRemoveWalletPolicyRule } from './useRemoveWalletPolicyRule';
2
+ export type { UseRemoveWalletPolicyRuleParams } from './useRemoveWalletPolicyRule';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useRemoveWalletPolicyRule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { removeWalletPolicyRule } from '@dynamic-labs-sdk/client/waas';
2
+ import type { UseBaseMutationParams } from '../../../../foundation/useBaseMutation';
3
+ type RemoveWalletPolicyRuleVariables = Parameters<typeof removeWalletPolicyRule>[0];
4
+ type RemoveWalletPolicyRuleResult = Awaited<ReturnType<typeof removeWalletPolicyRule>>;
5
+ /**
6
+ * Parameters for {@link useRemoveWalletPolicyRule}: an optional override of
7
+ * the underlying react-query mutation options.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const params: UseRemoveWalletPolicyRuleParams = {
12
+ * mutateParams: { onSuccess: () => console.log('removed') },
13
+ * };
14
+ * ```
15
+ * @see useRemoveWalletPolicyRule
16
+ * @see removeWalletPolicyRule
17
+ */
18
+ export type UseRemoveWalletPolicyRuleParams = {
19
+ /**
20
+ * Optional override of any react-query `UseMutationOptions`
21
+ * (`onSuccess`, `onError`, `retry`, etc.).
22
+ */
23
+ mutateParams?: NonNullable<UseBaseMutationParams<RemoveWalletPolicyRuleResult, RemoveWalletPolicyRuleVariables>['mutateParams']>;
24
+ };
25
+ /**
26
+ * Removes a single rule from a wallet's policy layer.
27
+ *
28
+ * Wraps `removeWalletPolicyRule` from `@dynamic-labs-sdk/client/waas`. Call
29
+ * `mutate({ ruleId, walletAccount })`; the resolved `data` is the
30
+ * wallet-Layer as it stands after the rule is removed. On success,
31
+ * invalidates {@link useGetWalletPolicyLayer} so mounted consumers refetch
32
+ * the updated rules.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * const { mutate: removeRule, isPending } = useRemoveWalletPolicyRule();
37
+ * <button
38
+ * onClick={() => removeRule({ ruleId, walletAccount })}
39
+ * disabled={isPending}
40
+ * >
41
+ * Remove rule
42
+ * </button>
43
+ * ```
44
+ *
45
+ * @returns A react-query mutation result whose `mutate`/`mutateAsync` removes the rule; the resolved `data` is the wallet-Layer after the rule is removed.
46
+ * @see removeWalletPolicyRule
47
+ * @see UseRemoveWalletPolicyRuleParams
48
+ */
49
+ export declare const useRemoveWalletPolicyRule: ({ mutateParams, }?: UseRemoveWalletPolicyRuleParams) => import("@tanstack/react-query").UseMutationResult<import("@dynamic-labs/sdk-api-core").WaasPolicyLayerResponse, Error, {
50
+ ruleId: string;
51
+ walletAccount: import("@dynamic-labs-sdk/client").WalletAccount;
52
+ }>;
53
+ export {};
54
+ //# sourceMappingURL=useRemoveWalletPolicyRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRemoveWalletPolicyRule.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useRemoveWalletPolicyRule/useRemoveWalletPolicyRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAIpF,KAAK,+BAA+B,GAAG,UAAU,CAC/C,OAAO,sBAAsB,CAC9B,CAAC,CAAC,CAAC,CAAC;AACL,KAAK,4BAA4B,GAAG,OAAO,CACzC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAC1C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CACxB,qBAAqB,CACnB,4BAA4B,EAC5B,+BAA+B,CAChC,CAAC,cAAc,CAAC,CAClB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,yBAAyB,uBAEnC,+BAA+B;;;EAM9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { useSignSerializedTransaction, type UseSignSerializedTransactionParams, } from './useSignSerializedTransaction';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useSignSerializedTransaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,KAAK,kCAAkC,GACxC,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { signSerializedTransaction } from '@dynamic-labs-sdk/client/waas';
2
+ import type { UseBaseMutationParams } from '../../../../foundation/useBaseMutation';
3
+ type SignSerializedTransactionVariables = Parameters<typeof signSerializedTransaction>[0];
4
+ type SignSerializedTransactionResult = Awaited<ReturnType<typeof signSerializedTransaction>>;
5
+ /**
6
+ * Parameters for {@link useSignSerializedTransaction}: an optional override of the underlying
7
+ * react-query mutation options.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const params: UseSignSerializedTransactionParams = {
12
+ * mutateParams: { onSuccess: () => {} },
13
+ * };
14
+ * ```
15
+ * @see useSignSerializedTransaction
16
+ * @see signSerializedTransaction
17
+ */
18
+ export type UseSignSerializedTransactionParams = {
19
+ /**
20
+ * Optional override of any react-query `UseMutationOptions`
21
+ * (`onSuccess`, `onError`, `retry`, etc.).
22
+ */
23
+ mutateParams?: NonNullable<UseBaseMutationParams<SignSerializedTransactionResult, SignSerializedTransactionVariables>['mutateParams']>;
24
+ };
25
+ /**
26
+ * Signs an already-serialized transaction directly.
27
+ *
28
+ * Wraps `signSerializedTransaction` from `@dynamic-labs-sdk/client/waas`.
29
+ * Call `mutate({ walletAccount, serializedTransaction, chainId })`; the
30
+ * resolved `data` is the raw signature.
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * const { mutate: signSerializedTransaction, isPending } = useSignSerializedTransaction();
35
+ * <button
36
+ * onClick={() => signSerializedTransaction({ walletAccount, serializedTransaction })}
37
+ * disabled={isPending}
38
+ * >
39
+ * Sign
40
+ * </button>
41
+ * ```
42
+ *
43
+ * @returns A react-query mutation whose `mutate`/`mutateAsync` calls `signSerializedTransaction` and whose `data` is its resolved value.
44
+ * @see signSerializedTransaction
45
+ * @see UseSignSerializedTransactionParams
46
+ */
47
+ export declare const useSignSerializedTransaction: ({ mutateParams, }?: UseSignSerializedTransactionParams) => import("@tanstack/react-query").UseMutationResult<{
48
+ signature: string;
49
+ }, Error, {
50
+ chainId?: string;
51
+ serializedTransaction: string;
52
+ walletAccount: import("@dynamic-labs-sdk/client").WalletAccount;
53
+ }>;
54
+ export {};
55
+ //# sourceMappingURL=useSignSerializedTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSignSerializedTransaction.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useSignSerializedTransaction/useSignSerializedTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAGpF,KAAK,kCAAkC,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1F,KAAK,+BAA+B,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC;AAE7F;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CACxB,qBAAqB,CACnB,+BAA+B,EAC/B,kCAAkC,CACnC,CAAC,cAAc,CAAC,CAClB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,4BAA4B,uBAEtC,kCAAkC;;;;;;EAKjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useUpsertAccountPolicyRule } from './useUpsertAccountPolicyRule';
2
+ export type { UseUpsertAccountPolicyRuleParams } from './useUpsertAccountPolicyRule';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useUpsertAccountPolicyRule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,YAAY,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { upsertAccountPolicyRule } from '@dynamic-labs-sdk/client/waas';
2
+ import type { UseBaseMutationParams } from '../../../../foundation/useBaseMutation';
3
+ type UpsertAccountPolicyRuleVariables = Parameters<typeof upsertAccountPolicyRule>[0];
4
+ type UpsertAccountPolicyRuleResult = Awaited<ReturnType<typeof upsertAccountPolicyRule>>;
5
+ /**
6
+ * Parameters for {@link useUpsertAccountPolicyRule}: an optional override of
7
+ * the underlying react-query mutation options.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const params: UseUpsertAccountPolicyRuleParams = {
12
+ * mutateParams: { onSuccess: () => console.log('saved') },
13
+ * };
14
+ * ```
15
+ * @see useUpsertAccountPolicyRule
16
+ * @see upsertAccountPolicyRule
17
+ */
18
+ export type UseUpsertAccountPolicyRuleParams = {
19
+ /**
20
+ * Optional override of any react-query `UseMutationOptions`
21
+ * (`onSuccess`, `onError`, `retry`, etc.).
22
+ */
23
+ mutateParams?: NonNullable<UseBaseMutationParams<UpsertAccountPolicyRuleResult, UpsertAccountPolicyRuleVariables>['mutateParams']>;
24
+ };
25
+ /**
26
+ * Creates or updates a single rule on a business account's account-Layer —
27
+ * the Rules that apply to every wallet in the business account. Build
28
+ * `rule` with `buildAllowPolicyRule` / `buildDenyPolicyRule` — the enclave
29
+ * always mints the rule id.
30
+ *
31
+ * Wraps `upsertAccountPolicyRule` from `@dynamic-labs-sdk/client/waas`. On
32
+ * success, invalidates {@link useGetAccountPolicyLayer} so mounted consumers
33
+ * refetch the updated rules.
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * const { mutate: upsertRule, isPending } = useUpsertAccountPolicyRule();
38
+ * <button
39
+ * onClick={() => upsertRule({ businessAccountId, rule })}
40
+ * disabled={isPending}
41
+ * >
42
+ * Save rule
43
+ * </button>
44
+ * ```
45
+ *
46
+ * @returns A react-query mutation result whose `mutate`/`mutateAsync` upserts the rule; the resolved `data` is the account-Layer after the rule is applied.
47
+ * @see upsertAccountPolicyRule
48
+ * @see UseUpsertAccountPolicyRuleParams
49
+ */
50
+ export declare const useUpsertAccountPolicyRule: ({ mutateParams, }?: UseUpsertAccountPolicyRuleParams) => import("@tanstack/react-query").UseMutationResult<import("@dynamic-labs/sdk-api-core").WaasPolicyLayerResponse, Error, {
51
+ businessAccountId: string;
52
+ rule: import("@dynamic-labs/sdk-api-core").WaasPolicyRule;
53
+ }>;
54
+ export {};
55
+ //# sourceMappingURL=useUpsertAccountPolicyRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpsertAccountPolicyRule.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useUpsertAccountPolicyRule/useUpsertAccountPolicyRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAIpF,KAAK,gCAAgC,GAAG,UAAU,CAChD,OAAO,uBAAuB,CAC/B,CAAC,CAAC,CAAC,CAAC;AACL,KAAK,6BAA6B,GAAG,OAAO,CAC1C,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAC3C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CACxB,qBAAqB,CACnB,6BAA6B,EAC7B,gCAAgC,CACjC,CAAC,cAAc,CAAC,CAClB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,0BAA0B,uBAEpC,gCAAgC;;;EAS/B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useUpsertSignerPolicyRule } from './useUpsertSignerPolicyRule';
2
+ export type { UseUpsertSignerPolicyRuleParams } from './useUpsertSignerPolicyRule';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useUpsertSignerPolicyRule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { upsertSignerPolicyRule } from '@dynamic-labs-sdk/client/waas';
2
+ import type { UseBaseMutationParams } from '../../../../foundation/useBaseMutation';
3
+ type UpsertSignerPolicyRuleVariables = Parameters<typeof upsertSignerPolicyRule>[0];
4
+ type UpsertSignerPolicyRuleResult = Awaited<ReturnType<typeof upsertSignerPolicyRule>>;
5
+ /**
6
+ * Parameters for {@link useUpsertSignerPolicyRule}: an optional override of
7
+ * the underlying react-query mutation options.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const params: UseUpsertSignerPolicyRuleParams = {
12
+ * mutateParams: { onSuccess: () => console.log('saved') },
13
+ * };
14
+ * ```
15
+ * @see useUpsertSignerPolicyRule
16
+ * @see upsertSignerPolicyRule
17
+ */
18
+ export type UseUpsertSignerPolicyRuleParams = {
19
+ /**
20
+ * Optional override of any react-query `UseMutationOptions`
21
+ * (`onSuccess`, `onError`, `retry`, etc.).
22
+ */
23
+ mutateParams?: NonNullable<UseBaseMutationParams<UpsertSignerPolicyRuleResult, UpsertSignerPolicyRuleVariables>['mutateParams']>;
24
+ };
25
+ /**
26
+ * Creates or updates a single rule on a signer's policy layer. Build `rule`
27
+ * with `buildAllowPolicyRule` / `buildDenyPolicyRule` — the enclave always
28
+ * mints the rule id.
29
+ *
30
+ * Wraps `upsertSignerPolicyRule` from `@dynamic-labs-sdk/client/waas`. Call
31
+ * `mutate({ rule, walletAccount })`; the resolved `data` is the signer-Layer
32
+ * as it stands after the rule is applied. On success, invalidates
33
+ * {@link useGetSignerPolicyLayer} so mounted consumers refetch the updated
34
+ * rules.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * const { mutate: upsertRule, isPending } = useUpsertSignerPolicyRule();
39
+ * <button
40
+ * onClick={() => upsertRule({ rule, walletAccount })}
41
+ * disabled={isPending}
42
+ * >
43
+ * Save rule
44
+ * </button>
45
+ * ```
46
+ *
47
+ * @returns A react-query mutation result whose `mutate`/`mutateAsync` upserts the rule; the resolved `data` is the signer-Layer after the rule is applied.
48
+ * @see upsertSignerPolicyRule
49
+ * @see UseUpsertSignerPolicyRuleParams
50
+ */
51
+ export declare const useUpsertSignerPolicyRule: ({ mutateParams, }?: UseUpsertSignerPolicyRuleParams) => import("@tanstack/react-query").UseMutationResult<import("@dynamic-labs/sdk-api-core").WaasPolicyLayerResponse, Error, {
52
+ rule: import("@dynamic-labs/sdk-api-core").WaasPolicyRule;
53
+ shareSetId?: string;
54
+ walletAccount: import("@dynamic-labs-sdk/client").WalletAccount;
55
+ }>;
56
+ export {};
57
+ //# sourceMappingURL=useUpsertSignerPolicyRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpsertSignerPolicyRule.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useUpsertSignerPolicyRule/useUpsertSignerPolicyRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAIpF,KAAK,+BAA+B,GAAG,UAAU,CAC/C,OAAO,sBAAsB,CAC9B,CAAC,CAAC,CAAC,CAAC;AACL,KAAK,4BAA4B,GAAG,OAAO,CACzC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAC1C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CACxB,qBAAqB,CACnB,4BAA4B,EAC5B,+BAA+B,CAChC,CAAC,cAAc,CAAC,CAClB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,yBAAyB,uBAEnC,+BAA+B;;;;EAM9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { useUpsertWalletPolicyRule, type UseUpsertWalletPolicyRuleParams, } from './useUpsertWalletPolicyRule';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useUpsertWalletPolicyRule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,KAAK,+BAA+B,GACrC,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { upsertWalletPolicyRule } from '@dynamic-labs-sdk/client/waas';
2
+ import type { UseBaseMutationParams } from '../../../../foundation/useBaseMutation';
3
+ type UpsertWalletPolicyRuleVariables = Parameters<typeof upsertWalletPolicyRule>[0];
4
+ type UpsertWalletPolicyRuleResult = Awaited<ReturnType<typeof upsertWalletPolicyRule>>;
5
+ /**
6
+ * Parameters for {@link useUpsertWalletPolicyRule}: an optional override of
7
+ * the underlying react-query mutation options.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const params: UseUpsertWalletPolicyRuleParams = {
12
+ * mutateParams: { onSuccess: () => console.log('saved') },
13
+ * };
14
+ * ```
15
+ * @see useUpsertWalletPolicyRule
16
+ * @see upsertWalletPolicyRule
17
+ */
18
+ export type UseUpsertWalletPolicyRuleParams = {
19
+ /**
20
+ * Optional override of any react-query `UseMutationOptions`
21
+ * (`onSuccess`, `onError`, `retry`, etc.).
22
+ */
23
+ mutateParams?: NonNullable<UseBaseMutationParams<UpsertWalletPolicyRuleResult, UpsertWalletPolicyRuleVariables>['mutateParams']>;
24
+ };
25
+ /**
26
+ * Creates or updates a single rule on a wallet's policy layer.
27
+ *
28
+ * Wraps `upsertWalletPolicyRule` from `@dynamic-labs-sdk/client/waas`. Call
29
+ * `mutate({ rule, walletAccount })`; the resolved `data` is the wallet-Layer
30
+ * as it stands after the rule is applied. On success, invalidates
31
+ * {@link useGetWalletPolicyLayer} so mounted consumers refetch the updated
32
+ * rules.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * const { mutate: upsertRule, isPending } = useUpsertWalletPolicyRule();
37
+ * <button
38
+ * onClick={() => upsertRule({ rule, walletAccount })}
39
+ * disabled={isPending}
40
+ * >
41
+ * Save rule
42
+ * </button>
43
+ * ```
44
+ *
45
+ * @returns A react-query mutation result whose `mutate`/`mutateAsync` upserts the rule; the resolved `data` is the wallet-Layer after the rule is applied.
46
+ * @see upsertWalletPolicyRule
47
+ * @see UseUpsertWalletPolicyRuleParams
48
+ */
49
+ export declare const useUpsertWalletPolicyRule: ({ mutateParams, }?: UseUpsertWalletPolicyRuleParams) => import("@tanstack/react-query").UseMutationResult<import("@dynamic-labs/sdk-api-core").WaasPolicyLayerResponse, Error, {
50
+ rule: import("@dynamic-labs/sdk-api-core").WaasPolicyRule;
51
+ walletAccount: import("@dynamic-labs-sdk/client").WalletAccount;
52
+ }>;
53
+ export {};
54
+ //# sourceMappingURL=useUpsertWalletPolicyRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpsertWalletPolicyRule.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/wrappers/functions/useUpsertWalletPolicyRule/useUpsertWalletPolicyRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAIpF,KAAK,+BAA+B,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AACpF,KAAK,4BAA4B,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC;AAEvF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CACxB,qBAAqB,CACnB,4BAA4B,EAC5B,+BAA+B,CAChC,CAAC,cAAc,CAAC,CAClB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,yBAAyB,uBAEnC,+BAA+B;;;EAM9B,CAAC"}