@dynamic-labs-sdk/client 1.23.0 → 1.24.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 (120) hide show
  1. package/dist/{NativeModuleNotLinkedError-DIpQjh_K.native.esm.js → NativeModuleNotLinkedError-CJy_4-6r.native.esm.js} +3 -3
  2. package/dist/{NativeModuleNotLinkedError-DIpQjh_K.native.esm.js.map → NativeModuleNotLinkedError-CJy_4-6r.native.esm.js.map} +1 -1
  3. package/dist/{consumeMfaTokenIfRequiredForAction-pUcqlY3s.cjs → consumeMfaTokenIfRequiredForAction-B6nFE5IO.cjs} +2 -2
  4. package/dist/{consumeMfaTokenIfRequiredForAction-pUcqlY3s.cjs.map → consumeMfaTokenIfRequiredForAction-B6nFE5IO.cjs.map} +1 -1
  5. package/dist/{consumeMfaTokenIfRequiredForAction-jsAdDyDj.esm.js → consumeMfaTokenIfRequiredForAction-DXTH4qki.esm.js} +2 -2
  6. package/dist/{consumeMfaTokenIfRequiredForAction-jsAdDyDj.esm.js.map → consumeMfaTokenIfRequiredForAction-DXTH4qki.esm.js.map} +1 -1
  7. package/dist/core.cjs +7 -6
  8. package/dist/core.cjs.map +1 -1
  9. package/dist/core.esm.js +7 -7
  10. package/dist/core.esm.js.map +1 -1
  11. package/dist/core.native.esm.js +6 -6
  12. package/dist/core.native.esm.js.map +1 -1
  13. package/dist/exports/core.d.ts +2 -0
  14. package/dist/exports/core.d.ts.map +1 -1
  15. package/dist/exports/waas.d.ts +2 -1
  16. package/dist/exports/waas.d.ts.map +1 -1
  17. package/dist/{getNetworkProviderFromNetworkId-DPFHY3b8.cjs → getNetworkProviderFromNetworkId-CZjFA5G8.cjs} +64 -2
  18. package/dist/getNetworkProviderFromNetworkId-CZjFA5G8.cjs.map +1 -0
  19. package/dist/{getNetworkProviderFromNetworkId-DTNPpR5H.esm.js → getNetworkProviderFromNetworkId-CjdC5HjA.esm.js} +59 -3
  20. package/dist/getNetworkProviderFromNetworkId-CjdC5HjA.esm.js.map +1 -0
  21. package/dist/{getNetworkProviderFromNetworkId-YcalZlDG.native.esm.js → getNetworkProviderFromNetworkId-R8IKGc6s.native.esm.js} +59 -261
  22. package/dist/getNetworkProviderFromNetworkId-R8IKGc6s.native.esm.js.map +1 -0
  23. package/dist/{getSignedSessionId-BjhgfsJD.native.esm.js → getSignedSessionId-B6Eqmue0.native.esm.js} +3 -3
  24. package/dist/{getSignedSessionId-BjhgfsJD.native.esm.js.map → getSignedSessionId-B6Eqmue0.native.esm.js.map} +1 -1
  25. package/dist/{getSignedSessionId-Btl5p_7b.esm.js → getSignedSessionId-BYR70F5w.esm.js} +2 -2
  26. package/dist/{getSignedSessionId-Btl5p_7b.esm.js.map → getSignedSessionId-BYR70F5w.esm.js.map} +1 -1
  27. package/dist/{getSignedSessionId-VX7LkxVJ.cjs → getSignedSessionId-BpUNqL9z.cjs} +2 -2
  28. package/dist/{getSignedSessionId-VX7LkxVJ.cjs.map → getSignedSessionId-BpUNqL9z.cjs.map} +1 -1
  29. package/dist/{getWalletProviderByKey-5sZK6kAJ.esm.js → getWalletProviderByKey-BVVFLnfy.esm.js} +2 -2
  30. package/dist/{getWalletProviderByKey-5sZK6kAJ.esm.js.map → getWalletProviderByKey-BVVFLnfy.esm.js.map} +1 -1
  31. package/dist/getWalletProviderByKey-CqdhcE7y.native.esm.js +279 -0
  32. package/dist/getWalletProviderByKey-CqdhcE7y.native.esm.js.map +1 -0
  33. package/dist/{getWalletProviderByKey--K4N2u-M.cjs → getWalletProviderByKey-D2ElEmJR.cjs} +2 -2
  34. package/dist/{getWalletProviderByKey--K4N2u-M.cjs.map → getWalletProviderByKey-D2ElEmJR.cjs.map} +1 -1
  35. package/dist/index.cjs +17 -67
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.esm.js +16 -66
  38. package/dist/index.esm.js.map +1 -1
  39. package/dist/index.native.esm.js +16 -66
  40. package/dist/index.native.esm.js.map +1 -1
  41. package/dist/{isDynamicWaasEnabled-MtEVK3ov.cjs → isDynamicWaasEnabled-B7_FiTkx.cjs} +2 -2
  42. package/dist/{isDynamicWaasEnabled-MtEVK3ov.cjs.map → isDynamicWaasEnabled-B7_FiTkx.cjs.map} +1 -1
  43. package/dist/{isDynamicWaasEnabled-sI3vpWvA.esm.js → isDynamicWaasEnabled-Ck0VFh7Z.esm.js} +2 -2
  44. package/dist/{isDynamicWaasEnabled-sI3vpWvA.esm.js.map → isDynamicWaasEnabled-Ck0VFh7Z.esm.js.map} +1 -1
  45. package/dist/{isDynamicWaasEnabled-BR_pG4jM.native.esm.js → isDynamicWaasEnabled-yo_LqzH5.native.esm.js} +2 -2
  46. package/dist/{isDynamicWaasEnabled-BR_pG4jM.native.esm.js.map → isDynamicWaasEnabled-yo_LqzH5.native.esm.js.map} +1 -1
  47. package/dist/{isMfaRequiredForAction-BiPVqg49.cjs → isMfaRequiredForAction-B3FO4Zbn.cjs} +2 -2
  48. package/dist/{isMfaRequiredForAction-BiPVqg49.cjs.map → isMfaRequiredForAction-B3FO4Zbn.cjs.map} +1 -1
  49. package/dist/{isMfaRequiredForAction-DJ2UX11y.esm.js → isMfaRequiredForAction-CnO4g-V0.esm.js} +2 -2
  50. package/dist/{isMfaRequiredForAction-DJ2UX11y.esm.js.map → isMfaRequiredForAction-CnO4g-V0.esm.js.map} +1 -1
  51. package/dist/{isMfaRequiredForAction-GWZny7T2.native.esm.js → isMfaRequiredForAction-Zi7_K00W.native.esm.js} +2 -2
  52. package/dist/{isMfaRequiredForAction-GWZny7T2.native.esm.js.map → isMfaRequiredForAction-Zi7_K00W.native.esm.js.map} +1 -1
  53. package/dist/{isUserOnboardingComplete-OvzVH1rg.esm.js → isUserOnboardingComplete-DZk1nVHO.esm.js} +3 -3
  54. package/dist/{isUserOnboardingComplete-OvzVH1rg.esm.js.map → isUserOnboardingComplete-DZk1nVHO.esm.js.map} +1 -1
  55. package/dist/{isUserOnboardingComplete-Hzz6fwTk.native.esm.js → isUserOnboardingComplete-DcRl6Q1f.native.esm.js} +3 -3
  56. package/dist/{isUserOnboardingComplete-Hzz6fwTk.native.esm.js.map → isUserOnboardingComplete-DcRl6Q1f.native.esm.js.map} +1 -1
  57. package/dist/{isUserOnboardingComplete-D1hw1c5_.cjs → isUserOnboardingComplete-Dnx30meW.cjs} +3 -3
  58. package/dist/{isUserOnboardingComplete-D1hw1c5_.cjs.map → isUserOnboardingComplete-Dnx30meW.cjs.map} +1 -1
  59. package/dist/{migrateFromFireblocks-BiLoNIkA.native.esm.js → migrateFromFireblocks-COEK_Acn.native.esm.js} +13 -13
  60. package/dist/migrateFromFireblocks-COEK_Acn.native.esm.js.map +1 -0
  61. package/dist/{migrateFromFireblocks-NRfLh1JL.cjs → migrateFromFireblocks-CdSxWZav.cjs} +13 -13
  62. package/dist/migrateFromFireblocks-CdSxWZav.cjs.map +1 -0
  63. package/dist/{migrateFromFireblocks-Y5pPtmew.esm.js → migrateFromFireblocks-nkmSeZrn.esm.js} +14 -14
  64. package/dist/migrateFromFireblocks-nkmSeZrn.esm.js.map +1 -0
  65. package/dist/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.d.ts +29 -0
  66. package/dist/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.d.ts.map +1 -0
  67. package/dist/modules/auth/getActionAuthorizationTokens/index.d.ts +2 -0
  68. package/dist/modules/auth/getActionAuthorizationTokens/index.d.ts.map +1 -0
  69. package/dist/modules/auth/logoutReason.d.ts +1 -1
  70. package/dist/modules/auth/logoutReason.d.ts.map +1 -1
  71. package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.d.ts +2 -2
  72. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +13 -12
  73. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
  74. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +4 -4
  75. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
  76. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +7 -2
  77. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -1
  78. package/dist/modules/waas/businessAccounts/assertTargetIdentity.d.ts +14 -0
  79. package/dist/modules/waas/businessAccounts/assertTargetIdentity.d.ts.map +1 -0
  80. package/dist/modules/waas/businessAccounts/businessAccounts.constants.d.ts +5 -0
  81. package/dist/modules/waas/businessAccounts/businessAccounts.constants.d.ts.map +1 -0
  82. package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +15 -1
  83. package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -1
  84. package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts.map +1 -1
  85. package/dist/modules/waas/businessAccounts/updateBusinessAccount/index.d.ts +2 -0
  86. package/dist/modules/waas/businessAccounts/updateBusinessAccount/index.d.ts.map +1 -0
  87. package/dist/modules/waas/businessAccounts/updateBusinessAccount/updateBusinessAccount.d.ts +26 -0
  88. package/dist/modules/waas/businessAccounts/updateBusinessAccount/updateBusinessAccount.d.ts.map +1 -0
  89. package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
  90. package/dist/modules/waas/waas.types.d.ts +2 -2
  91. package/dist/modules/waas/waas.types.d.ts.map +1 -1
  92. package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts +1 -1
  93. package/dist/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.d.ts.map +1 -1
  94. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  95. package/dist/{updateAuthFromVerifyResponse-ChnvPY0m.cjs → updateAuthFromVerifyResponse-BSORoVT0.cjs} +3 -3
  96. package/dist/{updateAuthFromVerifyResponse-ChnvPY0m.cjs.map → updateAuthFromVerifyResponse-BSORoVT0.cjs.map} +1 -1
  97. package/dist/{updateAuthFromVerifyResponse-Ct1Y6O_T.esm.js → updateAuthFromVerifyResponse-D0Tt9-Z-.esm.js} +3 -3
  98. package/dist/{updateAuthFromVerifyResponse-Ct1Y6O_T.esm.js.map → updateAuthFromVerifyResponse-D0Tt9-Z-.esm.js.map} +1 -1
  99. package/dist/waas.cjs +123 -41
  100. package/dist/waas.cjs.map +1 -1
  101. package/dist/waas.esm.js +124 -43
  102. package/dist/waas.esm.js.map +1 -1
  103. package/dist/waas.native.esm.js +123 -42
  104. package/dist/waas.native.esm.js.map +1 -1
  105. package/dist/waasCore.cjs +53 -15
  106. package/dist/waasCore.cjs.map +1 -1
  107. package/dist/waasCore.esm.js +53 -15
  108. package/dist/waasCore.esm.js.map +1 -1
  109. package/dist/waasCore.native.esm.js +52 -14
  110. package/dist/waasCore.native.esm.js.map +1 -1
  111. package/ios/DynamicClientScreenshotProtection.mm +11 -0
  112. package/package.json +3 -3
  113. package/dist/getNetworkProviderFromNetworkId-DPFHY3b8.cjs.map +0 -1
  114. package/dist/getNetworkProviderFromNetworkId-DTNPpR5H.esm.js.map +0 -1
  115. package/dist/getNetworkProviderFromNetworkId-YcalZlDG.native.esm.js.map +0 -1
  116. package/dist/getWalletProviderByKey-BhcBoGMW.native.esm.js +0 -20
  117. package/dist/getWalletProviderByKey-BhcBoGMW.native.esm.js.map +0 -1
  118. package/dist/migrateFromFireblocks-BiLoNIkA.native.esm.js.map +0 -1
  119. package/dist/migrateFromFireblocks-NRfLh1JL.cjs.map +0 -1
  120. package/dist/migrateFromFireblocks-Y5pPtmew.esm.js.map +0 -1
@@ -1,50 +1,72 @@
1
- import { A as formatWalletProviderKey, Ct as name, H as createApiClient, M as getChainFromVerifiedCredentialChain, O as NoWalletProviderFoundError, St as getCore, a as InvalidParamError, c as findWaasWalletProviderByChain, f as DYNAMIC_WAAS_METADATA, ft as assertDefined, l as isWaasWalletProvider, s as isWaasWalletAccount, vt as getDefaultClient, wt as version } from "./NativeModuleNotLinkedError-DIpQjh_K.native.esm.js";
2
- import { r as __refreshAuth_wrapped, t as isDynamicWaasEnabled } from "./isDynamicWaasEnabled-BR_pG4jM.native.esm.js";
3
- import { n as getVerifiedCredentialForWalletAccount, t as getWalletProviderByKey } from "./getWalletProviderByKey-BhcBoGMW.native.esm.js";
4
- import { a as NotWaasWalletProviderError, i as createWaasClient, n as getWaasWalletProviderFromWalletAccount, r as getWaasChainNameFromChain, t as migrateFromFireblocks } from "./migrateFromFireblocks-BiLoNIkA.native.esm.js";
1
+ import { A as formatWalletProviderKey, Ct as name, H as createApiClient, M as getChainFromVerifiedCredentialChain, O as NoWalletProviderFoundError, St as getCore, a as InvalidParamError, c as findWaasWalletProviderByChain, f as DYNAMIC_WAAS_METADATA, ft as assertDefined, l as isWaasWalletProvider, s as isWaasWalletAccount, vt as getDefaultClient, wt as version } from "./NativeModuleNotLinkedError-CJy_4-6r.native.esm.js";
2
+ import { n as getVerifiedCredentialForWalletAccount, r as __logoutWithReason_wrapped, t as getWalletProviderByKey } from "./getWalletProviderByKey-CqdhcE7y.native.esm.js";
3
+ import { r as __refreshAuth_wrapped, t as isDynamicWaasEnabled } from "./isDynamicWaasEnabled-yo_LqzH5.native.esm.js";
4
+ import { a as NotWaasWalletProviderError, i as getWaasWalletProviderFromWalletAccount, n as getWaasChainNameFromChain, r as createWaasClient, t as migrateFromFireblocks } from "./migrateFromFireblocks-COEK_Acn.native.esm.js";
5
5
  import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
6
- import { AssignableBusinessAccountMemberRole, JwtVerifiedCredentialFormatEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
6
+ import { AssignableBusinessAccountMemberRole, JwtVerifiedCredentialFormatEnum, UserIdentifierTypeEnum, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
7
7
 
8
- //#region src/modules/waas/businessAccounts/getBusinessAccountsClient/getBusinessAccountsClient.ts
8
+ //#region src/modules/waas/businessAccounts/assertTargetIdentity.ts
9
9
  /**
10
- * Returns the business accounts API client for the first enabled WaaS chain.
10
+ * Asserts a {@link TargetIdentity} resolves to a user: a `userId`, or an
11
+ * `identifier` with its `identifierType`. Throws otherwise.
11
12
  *
12
- * @param client - The Dynamic client instance.
13
- * @returns The business accounts API client.
14
- * @throws {InvalidParamError} When no WaaS chain configuration is enabled for the project.
15
13
  * @notInstrumented
16
14
  */
17
- const getBusinessAccountsClient = (client) => {
18
- const projectSettings = client.projectSettings;
19
- assertDefined(projectSettings, "Project settings are not available");
20
- const chainConfig = projectSettings.sdk.embeddedWallets?.chainConfigurations?.find((chain) => chain.enabled);
21
- if (!chainConfig) throw new InvalidParamError("No WaaS chain is enabled for this project");
22
- return createWaasClient({ chainName: getWaasChainNameFromChain(chainConfig.name) }, client).businessAccounts;
15
+ const assertTargetIdentity = ({ fnName, targetIdentity }) => {
16
+ const hasUserId = Boolean(targetIdentity.userId);
17
+ const hasIdentifier = Boolean(targetIdentity.identifier && targetIdentity.identifierType);
18
+ if (!hasUserId && !hasIdentifier) throw new InvalidParamError(`${fnName}: targetIdentity must provide a userId, or an identifier with its identifierType`);
19
+ };
20
+
21
+ //#endregion
22
+ //#region src/modules/waas/businessAccounts/businessAccounts.constants.ts
23
+ /** Maps the SDK's identifier-type union to the generated API enum. */
24
+ const IDENTIFIER_TYPE_TO_API = {
25
+ email: UserIdentifierTypeEnum.Email,
26
+ externalUserId: UserIdentifierTypeEnum.ExternalUserId,
27
+ id: UserIdentifierTypeEnum.Id,
28
+ phoneNumber: UserIdentifierTypeEnum.PhoneNumber,
29
+ socialAccountId: UserIdentifierTypeEnum.SocialAccountId,
30
+ socialUsername: UserIdentifierTypeEnum.SocialUsername
23
31
  };
24
32
 
25
33
  //#endregion
26
34
  //#region src/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.ts
27
35
  /**
28
- * Adds a member to an existing business account. Identify the target by a known
29
- * `userId`, or by `identifier` + `identifierType` (e.g. an email — the user is
30
- * created if absent).
36
+ * Adds a member to an existing business account. Identify the target with a
37
+ * `targetIdentity`: a known `userId`, or an `identifier` + `identifierType`
38
+ * (e.g. an email — the user is created if absent).
39
+ *
40
+ * Calls the SDK API directly (not the WaaS iframe): this is a server-state
41
+ * mutation with no MPC step, so a rejection (e.g. a 422 resource-limit) surfaces
42
+ * as a thrown error rather than stalling in the iframe bridge.
31
43
  *
32
44
  * @param params.businessAccountId - The ID of the business account.
33
- * @param [params.userId] - The ID of the user to add as a member.
34
- * @param [params.identifier] - The identifier value (e.g. an email address).
35
- * @param [params.identifierType] - The identifier type (e.g. `email`).
36
- * @param [params.role] - The member role (`admin` or `viewer`). Defaults server-side.
45
+ * @param params.targetIdentity - The member to add (userId, or identifier + identifierType).
46
+ * @param [params.role] - The member role (`admin` or `viewer`). Defaults to `viewer`.
37
47
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
38
48
  * @returns The created business account member.
39
49
  * @notInstrumented
40
50
  */
41
- const addBusinessAccountMember = async ({ businessAccountId, userId, identifier, identifierType, role }, client = getDefaultClient()) => {
42
- return getBusinessAccountsClient(client).addMember({
51
+ const addBusinessAccountMember = async ({ businessAccountId, targetIdentity, role }, client = getDefaultClient()) => {
52
+ assertTargetIdentity({
53
+ fnName: "addBusinessAccountMember",
54
+ targetIdentity
55
+ });
56
+ const core = getCore(client);
57
+ const apiClient = createApiClient({}, client);
58
+ const { userId, identifier, identifierType, socialProvider, smsCountryCode } = targetIdentity;
59
+ return await apiClient.sdkAddBusinessAccountMember({
60
+ addBusinessAccountMemberSdkRequest: {
61
+ identifier,
62
+ role: role === "admin" ? AssignableBusinessAccountMemberRole.Admin : AssignableBusinessAccountMemberRole.Viewer,
63
+ smsCountryCode,
64
+ socialProvider,
65
+ type: identifierType ? IDENTIFIER_TYPE_TO_API[identifierType] : void 0,
66
+ userId
67
+ },
43
68
  businessAccountId,
44
- identifier,
45
- identifierType,
46
- role,
47
- userId
69
+ environmentId: core.environmentId
48
70
  });
49
71
  };
50
72
 
@@ -76,29 +98,34 @@ const getWaasWalletProviderByChain = ({ chain }, client) => {
76
98
  * @param params.walletAccount - The wallet account to add the signer to.
77
99
  * @param [params.businessAccountId] - The business account; found-or-created when omitted.
78
100
  * @param [params.walletId] - The wallet UUID to link when finding-or-creating; defaults to `walletAccount.verifiedCredentialId`.
79
- * @param params.targetSignerIdentity - The signer to add (userId, or identifier + identifierType).
101
+ * @param params.targetIdentity - The signer to add (userId, or identifier + identifierType).
80
102
  * @param [params.signerType] - `endUser` (default) or `server`.
81
103
  * @param [params.password] - Password for the reshare, if the wallet is password-encrypted.
82
104
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
83
105
  * @returns The new signer's share set id.
84
106
  * @notInstrumented
85
107
  */
86
- const addBusinessAccountSigner = async ({ walletAccount, businessAccountId, walletId, targetSignerIdentity, signerType, password }, client = getDefaultClient()) => {
87
- const hasUserId = Boolean(targetSignerIdentity.userId);
88
- const hasIdentifier = Boolean(targetSignerIdentity.identifier && targetSignerIdentity.identifierType);
89
- if (!hasUserId && !hasIdentifier) throw new InvalidParamError("addBusinessAccountSigner: targetSignerIdentity must provide a userId, or an identifier with its identifierType");
108
+ const addBusinessAccountSigner = async ({ walletAccount, businessAccountId, walletId, targetIdentity, signerType, password }, client = getDefaultClient()) => {
109
+ assertTargetIdentity({
110
+ fnName: "addBusinessAccountSigner",
111
+ targetIdentity
112
+ });
90
113
  if (walletAccount.businessAccountId) assertDefined(businessAccountId, "addBusinessAccountSigner: this wallet is already part of a business account");
91
114
  let resolvedBusinessAccountId = businessAccountId;
92
115
  if (!resolvedBusinessAccountId) {
93
116
  const linkWalletId = walletId ?? walletAccount.verifiedCredentialId;
94
117
  assertDefined(linkWalletId, "addBusinessAccountSigner: cannot resolve a wallet id to link — pass walletId, or use a verified wallet account");
95
- resolvedBusinessAccountId = (await getBusinessAccountsClient(client).addWalletToBusinessAccount({ walletId: linkWalletId })).id;
118
+ const core = getCore(client);
119
+ resolvedBusinessAccountId = (await createApiClient({}, client).sdkLinkBusinessAccountWallet({
120
+ environmentId: core.environmentId,
121
+ linkBusinessAccountWalletSdkRequest: { walletId: linkWalletId }
122
+ })).id;
96
123
  }
97
124
  const result = await getWaasWalletProviderByChain({ chain: walletAccount.chain }, client).reshareToNewSignerShareSet({
98
125
  businessAccountId: resolvedBusinessAccountId,
99
126
  password,
100
127
  signerType,
101
- targetSignerIdentity,
128
+ targetSignerIdentity: targetIdentity,
102
129
  walletAccount
103
130
  });
104
131
  await __refreshAuth_wrapped(client);
@@ -108,10 +135,14 @@ const addBusinessAccountSigner = async ({ walletAccount, businessAccountId, wall
108
135
  //#endregion
109
136
  //#region src/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.ts
110
137
  /**
111
- * Links an existing wallet to a business account. Omit `businessAccountId` to
138
+ * Links a wallet to a business account, or omit `businessAccountId` to
112
139
  * find-or-create the per-wallet business account (the server seats the wallet's
113
140
  * owner as the first member/signer).
114
141
  *
142
+ * Calls the SDK API directly (not the WaaS iframe): this is a server-state
143
+ * mutation with no MPC step, so a rejection (e.g. a 422 resource-limit) surfaces
144
+ * as a thrown error rather than stalling in the iframe bridge.
145
+ *
115
146
  * @param [params.businessAccountId] - The business account to link to; found-or-created when omitted.
116
147
  * @param params.walletId - The ID of the wallet to link.
117
148
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
@@ -119,9 +150,13 @@ const addBusinessAccountSigner = async ({ walletAccount, businessAccountId, wall
119
150
  * @notInstrumented
120
151
  */
121
152
  const addWalletToBusinessAccount = async ({ businessAccountId, walletId }, client = getDefaultClient()) => {
122
- const detail = await getBusinessAccountsClient(client).addWalletToBusinessAccount({
123
- businessAccountId,
124
- walletId
153
+ const core = getCore(client);
154
+ const detail = await createApiClient({}, client).sdkLinkBusinessAccountWallet({
155
+ environmentId: core.environmentId,
156
+ linkBusinessAccountWalletSdkRequest: {
157
+ businessAccountId,
158
+ walletId
159
+ }
125
160
  });
126
161
  await __refreshAuth_wrapped(client);
127
162
  return detail;
@@ -150,6 +185,24 @@ const backupWaasKeySharesToGoogleDrive = async ({ googleDriveAccessToken, passwo
150
185
  });
151
186
  };
152
187
 
188
+ //#endregion
189
+ //#region src/modules/waas/businessAccounts/getBusinessAccountsClient/getBusinessAccountsClient.ts
190
+ /**
191
+ * Returns the business accounts API client for the first enabled WaaS chain.
192
+ *
193
+ * @param client - The Dynamic client instance.
194
+ * @returns The business accounts API client.
195
+ * @throws {InvalidParamError} When no WaaS chain configuration is enabled for the project.
196
+ * @notInstrumented
197
+ */
198
+ const getBusinessAccountsClient = (client) => {
199
+ const projectSettings = client.projectSettings;
200
+ assertDefined(projectSettings, "Project settings are not available");
201
+ const chainConfig = projectSettings.sdk.embeddedWallets?.chainConfigurations?.find((chain) => chain.enabled);
202
+ if (!chainConfig) throw new InvalidParamError("No WaaS chain is enabled for this project");
203
+ return createWaasClient({ chainName: getWaasChainNameFromChain(chainConfig.name) }, client).businessAccounts;
204
+ };
205
+
153
206
  //#endregion
154
207
  //#region src/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.ts
155
208
  /**
@@ -714,7 +767,7 @@ const transferBusinessAccountOwnership = async ({ businessAccountId, newOwnerUse
714
767
  environmentId: core.environmentId,
715
768
  transferBusinessAccountOwnershipSdkRequest: { newOwnerUserId }
716
769
  });
717
- await __refreshAuth_wrapped(client);
770
+ await __logoutWithReason_wrapped({ reason: "business-account-ownership-transferred" }, client);
718
771
  return detail;
719
772
  };
720
773
 
@@ -736,6 +789,34 @@ const unlockWallet = async ({ password, walletAccount }, client = getDefaultClie
736
789
  });
737
790
  };
738
791
 
792
+ //#endregion
793
+ //#region src/modules/waas/businessAccounts/updateBusinessAccount/updateBusinessAccount.ts
794
+ /**
795
+ * Renames a business account (owner-/admin-only). Calls the SDK API directly
796
+ * (no MPC step), so a rejection surfaces as a thrown error.
797
+ *
798
+ * @param params.businessAccountId - The business account to rename.
799
+ * @param params.name - The new name.
800
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
801
+ * @returns The updated business account.
802
+ *
803
+ * @example
804
+ * ```ts
805
+ * await updateBusinessAccount({ businessAccountId, name: 'Acme Inc' });
806
+ * ```
807
+ *
808
+ * @see getBusinessAccount
809
+ * @notInstrumented
810
+ */
811
+ const updateBusinessAccount = async ({ businessAccountId, name: name$1 }, client = getDefaultClient()) => {
812
+ const core = getCore(client);
813
+ return await createApiClient({}, client).sdkUpdateBusinessAccount({
814
+ businessAccountId,
815
+ environmentId: core.environmentId,
816
+ updateBusinessAccountSdkRequest: { name: name$1 }
817
+ });
818
+ };
819
+
739
820
  //#endregion
740
821
  //#region src/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.ts
741
822
  const ROLE_TO_API = {
@@ -803,5 +884,5 @@ const updateWaasPassword = async ({ currentPassword, newPassword, walletAccount
803
884
  assertPackageVersion(name, version);
804
885
 
805
886
  //#endregion
806
- export { NotWaasWalletProviderError, addBusinessAccountMember, addBusinessAccountSigner, addWalletToBusinessAccount, backupWaasKeySharesToGoogleDrive, createBusinessAccount, createWaasWalletAccounts, createWalletForBusinessAccount, delegateWaasKeyShares, exportWaasClientKeyshares, exportWaasPrivateKey, getBusinessAccount, getChainsMissingWaasWalletAccounts, getWalletRecoveryState, hasDelegatedAccess, importWaasPrivateKey, isDynamicWaasEnabled, isPasswordRequiredForWaasWallets, isWaasWalletAccount, isWalletCreationRequirement, listBusinessAccounts, migrateFromFireblocks, normalizeWalletRequirements, refreshWaasWalletAccountShares, removeBusinessAccountMember, removeBusinessAccountSigner, revokeWaasDelegation, setWaasWalletAccountPassword, shouldAutoCreateWalletForChain, transferBusinessAccountOwnership, unlockWallet, updateBusinessAccountMemberRole, updateWaasPassword };
887
+ export { NotWaasWalletProviderError, addBusinessAccountMember, addBusinessAccountSigner, addWalletToBusinessAccount, backupWaasKeySharesToGoogleDrive, createBusinessAccount, createWaasWalletAccounts, createWalletForBusinessAccount, delegateWaasKeyShares, exportWaasClientKeyshares, exportWaasPrivateKey, getBusinessAccount, getChainsMissingWaasWalletAccounts, getWalletRecoveryState, hasDelegatedAccess, importWaasPrivateKey, isDynamicWaasEnabled, isPasswordRequiredForWaasWallets, isWaasWalletAccount, isWalletCreationRequirement, listBusinessAccounts, migrateFromFireblocks, normalizeWalletRequirements, refreshWaasWalletAccountShares, removeBusinessAccountMember, removeBusinessAccountSigner, revokeWaasDelegation, setWaasWalletAccountPassword, shouldAutoCreateWalletForChain, transferBusinessAccountOwnership, unlockWallet, updateBusinessAccount, updateBusinessAccountMemberRole, updateWaasPassword };
807
888
  //# sourceMappingURL=waas.native.esm.js.map