@dynamic-labs-sdk/client 1.32.0 → 1.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{apiClient-Bwd6cllS.native.esm.js → apiClient-BbjPoAwE.native.esm.js} +46 -13
- package/dist/apiClient-BbjPoAwE.native.esm.js.map +1 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/core.cjs +97 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +78 -6
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +80 -8
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/UnexpectedConsentResponseError.d.ts +7 -0
- package/dist/errors/UnexpectedConsentResponseError.d.ts.map +1 -0
- package/dist/exports/core.d.ts +10 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +2 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +2 -1
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-5UBZwUg2.cjs → getNetworkProviderFromNetworkId-BXoTukxv.cjs} +105 -82
- package/dist/getNetworkProviderFromNetworkId-BXoTukxv.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-DSsGkava.native.esm.js → getNetworkProviderFromNetworkId-Cs3hLqBS.native.esm.js} +112 -89
- package/dist/getNetworkProviderFromNetworkId-Cs3hLqBS.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-TTqmAiJh.esm.js → getNetworkProviderFromNetworkId-D_Hg6kP7.esm.js} +106 -83
- package/dist/getNetworkProviderFromNetworkId-D_Hg6kP7.esm.js.map +1 -0
- package/dist/{getSignedSessionId-DBUnRGjt.cjs → getSignedSessionId-2O_cJtIV.cjs} +3 -3
- package/dist/{getSignedSessionId-DBUnRGjt.cjs.map → getSignedSessionId-2O_cJtIV.cjs.map} +1 -1
- package/dist/{getSignedSessionId-BkYhH1zc.native.esm.js → getSignedSessionId-Bk-8is5J.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-BkYhH1zc.native.esm.js.map → getSignedSessionId-Bk-8is5J.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DeeDyino.esm.js → getSignedSessionId-D_TknHwX.esm.js} +3 -3
- package/dist/{getSignedSessionId-DeeDyino.esm.js.map → getSignedSessionId-D_TknHwX.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-C--Dza_K.esm.js → getVerifiedCredentialForWalletAccount-BmsHgXbj.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-C--Dza_K.esm.js.map → getVerifiedCredentialForWalletAccount-BmsHgXbj.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-BSxiaaVp.cjs → getVerifiedCredentialForWalletAccount-upiwolAi.cjs} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-BSxiaaVp.cjs.map → getVerifiedCredentialForWalletAccount-upiwolAi.cjs.map} +1 -1
- package/dist/index.cjs +379 -638
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +375 -635
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +377 -637
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-BPEXPqSt.esm.js → isMfaRequiredForAction-CHqeZeTS.esm.js} +3 -9
- package/dist/{isMfaRequiredForAction-BPEXPqSt.esm.js.map → isMfaRequiredForAction-CHqeZeTS.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DfrEFvU2.native.esm.js → isMfaRequiredForAction-D7b7mUT9.native.esm.js} +3 -9
- package/dist/{isMfaRequiredForAction-DfrEFvU2.native.esm.js.map → isMfaRequiredForAction-D7b7mUT9.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-62zh3W-2.cjs → isMfaRequiredForAction-DF65MJNN.cjs} +3 -9
- package/dist/{isMfaRequiredForAction-62zh3W-2.cjs.map → isMfaRequiredForAction-DF65MJNN.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-DtxIznZD.cjs → isUserOnboardingComplete-BAL-3zu7.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-DtxIznZD.cjs.map → isUserOnboardingComplete-BAL-3zu7.cjs.map} +1 -1
- package/dist/{isUserOnboardingComplete-BWrCHXXO.native.esm.js → isUserOnboardingComplete-CYpgo52t.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-BWrCHXXO.native.esm.js.map → isUserOnboardingComplete-CYpgo52t.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-Dmck83_2.esm.js → isUserOnboardingComplete-CpHVw8ee.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-Dmck83_2.esm.js.map → isUserOnboardingComplete-CpHVw8ee.esm.js.map} +1 -1
- package/dist/{logoutWithReason-DIc7cC6T.native.esm.js → logoutWithReason-Bd1qUh7l.native.esm.js} +3 -9
- package/dist/{logoutWithReason-DIc7cC6T.native.esm.js.map → logoutWithReason-Bd1qUh7l.native.esm.js.map} +1 -1
- package/dist/{logoutWithReason-yDqQ0UIt.cjs → logoutWithReason-CFjm8dbR.cjs} +58 -19
- package/dist/logoutWithReason-CFjm8dbR.cjs.map +1 -0
- package/dist/{logoutWithReason-x8mE7EAy.esm.js → logoutWithReason-CX9hGTPw.esm.js} +47 -20
- package/dist/logoutWithReason-CX9hGTPw.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-BUhWQCqm.native.esm.js → migrateFromFireblocks-BLz9aHOY.native.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-BUhWQCqm.native.esm.js.map → migrateFromFireblocks-BLz9aHOY.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-qYPrnWF8.cjs → migrateFromFireblocks-BiZmnKp9.cjs} +2 -2
- package/dist/{migrateFromFireblocks-qYPrnWF8.cjs.map → migrateFromFireblocks-BiZmnKp9.cjs.map} +1 -1
- package/dist/{migrateFromFireblocks-BapjEhra.esm.js → migrateFromFireblocks-C8KXMXk-.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-BapjEhra.esm.js.map → migrateFromFireblocks-C8KXMXk-.esm.js.map} +1 -1
- package/dist/modules/funding/coinbase/getCoinbaseAccounts/getCoinbaseAccounts.d.ts +1 -1
- package/dist/modules/funding/coinbase/getCoinbaseBuyUrl/getCoinbaseBuyUrl.d.ts +1 -1
- package/dist/modules/funding/kraken/getKrakenAccounts/getKrakenAccounts.d.ts +1 -1
- package/dist/modules/funding/kraken/getKrakenWhitelistedAddresses/getKrakenWhitelistedAddresses.d.ts +1 -1
- package/dist/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.d.ts +95 -0
- package/dist/modules/sessionKeys/signBusinessAccountIntent/signBusinessAccountIntent.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +11 -4
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +15 -6
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +7 -3
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +115 -2
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/isBusinessAccountActionRequired/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/isBusinessAccountActionRequired/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/isBusinessAccountActionRequired/isBusinessAccountActionRequired.d.ts +27 -0
- package/dist/modules/waas/businessAccounts/isBusinessAccountActionRequired/isBusinessAccountActionRequired.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/parseGovernedResponse.d.ts +34 -0
- package/dist/modules/waas/businessAccounts/parseGovernedResponse.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/removeBusinessAccountWallet/removeBusinessAccountWallet.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts +4 -3
- package/dist/modules/waas/businessAccounts/transferBusinessAccountOwnership/transferBusinessAccountOwnership.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts +16 -8
- package/dist/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.d.ts.map +1 -1
- package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
- package/dist/modules/waas/waas.types.d.ts +5 -2
- package/dist/modules/waas/waas.types.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildWalletBookConnectionOptions/buildWalletBookConnectionOptions.d.ts +42 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletBookConnectionOptions/buildWalletBookConnectionOptions.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts +7 -1
- package/dist/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/buildWalletOption/buildWalletOption.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/deriveSupportedChains/deriveSupportedChains.d.ts +27 -0
- package/dist/modules/walletOptionsCatalogue/deriveSupportedChains/deriveSupportedChains.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +4 -0
- package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
- package/dist/modules/walletOptionsCatalogue/isWalletExtensionInstalled/index.d.ts +3 -0
- package/dist/modules/walletOptionsCatalogue/isWalletExtensionInstalled/index.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/isWalletExtensionInstalled/isWalletExtensionInstalled.d.ts +35 -0
- package/dist/modules/walletOptionsCatalogue/isWalletExtensionInstalled/isWalletExtensionInstalled.d.ts.map +1 -0
- package/dist/modules/walletOptionsCatalogue/sortWalletOptions/sortWalletOptions.d.ts +1 -1
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts +7 -0
- package/dist/modules/walletOptionsCatalogue/walletOptionsCatalogue.types.d.ts.map +1 -1
- package/dist/modules/wallets/resolveWalletConnectionOption/resolveWalletConnectionOption.d.ts.map +1 -1
- package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/getUriConnectionStarterChains.d.ts +27 -0
- package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/getUriConnectionStarterChains.d.ts.map +1 -0
- package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/index.d.ts +2 -0
- package/dist/modules/wallets/uriConnectionStarterRegistry/getUriConnectionStarterChains/index.d.ts.map +1 -0
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts.map +1 -1
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts +6 -5
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts.map +1 -1
- package/dist/services/instrumentation/resolveInstrumentationCore/index.d.ts +2 -0
- package/dist/services/instrumentation/resolveInstrumentationCore/index.d.ts.map +1 -0
- package/dist/services/instrumentation/resolveInstrumentationCore/resolveInstrumentationCore.d.ts +19 -0
- package/dist/services/instrumentation/resolveInstrumentationCore/resolveInstrumentationCore.d.ts.map +1 -0
- package/dist/services/instrumentation/transports/createDynamicTransport/createDynamicTransport.d.ts +4 -3
- package/dist/services/instrumentation/transports/createDynamicTransport/createDynamicTransport.d.ts.map +1 -1
- package/dist/services/realtime/createRealtimeService/createRealtimeService.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/isScreeningBlockedError/index.d.ts +2 -0
- package/dist/utils/isScreeningBlockedError/index.d.ts.map +1 -0
- package/dist/utils/isScreeningBlockedError/isScreeningBlockedError.d.ts +24 -0
- package/dist/utils/isScreeningBlockedError/isScreeningBlockedError.d.ts.map +1 -0
- package/dist/{waas-DzcYsWU8.esm.js → waas-DjgZ-ghV.esm.js} +163 -32
- package/dist/waas-DjgZ-ghV.esm.js.map +1 -0
- package/dist/{waas-WID2Fy_N.cjs → waas-G-4JvdgJ.cjs} +167 -30
- package/dist/waas-G-4JvdgJ.cjs.map +1 -0
- package/dist/{waas-CyUrvkQr.native.esm.js → waas-oKD6ZDP9.native.esm.js} +163 -32
- package/dist/waas-oKD6ZDP9.native.esm.js.map +1 -0
- package/dist/waas.cjs +5 -4
- package/dist/waas.esm.js +5 -5
- package/dist/waas.native.esm.js +5 -5
- package/dist/waasCore.cjs +8 -6
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +8 -6
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +8 -6
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +6 -5
- package/dist/apiClient-Bwd6cllS.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-5UBZwUg2.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DSsGkava.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-TTqmAiJh.esm.js.map +0 -1
- package/dist/logoutWithReason-x8mE7EAy.esm.js.map +0 -1
- package/dist/logoutWithReason-yDqQ0UIt.cjs.map +0 -1
- package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts +0 -18
- package/dist/modules/walletOptionsCatalogue/hasInstalledProvider/hasInstalledProvider.d.ts.map +0 -1
- package/dist/waas-CyUrvkQr.native.esm.js.map +0 -1
- package/dist/waas-DzcYsWU8.esm.js.map +0 -1
- package/dist/waas-WID2Fy_N.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as isDynamicWaasEnabled, o as NotWaasWalletProviderError, r as getWaasWalletProviderFromWalletAccount } from "./migrateFromFireblocks-
|
|
3
|
-
import { o as getVerifiedCredentialForWalletAccount, s as getWalletProviderByKey, t as __logoutWithReason_wrapped } from "./logoutWithReason-
|
|
1
|
+
import { Ct as getCore, Dt as name, F as formatWalletProviderKey, L as getChainFromVerifiedCredentialChain, Ot as version, P as getWalletAccounts, S as isWaasWalletProvider, T as DYNAMIC_WAAS_METADATA, b as isWaasWalletAccount, bt as getDefaultClient, g as InvalidParamError, ht as assertDefined, i as __refreshAuth_wrapped, n as NoWalletProviderFoundError, r as createApiClient, wt as BaseError, x as findWaasWalletProviderByChain } from "./apiClient-BbjPoAwE.native.esm.js";
|
|
2
|
+
import { n as isDynamicWaasEnabled, o as NotWaasWalletProviderError, r as getWaasWalletProviderFromWalletAccount } from "./migrateFromFireblocks-BLz9aHOY.native.esm.js";
|
|
3
|
+
import { o as getVerifiedCredentialForWalletAccount, s as getWalletProviderByKey, t as __logoutWithReason_wrapped } from "./logoutWithReason-Bd1qUh7l.native.esm.js";
|
|
4
4
|
import { assertPackageVersion } from "@dynamic-labs-sdk/assert-package-version";
|
|
5
|
-
import {
|
|
5
|
+
import { JwtVerifiedCredentialFormatEnum, TokenScope, UserIdentifierTypeEnum, WaasChainEnum, WaasPolicyLayerRuleOperationOpEnum, WaasPolicyLayerUpdateRequestOpEnum, WaasPolicyRuleType, WaasSignerPolicyLayerUpdateRequestOpEnum, WaasWalletShareSetType, WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/waas/waas.consts.ts
|
|
8
8
|
/**
|
|
@@ -51,6 +51,54 @@ const IDENTIFIER_TYPE_TO_API = {
|
|
|
51
51
|
socialUsername: UserIdentifierTypeEnum.SocialUsername
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/errors/UnexpectedConsentResponseError.ts
|
|
56
|
+
var UnexpectedConsentResponseError = class extends BaseError {
|
|
57
|
+
constructor({ message }) {
|
|
58
|
+
super({
|
|
59
|
+
cause: null,
|
|
60
|
+
code: "unexpected_consent_response_error",
|
|
61
|
+
docsUrl: null,
|
|
62
|
+
name: "UnexpectedConsentResponse",
|
|
63
|
+
shortMessage: message
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/modules/waas/businessAccounts/parseGovernedResponse.ts
|
|
70
|
+
/**
|
|
71
|
+
* Reads a governed mutation's 202 body off the raw response, narrowed on
|
|
72
|
+
* `reason` + `intent` rather than cast outright: a malformed or unrecognized
|
|
73
|
+
* body would otherwise pass through as action-required, and the caller would
|
|
74
|
+
* sign or wait on data that does not exist.
|
|
75
|
+
*
|
|
76
|
+
* Shared by every governed business-account mutation, since the generated
|
|
77
|
+
* 200 mapper cannot run over this body — it assumes the ungoverned success
|
|
78
|
+
* shape and throws or returns garbage instead.
|
|
79
|
+
*
|
|
80
|
+
* @param params.fnName - The calling function's name, named in the thrown error.
|
|
81
|
+
* @param params.response - The raw fetch `Response` carrying the 202 body.
|
|
82
|
+
* @returns The governed-pending result: the intent to sign, or the proposal collecting approvals.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* if (response.raw.status === 202) {
|
|
87
|
+
* return parseGovernedResponse({ fnName: 'addBusinessAccountMember', response: response.raw });
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @see addBusinessAccountMember
|
|
92
|
+
* @see removeBusinessAccountWallet
|
|
93
|
+
* @throws {UnexpectedConsentResponseError} When the 202 body has no recognized reason or no intent.
|
|
94
|
+
* @notInstrumented
|
|
95
|
+
*/
|
|
96
|
+
const parseGovernedResponse = async ({ fnName, response }) => {
|
|
97
|
+
const payload = await response.json();
|
|
98
|
+
if (payload.reason !== "INTENT_REQUIRED" && payload.reason !== "APPROVALS_REQUIRED" || !payload.intent) throw new UnexpectedConsentResponseError({ message: `${fnName}: unexpected 202 body` });
|
|
99
|
+
return payload;
|
|
100
|
+
};
|
|
101
|
+
|
|
54
102
|
//#endregion
|
|
55
103
|
//#region src/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.ts
|
|
56
104
|
/**
|
|
@@ -62,11 +110,18 @@ const IDENTIFIER_TYPE_TO_API = {
|
|
|
62
110
|
* mutation with no MPC step, so a rejection (e.g. a 422 resource-limit) surfaces
|
|
63
111
|
* as a thrown error rather than stalling in the iframe bridge.
|
|
64
112
|
*
|
|
113
|
+
* When the account governs `addMember`, nothing is written and the 202 body is
|
|
114
|
+
* returned instead — first the intent to sign, then the proposal collecting
|
|
115
|
+
* approvals. Narrow it with `isBusinessAccountActionRequired`.
|
|
116
|
+
*
|
|
65
117
|
* @param params.businessAccountId - The ID of the business account.
|
|
66
118
|
* @param params.targetIdentity - The member to add (userId, or identifier + identifierType).
|
|
67
|
-
* @param [params.role] - The member role (`admin
|
|
119
|
+
* @param [params.role] - The member role: a built-in (`admin`, `viewer`) or a
|
|
120
|
+
* role this account defined. Defaults to `viewer`. `owner` is rejected — use
|
|
121
|
+
* `transferBusinessAccountOwnership`.
|
|
68
122
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
69
|
-
* @returns The created business account member.
|
|
123
|
+
* @returns The created business account member, or the outstanding action required.
|
|
124
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
70
125
|
* @notInstrumented
|
|
71
126
|
*/
|
|
72
127
|
const addBusinessAccountMember = async ({ businessAccountId, targetIdentity, role }, client = getDefaultClient()) => {
|
|
@@ -77,10 +132,10 @@ const addBusinessAccountMember = async ({ businessAccountId, targetIdentity, rol
|
|
|
77
132
|
const core = getCore(client);
|
|
78
133
|
const apiClient = createApiClient({ elevatedAccessTokenScope: TokenScope.BusinessAccountmemberadd }, client);
|
|
79
134
|
const { userId, identifier, identifierType, socialProvider, smsCountryCode } = targetIdentity;
|
|
80
|
-
|
|
135
|
+
const response = await apiClient.sdkAddBusinessAccountMemberRaw({
|
|
81
136
|
addBusinessAccountMemberSdkRequest: {
|
|
82
137
|
identifier,
|
|
83
|
-
role: role
|
|
138
|
+
role: role ?? "viewer",
|
|
84
139
|
smsCountryCode,
|
|
85
140
|
socialProvider,
|
|
86
141
|
type: identifierType ? IDENTIFIER_TYPE_TO_API[identifierType] : void 0,
|
|
@@ -89,6 +144,11 @@ const addBusinessAccountMember = async ({ businessAccountId, targetIdentity, rol
|
|
|
89
144
|
businessAccountId,
|
|
90
145
|
environmentId: core.environmentId
|
|
91
146
|
});
|
|
147
|
+
if (response.raw.status === 202) return parseGovernedResponse({
|
|
148
|
+
fnName: "addBusinessAccountMember",
|
|
149
|
+
response: response.raw
|
|
150
|
+
});
|
|
151
|
+
return await response.value();
|
|
92
152
|
};
|
|
93
153
|
|
|
94
154
|
//#endregion
|
|
@@ -124,10 +184,12 @@ const getWaasWalletProviderByChain = ({ chain }, client) => {
|
|
|
124
184
|
* @param [params.password] - Password for the current signer's share, if it is password-encrypted.
|
|
125
185
|
* @param [params.targetSignerPassword] - Password used to encrypt the new signer's share. Required when wallet passwords are required by the environment.
|
|
126
186
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
127
|
-
* @returns The new signer's share set id
|
|
187
|
+
* @returns The new signer's share set id, or a consent-pending answer when the
|
|
188
|
+
* account governs `addSignerToWallet` — the reshare has NOT run in that case.
|
|
189
|
+
* Narrow it with `isBusinessAccountActionRequired`.
|
|
128
190
|
* @notInstrumented
|
|
129
191
|
*/
|
|
130
|
-
const addBusinessAccountSigner = async ({ walletAccount, businessAccountId, walletId, targetIdentity, signerType, password, targetSignerPassword }, client = getDefaultClient()) => {
|
|
192
|
+
const addBusinessAccountSigner = async ({ walletAccount, businessAccountId, walletId, targetIdentity, signerType, password, targetSignerPassword, intent, intentSignature }, client = getDefaultClient()) => {
|
|
131
193
|
assertTargetIdentity({
|
|
132
194
|
fnName: "addBusinessAccountSigner",
|
|
133
195
|
targetIdentity
|
|
@@ -145,6 +207,8 @@ const addBusinessAccountSigner = async ({ walletAccount, businessAccountId, wall
|
|
|
145
207
|
}
|
|
146
208
|
const result = await getWaasWalletProviderByChain({ chain: walletAccount.chain }, client).reshareToNewSignerShareSet({
|
|
147
209
|
businessAccountId: resolvedBusinessAccountId,
|
|
210
|
+
intent,
|
|
211
|
+
intentSignature,
|
|
148
212
|
password,
|
|
149
213
|
signerType,
|
|
150
214
|
targetSignerIdentity: targetIdentity,
|
|
@@ -166,21 +230,31 @@ const addBusinessAccountSigner = async ({ walletAccount, businessAccountId, wall
|
|
|
166
230
|
* mutation with no MPC step, so a rejection (e.g. a 422 resource-limit) surfaces
|
|
167
231
|
* as a thrown error rather than stalling in the iframe bridge.
|
|
168
232
|
*
|
|
233
|
+
* When the account governs `linkWallet`, nothing is written and the 202 body is
|
|
234
|
+
* returned instead — first the intent to sign, then the proposal collecting
|
|
235
|
+
* approvals. Narrow it with `isBusinessAccountActionRequired`.
|
|
236
|
+
*
|
|
169
237
|
* @param [params.businessAccountId] - The business account to link to; found-or-created when omitted.
|
|
170
238
|
* @param params.walletId - The ID of the wallet to link.
|
|
171
239
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
172
|
-
* @returns The updated business account detail.
|
|
240
|
+
* @returns The updated business account detail, or the outstanding action required.
|
|
173
241
|
* @notInstrumented
|
|
174
242
|
*/
|
|
175
243
|
const addWalletToBusinessAccount = async ({ businessAccountId, walletId }, client = getDefaultClient()) => {
|
|
176
244
|
const core = getCore(client);
|
|
177
|
-
const
|
|
245
|
+
const response = await createApiClient({ elevatedAccessTokenScope: TokenScope.BusinessAccountlinkWallet }, client).sdkLinkBusinessAccountWalletRaw({
|
|
178
246
|
environmentId: core.environmentId,
|
|
179
247
|
linkBusinessAccountWalletSdkRequest: {
|
|
180
248
|
businessAccountId,
|
|
181
249
|
walletId
|
|
182
250
|
}
|
|
183
251
|
});
|
|
252
|
+
if (response.raw.status === 202) {
|
|
253
|
+
const payload = await response.raw.json();
|
|
254
|
+
if (payload.reason !== "INTENT_REQUIRED" && payload.reason !== "APPROVALS_REQUIRED" || !payload.intent) throw new UnexpectedConsentResponseError({ message: `addWalletToBusinessAccount: unexpected 202 body: ${JSON.stringify(payload)}` });
|
|
255
|
+
return payload;
|
|
256
|
+
}
|
|
257
|
+
const detail = await response.value();
|
|
184
258
|
await __refreshAuth_wrapped(client);
|
|
185
259
|
return detail;
|
|
186
260
|
};
|
|
@@ -1480,6 +1554,34 @@ const importWaasPrivateKey = async ({ chain, privateKey, thresholdSignatureSchem
|
|
|
1480
1554
|
});
|
|
1481
1555
|
};
|
|
1482
1556
|
|
|
1557
|
+
//#endregion
|
|
1558
|
+
//#region src/modules/waas/businessAccounts/isBusinessAccountActionRequired/isBusinessAccountActionRequired.ts
|
|
1559
|
+
/**
|
|
1560
|
+
* Narrows a governed mutation's result to the not-yet-authorized case.
|
|
1561
|
+
*
|
|
1562
|
+
* A governed action answers 202 with the bytes to sign, or with the proposal
|
|
1563
|
+
* collecting approvals — neither is an error, so both come back as a value. Use
|
|
1564
|
+
* this to tell them apart from the applied result.
|
|
1565
|
+
*
|
|
1566
|
+
* @param result - What a governed business-account mutation returned.
|
|
1567
|
+
* @returns True when the action still needs a signature or approvals.
|
|
1568
|
+
*
|
|
1569
|
+
* @example
|
|
1570
|
+
* ```ts
|
|
1571
|
+
* const result = await addWalletToBusinessAccount({ walletId });
|
|
1572
|
+
* if (isBusinessAccountActionRequired(result)) {
|
|
1573
|
+
* await signIntent(result.intent);
|
|
1574
|
+
* return;
|
|
1575
|
+
* }
|
|
1576
|
+
* console.log(result.members.length);
|
|
1577
|
+
* ```
|
|
1578
|
+
*
|
|
1579
|
+
* @see {@link BusinessAccountActionRequired} for the shape this narrows to.
|
|
1580
|
+
* @see {@link addWalletToBusinessAccount} for a governed mutation that can return it.
|
|
1581
|
+
* @notInstrumented
|
|
1582
|
+
*/
|
|
1583
|
+
const isBusinessAccountActionRequired = (result) => "reason" in result && (result.reason === "INTENT_REQUIRED" || result.reason === "APPROVALS_REQUIRED");
|
|
1584
|
+
|
|
1483
1585
|
//#endregion
|
|
1484
1586
|
//#region src/modules/waas/isPasswordRequiredForWaasWallets/isPasswordRequiredForWaasWallets.ts
|
|
1485
1587
|
/**
|
|
@@ -1575,7 +1677,7 @@ const removeAccountPolicyRule = async ({ businessAccountId, ruleId }, client = g
|
|
|
1575
1677
|
* @param params.businessAccountId - The business account to remove the member from.
|
|
1576
1678
|
* @param params.userId - The id of the user to remove.
|
|
1577
1679
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1578
|
-
* @returns The removed member.
|
|
1680
|
+
* @returns The removed member, or the outstanding action required.
|
|
1579
1681
|
*
|
|
1580
1682
|
* @example
|
|
1581
1683
|
* ```ts
|
|
@@ -1589,15 +1691,21 @@ const removeAccountPolicyRule = async ({ businessAccountId, ruleId }, client = g
|
|
|
1589
1691
|
*
|
|
1590
1692
|
* @see addBusinessAccountMember
|
|
1591
1693
|
* @see getBusinessAccount
|
|
1694
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
1592
1695
|
* @notInstrumented
|
|
1593
1696
|
*/
|
|
1594
1697
|
const removeBusinessAccountMember = async ({ businessAccountId, userId }, client = getDefaultClient()) => {
|
|
1595
1698
|
const core = getCore(client);
|
|
1596
|
-
const
|
|
1699
|
+
const response = await createApiClient({ elevatedAccessTokenScope: TokenScope.BusinessAccountmemberremove }, client).sdkRemoveBusinessAccountMemberRaw({
|
|
1597
1700
|
businessAccountId,
|
|
1598
1701
|
environmentId: core.environmentId,
|
|
1599
1702
|
userId
|
|
1600
1703
|
});
|
|
1704
|
+
if (response.raw.status === 202) return parseGovernedResponse({
|
|
1705
|
+
fnName: "removeBusinessAccountMember",
|
|
1706
|
+
response: response.raw
|
|
1707
|
+
});
|
|
1708
|
+
const { member } = await response.value();
|
|
1601
1709
|
return member;
|
|
1602
1710
|
};
|
|
1603
1711
|
|
|
@@ -1613,7 +1721,7 @@ const removeBusinessAccountMember = async ({ businessAccountId, userId }, client
|
|
|
1613
1721
|
* @param params.walletId - The wallet the signer is attached to.
|
|
1614
1722
|
* @param params.signerId - The id of the signer to remove (`BusinessAccountSigner.id`).
|
|
1615
1723
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1616
|
-
* @returns The removed signer.
|
|
1724
|
+
* @returns The removed signer, or the outstanding action required.
|
|
1617
1725
|
*
|
|
1618
1726
|
* @example
|
|
1619
1727
|
* ```ts
|
|
@@ -1628,16 +1736,22 @@ const removeBusinessAccountMember = async ({ businessAccountId, userId }, client
|
|
|
1628
1736
|
*
|
|
1629
1737
|
* @see addBusinessAccountSigner
|
|
1630
1738
|
* @see getBusinessAccount
|
|
1739
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
1631
1740
|
* @notInstrumented
|
|
1632
1741
|
*/
|
|
1633
1742
|
const removeBusinessAccountSigner = async ({ businessAccountId, walletId, signerId }, client = getDefaultClient()) => {
|
|
1634
1743
|
const core = getCore(client);
|
|
1635
|
-
const
|
|
1744
|
+
const response = await createApiClient({ elevatedAccessTokenScope: TokenScope.BusinessAccountsignerremove }, client).sdkRemoveBusinessAccountSignerRaw({
|
|
1636
1745
|
businessAccountId,
|
|
1637
1746
|
environmentId: core.environmentId,
|
|
1638
1747
|
signerId,
|
|
1639
1748
|
walletId
|
|
1640
1749
|
});
|
|
1750
|
+
if (response.raw.status === 202) return parseGovernedResponse({
|
|
1751
|
+
fnName: "removeBusinessAccountSigner",
|
|
1752
|
+
response: response.raw
|
|
1753
|
+
});
|
|
1754
|
+
const { signer } = await response.value();
|
|
1641
1755
|
return signer;
|
|
1642
1756
|
};
|
|
1643
1757
|
|
|
@@ -1651,7 +1765,7 @@ const removeBusinessAccountSigner = async ({ businessAccountId, walletId, signer
|
|
|
1651
1765
|
* @param params.businessAccountId - The business account the wallet belongs to.
|
|
1652
1766
|
* @param params.walletId - The wallet to remove (`BusinessAccountWallet.id`).
|
|
1653
1767
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1654
|
-
* @returns The updated business account detail.
|
|
1768
|
+
* @returns The updated business account detail, or the outstanding action required.
|
|
1655
1769
|
*
|
|
1656
1770
|
* @example
|
|
1657
1771
|
* ```ts
|
|
@@ -1664,15 +1778,21 @@ const removeBusinessAccountSigner = async ({ businessAccountId, walletId, signer
|
|
|
1664
1778
|
*
|
|
1665
1779
|
* @see addWalletToBusinessAccount
|
|
1666
1780
|
* @see getBusinessAccount
|
|
1781
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
1667
1782
|
* @notInstrumented
|
|
1668
1783
|
*/
|
|
1669
1784
|
const removeBusinessAccountWallet = async ({ businessAccountId, walletId }, client = getDefaultClient()) => {
|
|
1670
1785
|
const core = getCore(client);
|
|
1671
|
-
const
|
|
1786
|
+
const response = await createApiClient({ elevatedAccessTokenScope: TokenScope.BusinessAccountwalletremove }, client).sdkRemoveBusinessAccountWalletRaw({
|
|
1672
1787
|
businessAccountId,
|
|
1673
1788
|
environmentId: core.environmentId,
|
|
1674
1789
|
walletId
|
|
1675
1790
|
});
|
|
1791
|
+
if (response.raw.status === 202) return parseGovernedResponse({
|
|
1792
|
+
fnName: "removeBusinessAccountWallet",
|
|
1793
|
+
response: response.raw
|
|
1794
|
+
});
|
|
1795
|
+
const detail = await response.value();
|
|
1676
1796
|
await __refreshAuth_wrapped(client);
|
|
1677
1797
|
return detail;
|
|
1678
1798
|
};
|
|
@@ -1916,7 +2036,7 @@ const signSerializedTransaction = async ({ chainId, serializedTransaction, walle
|
|
|
1916
2036
|
* @param params.businessAccountId - The business account whose ownership moves.
|
|
1917
2037
|
* @param params.newOwnerUserId - The member to promote to owner.
|
|
1918
2038
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1919
|
-
* @returns The updated business account detail.
|
|
2039
|
+
* @returns The updated business account detail, or the outstanding action required.
|
|
1920
2040
|
*
|
|
1921
2041
|
* @example
|
|
1922
2042
|
* ```ts
|
|
@@ -1929,15 +2049,21 @@ const signSerializedTransaction = async ({ chainId, serializedTransaction, walle
|
|
|
1929
2049
|
* ```
|
|
1930
2050
|
*
|
|
1931
2051
|
* @see getBusinessAccount
|
|
2052
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
1932
2053
|
* @notInstrumented
|
|
1933
2054
|
*/
|
|
1934
2055
|
const transferBusinessAccountOwnership = async ({ businessAccountId, newOwnerUserId }, client = getDefaultClient()) => {
|
|
1935
2056
|
const core = getCore(client);
|
|
1936
|
-
const
|
|
2057
|
+
const response = await createApiClient({ elevatedAccessTokenScope: TokenScope.BusinessAccounttransferOwnership }, client).sdkTransferBusinessAccountOwnershipRaw({
|
|
1937
2058
|
businessAccountId,
|
|
1938
2059
|
environmentId: core.environmentId,
|
|
1939
2060
|
transferBusinessAccountOwnershipSdkRequest: { newOwnerUserId }
|
|
1940
2061
|
});
|
|
2062
|
+
if (response.raw.status === 202) return parseGovernedResponse({
|
|
2063
|
+
fnName: "transferBusinessAccountOwnership",
|
|
2064
|
+
response: response.raw
|
|
2065
|
+
});
|
|
2066
|
+
const detail = await response.value();
|
|
1941
2067
|
await __logoutWithReason_wrapped({ reason: "business-account-ownership-transferred" }, client);
|
|
1942
2068
|
return detail;
|
|
1943
2069
|
};
|
|
@@ -1990,19 +2116,18 @@ const updateBusinessAccount = async ({ businessAccountId, name: name$1 }, client
|
|
|
1990
2116
|
|
|
1991
2117
|
//#endregion
|
|
1992
2118
|
//#region src/modules/waas/businessAccounts/updateBusinessAccountMemberRole/updateBusinessAccountMemberRole.ts
|
|
1993
|
-
const ROLE_TO_API = {
|
|
1994
|
-
admin: AssignableBusinessAccountMemberRole.Admin,
|
|
1995
|
-
viewer: AssignableBusinessAccountMemberRole.Viewer
|
|
1996
|
-
};
|
|
1997
2119
|
/**
|
|
1998
|
-
* Changes an existing member's role
|
|
1999
|
-
*
|
|
2120
|
+
* Changes an existing member's role (owner-/admin-only) to any role the account
|
|
2121
|
+
* defines — a built-in or a custom one, including from one custom role to
|
|
2122
|
+
* another. Owner is not assignable here — use
|
|
2123
|
+
* `transferBusinessAccountOwnership` for that.
|
|
2000
2124
|
*
|
|
2001
2125
|
* @param params.businessAccountId - The business account the member belongs to.
|
|
2002
2126
|
* @param params.userId - The member whose role changes.
|
|
2003
|
-
* @param params.role - The new role (`admin
|
|
2127
|
+
* @param params.role - The new role: a built-in (`admin`, `viewer`) or a role
|
|
2128
|
+
* this account defined.
|
|
2004
2129
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2005
|
-
* @returns The updated business account member.
|
|
2130
|
+
* @returns The updated business account member, or the outstanding action required.
|
|
2006
2131
|
*
|
|
2007
2132
|
* @example
|
|
2008
2133
|
* ```ts
|
|
@@ -2015,16 +2140,22 @@ const ROLE_TO_API = {
|
|
|
2015
2140
|
*
|
|
2016
2141
|
* @see transferBusinessAccountOwnership
|
|
2017
2142
|
* @see addBusinessAccountMember
|
|
2143
|
+
* @throws {UnexpectedConsentResponseError} When a governed account answers 202 with an unrecognized body.
|
|
2018
2144
|
* @notInstrumented
|
|
2019
2145
|
*/
|
|
2020
2146
|
const updateBusinessAccountMemberRole = async ({ businessAccountId, userId, role }, client = getDefaultClient()) => {
|
|
2021
2147
|
const core = getCore(client);
|
|
2022
|
-
|
|
2148
|
+
const response = await createApiClient({ elevatedAccessTokenScope: TokenScope.BusinessAccountmemberroleupdate }, client).sdkUpdateBusinessAccountMemberRoleRaw({
|
|
2023
2149
|
businessAccountId,
|
|
2024
2150
|
environmentId: core.environmentId,
|
|
2025
|
-
updateBusinessAccountMemberRoleSdkRequest: { role
|
|
2151
|
+
updateBusinessAccountMemberRoleSdkRequest: { role },
|
|
2026
2152
|
userId
|
|
2027
2153
|
});
|
|
2154
|
+
if (response.raw.status === 202) return parseGovernedResponse({
|
|
2155
|
+
fnName: "updateBusinessAccountMemberRole",
|
|
2156
|
+
response: response.raw
|
|
2157
|
+
});
|
|
2158
|
+
return await response.value();
|
|
2028
2159
|
};
|
|
2029
2160
|
|
|
2030
2161
|
//#endregion
|
|
@@ -2146,5 +2277,5 @@ const upsertWalletPolicyRule = async ({ rule, walletAccount }, client = getDefau
|
|
|
2146
2277
|
assertPackageVersion(name, version);
|
|
2147
2278
|
|
|
2148
2279
|
//#endregion
|
|
2149
|
-
export {
|
|
2150
|
-
//# sourceMappingURL=waas-
|
|
2280
|
+
export { WaasChainEnum$1 as $, getPolicy as A, normalizeWalletRequirements as B, isBusinessAccountActionRequired as C, getWalletPolicyLayer as D, getWalletRecoveryState as E, exportWaasClientKeyshares as F, expandPolicyRules as G, createWaasOfflineRecoveryShares as H, desugarPolicyRules as I, buildAllowPolicyRule as J, createBusinessAccount as K, delegateWaasKeyShares as L, getBusinessAccount as M, getAccountPolicyLayer as N, getWalletAccountShareSets as O, exportWaasPrivateKey as P, addBusinessAccountMember as Q, createWalletForBusinessAccount as R, isPasswordRequiredForWaasWallets as S, hasDelegatedAccess as T, createPolicy as U, isWalletCreationRequirement as V, resolvePolicyScope as W, addWalletToBusinessAccount as X, backupWaasKeySharesToGoogleDrive as Y, addBusinessAccountSigner as Z, removeBusinessAccountSigner as _, updateBusinessAccountMemberRole as a, refreshWaasWalletAccountShares as b, transferBusinessAccountOwnership as c, setWaasWalletAccountPassword as d, WaasWalletShareSetType$1 as et, revokeWaasDelegation as f, removeBusinessAccountWallet as g, removePolicyRules as h, updateWaasPassword as i, getChainsMissingWaasWalletAccounts as j, getSignerPolicyLayer as k, signSerializedTransaction as l, removeSignerPolicyRule as m, upsertSignerPolicyRule as n, updateBusinessAccount as o, removeWalletPolicyRule as p, buildDenyPolicyRule as q, upsertAccountPolicyRule as r, unlockWallet as s, upsertWalletPolicyRule as t, shouldAutoCreateWalletForChain as u, removeBusinessAccountMember as v, importWaasPrivateKey as w, listBusinessAccounts as x, removeAccountPolicyRule as y, createWaasWalletAccounts as z };
|
|
2281
|
+
//# sourceMappingURL=waas-oKD6ZDP9.native.esm.js.map
|