@dynamic-labs-sdk/client 1.28.0 → 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 (279) hide show
  1. package/android/src/main/java/xyz/dynamic/client/webview/DynamicWebViewHost.kt +8 -3
  2. package/android/src/main/java/xyz/dynamic/client/webview/DynamicWebViewModule.kt +27 -0
  3. package/dist/core.cjs +30 -7
  4. package/dist/core.cjs.map +1 -1
  5. package/dist/core.esm.js +30 -7
  6. package/dist/core.esm.js.map +1 -1
  7. package/dist/core.native.esm.js +32 -9
  8. package/dist/core.native.esm.js.map +1 -1
  9. package/dist/exports/waas.d.ts +26 -2
  10. package/dist/exports/waas.d.ts.map +1 -1
  11. package/dist/{getNetworkProviderFromNetworkId-DBjVmBmy.esm.js → getNetworkProviderFromNetworkId-Be2CBFTv.esm.js} +2 -2
  12. package/dist/{getNetworkProviderFromNetworkId-DBjVmBmy.esm.js.map → getNetworkProviderFromNetworkId-Be2CBFTv.esm.js.map} +1 -1
  13. package/dist/{getNetworkProviderFromNetworkId-OhoRrL_X.cjs → getNetworkProviderFromNetworkId-BsmqXKF_.cjs} +2 -2
  14. package/dist/{getNetworkProviderFromNetworkId-OhoRrL_X.cjs.map → getNetworkProviderFromNetworkId-BsmqXKF_.cjs.map} +1 -1
  15. package/dist/{getNetworkProviderFromNetworkId-CKWQLHSE.native.esm.js → getNetworkProviderFromNetworkId-DReHSnab.native.esm.js} +7 -7
  16. package/dist/getNetworkProviderFromNetworkId-DReHSnab.native.esm.js.map +1 -0
  17. package/dist/{getSignedSessionId-BncZzHdQ.esm.js → getSignedSessionId-CLvqM34v.esm.js} +3 -3
  18. package/dist/{getSignedSessionId-BncZzHdQ.esm.js.map → getSignedSessionId-CLvqM34v.esm.js.map} +1 -1
  19. package/dist/{getSignedSessionId-gwqj9h2p.cjs → getSignedSessionId-CcV_jWux.cjs} +3 -3
  20. package/dist/{getSignedSessionId-gwqj9h2p.cjs.map → getSignedSessionId-CcV_jWux.cjs.map} +1 -1
  21. package/dist/{getSignedSessionId-Dwqj_Cxx.native.esm.js → getSignedSessionId-DdslNjRv.native.esm.js} +3 -3
  22. package/dist/{getSignedSessionId-Dwqj_Cxx.native.esm.js.map → getSignedSessionId-DdslNjRv.native.esm.js.map} +1 -1
  23. package/dist/{getWalletProviderByKey-CnpXHkmq.cjs → getWalletProviderByKey-BMsrnfN2.cjs} +2 -2
  24. package/dist/{getWalletProviderByKey-CnpXHkmq.cjs.map → getWalletProviderByKey-BMsrnfN2.cjs.map} +1 -1
  25. package/dist/{getWalletProviderByKey-Dh1slnTF.native.esm.js → getWalletProviderByKey-BtcGKhh6.native.esm.js} +2 -2
  26. package/dist/{getWalletProviderByKey-Dh1slnTF.native.esm.js.map → getWalletProviderByKey-BtcGKhh6.native.esm.js.map} +1 -1
  27. package/dist/{getWalletProviderByKey-C9TWlmDD.esm.js → getWalletProviderByKey-FfQmRcK1.esm.js} +2 -2
  28. package/dist/{getWalletProviderByKey-C9TWlmDD.esm.js.map → getWalletProviderByKey-FfQmRcK1.esm.js.map} +1 -1
  29. package/dist/index.cjs +41 -6
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.esm.js +41 -6
  32. package/dist/index.esm.js.map +1 -1
  33. package/dist/index.native.esm.js +44 -9
  34. package/dist/index.native.esm.js.map +1 -1
  35. package/dist/{isDynamicWaasEnabled-D3-nDwVw.esm.js → isDynamicWaasEnabled-B8e0N7Bb.esm.js} +2 -2
  36. package/dist/{isDynamicWaasEnabled-D3-nDwVw.esm.js.map → isDynamicWaasEnabled-B8e0N7Bb.esm.js.map} +1 -1
  37. package/dist/{isDynamicWaasEnabled-DnDhv_Uj.cjs → isDynamicWaasEnabled-DT4jhqkC.cjs} +2 -2
  38. package/dist/{isDynamicWaasEnabled-DnDhv_Uj.cjs.map → isDynamicWaasEnabled-DT4jhqkC.cjs.map} +1 -1
  39. package/dist/{isDynamicWaasEnabled-CvxVdfKf.native.esm.js → isDynamicWaasEnabled-GTkHpRu6.native.esm.js} +2 -2
  40. package/dist/{isDynamicWaasEnabled-CvxVdfKf.native.esm.js.map → isDynamicWaasEnabled-GTkHpRu6.native.esm.js.map} +1 -1
  41. package/dist/{isMfaRequiredForAction-BjRiou3K.cjs → isMfaRequiredForAction-9ZrKcsTN.cjs} +2 -2
  42. package/dist/{isMfaRequiredForAction-BjRiou3K.cjs.map → isMfaRequiredForAction-9ZrKcsTN.cjs.map} +1 -1
  43. package/dist/{isMfaRequiredForAction-D5rzx59E.esm.js → isMfaRequiredForAction-DRqf4xyv.esm.js} +2 -2
  44. package/dist/{isMfaRequiredForAction-D5rzx59E.esm.js.map → isMfaRequiredForAction-DRqf4xyv.esm.js.map} +1 -1
  45. package/dist/{isMfaRequiredForAction-BJGirRfD.native.esm.js → isMfaRequiredForAction-e4Bdq2tD.native.esm.js} +2 -2
  46. package/dist/{isMfaRequiredForAction-BJGirRfD.native.esm.js.map → isMfaRequiredForAction-e4Bdq2tD.native.esm.js.map} +1 -1
  47. package/dist/{isUserOnboardingComplete-OFxAxj23.esm.js → isUserOnboardingComplete-Bq_7_Fck.esm.js} +3 -3
  48. package/dist/{isUserOnboardingComplete-OFxAxj23.esm.js.map → isUserOnboardingComplete-Bq_7_Fck.esm.js.map} +1 -1
  49. package/dist/{isUserOnboardingComplete-KCtF3oaO.cjs → isUserOnboardingComplete-DINsEIfi.cjs} +3 -3
  50. package/dist/{isUserOnboardingComplete-KCtF3oaO.cjs.map → isUserOnboardingComplete-DINsEIfi.cjs.map} +1 -1
  51. package/dist/{isUserOnboardingComplete-B3cHYyNI.native.esm.js → isUserOnboardingComplete-DKt0bwXg.native.esm.js} +3 -3
  52. package/dist/{isUserOnboardingComplete-B3cHYyNI.native.esm.js.map → isUserOnboardingComplete-DKt0bwXg.native.esm.js.map} +1 -1
  53. package/dist/{migrateFromFireblocks-DY0SAilk.native.esm.js → migrateFromFireblocks-3naM4iCQ.native.esm.js} +3 -3
  54. package/dist/{migrateFromFireblocks-DY0SAilk.native.esm.js.map → migrateFromFireblocks-3naM4iCQ.native.esm.js.map} +1 -1
  55. package/dist/{migrateFromFireblocks-BM6Iaii-.esm.js → migrateFromFireblocks-DbTnFE38.esm.js} +3 -3
  56. package/dist/{migrateFromFireblocks-BM6Iaii-.esm.js.map → migrateFromFireblocks-DbTnFE38.esm.js.map} +1 -1
  57. package/dist/{migrateFromFireblocks-Dg6igmRk.cjs → migrateFromFireblocks-Dyh2dGWB.cjs} +3 -3
  58. package/dist/{migrateFromFireblocks-Dg6igmRk.cjs.map → migrateFromFireblocks-Dyh2dGWB.cjs.map} +1 -1
  59. package/dist/modules/auth/decodeJwt/decodeJwt.d.ts +2 -1
  60. package/dist/modules/auth/decodeJwt/decodeJwt.d.ts.map +1 -1
  61. package/dist/modules/auth/logoutReason.d.ts +1 -1
  62. package/dist/modules/auth/logoutReason.d.ts.map +1 -1
  63. package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
  64. package/dist/modules/initializeClient/logoutIfSessionPublicKeyMismatched/logoutIfSessionPublicKeyMismatched.d.ts +18 -0
  65. package/dist/modules/initializeClient/logoutIfSessionPublicKeyMismatched/logoutIfSessionPublicKeyMismatched.d.ts.map +1 -0
  66. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +2 -2
  67. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
  68. package/dist/modules/waas/getWalletAccountShareSets/getWalletAccountShareSets.d.ts +27 -0
  69. package/dist/modules/waas/getWalletAccountShareSets/getWalletAccountShareSets.d.ts.map +1 -0
  70. package/dist/modules/waas/getWalletAccountShareSets/index.d.ts +3 -0
  71. package/dist/modules/waas/getWalletAccountShareSets/index.d.ts.map +1 -0
  72. package/dist/modules/waas/injectWaasVerifiedCredentialFields/injectWaasVerifiedCredentialFields.d.ts +25 -0
  73. package/dist/modules/waas/injectWaasVerifiedCredentialFields/injectWaasVerifiedCredentialFields.d.ts.map +1 -0
  74. package/dist/modules/waas/policies/applyPolicyLayerBatch/applyPolicyLayerBatch.d.ts +18 -0
  75. package/dist/modules/waas/policies/applyPolicyLayerBatch/applyPolicyLayerBatch.d.ts.map +1 -0
  76. package/dist/modules/waas/policies/applyPolicyLayerBatch/index.d.ts +2 -0
  77. package/dist/modules/waas/policies/applyPolicyLayerBatch/index.d.ts.map +1 -0
  78. package/dist/modules/waas/policies/buildAllowAddressesRule/buildAllowAddressesRule.d.ts +10 -0
  79. package/dist/modules/waas/policies/buildAllowAddressesRule/buildAllowAddressesRule.d.ts.map +1 -0
  80. package/dist/modules/waas/policies/buildAllowAddressesRule/index.d.ts +2 -0
  81. package/dist/modules/waas/policies/buildAllowAddressesRule/index.d.ts.map +1 -0
  82. package/dist/modules/waas/policies/buildAllowPolicyRule/buildAllowPolicyRule.d.ts +11 -0
  83. package/dist/modules/waas/policies/buildAllowPolicyRule/buildAllowPolicyRule.d.ts.map +1 -0
  84. package/dist/modules/waas/policies/buildAllowPolicyRule/index.d.ts +2 -0
  85. package/dist/modules/waas/policies/buildAllowPolicyRule/index.d.ts.map +1 -0
  86. package/dist/modules/waas/policies/buildBlockExportRule/buildBlockExportRule.d.ts +11 -0
  87. package/dist/modules/waas/policies/buildBlockExportRule/buildBlockExportRule.d.ts.map +1 -0
  88. package/dist/modules/waas/policies/buildBlockExportRule/index.d.ts +2 -0
  89. package/dist/modules/waas/policies/buildBlockExportRule/index.d.ts.map +1 -0
  90. package/dist/modules/waas/policies/buildDenyAddressesRule/buildDenyAddressesRule.d.ts +8 -0
  91. package/dist/modules/waas/policies/buildDenyAddressesRule/buildDenyAddressesRule.d.ts.map +1 -0
  92. package/dist/modules/waas/policies/buildDenyAddressesRule/index.d.ts +2 -0
  93. package/dist/modules/waas/policies/buildDenyAddressesRule/index.d.ts.map +1 -0
  94. package/dist/modules/waas/policies/buildDenyPolicyRule/buildDenyPolicyRule.d.ts +11 -0
  95. package/dist/modules/waas/policies/buildDenyPolicyRule/buildDenyPolicyRule.d.ts.map +1 -0
  96. package/dist/modules/waas/policies/buildDenyPolicyRule/index.d.ts +2 -0
  97. package/dist/modules/waas/policies/buildDenyPolicyRule/index.d.ts.map +1 -0
  98. package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/buildMaxAmountPerTransactionRule.d.ts +10 -0
  99. package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/buildMaxAmountPerTransactionRule.d.ts.map +1 -0
  100. package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/index.d.ts +2 -0
  101. package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/index.d.ts.map +1 -0
  102. package/dist/modules/waas/policies/buildOperationForExistingRule/buildOperationForExistingRule.d.ts +26 -0
  103. package/dist/modules/waas/policies/buildOperationForExistingRule/buildOperationForExistingRule.d.ts.map +1 -0
  104. package/dist/modules/waas/policies/buildOperationForExistingRule/index.d.ts +2 -0
  105. package/dist/modules/waas/policies/buildOperationForExistingRule/index.d.ts.map +1 -0
  106. package/dist/modules/waas/policies/buildOperationsForRule/buildOperationsForRule.d.ts +24 -0
  107. package/dist/modules/waas/policies/buildOperationsForRule/buildOperationsForRule.d.ts.map +1 -0
  108. package/dist/modules/waas/policies/buildOperationsForRule/index.d.ts +2 -0
  109. package/dist/modules/waas/policies/buildOperationsForRule/index.d.ts.map +1 -0
  110. package/dist/modules/waas/policies/buildValueLimit/buildValueLimit.d.ts +10 -0
  111. package/dist/modules/waas/policies/buildValueLimit/buildValueLimit.d.ts.map +1 -0
  112. package/dist/modules/waas/policies/buildValueLimit/index.d.ts +2 -0
  113. package/dist/modules/waas/policies/buildValueLimit/index.d.ts.map +1 -0
  114. package/dist/modules/waas/policies/createPolicy/createPolicy.d.ts +39 -0
  115. package/dist/modules/waas/policies/createPolicy/createPolicy.d.ts.map +1 -0
  116. package/dist/modules/waas/policies/createPolicy/index.d.ts +2 -0
  117. package/dist/modules/waas/policies/createPolicy/index.d.ts.map +1 -0
  118. package/dist/modules/waas/policies/desugarPolicyRules/desugarPolicyRules.d.ts +23 -0
  119. package/dist/modules/waas/policies/desugarPolicyRules/desugarPolicyRules.d.ts.map +1 -0
  120. package/dist/modules/waas/policies/desugarPolicyRules/index.d.ts +2 -0
  121. package/dist/modules/waas/policies/desugarPolicyRules/index.d.ts.map +1 -0
  122. package/dist/modules/waas/policies/expandPolicyRules/expandPolicyRules.d.ts +22 -0
  123. package/dist/modules/waas/policies/expandPolicyRules/expandPolicyRules.d.ts.map +1 -0
  124. package/dist/modules/waas/policies/expandPolicyRules/index.d.ts +2 -0
  125. package/dist/modules/waas/policies/expandPolicyRules/index.d.ts.map +1 -0
  126. package/dist/modules/waas/policies/fillOmittedRuleValues/fillOmittedRuleValues.d.ts +26 -0
  127. package/dist/modules/waas/policies/fillOmittedRuleValues/fillOmittedRuleValues.d.ts.map +1 -0
  128. package/dist/modules/waas/policies/fillOmittedRuleValues/index.d.ts +2 -0
  129. package/dist/modules/waas/policies/fillOmittedRuleValues/index.d.ts.map +1 -0
  130. package/dist/modules/waas/policies/findMatchedRuleKind/findMatchedRuleKind.d.ts +22 -0
  131. package/dist/modules/waas/policies/findMatchedRuleKind/findMatchedRuleKind.d.ts.map +1 -0
  132. package/dist/modules/waas/policies/findMatchedRuleKind/index.d.ts +3 -0
  133. package/dist/modules/waas/policies/findMatchedRuleKind/index.d.ts.map +1 -0
  134. package/dist/modules/waas/policies/getAccountPolicyLayer/getAccountPolicyLayer.d.ts +18 -0
  135. package/dist/modules/waas/policies/getAccountPolicyLayer/getAccountPolicyLayer.d.ts.map +1 -0
  136. package/dist/modules/waas/policies/getAccountPolicyLayer/index.d.ts +2 -0
  137. package/dist/modules/waas/policies/getAccountPolicyLayer/index.d.ts.map +1 -0
  138. package/dist/modules/waas/policies/getPolicy/getPolicy.d.ts +34 -0
  139. package/dist/modules/waas/policies/getPolicy/getPolicy.d.ts.map +1 -0
  140. package/dist/modules/waas/policies/getPolicy/index.d.ts +2 -0
  141. package/dist/modules/waas/policies/getPolicy/index.d.ts.map +1 -0
  142. package/dist/modules/waas/policies/getResolvedPolicyLayer/getResolvedPolicyLayer.d.ts +16 -0
  143. package/dist/modules/waas/policies/getResolvedPolicyLayer/getResolvedPolicyLayer.d.ts.map +1 -0
  144. package/dist/modules/waas/policies/getResolvedPolicyLayer/index.d.ts +2 -0
  145. package/dist/modules/waas/policies/getResolvedPolicyLayer/index.d.ts.map +1 -0
  146. package/dist/modules/waas/policies/getSignerPolicyLayer/getSignerPolicyLayer.d.ts +25 -0
  147. package/dist/modules/waas/policies/getSignerPolicyLayer/getSignerPolicyLayer.d.ts.map +1 -0
  148. package/dist/modules/waas/policies/getSignerPolicyLayer/index.d.ts +2 -0
  149. package/dist/modules/waas/policies/getSignerPolicyLayer/index.d.ts.map +1 -0
  150. package/dist/modules/waas/policies/getWalletPolicyLayer/getWalletPolicyLayer.d.ts +20 -0
  151. package/dist/modules/waas/policies/getWalletPolicyLayer/getWalletPolicyLayer.d.ts.map +1 -0
  152. package/dist/modules/waas/policies/getWalletPolicyLayer/index.d.ts +2 -0
  153. package/dist/modules/waas/policies/getWalletPolicyLayer/index.d.ts.map +1 -0
  154. package/dist/modules/waas/policies/hasAddresses/hasAddresses.d.ts +7 -0
  155. package/dist/modules/waas/policies/hasAddresses/hasAddresses.d.ts.map +1 -0
  156. package/dist/modules/waas/policies/hasAddresses/index.d.ts +2 -0
  157. package/dist/modules/waas/policies/hasAddresses/index.d.ts.map +1 -0
  158. package/dist/modules/waas/policies/hasUnrecognizedFields/hasUnrecognizedFields.d.ts +6 -0
  159. package/dist/modules/waas/policies/hasUnrecognizedFields/hasUnrecognizedFields.d.ts.map +1 -0
  160. package/dist/modules/waas/policies/hasUnrecognizedFields/index.d.ts +2 -0
  161. package/dist/modules/waas/policies/hasUnrecognizedFields/index.d.ts.map +1 -0
  162. package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/index.d.ts +2 -0
  163. package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/index.d.ts.map +1 -0
  164. package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/isPolicyRuleDeletionMarker.d.ts +14 -0
  165. package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/isPolicyRuleDeletionMarker.d.ts.map +1 -0
  166. package/dist/modules/waas/policies/matchExistingRules/index.d.ts +3 -0
  167. package/dist/modules/waas/policies/matchExistingRules/index.d.ts.map +1 -0
  168. package/dist/modules/waas/policies/matchExistingRules/matchExistingRules.d.ts +33 -0
  169. package/dist/modules/waas/policies/matchExistingRules/matchExistingRules.d.ts.map +1 -0
  170. package/dist/modules/waas/policies/policies.types.d.ts +91 -0
  171. package/dist/modules/waas/policies/policies.types.d.ts.map +1 -0
  172. package/dist/modules/waas/policies/policyRuleDefaultNames.d.ts +10 -0
  173. package/dist/modules/waas/policies/policyRuleDefaultNames.d.ts.map +1 -0
  174. package/dist/modules/waas/policies/policyRuleKinds.d.ts +34 -0
  175. package/dist/modules/waas/policies/policyRuleKinds.d.ts.map +1 -0
  176. package/dist/modules/waas/policies/readAllowAddressesRule/index.d.ts +2 -0
  177. package/dist/modules/waas/policies/readAllowAddressesRule/index.d.ts.map +1 -0
  178. package/dist/modules/waas/policies/readAllowAddressesRule/readAllowAddressesRule.d.ts +9 -0
  179. package/dist/modules/waas/policies/readAllowAddressesRule/readAllowAddressesRule.d.ts.map +1 -0
  180. package/dist/modules/waas/policies/readBlockExportRule/index.d.ts +2 -0
  181. package/dist/modules/waas/policies/readBlockExportRule/index.d.ts.map +1 -0
  182. package/dist/modules/waas/policies/readBlockExportRule/readBlockExportRule.d.ts +8 -0
  183. package/dist/modules/waas/policies/readBlockExportRule/readBlockExportRule.d.ts.map +1 -0
  184. package/dist/modules/waas/policies/readCoveredRule/index.d.ts +3 -0
  185. package/dist/modules/waas/policies/readCoveredRule/index.d.ts.map +1 -0
  186. package/dist/modules/waas/policies/readCoveredRule/readCoveredRule.d.ts +31 -0
  187. package/dist/modules/waas/policies/readCoveredRule/readCoveredRule.d.ts.map +1 -0
  188. package/dist/modules/waas/policies/readDenyAddressesRule/index.d.ts +2 -0
  189. package/dist/modules/waas/policies/readDenyAddressesRule/index.d.ts.map +1 -0
  190. package/dist/modules/waas/policies/readDenyAddressesRule/readDenyAddressesRule.d.ts +8 -0
  191. package/dist/modules/waas/policies/readDenyAddressesRule/readDenyAddressesRule.d.ts.map +1 -0
  192. package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/index.d.ts +2 -0
  193. package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/index.d.ts.map +1 -0
  194. package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/readMaxAmountPerTransactionRule.d.ts +8 -0
  195. package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/readMaxAmountPerTransactionRule.d.ts.map +1 -0
  196. package/dist/modules/waas/policies/readValueLimit/index.d.ts +2 -0
  197. package/dist/modules/waas/policies/readValueLimit/index.d.ts.map +1 -0
  198. package/dist/modules/waas/policies/readValueLimit/readValueLimit.d.ts +10 -0
  199. package/dist/modules/waas/policies/readValueLimit/readValueLimit.d.ts.map +1 -0
  200. package/dist/modules/waas/policies/removeAccountPolicyRule/index.d.ts +2 -0
  201. package/dist/modules/waas/policies/removeAccountPolicyRule/index.d.ts.map +1 -0
  202. package/dist/modules/waas/policies/removeAccountPolicyRule/removeAccountPolicyRule.d.ts +20 -0
  203. package/dist/modules/waas/policies/removeAccountPolicyRule/removeAccountPolicyRule.d.ts.map +1 -0
  204. package/dist/modules/waas/policies/removePolicyRules/index.d.ts +2 -0
  205. package/dist/modules/waas/policies/removePolicyRules/index.d.ts.map +1 -0
  206. package/dist/modules/waas/policies/removePolicyRules/removePolicyRules.d.ts +30 -0
  207. package/dist/modules/waas/policies/removePolicyRules/removePolicyRules.d.ts.map +1 -0
  208. package/dist/modules/waas/policies/removeSignerPolicyRule/index.d.ts +2 -0
  209. package/dist/modules/waas/policies/removeSignerPolicyRule/index.d.ts.map +1 -0
  210. package/dist/modules/waas/policies/removeSignerPolicyRule/removeSignerPolicyRule.d.ts +25 -0
  211. package/dist/modules/waas/policies/removeSignerPolicyRule/removeSignerPolicyRule.d.ts.map +1 -0
  212. package/dist/modules/waas/policies/removeWalletPolicyRule/index.d.ts +2 -0
  213. package/dist/modules/waas/policies/removeWalletPolicyRule/index.d.ts.map +1 -0
  214. package/dist/modules/waas/policies/removeWalletPolicyRule/removeWalletPolicyRule.d.ts +22 -0
  215. package/dist/modules/waas/policies/removeWalletPolicyRule/removeWalletPolicyRule.d.ts.map +1 -0
  216. package/dist/modules/waas/policies/resolvePolicyScope/index.d.ts +3 -0
  217. package/dist/modules/waas/policies/resolvePolicyScope/index.d.ts.map +1 -0
  218. package/dist/modules/waas/policies/resolvePolicyScope/resolvePolicyScope.d.ts +31 -0
  219. package/dist/modules/waas/policies/resolvePolicyScope/resolvePolicyScope.d.ts.map +1 -0
  220. package/dist/modules/waas/policies/resolveRuleName/index.d.ts +2 -0
  221. package/dist/modules/waas/policies/resolveRuleName/index.d.ts.map +1 -0
  222. package/dist/modules/waas/policies/resolveRuleName/resolveRuleName.d.ts +20 -0
  223. package/dist/modules/waas/policies/resolveRuleName/resolveRuleName.d.ts.map +1 -0
  224. package/dist/modules/waas/policies/sameChainIds/index.d.ts +2 -0
  225. package/dist/modules/waas/policies/sameChainIds/index.d.ts.map +1 -0
  226. package/dist/modules/waas/policies/sameChainIds/sameChainIds.d.ts +14 -0
  227. package/dist/modules/waas/policies/sameChainIds/sameChainIds.d.ts.map +1 -0
  228. package/dist/modules/waas/policies/sortRulesByRuleId/index.d.ts +2 -0
  229. package/dist/modules/waas/policies/sortRulesByRuleId/index.d.ts.map +1 -0
  230. package/dist/modules/waas/policies/sortRulesByRuleId/sortRulesByRuleId.d.ts +12 -0
  231. package/dist/modules/waas/policies/sortRulesByRuleId/sortRulesByRuleId.d.ts.map +1 -0
  232. package/dist/modules/waas/policies/upsertAccountPolicyRule/index.d.ts +2 -0
  233. package/dist/modules/waas/policies/upsertAccountPolicyRule/index.d.ts.map +1 -0
  234. package/dist/modules/waas/policies/upsertAccountPolicyRule/upsertAccountPolicyRule.d.ts +24 -0
  235. package/dist/modules/waas/policies/upsertAccountPolicyRule/upsertAccountPolicyRule.d.ts.map +1 -0
  236. package/dist/modules/waas/policies/upsertSignerPolicyRule/index.d.ts +2 -0
  237. package/dist/modules/waas/policies/upsertSignerPolicyRule/index.d.ts.map +1 -0
  238. package/dist/modules/waas/policies/upsertSignerPolicyRule/upsertSignerPolicyRule.d.ts +28 -0
  239. package/dist/modules/waas/policies/upsertSignerPolicyRule/upsertSignerPolicyRule.d.ts.map +1 -0
  240. package/dist/modules/waas/policies/upsertWalletPolicyRule/index.d.ts +2 -0
  241. package/dist/modules/waas/policies/upsertWalletPolicyRule/index.d.ts.map +1 -0
  242. package/dist/modules/waas/policies/upsertWalletPolicyRule/upsertWalletPolicyRule.d.ts +25 -0
  243. package/dist/modules/waas/policies/upsertWalletPolicyRule/upsertWalletPolicyRule.d.ts.map +1 -0
  244. package/dist/modules/waas/signSerializedTransaction/index.d.ts +2 -0
  245. package/dist/modules/waas/signSerializedTransaction/index.d.ts.map +1 -0
  246. package/dist/modules/waas/signSerializedTransaction/signSerializedTransaction.d.ts +23 -0
  247. package/dist/modules/waas/signSerializedTransaction/signSerializedTransaction.d.ts.map +1 -0
  248. package/dist/modules/waas/waas.types.d.ts +22 -1
  249. package/dist/modules/waas/waas.types.d.ts.map +1 -1
  250. package/dist/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.d.ts.map +1 -1
  251. package/dist/modules/wallets/walletAccount/walletAccount.types.d.ts +0 -2
  252. package/dist/modules/wallets/walletAccount/walletAccount.types.d.ts.map +1 -1
  253. package/dist/modules/wallets/walletProvider/events/createWalletProviderEventEmitter/createWalletProviderEventEmitter.d.ts +1 -0
  254. package/dist/modules/wallets/walletProvider/events/createWalletProviderEventEmitter/createWalletProviderEventEmitter.d.ts.map +1 -1
  255. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  256. package/dist/{updateAuthFromVerifyResponse-DcwFCD-Y.esm.js → updateAuthFromVerifyResponse-B42kkGLd.esm.js} +38 -15
  257. package/dist/updateAuthFromVerifyResponse-B42kkGLd.esm.js.map +1 -0
  258. package/dist/{updateAuthFromVerifyResponse-DD_rZDrQ.cjs → updateAuthFromVerifyResponse-CePaJzru.cjs} +43 -14
  259. package/dist/updateAuthFromVerifyResponse-CePaJzru.cjs.map +1 -0
  260. package/dist/{updateAuthFromVerifyResponse-DtnQfhJ1.native.esm.js → updateAuthFromVerifyResponse-Dd0q0rPX.native.esm.js} +38 -15
  261. package/dist/updateAuthFromVerifyResponse-Dd0q0rPX.native.esm.js.map +1 -0
  262. package/dist/utils/objectKeys/index.d.ts +2 -0
  263. package/dist/utils/objectKeys/index.d.ts.map +1 -0
  264. package/dist/utils/objectKeys/objectKeys.d.ts +8 -0
  265. package/dist/utils/objectKeys/objectKeys.d.ts.map +1 -0
  266. package/dist/waas.cjs +1198 -4
  267. package/dist/waas.cjs.map +1 -1
  268. package/dist/waas.esm.js +1176 -7
  269. package/dist/waas.esm.js.map +1 -1
  270. package/dist/waas.native.esm.js +1176 -7
  271. package/dist/waas.native.esm.js.map +1 -1
  272. package/dist/waasCore.cjs +6 -6
  273. package/dist/waasCore.esm.js +6 -6
  274. package/dist/waasCore.native.esm.js +6 -6
  275. package/package.json +4 -4
  276. package/dist/getNetworkProviderFromNetworkId-CKWQLHSE.native.esm.js.map +0 -1
  277. package/dist/updateAuthFromVerifyResponse-DD_rZDrQ.cjs.map +0 -1
  278. package/dist/updateAuthFromVerifyResponse-DcwFCD-Y.esm.js.map +0 -1
  279. package/dist/updateAuthFromVerifyResponse-DtnQfhJ1.native.esm.js.map +0 -1
package/dist/waas.cjs CHANGED
@@ -1,7 +1,7 @@
1
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-DD_rZDrQ.cjs');
2
- const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-DnDhv_Uj.cjs');
3
- const require_getWalletProviderByKey = require('./getWalletProviderByKey-CnpXHkmq.cjs');
4
- const require_migrateFromFireblocks = require('./migrateFromFireblocks-Dg6igmRk.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CePaJzru.cjs');
2
+ const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-DT4jhqkC.cjs');
3
+ const require_getWalletProviderByKey = require('./getWalletProviderByKey-BMsrnfN2.cjs');
4
+ const require_migrateFromFireblocks = require('./migrateFromFireblocks-Dyh2dGWB.cjs');
5
5
  let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
6
6
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
7
7
 
@@ -185,6 +185,34 @@ const backupWaasKeySharesToGoogleDrive = async ({ googleDriveAccessToken, passwo
185
185
  });
186
186
  };
187
187
 
188
+ //#endregion
189
+ //#region src/modules/waas/policies/buildAllowPolicyRule/buildAllowPolicyRule.ts
190
+ /**
191
+ * Builds a policy rule that permits the described action.
192
+ *
193
+ * @param rule - The rule fields (name, chain, and any targeting/limit fields).
194
+ * @returns A `WaasPolicyRule` with `ruleType` set to `allow`.
195
+ * @notInstrumented
196
+ */
197
+ const buildAllowPolicyRule = (rule) => ({
198
+ ...rule,
199
+ ruleType: _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Allow
200
+ });
201
+
202
+ //#endregion
203
+ //#region src/modules/waas/policies/buildDenyPolicyRule/buildDenyPolicyRule.ts
204
+ /**
205
+ * Builds a policy rule that blocks the described action.
206
+ *
207
+ * @param rule - The rule fields (name, chain, and any targeting/limit fields).
208
+ * @returns A `WaasPolicyRule` with `ruleType` set to `deny`.
209
+ * @notInstrumented
210
+ */
211
+ const buildDenyPolicyRule = (rule) => ({
212
+ ...rule,
213
+ ruleType: _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Deny
214
+ });
215
+
188
216
  //#endregion
189
217
  //#region src/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.ts
190
218
  /**
@@ -212,6 +240,649 @@ const createBusinessAccount = async (params, client = require_updateAuthFromVeri
212
240
  return result;
213
241
  };
214
242
 
243
+ //#endregion
244
+ //#region src/modules/waas/policies/applyPolicyLayerBatch/applyPolicyLayerBatch.ts
245
+ /**
246
+ * Applies a batch of rule operations to the policy layer a
247
+ * {@link ResolvedPolicyScope} points at, atomically in one enclave cycle.
248
+ * Shared by {@link createPolicy} and {@link removePolicyRules} so the
249
+ * account-vs-wallet-vs-signer branch is written once.
250
+ *
251
+ * @notInstrumented
252
+ */
253
+ const applyPolicyLayerBatch = ({ operations, resolvedScope }, client) => {
254
+ const { environmentId } = require_updateAuthFromVerifyResponse.getCore(client);
255
+ const apiClient = require_updateAuthFromVerifyResponse.createApiClient({}, client);
256
+ switch (resolvedScope.target) {
257
+ case "account": return apiClient.updateBusinessAccountPolicyLayer({
258
+ businessAccountId: resolvedScope.businessAccountId,
259
+ environmentId,
260
+ waasPolicyLayerUpdateRequest: {
261
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerUpdateRequestOpEnum.Batch,
262
+ operations
263
+ }
264
+ });
265
+ case "wallet": return apiClient.updateWaasWalletSelfPolicyLayer({
266
+ environmentId,
267
+ waasPolicyLayerUpdateRequest: {
268
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerUpdateRequestOpEnum.Batch,
269
+ operations
270
+ },
271
+ walletId: resolvedScope.walletId
272
+ });
273
+ case "signer": return apiClient.updateWaasSignerSelfPolicyLayer({
274
+ environmentId,
275
+ waasSignerPolicyLayerUpdateRequest: {
276
+ op: _dynamic_labs_sdk_api_core.WaasSignerPolicyLayerUpdateRequestOpEnum.Batch,
277
+ operations,
278
+ shareSetId: resolvedScope.shareSetId
279
+ },
280
+ walletId: resolvedScope.walletId
281
+ });
282
+ default: {
283
+ const unhandledScope = resolvedScope;
284
+ throw new require_updateAuthFromVerifyResponse.InvalidParamError(`applyPolicyLayerBatch: unhandled target "${JSON.stringify(unhandledScope)}"`);
285
+ }
286
+ }
287
+ };
288
+
289
+ //#endregion
290
+ //#region src/utils/objectKeys/objectKeys.ts
291
+ /**
292
+ * Typed `Object.keys` — returns `(keyof T)[]` instead of `string[]`, for
293
+ * objects whose key set is fully known at the type level.
294
+ *
295
+ * @notInstrumented
296
+ */
297
+ const objectKeys = (value) => Object.keys(value);
298
+
299
+ //#endregion
300
+ //#region src/modules/waas/policies/buildValueLimit/buildValueLimit.ts
301
+ /**
302
+ * Turns a {@link PolicyRuleMaxAmountPerTransaction} into the `valueLimit` shape a rule stores it as.
303
+ * @notInstrumented
304
+ */
305
+ const buildValueLimit = ({ amount, asset }) => ({
306
+ asset,
307
+ maxPerCall: amount
308
+ });
309
+
310
+ //#endregion
311
+ //#region src/modules/waas/policies/policyRuleDefaultNames.ts
312
+ /**
313
+ * Each rule kind's name when the caller doesn't override it via
314
+ * `PolicyRules['names']`. Shared between the `build*Rule` functions and
315
+ * `desugarPolicyRules` so a rename can't drift the two out of sync — the
316
+ * same reason `RULE_KINDS` in `policyRuleKinds.ts` is a single table
317
+ * instead of parallel switches.
318
+ */
319
+ const DEFAULT_POLICY_RULE_NAMES = {
320
+ allowAddresses: "Allowed addresses",
321
+ blockExport: "Block key export",
322
+ denyAddresses: "Denied addresses",
323
+ maxAmountPerTransaction: "Per-transaction cap"
324
+ };
325
+
326
+ //#endregion
327
+ //#region src/modules/waas/policies/buildAllowAddressesRule/buildAllowAddressesRule.ts
328
+ /**
329
+ * Builds the `allowAddresses` rule, absorbing a sibling
330
+ * `maxAmountPerTransaction` onto the same rule instead of letting it emit
331
+ * its own — see `buildMaxAmountPerTransactionRule`.
332
+ * @notInstrumented
333
+ */
334
+ const buildAllowAddressesRule = ({ context: { chain, chainIds }, rules }) => {
335
+ if (!rules.allowAddresses || rules.allowAddresses.length === 0) return void 0;
336
+ return {
337
+ addresses: rules.allowAddresses,
338
+ chain,
339
+ chainIds,
340
+ name: rules.names?.allowAddresses ?? DEFAULT_POLICY_RULE_NAMES.allowAddresses,
341
+ ruleType: _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Allow,
342
+ ...rules.maxAmountPerTransaction ? { valueLimit: buildValueLimit(rules.maxAmountPerTransaction) } : {}
343
+ };
344
+ };
345
+
346
+ //#endregion
347
+ //#region src/modules/waas/policies/buildBlockExportRule/buildBlockExportRule.ts
348
+ /**
349
+ * Builds the `blockExport` rule. `deny`, not `allow`: an addressless
350
+ * allow-rule normalizes to an empty allowed-set, denying every transaction.
351
+ * `chain`/`chainIds` are stamped for consistency but the enforcement of a
352
+ * `blockExport` `operationRestrictions` rule is wallet-wide, ignoring them.
353
+ * @notInstrumented
354
+ */
355
+ const buildBlockExportRule = ({ context: { chain, chainIds }, rules }) => {
356
+ if (rules.blockExport !== true) return void 0;
357
+ return {
358
+ chain,
359
+ chainIds,
360
+ name: rules.names?.blockExport ?? DEFAULT_POLICY_RULE_NAMES.blockExport,
361
+ operationRestrictions: { blockExport: true },
362
+ ruleType: _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Deny
363
+ };
364
+ };
365
+
366
+ //#endregion
367
+ //#region src/modules/waas/policies/buildDenyAddressesRule/buildDenyAddressesRule.ts
368
+ /**
369
+ * Builds the `denyAddresses` rule. Independent of `allowAddresses`.
370
+ * @notInstrumented
371
+ */
372
+ const buildDenyAddressesRule = ({ context: { chain, chainIds }, rules }) => {
373
+ if (!rules.denyAddresses || rules.denyAddresses.length === 0) return void 0;
374
+ return {
375
+ addresses: rules.denyAddresses,
376
+ chain,
377
+ chainIds,
378
+ name: rules.names?.denyAddresses ?? DEFAULT_POLICY_RULE_NAMES.denyAddresses,
379
+ ruleType: _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Deny
380
+ };
381
+ };
382
+
383
+ //#endregion
384
+ //#region src/modules/waas/policies/buildMaxAmountPerTransactionRule/buildMaxAmountPerTransactionRule.ts
385
+ /**
386
+ * Builds the standalone `maxAmountPerTransaction` rule. Only fires when
387
+ * `allowAddresses` didn't already absorb this cap onto its own rule. `deny`
388
+ * for the same reason as `blockExport`'s builder.
389
+ * @notInstrumented
390
+ */
391
+ const buildMaxAmountPerTransactionRule = ({ context: { chain, chainIds }, rules }) => {
392
+ const isAbsorbedByAllowAddresses = Boolean(rules.allowAddresses?.length);
393
+ if (!rules.maxAmountPerTransaction || isAbsorbedByAllowAddresses) return void 0;
394
+ return {
395
+ chain,
396
+ chainIds,
397
+ name: rules.names?.maxAmountPerTransaction ?? DEFAULT_POLICY_RULE_NAMES.maxAmountPerTransaction,
398
+ ruleType: _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Deny,
399
+ valueLimit: buildValueLimit(rules.maxAmountPerTransaction)
400
+ };
401
+ };
402
+
403
+ //#endregion
404
+ //#region src/modules/waas/policies/hasAddresses/hasAddresses.ts
405
+ /**
406
+ * Checks both the current `addresses` array and the legacy singular `address` field.
407
+ * @notInstrumented
408
+ */
409
+ const hasAddresses = (rule) => rule.addresses !== void 0 && rule.addresses.length > 0 || rule.address != null;
410
+
411
+ //#endregion
412
+ //#region src/modules/waas/policies/hasUnrecognizedFields/hasUnrecognizedFields.ts
413
+ const RECOGNIZED_TOP_LEVEL_KEY_SET = new Set([
414
+ "ruleId",
415
+ "name",
416
+ "ruleType",
417
+ "addresses",
418
+ "chain",
419
+ "chainIds",
420
+ "valueLimit",
421
+ "operationRestrictions"
422
+ ]);
423
+ /**
424
+ * @notInstrumented
425
+ */
426
+ const hasUnrecognizedFields = (rule) => Object.keys(rule).some((key) => !RECOGNIZED_TOP_LEVEL_KEY_SET.has(key) && rule[key] != null) || rule.valueLimit?.totalLimit != null || rule.operationRestrictions?.blockRevocation != null || rule.operationRestrictions?.blockClientSigning != null;
427
+
428
+ //#endregion
429
+ //#region src/modules/waas/policies/readValueLimit/readValueLimit.ts
430
+ /**
431
+ * Reads a stored `valueLimit` back into a {@link PolicyRuleMaxAmountPerTransaction}.
432
+ * @notInstrumented
433
+ */
434
+ const readValueLimit = ({ asset, maxPerCall }) => ({
435
+ amount: maxPerCall,
436
+ ...asset ? { asset } : {}
437
+ });
438
+
439
+ //#endregion
440
+ //#region src/modules/waas/policies/readAllowAddressesRule/readAllowAddressesRule.ts
441
+ /**
442
+ * Recognizes an existing rule as `allowAddresses`, reading back a merged
443
+ * `maxAmountPerTransaction` cap too when the rule carries one.
444
+ * @notInstrumented
445
+ */
446
+ const readAllowAddressesRule = (rule) => {
447
+ if (!(rule.ruleType === _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Allow && rule.operationRestrictions === void 0 && (rule.valueLimit === void 0 || rule.valueLimit.maxPerCall !== void 0) && hasAddresses(rule) && !hasUnrecognizedFields(rule))) return void 0;
448
+ return {
449
+ allowAddresses: rule.addresses,
450
+ ...rule.valueLimit?.maxPerCall !== void 0 ? { maxAmountPerTransaction: readValueLimit({
451
+ asset: rule.valueLimit.asset,
452
+ maxPerCall: rule.valueLimit.maxPerCall
453
+ }) } : {}
454
+ };
455
+ };
456
+
457
+ //#endregion
458
+ //#region src/modules/waas/policies/readBlockExportRule/readBlockExportRule.ts
459
+ /**
460
+ * Recognizes an existing rule as `blockExport`.
461
+ * @notInstrumented
462
+ */
463
+ const readBlockExportRule = (rule) => {
464
+ if (!(rule.ruleType === _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Deny && rule.operationRestrictions?.blockExport === true && rule.valueLimit === void 0 && !hasAddresses(rule) && !hasUnrecognizedFields(rule))) return void 0;
465
+ return { blockExport: true };
466
+ };
467
+
468
+ //#endregion
469
+ //#region src/modules/waas/policies/readDenyAddressesRule/readDenyAddressesRule.ts
470
+ /**
471
+ * Recognizes an existing rule as `denyAddresses`.
472
+ * @notInstrumented
473
+ */
474
+ const readDenyAddressesRule = (rule) => {
475
+ if (!(rule.ruleType === _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Deny && rule.operationRestrictions === void 0 && rule.valueLimit === void 0 && hasAddresses(rule) && !hasUnrecognizedFields(rule))) return void 0;
476
+ return { denyAddresses: rule.addresses };
477
+ };
478
+
479
+ //#endregion
480
+ //#region src/modules/waas/policies/readMaxAmountPerTransactionRule/readMaxAmountPerTransactionRule.ts
481
+ /**
482
+ * Recognizes an existing rule as a standalone `maxAmountPerTransaction` cap.
483
+ * @notInstrumented
484
+ */
485
+ const readMaxAmountPerTransactionRule = (rule) => {
486
+ if (!(rule.ruleType === _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Deny && rule.operationRestrictions === void 0 && rule.valueLimit?.maxPerCall !== void 0 && !hasAddresses(rule) && !hasUnrecognizedFields(rule))) return void 0;
487
+ return { maxAmountPerTransaction: readValueLimit({
488
+ asset: rule.valueLimit.asset,
489
+ maxPerCall: rule.valueLimit.maxPerCall
490
+ }) };
491
+ };
492
+
493
+ //#endregion
494
+ //#region src/modules/waas/policies/policyRuleKinds.ts
495
+ /** The four keys of {@link PolicyRules}, each of which produces its own rule. */
496
+ const RULE_KIND_KEYS = [
497
+ "blockExport",
498
+ "allowAddresses",
499
+ "denyAddresses",
500
+ "maxAmountPerTransaction"
501
+ ];
502
+ /**
503
+ * The single source of truth {@link expandPolicyRules} and
504
+ * {@link desugarPolicyRules} both build on. Entries are alphabetized
505
+ * (enforced by lint), not grouped by relationship — `allowAddresses` and
506
+ * `maxAmountPerTransaction` cooperate (see their builders' comments) despite
507
+ * sitting apart here.
508
+ */
509
+ const RULE_KINDS = {
510
+ allowAddresses: {
511
+ buildRule: buildAllowAddressesRule,
512
+ readRule: readAllowAddressesRule
513
+ },
514
+ blockExport: {
515
+ buildRule: buildBlockExportRule,
516
+ readRule: readBlockExportRule
517
+ },
518
+ denyAddresses: {
519
+ buildRule: buildDenyAddressesRule,
520
+ readRule: readDenyAddressesRule
521
+ },
522
+ maxAmountPerTransaction: {
523
+ buildRule: buildMaxAmountPerTransactionRule,
524
+ readRule: readMaxAmountPerTransactionRule
525
+ }
526
+ };
527
+
528
+ //#endregion
529
+ //#region src/modules/waas/policies/readCoveredRule/readCoveredRule.ts
530
+ /**
531
+ * The sugar keys and values an existing rule structurally represents — a
532
+ * single rule can cover more than one key (see `allowAddresses` absorbing
533
+ * `maxAmountPerTransaction` in `policyRuleKinds.ts`). A rule carrying a
534
+ * per-rule `modifiableBySigner` grant is never matched here — treating it
535
+ * as covering keys would let a caller's batch reuse/replace/remove it and
536
+ * silently revoke that signer's edit permission (mirrors `desugarPolicyRules`).
537
+ *
538
+ * @param rule - The existing policy-layer rule to read.
539
+ * @returns The sugar keys and values the rule covers, or undefined when it matches no kind or carries a signer grant.
540
+ * @notInstrumented
541
+ */
542
+ const readCoveredRule = (rule) => {
543
+ if (rule.modifiableBySigner === true) return;
544
+ for (const kind of RULE_KIND_KEYS) {
545
+ const values = RULE_KINDS[kind].readRule(rule);
546
+ if (values === void 0) continue;
547
+ return {
548
+ keys: objectKeys(values),
549
+ kind,
550
+ values
551
+ };
552
+ }
553
+ };
554
+
555
+ //#endregion
556
+ //#region src/modules/waas/policies/sortRulesByRuleId/sortRulesByRuleId.ts
557
+ /**
558
+ * Sorts rules by `ruleId` ascending (a rule missing one sorts first, as `''`)
559
+ * — the deterministic order {@link matchExistingRules} picks its reuse
560
+ * target from, so every caller agrees on which duplicate rule wins.
561
+ *
562
+ * @param rules - The rules to sort.
563
+ * @returns A new array, sorted by `ruleId` ascending.
564
+ * @notInstrumented
565
+ */
566
+ const sortRulesByRuleId = (rules) => [...rules].sort((a, b) => {
567
+ const idA = a.ruleId ?? "";
568
+ const idB = b.ruleId ?? "";
569
+ if (idA < idB) return -1;
570
+ if (idA > idB) return 1;
571
+ return 0;
572
+ });
573
+
574
+ //#endregion
575
+ //#region src/modules/waas/policies/matchExistingRules/matchExistingRules.ts
576
+ const coveredRuleKeys = (rule) => readCoveredRule(rule)?.keys ?? [];
577
+ /**
578
+ * Matches existing rules covering any of `builtRule`'s keys. Only rules
579
+ * being *absorbed* into it — i.e. no other match claims the same key — are
580
+ * superseded (safe to remove). Two matches claiming the SAME key (e.g. two
581
+ * hand-authored `denyAddresses` rules for this chain scope) are a
582
+ * legitimate duplicate, not one superseding the other, so are left alone
583
+ * rather than removed.
584
+ *
585
+ * @param params.builtRule - The newly built rule to match existing rules against.
586
+ * @param params.consumedRuleIds - `ruleId`s already reused or removed for a prior built rule this call, so none is touched twice.
587
+ * @param params.existingRulesInScope - The layer's rules already narrowed to the target chain scope.
588
+ * @returns The rule to reuse `builtRule`'s upsert onto (if any), and every rule it supersedes.
589
+ * @notInstrumented
590
+ */
591
+ const matchExistingRules = ({ builtRule, consumedRuleIds, existingRulesInScope }) => {
592
+ const builtKeys = new Set(coveredRuleKeys(builtRule));
593
+ const matches = sortRulesByRuleId(existingRulesInScope).filter((existingRule) => existingRule.ruleId !== void 0 && !consumedRuleIds.has(existingRule.ruleId)).map((rule) => ({
594
+ keys: coveredRuleKeys(rule),
595
+ rule
596
+ })).filter(({ keys }) => keys.some((key) => builtKeys.has(key)));
597
+ const [reused, ...rest] = matches;
598
+ const superseded = rest.filter(({ keys, rule }) => {
599
+ const ruleKeys = new Set(keys);
600
+ return !matches.some((other) => other.rule.ruleId !== rule.ruleId && other.keys.some((key) => ruleKeys.has(key)));
601
+ }).map(({ rule }) => rule);
602
+ return {
603
+ reused: reused?.rule,
604
+ superseded
605
+ };
606
+ };
607
+
608
+ //#endregion
609
+ //#region src/modules/waas/policies/resolveRuleName/resolveRuleName.ts
610
+ /**
611
+ * Keeps the reused rule's label unless the caller overrides it or its
612
+ * name-owning kind changed.
613
+ *
614
+ * @param params.builtRule - The newly built rule about to be upserted.
615
+ * @param params.reused - The existing rule `builtRule` is upserted onto, if any.
616
+ * @param params.rules - The caller's requested {@link PolicyRules} sugar map.
617
+ * @returns The name to use for the upserted rule.
618
+ * @notInstrumented
619
+ */
620
+ const resolveRuleName = ({ builtRule, reused, rules }) => {
621
+ if (reused === void 0) return builtRule.name;
622
+ const builtKind = readCoveredRule(builtRule)?.kind;
623
+ const reusedKind = readCoveredRule(reused)?.kind;
624
+ const sameOwningKind = builtKind !== void 0 && builtKind === reusedKind;
625
+ const nameOverridden = builtKind !== void 0 && rules.names?.[builtKind] !== void 0;
626
+ return sameOwningKind && !nameOverridden ? reused.name : builtRule.name;
627
+ };
628
+
629
+ //#endregion
630
+ //#region src/modules/waas/policies/buildOperationsForRule/buildOperationsForRule.ts
631
+ /**
632
+ * Upserts `builtRule` onto the existing rule it reuses (if any), and
633
+ * removes every rule that rule superseded. Mutates `consumedRuleIds` so a
634
+ * later call for a different built rule never reuses or removes the same
635
+ * existing rule twice.
636
+ *
637
+ * @param params.builtRule - The newly built rule to turn into batch operations.
638
+ * @param params.consumedRuleIds - `ruleId`s already reused or removed for a prior built rule this call.
639
+ * @param params.existingRulesInScope - The layer's rules already narrowed to the target chain scope.
640
+ * @param params.rules - The caller's requested {@link PolicyRules} sugar map.
641
+ * @returns The batch operations for this built rule — one upsert, plus a remove per superseded rule.
642
+ * @notInstrumented
643
+ */
644
+ const buildOperationsForRule = ({ builtRule, consumedRuleIds, existingRulesInScope, rules }) => {
645
+ const { reused, superseded } = matchExistingRules({
646
+ builtRule,
647
+ consumedRuleIds,
648
+ existingRulesInScope
649
+ });
650
+ const reusedRuleId = reused?.ruleId;
651
+ const operations = [{
652
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerRuleOperationOpEnum.Upsert,
653
+ rule: reusedRuleId ? {
654
+ ...builtRule,
655
+ name: resolveRuleName({
656
+ builtRule,
657
+ reused,
658
+ rules
659
+ }),
660
+ ruleId: reusedRuleId
661
+ } : builtRule
662
+ }];
663
+ if (reusedRuleId) consumedRuleIds.add(reusedRuleId);
664
+ for (const { ruleId } of superseded) {
665
+ consumedRuleIds.add(ruleId);
666
+ operations.push({
667
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerRuleOperationOpEnum.Remove,
668
+ ruleId
669
+ });
670
+ }
671
+ return operations;
672
+ };
673
+
674
+ //#endregion
675
+ //#region src/modules/waas/policies/expandPolicyRules/expandPolicyRules.ts
676
+ /**
677
+ * Expands the {@link PolicyRules} sugar map into `WaasPolicyRule[]` for one
678
+ * chain scope. Omitting `chainIds` (or passing an empty array) builds a
679
+ * wildcard rule matching every chain id of `chain`.
680
+ *
681
+ * @param params.rules - The sugar map describing the desired rules.
682
+ * @param params.chain - The chain these rules apply to.
683
+ * @param params.chainIds - The chain ids these rules apply to; omit for a wildcard rule that matches every chain id of `chain`.
684
+ * @returns The expanded `WaasPolicyRule[]`, without `ruleId`.
685
+ * @throws When expansion would produce an `allow` rule with a value limit and no addresses — that empties the allowed set and denies every transaction on the chain.
686
+ * @notInstrumented
687
+ */
688
+ const expandPolicyRules = ({ chain, chainIds, rules }) => {
689
+ const context = {
690
+ chain,
691
+ chainIds: chainIds ?? []
692
+ };
693
+ const expanded = RULE_KIND_KEYS.flatMap((key) => {
694
+ const rule = RULE_KINDS[key].buildRule({
695
+ context,
696
+ rules
697
+ });
698
+ return rule ? [rule] : [];
699
+ });
700
+ if (expanded.some((rule) => rule.ruleType === _dynamic_labs_sdk_api_core.WaasPolicyRuleType.Allow && rule.valueLimit !== void 0 && (rule.addresses === void 0 || rule.addresses.length === 0))) throw new require_updateAuthFromVerifyResponse.InvalidParamError("expandPolicyRules: refusing to emit an allow rule with a value limit and no addresses — it would empty the allowed-address set and deny every transaction on this chain");
701
+ return expanded;
702
+ };
703
+
704
+ //#endregion
705
+ //#region src/modules/waas/policies/fillOmittedRuleValues/fillOmittedRuleValues.ts
706
+ /**
707
+ * Whether the caller's value for a sugar key would actually produce a rule —
708
+ * an empty `allowAddresses`/`denyAddresses` array builds no rule (see
709
+ * `buildAllowAddressesRule`/`buildDenyAddressesRule`), so it must count the
710
+ * same as omitted here. Otherwise a real value is present.
711
+ */
712
+ const isRuleKeyRequested = (value) => Array.isArray(value) ? value.length > 0 : value !== void 0;
713
+ /**
714
+ * A key the caller omitted can be silently dropped if it's merged into the
715
+ * same rule as a key they DID supply (e.g. re-saving only `allowAddresses`
716
+ * when the existing rule also carries `maxAmountPerTransaction`) — carries
717
+ * it forward so a partial re-save never erases a restriction the caller
718
+ * didn't ask to remove.
719
+ *
720
+ * Rules are visited in the same lexicographically-smallest-`ruleId` order
721
+ * `matchExistingRules` reuses, and only the first rule to cover a given key
722
+ * fills it — so when duplicate rules cover the same omitted key, the value
723
+ * always comes from the rule that will actually be upserted.
724
+ *
725
+ * @param params.existingRulesInScope - The layer's rules already narrowed to the target chain scope.
726
+ * @param params.rules - The caller's requested {@link PolicyRules} sugar map.
727
+ * @returns `rules`, with any key a partially-requested existing rule also covers filled in from that rule's current value.
728
+ * @notInstrumented
729
+ */
730
+ const fillOmittedRuleValues = ({ existingRulesInScope, rules }) => {
731
+ const mergedRules = { ...rules };
732
+ for (const existingRule of sortRulesByRuleId(existingRulesInScope)) {
733
+ const covered = readCoveredRule(existingRule);
734
+ const isPartiallyRequested = covered !== void 0 && covered.keys.some((key) => isRuleKeyRequested(rules[key])) && covered.keys.some((key) => !isRuleKeyRequested(rules[key]));
735
+ if (covered === void 0 || !isPartiallyRequested) continue;
736
+ for (const key of covered.keys) if (!isRuleKeyRequested(rules[key]) && mergedRules[key] === void 0) Object.assign(mergedRules, { [key]: covered.values[key] });
737
+ }
738
+ return mergedRules;
739
+ };
740
+
741
+ //#endregion
742
+ //#region src/modules/waas/policies/getResolvedPolicyLayer/getResolvedPolicyLayer.ts
743
+ /**
744
+ * Fetches the policy layer a {@link ResolvedPolicyScope} points at. Shared
745
+ * by {@link createPolicy}, {@link getPolicy}, and {@link removePolicyRules}
746
+ * so the account/wallet/signer branch is written once.
747
+ *
748
+ * @notInstrumented
749
+ */
750
+ const getResolvedPolicyLayer = ({ resolvedScope }, client) => {
751
+ const { environmentId } = require_updateAuthFromVerifyResponse.getCore(client);
752
+ const apiClient = require_updateAuthFromVerifyResponse.createApiClient({}, client);
753
+ switch (resolvedScope.target) {
754
+ case "account": return apiClient.getBusinessAccountPolicyLayer({
755
+ businessAccountId: resolvedScope.businessAccountId,
756
+ environmentId
757
+ });
758
+ case "wallet": return apiClient.getWaasWalletSelfPolicyLayer({
759
+ environmentId,
760
+ walletId: resolvedScope.walletId
761
+ });
762
+ case "signer": return apiClient.getWaasSignerSelfPolicyLayer({
763
+ environmentId,
764
+ shareSetId: resolvedScope.shareSetId,
765
+ walletId: resolvedScope.walletId
766
+ });
767
+ default: {
768
+ const unhandledScope = resolvedScope;
769
+ throw new require_updateAuthFromVerifyResponse.InvalidParamError(`getResolvedPolicyLayer: unhandled target "${JSON.stringify(unhandledScope)}"`);
770
+ }
771
+ }
772
+ };
773
+
774
+ //#endregion
775
+ //#region src/modules/waas/policies/resolvePolicyScope/resolvePolicyScope.ts
776
+ /** Narrows a {@link WalletAccount} to {@link WaasWalletAccount} so WaaS-only fields (e.g. `shareSetId`) are accessible. */
777
+ const isWaasWallet = (walletAccount) => require_updateAuthFromVerifyResponse.isWaasWalletAccount({ walletAccount });
778
+ /**
779
+ * Resolves a {@link PolicyScope} to its concrete policy layer. When only a
780
+ * `shareSetId` is given, the owning wallet is found locally by scanning the
781
+ * client's own wallet accounts — no network request.
782
+ *
783
+ * @param params.scope - The scope to resolve.
784
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
785
+ * @returns The concrete target (`account`, `wallet`, or `signer`) plus the ids needed to call the SDK API.
786
+ * @throws When a `shareSetId`-only scope doesn't match any of the client's wallet accounts.
787
+ * @notInstrumented
788
+ */
789
+ const resolvePolicyScope = ({ scope }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
790
+ if ("businessAccountId" in scope) return {
791
+ businessAccountId: scope.businessAccountId,
792
+ target: "account"
793
+ };
794
+ if ("walletId" in scope) return scope.shareSetId === void 0 ? {
795
+ target: "wallet",
796
+ walletId: scope.walletId
797
+ } : {
798
+ shareSetId: scope.shareSetId,
799
+ target: "signer",
800
+ walletId: scope.walletId
801
+ };
802
+ const owningWalletAccount = require_updateAuthFromVerifyResponse.getWalletAccounts(client).filter(isWaasWallet).find((walletAccount) => walletAccount.shareSetId === scope.shareSetId || walletAccount.otherShareSets?.some((shareSet) => shareSet.shareSetId === scope.shareSetId));
803
+ require_updateAuthFromVerifyResponse.assertDefined(owningWalletAccount?.verifiedCredentialId, `resolvePolicyScope: could not resolve a wallet for shareSetId "${scope.shareSetId}" — no verified wallet account exposes this share set`);
804
+ return {
805
+ shareSetId: scope.shareSetId,
806
+ target: "signer",
807
+ walletId: owningWalletAccount.verifiedCredentialId
808
+ };
809
+ };
810
+
811
+ //#endregion
812
+ //#region src/modules/waas/policies/sameChainIds/sameChainIds.ts
813
+ /**
814
+ * Whether two chainIds arrays describe the same set, regardless of order.
815
+ * Shared by {@link createPolicy} and {@link removePolicyRules} to keep their
816
+ * existing-rule lookups consistent.
817
+ *
818
+ * @notInstrumented
819
+ */
820
+ const sameChainIds = ({ existing = [], requested }) => {
821
+ if (existing.length !== requested.length) return false;
822
+ const sortedExisting = [...existing].sort((x, y) => x - y);
823
+ const sortedRequested = [...requested].sort((x, y) => x - y);
824
+ return sortedExisting.every((id, index) => id === sortedRequested[index]);
825
+ };
826
+
827
+ //#endregion
828
+ //#region src/modules/waas/policies/createPolicy/createPolicy.ts
829
+ /**
830
+ * Creates or updates a wallet's, signer's, or business account's policy rules from the
831
+ * {@link PolicyRules} sugar map, in one atomic `batch` PATCH. Each key in
832
+ * `rules` maps to at most one underlying rule, so calling this twice with
833
+ * the same map updates that rule in place instead of duplicating it.
834
+ *
835
+ * Known race: no ETag / optimistic-concurrency check — concurrent calls for
836
+ * the same scope can both read-then-write and duplicate a rule.
837
+ *
838
+ * When more than one existing rule matches the same sugar key(s), only
839
+ * rules being absorbed into the newly built rule (i.e. no other match
840
+ * claims the same key) are removed. Two rules that duplicate the same key
841
+ * (e.g. two hand-authored `denyAddresses` rules for this chain scope) are
842
+ * left as-is rather than one being silently deleted — this call updates the
843
+ * lexicographically-smallest-`ruleId` match in place and leaves the rest
844
+ * untouched. A caller repeating this call will not converge on a single
845
+ * rule; the duplicate has to be removed by hand.
846
+ *
847
+ * @param params.scope - Which policy layer to update — see {@link resolvePolicyScope}.
848
+ * @param params.chain - The chain the rules apply to.
849
+ * @param params.chainIds - The chain ids the rules apply to; omit for a wildcard rule that matches every chain id of `chain`.
850
+ * @param params.rules - The desired rules, as a {@link PolicyRules} sugar map.
851
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
852
+ * @returns The policy layer as it stands after the batch is applied.
853
+ * @throws When `rules` produces no recognized keys, or via {@link resolvePolicyScope}'s scope-resolution errors.
854
+ * @notInstrumented
855
+ */
856
+ const createPolicy = async ({ chain, chainIds, rules, scope }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
857
+ const normalizedChainIds = chainIds ?? [];
858
+ const resolvedScope = resolvePolicyScope({ scope }, client);
859
+ const existingRulesInScope = ((await getResolvedPolicyLayer({ resolvedScope }, client)).layerContent.rules ?? []).filter((existingRule) => existingRule.chain === chain && sameChainIds({
860
+ existing: existingRule.chainIds,
861
+ requested: normalizedChainIds
862
+ }));
863
+ const expandedRules = expandPolicyRules({
864
+ chain,
865
+ chainIds: normalizedChainIds,
866
+ rules: fillOmittedRuleValues({
867
+ existingRulesInScope,
868
+ rules
869
+ })
870
+ });
871
+ if (expandedRules.length === 0) throw new require_updateAuthFromVerifyResponse.InvalidParamError("createPolicy: rules must include at least one recognized policy key");
872
+ const consumedRuleIds = /* @__PURE__ */ new Set();
873
+ const operations = [];
874
+ for (const builtRule of expandedRules) operations.push(...buildOperationsForRule({
875
+ builtRule,
876
+ consumedRuleIds,
877
+ existingRulesInScope,
878
+ rules
879
+ }));
880
+ return applyPolicyLayerBatch({
881
+ operations,
882
+ resolvedScope
883
+ }, client);
884
+ };
885
+
215
886
  //#endregion
216
887
  //#region src/modules/waas/createWaasOfflineRecoveryShares/createWaasOfflineRecoveryShares.ts
217
888
  /**
@@ -323,6 +994,7 @@ const normalizeWalletRequirements = ({ defaultBitcoinConfig, input }) => {
323
994
  const createWaasWalletAccounts = async ({ chains, password, thresholdSignatureScheme }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
324
995
  const normalizedRequirements = normalizeWalletRequirements({ input: chains });
325
996
  const supportedChains = [
997
+ "ALEO",
326
998
  "BTC",
327
999
  "EVM",
328
1000
  "SOL",
@@ -420,6 +1092,101 @@ const delegateWaasKeyShares = async ({ initialSignerRules, password, walletAccou
420
1092
  await require_isDynamicWaasEnabled.__refreshAuth_wrapped(client);
421
1093
  };
422
1094
 
1095
+ //#endregion
1096
+ //#region src/modules/waas/policies/findMatchedRuleKind/findMatchedRuleKind.ts
1097
+ const COUPLED_RULE_KINDS = new Set(["allowAddresses", "maxAmountPerTransaction"]);
1098
+ const isBlocked = ({ claimedKinds, populatedKeys }) => populatedKeys.some((key) => claimedKinds.has(key) || COUPLED_RULE_KINDS.has(key) && [...COUPLED_RULE_KINDS].some((coupledKey) => claimedKinds.has(coupledKey)));
1099
+ /**
1100
+ * Finds the first {@link RULE_KINDS} entry that recognizes `entry` as its
1101
+ * kind without colliding with an already-claimed key. Must check every key
1102
+ * `readRule` would populate, not just this kind's own key — allowAddresses'
1103
+ * `readRule` also populates `maxAmountPerTransaction` when the rule carries
1104
+ * a merged cap, so accepting it while that key is already claimed would
1105
+ * overwrite an earlier standalone cap.
1106
+ * @notInstrumented
1107
+ */
1108
+ const findMatchedRuleKind = ({ claimedKinds, entry }) => {
1109
+ for (const key of RULE_KIND_KEYS) {
1110
+ const readResult = RULE_KINDS[key].readRule(entry);
1111
+ if (readResult === void 0) continue;
1112
+ if (!isBlocked({
1113
+ claimedKinds,
1114
+ populatedKeys: Object.keys(readResult)
1115
+ })) return {
1116
+ kind: key,
1117
+ readResult
1118
+ };
1119
+ }
1120
+ };
1121
+
1122
+ //#endregion
1123
+ //#region src/modules/waas/policies/isPolicyRuleDeletionMarker/isPolicyRuleDeletionMarker.ts
1124
+ /** The exact key set of a deletion marker — checked as a closed shape, not by presence alone. */
1125
+ const DELETION_MARKER_KEYS = new Set([
1126
+ "ruleId",
1127
+ "deletedByType",
1128
+ "deletedById"
1129
+ ]);
1130
+ /**
1131
+ * Recognizes a policy-Layer deletion marker — the enclave's stand-in for a
1132
+ * rule it couldn't drop outright, kept so the removal stays attributable.
1133
+ * Matches on the entry's exact key set, not field presence, since the read
1134
+ * response types every entry as a live rule.
1135
+ *
1136
+ * @param entry - The raw policy-Layer rule entry to check.
1137
+ * @returns Whether `entry` is a deletion marker rather than a live rule.
1138
+ * @notInstrumented
1139
+ */
1140
+ const isPolicyRuleDeletionMarker = (entry) => {
1141
+ const candidate = entry;
1142
+ return typeof candidate.ruleId === "string" && typeof candidate.deletedByType === "string" && typeof candidate.deletedById === "string" && Object.keys(entry).every((key) => DELETION_MARKER_KEYS.has(key));
1143
+ };
1144
+
1145
+ //#endregion
1146
+ //#region src/modules/waas/policies/desugarPolicyRules/desugarPolicyRules.ts
1147
+ /**
1148
+ * Reverses {@link expandPolicyRules} using {@link findMatchedRuleKind}'s
1149
+ * same rule-kind table, skipping deletion markers. A kind claims at most
1150
+ * one rule; extra matches, out-of-vocabulary fields, and per-rule
1151
+ * `modifiableBySigner` grants (no sugar representation) all go to
1152
+ * `unmapped` instead of being dropped.
1153
+ *
1154
+ * @param params.entries - The policy-Layer's rule entries, as returned in `layerContent.rules`.
1155
+ * @returns The recognized rules as a {@link PolicyRules} map, plus whatever wasn't recognized.
1156
+ * @notInstrumented
1157
+ */
1158
+ const desugarPolicyRules = ({ entries }) => {
1159
+ const rules = {};
1160
+ const unmapped = [];
1161
+ const claimedKinds = /* @__PURE__ */ new Set();
1162
+ for (const entry of entries) {
1163
+ if (isPolicyRuleDeletionMarker(entry)) continue;
1164
+ if (entry.modifiableBySigner === true) {
1165
+ unmapped.push(entry);
1166
+ continue;
1167
+ }
1168
+ const matched = findMatchedRuleKind({
1169
+ claimedKinds,
1170
+ entry
1171
+ });
1172
+ if (matched === void 0) {
1173
+ unmapped.push(entry);
1174
+ continue;
1175
+ }
1176
+ const { kind, readResult } = matched;
1177
+ Object.assign(rules, readResult);
1178
+ for (const key of Object.keys(readResult)) claimedKinds.add(key);
1179
+ if (entry.name !== DEFAULT_POLICY_RULE_NAMES[kind]) rules.names = {
1180
+ ...rules.names,
1181
+ [kind]: entry.name
1182
+ };
1183
+ }
1184
+ return {
1185
+ rules,
1186
+ unmapped
1187
+ };
1188
+ };
1189
+
423
1190
  //#endregion
424
1191
  //#region src/modules/waas/exportWaasClientKeyshares/exportWaasClientKeyshares.ts
425
1192
  /**
@@ -464,6 +1231,26 @@ const exportWaasPrivateKey = async ({ displayContainer, password, walletAccount
464
1231
  });
465
1232
  };
466
1233
 
1234
+ //#endregion
1235
+ //#region src/modules/waas/policies/getAccountPolicyLayer/getAccountPolicyLayer.ts
1236
+ /**
1237
+ * Fetches a business account's active policy rules (the account-Layer).
1238
+ * BA owner/admin only. Calls the SDK API directly (no MPC step), so a
1239
+ * rejection surfaces as a thrown error.
1240
+ *
1241
+ * @param params.businessAccountId - The business account to read policy rules for.
1242
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1243
+ * @returns The account-Layer, including its current rules.
1244
+ * @notInstrumented
1245
+ */
1246
+ const getAccountPolicyLayer = async ({ businessAccountId }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1247
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
1248
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).getBusinessAccountPolicyLayer({
1249
+ businessAccountId,
1250
+ environmentId: core.environmentId
1251
+ });
1252
+ };
1253
+
467
1254
  //#endregion
468
1255
  //#region src/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.ts
469
1256
  /**
@@ -512,6 +1299,110 @@ const getChainsMissingWaasWalletAccounts = (client = require_updateAuthFromVerif
512
1299
  }));
513
1300
  };
514
1301
 
1302
+ //#endregion
1303
+ //#region src/modules/waas/policies/getPolicy/getPolicy.ts
1304
+ /**
1305
+ * Fetches a policy layer and reads its `chain`/`chainIds` scope back into
1306
+ * the {@link PolicyRules} sugar map (see {@link desugarPolicyRules}). A
1307
+ * layer can hold rules for more than one chain, so entries are narrowed to
1308
+ * `chain`/`chainIds` first — the same scoping {@link createPolicy} uses —
1309
+ * to keep the `getPolicy` → edit → `createPolicy` round-trip safe for
1310
+ * multi-chain wallets. Calls the SDK API directly (no MPC step), so a
1311
+ * rejection surfaces as a thrown error.
1312
+ *
1313
+ * @param params.scope - Which policy layer to read — see {@link resolvePolicyScope}.
1314
+ * @param params.chain - The chain to read rules for.
1315
+ * @param params.chainIds - The chain ids to read rules for; omit to read the wildcard rule matching every chain id of `chain`.
1316
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1317
+ * @returns The recognized rules as a {@link PolicyRules} map, whatever wasn't recognized within `chain`/`chainIds`, and the layer's id and last-updated timestamp.
1318
+ * @throws Via {@link resolvePolicyScope}'s scope-resolution errors.
1319
+ * @notInstrumented
1320
+ */
1321
+ const getPolicy = async ({ chain, chainIds, scope }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1322
+ const normalizedChainIds = chainIds ?? [];
1323
+ const layer = await getResolvedPolicyLayer({ resolvedScope: resolvePolicyScope({ scope }, client) }, client);
1324
+ const { rules, unmapped } = desugarPolicyRules({ entries: (layer.layerContent.rules ?? []).filter((entry) => entry.chain === chain && sameChainIds({
1325
+ existing: entry.chainIds,
1326
+ requested: normalizedChainIds
1327
+ })) });
1328
+ return {
1329
+ layerId: layer.layerId,
1330
+ rules,
1331
+ unmapped,
1332
+ updatedAt: layer.updatedAt
1333
+ };
1334
+ };
1335
+
1336
+ //#endregion
1337
+ //#region src/modules/waas/policies/getSignerPolicyLayer/getSignerPolicyLayer.ts
1338
+ /**
1339
+ * Fetches a signer's active policy rules (the signer-Layer) — the caller's
1340
+ * own active share set by default, or another share set on the same wallet
1341
+ * (e.g. a delegated share set) when `shareSetId` is given. Calls the SDK API
1342
+ * directly (no MPC step), so a rejection surfaces as a thrown error.
1343
+ *
1344
+ * @param params.walletAccount - The wallet account whose signer-Layer to read.
1345
+ * @param [params.shareSetId] - The share set to target; defaults to the caller's own.
1346
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1347
+ * @returns The signer-Layer, including its current rules.
1348
+ * @throws {ValueMustBeDefinedError} When `walletAccount` has no `verifiedCredentialId` (it isn't a verified wallet account yet).
1349
+ * @throws {APIError} When the SDK API request fails, for example an unauthorized, not-found, or server error response.
1350
+ * @notInstrumented
1351
+ */
1352
+ const getSignerPolicyLayer = async ({ shareSetId, walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1353
+ require_updateAuthFromVerifyResponse.assertDefined(walletAccount.verifiedCredentialId, "getSignerPolicyLayer: cannot resolve a wallet id — use a verified wallet account");
1354
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
1355
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).getWaasSignerSelfPolicyLayer({
1356
+ environmentId: core.environmentId,
1357
+ shareSetId,
1358
+ walletId: walletAccount.verifiedCredentialId
1359
+ });
1360
+ };
1361
+
1362
+ //#endregion
1363
+ //#region src/modules/waas/getWalletAccountShareSets/getWalletAccountShareSets.ts
1364
+ /**
1365
+ * No network request. Share set ids rotate on refresh/reshare (stale ids are
1366
+ * rejected server-side), so re-read rather than cache; non-WaaS accounts
1367
+ * return `{ own: undefined, others: [] }` instead of throwing.
1368
+ *
1369
+ * @param params.walletAccount - The WaaS wallet account whose share sets to read.
1370
+ * @returns The account's own share set (if any) and the wallet's other active share sets.
1371
+ * @notInstrumented
1372
+ */
1373
+ const getWalletAccountShareSets = ({ walletAccount }) => {
1374
+ const own = walletAccount.shareSetId ? {
1375
+ shareSetId: walletAccount.shareSetId,
1376
+ shareSetType: walletAccount.shareSetType
1377
+ } : void 0;
1378
+ return {
1379
+ others: walletAccount.otherShareSets ?? [],
1380
+ own
1381
+ };
1382
+ };
1383
+
1384
+ //#endregion
1385
+ //#region src/modules/waas/policies/getWalletPolicyLayer/getWalletPolicyLayer.ts
1386
+ /**
1387
+ * Fetches a wallet's active policy rules (the wallet-Layer). Calls the SDK
1388
+ * API directly (no MPC step), so a rejection surfaces as a thrown error.
1389
+ *
1390
+ * @param params.walletAccount - The wallet account to read policy rules for.
1391
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1392
+ * @returns The wallet-Layer, including its current rules.
1393
+ * @throws {ValueMustBeDefinedError} When `walletAccount` has no `verifiedCredentialId` (it isn't a verified wallet account yet).
1394
+ * @throws {APIError} When the SDK API request fails, for example an unauthorized, not-found, or server error response.
1395
+ * @notInstrumented
1396
+ */
1397
+ const getWalletPolicyLayer = async ({ walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1398
+ require_updateAuthFromVerifyResponse.assertDefined(walletAccount.verifiedCredentialId, "getWalletPolicyLayer: cannot resolve a wallet id — use a verified wallet account");
1399
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
1400
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).getWaasWalletSelfPolicyLayer({
1401
+ environmentId: core.environmentId,
1402
+ walletId: walletAccount.verifiedCredentialId
1403
+ });
1404
+ };
1405
+
515
1406
  //#endregion
516
1407
  //#region src/modules/waas/getWalletRecoveryState/getWalletRecoveryState.ts
517
1408
  /**
@@ -626,6 +1517,31 @@ const refreshWaasWalletAccountShares = async ({ walletAccount, password }, clien
626
1517
  });
627
1518
  };
628
1519
 
1520
+ //#endregion
1521
+ //#region src/modules/waas/policies/removeAccountPolicyRule/removeAccountPolicyRule.ts
1522
+ /**
1523
+ * Removes a single rule from a business account's account-Layer. BA
1524
+ * owner/admin only. Calls the SDK API directly (no MPC step), so a
1525
+ * rejection surfaces as a thrown error.
1526
+ *
1527
+ * @param params.businessAccountId - The business account to remove the rule from.
1528
+ * @param params.ruleId - The id of the rule to remove.
1529
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1530
+ * @returns The account-Layer as it stands after the rule is removed.
1531
+ * @notInstrumented
1532
+ */
1533
+ const removeAccountPolicyRule = async ({ businessAccountId, ruleId }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1534
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
1535
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).updateBusinessAccountPolicyLayer({
1536
+ businessAccountId,
1537
+ environmentId: core.environmentId,
1538
+ waasPolicyLayerUpdateRequest: {
1539
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerUpdateRequestOpEnum.Remove,
1540
+ ruleId
1541
+ }
1542
+ });
1543
+ };
1544
+
629
1545
  //#endregion
630
1546
  //#region src/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.ts
631
1547
  /**
@@ -738,6 +1654,147 @@ const removeBusinessAccountWallet = async ({ businessAccountId, walletId }, clie
738
1654
  return detail;
739
1655
  };
740
1656
 
1657
+ //#endregion
1658
+ //#region src/modules/waas/policies/buildOperationForExistingRule/buildOperationForExistingRule.ts
1659
+ /**
1660
+ * Builds the operation to remove or rebuild `existingRule` when the
1661
+ * caller's requested keys touch it — outright removal when every key it
1662
+ * covers is being removed, or an upsert of the rule rebuilt from its
1663
+ * remaining keys when only some are. Returns undefined when none of the
1664
+ * requested keys touch this rule, when it's outside the sugar vocabulary,
1665
+ * or when it can't be identified without a `ruleId`.
1666
+ *
1667
+ * @param params.chain - The chain the rule to remove/rebuild applies to.
1668
+ * @param params.chainIds - The chain ids the rule to remove/rebuild applies to.
1669
+ * @param params.existingRule - The existing layer rule to check.
1670
+ * @param params.rules - The sugar keys to remove.
1671
+ * @returns The operation for this rule, or undefined when it isn't touched.
1672
+ * @notInstrumented
1673
+ */
1674
+ const buildOperationForExistingRule = ({ chain, chainIds, existingRule, rules }) => {
1675
+ if (existingRule.ruleId === void 0) return;
1676
+ const covered = readCoveredRule(existingRule);
1677
+ if (covered === void 0) return;
1678
+ const remainingKeys = covered.keys.filter((key) => !rules.includes(key));
1679
+ if (remainingKeys.length === covered.keys.length) return;
1680
+ if (remainingKeys.length === 0) return {
1681
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerRuleOperationOpEnum.Remove,
1682
+ ruleId: existingRule.ruleId
1683
+ };
1684
+ const remainingRules = {};
1685
+ for (const key of remainingKeys) Object.assign(remainingRules, { [key]: covered.values[key] });
1686
+ const [rebuiltRule] = expandPolicyRules({
1687
+ chain,
1688
+ chainIds,
1689
+ rules: remainingRules
1690
+ });
1691
+ if (rebuiltRule === void 0) return;
1692
+ const keepsName = readCoveredRule(rebuiltRule)?.kind === covered.kind;
1693
+ return {
1694
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerRuleOperationOpEnum.Upsert,
1695
+ rule: {
1696
+ ...rebuiltRule,
1697
+ name: keepsName ? existingRule.name ?? rebuiltRule.name : rebuiltRule.name,
1698
+ ruleId: existingRule.ruleId
1699
+ }
1700
+ };
1701
+ };
1702
+
1703
+ //#endregion
1704
+ //#region src/modules/waas/policies/removePolicyRules/removePolicyRules.ts
1705
+ /**
1706
+ * Removes the rules behind one or more {@link PolicyRules} keys from a
1707
+ * policy layer, in one atomic `batch` PATCH. For every existing rule the
1708
+ * given keys touch, either removes it outright or — when it also covers a
1709
+ * key the caller didn't ask to remove (e.g. an
1710
+ * `allowAddresses`+`maxAmountPerTransaction` rule with only the cap
1711
+ * removed) — rebuilds it from the remaining keys so that restriction
1712
+ * survives.
1713
+ *
1714
+ * @param params.scope - Which policy layer to update — see {@link resolvePolicyScope}.
1715
+ * @param params.chain - The chain the rules to remove apply to.
1716
+ * @param params.chainIds - The chain ids the rules to remove apply to; omit to target the wildcard rule that matches every chain id of `chain`.
1717
+ * @param params.rules - The sugar keys to remove.
1718
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1719
+ * @returns The policy layer as it stands after the batch is applied.
1720
+ * @throws When none of the given keys match an existing rule for this chain scope, or via {@link resolvePolicyScope}'s scope-resolution errors.
1721
+ * @notInstrumented
1722
+ */
1723
+ const removePolicyRules = async ({ chain, chainIds, rules, scope }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1724
+ const normalizedChainIds = chainIds ?? [];
1725
+ const resolvedScope = resolvePolicyScope({ scope }, client);
1726
+ const operations = ((await getResolvedPolicyLayer({ resolvedScope }, client)).layerContent.rules ?? []).filter((existingRule) => existingRule.chain === chain && sameChainIds({
1727
+ existing: existingRule.chainIds,
1728
+ requested: normalizedChainIds
1729
+ })).map((existingRule) => buildOperationForExistingRule({
1730
+ chain,
1731
+ chainIds: normalizedChainIds,
1732
+ existingRule,
1733
+ rules
1734
+ })).filter((operation) => operation !== void 0);
1735
+ if (operations.length === 0) throw new require_updateAuthFromVerifyResponse.InvalidParamError("removePolicyRules: none of the given rule keys matched an existing rule for this scope");
1736
+ return applyPolicyLayerBatch({
1737
+ operations,
1738
+ resolvedScope
1739
+ }, client);
1740
+ };
1741
+
1742
+ //#endregion
1743
+ //#region src/modules/waas/policies/removeSignerPolicyRule/removeSignerPolicyRule.ts
1744
+ /**
1745
+ * Removes a single rule from a signer's policy layer. Calls the SDK API
1746
+ * directly (no MPC step), so a rejection surfaces as a thrown error.
1747
+ *
1748
+ * @param params.walletAccount - The wallet account whose signer-Layer to update.
1749
+ * @param params.ruleId - The id of the rule to remove.
1750
+ * @param [params.shareSetId] - The share set to target; defaults to the caller's own. Only the wallet's own owner may target another share set.
1751
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1752
+ * @returns The signer-Layer as it stands after the rule is removed.
1753
+ * @throws {ValueMustBeDefinedError} When `walletAccount` has no `verifiedCredentialId` (it isn't a verified wallet account yet).
1754
+ * @throws {APIError} When the SDK API request fails, for example an unauthorized, not-found, or server error response.
1755
+ * @notInstrumented
1756
+ */
1757
+ const removeSignerPolicyRule = async ({ ruleId, shareSetId, walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1758
+ require_updateAuthFromVerifyResponse.assertDefined(walletAccount.verifiedCredentialId, "removeSignerPolicyRule: cannot resolve a wallet id — use a verified wallet account");
1759
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
1760
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).updateWaasSignerSelfPolicyLayer({
1761
+ environmentId: core.environmentId,
1762
+ waasSignerPolicyLayerUpdateRequest: {
1763
+ op: _dynamic_labs_sdk_api_core.WaasSignerPolicyLayerUpdateRequestOpEnum.Remove,
1764
+ ruleId,
1765
+ shareSetId
1766
+ },
1767
+ walletId: walletAccount.verifiedCredentialId
1768
+ });
1769
+ };
1770
+
1771
+ //#endregion
1772
+ //#region src/modules/waas/policies/removeWalletPolicyRule/removeWalletPolicyRule.ts
1773
+ /**
1774
+ * Removes a single rule from a wallet's policy layer. Calls the SDK API
1775
+ * directly (no MPC step), so a rejection surfaces as a thrown error.
1776
+ *
1777
+ * @param params.walletAccount - The wallet account to remove the rule from.
1778
+ * @param params.ruleId - The id of the rule to remove.
1779
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1780
+ * @returns The wallet-Layer as it stands after the rule is removed.
1781
+ * @throws {ValueMustBeDefinedError} When `walletAccount` has no `verifiedCredentialId` (it isn't a verified wallet account yet).
1782
+ * @throws {APIError} When the SDK API request fails, for example an unauthorized, not-found, or server error response.
1783
+ * @notInstrumented
1784
+ */
1785
+ const removeWalletPolicyRule = async ({ ruleId, walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1786
+ require_updateAuthFromVerifyResponse.assertDefined(walletAccount.verifiedCredentialId, "removeWalletPolicyRule: cannot resolve a wallet id — use a verified wallet account");
1787
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
1788
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).updateWaasWalletSelfPolicyLayer({
1789
+ environmentId: core.environmentId,
1790
+ waasPolicyLayerUpdateRequest: {
1791
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerUpdateRequestOpEnum.Remove,
1792
+ ruleId
1793
+ },
1794
+ walletId: walletAccount.verifiedCredentialId
1795
+ });
1796
+ };
1797
+
741
1798
  //#endregion
742
1799
  //#region src/modules/waas/revokeWaasDelegation/revokeWaasDelegation.ts
743
1800
  /**
@@ -805,6 +1862,27 @@ const shouldAutoCreateWalletForChain = ({ chain }, client = require_updateAuthFr
805
1862
  return getChainsMissingWaasWalletAccounts(client).includes(chain);
806
1863
  };
807
1864
 
1865
+ //#endregion
1866
+ //#region src/modules/waas/signSerializedTransaction/signSerializedTransaction.ts
1867
+ /**
1868
+ * No gas estimation, balance check, or broadcast — unlike `transferAmount`.
1869
+ * Useful for exercising WaaS policy enforcement in isolation.
1870
+ *
1871
+ * @param params.walletAccount - The wallet account to sign with.
1872
+ * @param params.serializedTransaction - The raw serialized transaction (e.g. viem's `serializeTransaction`).
1873
+ * @param [params.chainId] - The chain id, if required by the target chain's signer.
1874
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
1875
+ * @returns The raw signature.
1876
+ * @notInstrumented
1877
+ */
1878
+ const signSerializedTransaction = async ({ chainId, serializedTransaction, walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
1879
+ return require_migrateFromFireblocks.getWaasWalletProviderFromWalletAccount({ walletAccount }, client).signSerializedTransaction({
1880
+ chainId,
1881
+ serializedTransaction,
1882
+ walletAccount
1883
+ });
1884
+ };
1885
+
808
1886
  //#endregion
809
1887
  //#region src/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.ts
810
1888
  /**
@@ -949,6 +2027,97 @@ const updateWaasPassword = async ({ currentPassword, newPassword, walletAccount
949
2027
  });
950
2028
  };
951
2029
 
2030
+ //#endregion
2031
+ //#region src/modules/waas/policies/upsertAccountPolicyRule/upsertAccountPolicyRule.ts
2032
+ /**
2033
+ * Creates or updates a single rule on a business account's account-Layer
2034
+ * (rules applied to every wallet in the account). Build `rule` with
2035
+ * {@link buildAllowPolicyRule} / {@link buildDenyPolicyRule}. Omit
2036
+ * `rule.ruleId` to create a new rule (the enclave mints one for you); pass
2037
+ * an existing `ruleId` to update it in place. BA owner/admin only. Calls
2038
+ * the SDK API directly (no MPC step), so a rejection surfaces as a thrown
2039
+ * error.
2040
+ *
2041
+ * @param params.businessAccountId - The business account to apply the rule to.
2042
+ * @param params.rule - The rule to create or update.
2043
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2044
+ * @returns The account-Layer as it stands after the rule is applied.
2045
+ * @notInstrumented
2046
+ */
2047
+ const upsertAccountPolicyRule = async ({ businessAccountId, rule }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
2048
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
2049
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).updateBusinessAccountPolicyLayer({
2050
+ businessAccountId,
2051
+ environmentId: core.environmentId,
2052
+ waasPolicyLayerUpdateRequest: {
2053
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerUpdateRequestOpEnum.Upsert,
2054
+ rule
2055
+ }
2056
+ });
2057
+ };
2058
+
2059
+ //#endregion
2060
+ //#region src/modules/waas/policies/upsertSignerPolicyRule/upsertSignerPolicyRule.ts
2061
+ /**
2062
+ * Creates or updates a single rule on a signer's policy layer. Build `rule`
2063
+ * with {@link buildAllowPolicyRule} / {@link buildDenyPolicyRule}. Omit
2064
+ * `rule.ruleId` to create a new rule (the enclave mints one for you); pass an
2065
+ * existing `ruleId` to update it in place. Calls the SDK API directly (no MPC
2066
+ * step), so a rejection surfaces as a thrown error.
2067
+ *
2068
+ * @param params.walletAccount - The wallet account whose signer-Layer to update.
2069
+ * @param params.rule - The rule to create or update.
2070
+ * @param [params.shareSetId] - The share set to target; defaults to the caller's own. Only the wallet's own owner may target another share set.
2071
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2072
+ * @returns The signer-Layer as it stands after the rule is applied.
2073
+ * @throws {ValueMustBeDefinedError} When `walletAccount` has no `verifiedCredentialId` (it isn't a verified wallet account yet).
2074
+ * @throws {APIError} When the SDK API request fails, for example an unauthorized, not-found, or server error response.
2075
+ * @notInstrumented
2076
+ */
2077
+ const upsertSignerPolicyRule = async ({ rule, shareSetId, walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
2078
+ require_updateAuthFromVerifyResponse.assertDefined(walletAccount.verifiedCredentialId, "upsertSignerPolicyRule: cannot resolve a wallet id — use a verified wallet account");
2079
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
2080
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).updateWaasSignerSelfPolicyLayer({
2081
+ environmentId: core.environmentId,
2082
+ waasSignerPolicyLayerUpdateRequest: {
2083
+ op: _dynamic_labs_sdk_api_core.WaasSignerPolicyLayerUpdateRequestOpEnum.Upsert,
2084
+ rule,
2085
+ shareSetId
2086
+ },
2087
+ walletId: walletAccount.verifiedCredentialId
2088
+ });
2089
+ };
2090
+
2091
+ //#endregion
2092
+ //#region src/modules/waas/policies/upsertWalletPolicyRule/upsertWalletPolicyRule.ts
2093
+ /**
2094
+ * Creates or updates a single rule on a wallet's policy layer. Build `rule`
2095
+ * with {@link buildAllowPolicyRule} / {@link buildDenyPolicyRule}. Omit
2096
+ * `rule.ruleId` to create a new rule (the enclave mints one for you); pass an
2097
+ * existing `ruleId` to update it in place. Calls the SDK API directly (no MPC
2098
+ * step), so a rejection surfaces as a thrown error.
2099
+ *
2100
+ * @param params.walletAccount - The wallet account to apply the rule to.
2101
+ * @param params.rule - The rule to create or update.
2102
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
2103
+ * @returns The wallet-Layer as it stands after the rule is applied.
2104
+ * @throws {ValueMustBeDefinedError} When `walletAccount` has no `verifiedCredentialId` (it isn't a verified wallet account yet).
2105
+ * @throws {APIError} When the SDK API request fails, for example an unauthorized, not-found, or server error response.
2106
+ * @notInstrumented
2107
+ */
2108
+ const upsertWalletPolicyRule = async ({ rule, walletAccount }, client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
2109
+ require_updateAuthFromVerifyResponse.assertDefined(walletAccount.verifiedCredentialId, "upsertWalletPolicyRule: cannot resolve a wallet id — use a verified wallet account");
2110
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
2111
+ return require_updateAuthFromVerifyResponse.createApiClient({}, client).updateWaasWalletSelfPolicyLayer({
2112
+ environmentId: core.environmentId,
2113
+ waasPolicyLayerUpdateRequest: {
2114
+ op: _dynamic_labs_sdk_api_core.WaasPolicyLayerUpdateRequestOpEnum.Upsert,
2115
+ rule
2116
+ },
2117
+ walletId: walletAccount.verifiedCredentialId
2118
+ });
2119
+ };
2120
+
952
2121
  //#endregion
953
2122
  //#region src/exports/waas.ts
954
2123
  (0, _dynamic_labs_sdk_assert_package_version.assertPackageVersion)(require_updateAuthFromVerifyResponse.name, require_updateAuthFromVerifyResponse.version);
@@ -956,19 +2125,35 @@ const updateWaasPassword = async ({ currentPassword, newPassword, walletAccount
956
2125
  //#endregion
957
2126
  exports.NotWaasWalletProviderError = require_migrateFromFireblocks.NotWaasWalletProviderError;
958
2127
  exports.TransactionBroadcastError = require_isDynamicWaasEnabled.TransactionBroadcastError;
2128
+ Object.defineProperty(exports, 'WaasWalletShareSetType', {
2129
+ enumerable: true,
2130
+ get: function () {
2131
+ return _dynamic_labs_sdk_api_core.WaasWalletShareSetType;
2132
+ }
2133
+ });
959
2134
  exports.addBusinessAccountMember = addBusinessAccountMember;
960
2135
  exports.addBusinessAccountSigner = addBusinessAccountSigner;
961
2136
  exports.addWalletToBusinessAccount = addWalletToBusinessAccount;
962
2137
  exports.backupWaasKeySharesToGoogleDrive = backupWaasKeySharesToGoogleDrive;
2138
+ exports.buildAllowPolicyRule = buildAllowPolicyRule;
2139
+ exports.buildDenyPolicyRule = buildDenyPolicyRule;
963
2140
  exports.createBusinessAccount = createBusinessAccount;
2141
+ exports.createPolicy = createPolicy;
964
2142
  exports.createWaasOfflineRecoveryShares = createWaasOfflineRecoveryShares;
965
2143
  exports.createWaasWalletAccounts = createWaasWalletAccounts;
966
2144
  exports.createWalletForBusinessAccount = createWalletForBusinessAccount;
967
2145
  exports.delegateWaasKeyShares = delegateWaasKeyShares;
2146
+ exports.desugarPolicyRules = desugarPolicyRules;
2147
+ exports.expandPolicyRules = expandPolicyRules;
968
2148
  exports.exportWaasClientKeyshares = exportWaasClientKeyshares;
969
2149
  exports.exportWaasPrivateKey = exportWaasPrivateKey;
2150
+ exports.getAccountPolicyLayer = getAccountPolicyLayer;
970
2151
  exports.getBusinessAccount = getBusinessAccount;
971
2152
  exports.getChainsMissingWaasWalletAccounts = getChainsMissingWaasWalletAccounts;
2153
+ exports.getPolicy = getPolicy;
2154
+ exports.getSignerPolicyLayer = getSignerPolicyLayer;
2155
+ exports.getWalletAccountShareSets = getWalletAccountShareSets;
2156
+ exports.getWalletPolicyLayer = getWalletPolicyLayer;
972
2157
  exports.getWalletRecoveryState = getWalletRecoveryState;
973
2158
  exports.hasDelegatedAccess = hasDelegatedAccess;
974
2159
  exports.importWaasPrivateKey = importWaasPrivateKey;
@@ -980,15 +2165,24 @@ exports.listBusinessAccounts = listBusinessAccounts;
980
2165
  exports.migrateFromFireblocks = require_migrateFromFireblocks.migrateFromFireblocks;
981
2166
  exports.normalizeWalletRequirements = normalizeWalletRequirements;
982
2167
  exports.refreshWaasWalletAccountShares = refreshWaasWalletAccountShares;
2168
+ exports.removeAccountPolicyRule = removeAccountPolicyRule;
983
2169
  exports.removeBusinessAccountMember = removeBusinessAccountMember;
984
2170
  exports.removeBusinessAccountSigner = removeBusinessAccountSigner;
985
2171
  exports.removeBusinessAccountWallet = removeBusinessAccountWallet;
2172
+ exports.removePolicyRules = removePolicyRules;
2173
+ exports.removeSignerPolicyRule = removeSignerPolicyRule;
2174
+ exports.removeWalletPolicyRule = removeWalletPolicyRule;
2175
+ exports.resolvePolicyScope = resolvePolicyScope;
986
2176
  exports.revokeWaasDelegation = revokeWaasDelegation;
987
2177
  exports.setWaasWalletAccountPassword = setWaasWalletAccountPassword;
988
2178
  exports.shouldAutoCreateWalletForChain = shouldAutoCreateWalletForChain;
2179
+ exports.signSerializedTransaction = signSerializedTransaction;
989
2180
  exports.transferBusinessAccountOwnership = transferBusinessAccountOwnership;
990
2181
  exports.unlockWallet = unlockWallet;
991
2182
  exports.updateBusinessAccount = updateBusinessAccount;
992
2183
  exports.updateBusinessAccountMemberRole = updateBusinessAccountMemberRole;
993
2184
  exports.updateWaasPassword = updateWaasPassword;
2185
+ exports.upsertAccountPolicyRule = upsertAccountPolicyRule;
2186
+ exports.upsertSignerPolicyRule = upsertSignerPolicyRule;
2187
+ exports.upsertWalletPolicyRule = upsertWalletPolicyRule;
994
2188
  //# sourceMappingURL=waas.cjs.map