@dynamic-labs/sdk-api-core 0.2.0 → 0.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-api-core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -870,7 +870,7 @@ class SDKApi extends runtime.BaseAPI {
870
870
  await this.broadcastFlowOptionsRaw(requestParameters, initOverrides);
871
871
  }
872
872
  /**
873
- * Relays an already-signed transaction from a Dynamic v3 WaaS wallet to the network. The server derives chain and wallet address from `walletId`, verifies the signed payload belongs to the wallet, owns provider selection and bounded retry/failover of the identical signed bytes, and replays a stored result when `x-idempotency-key` repeats.
873
+ * Relays an already-signed transaction from a Dynamic v3 WaaS wallet to the network. The server derives chain and wallet address from `walletId`, verifies the signed payload belongs to the wallet, owns provider selection and bounded retry/failover of the identical signed bytes, and replays a stored result when `x-idempotency-key` repeats. Replacement or speed-up transactions use different signed bytes and require a new key; reusing an existing key with different bytes returns 409.
874
874
  * Broadcast a signed transaction from a Dynamic v3 WaaS wallet
875
875
  */
876
876
  async broadcastWaasTransactionRaw(requestParameters, initOverrides) {
@@ -909,7 +909,7 @@ class SDKApi extends runtime.BaseAPI {
909
909
  return new runtime.JSONApiResponse(response, (jsonValue) => WaasTransactionBroadcastResponse.WaasTransactionBroadcastResponseFromJSON(jsonValue));
910
910
  }
911
911
  /**
912
- * Relays an already-signed transaction from a Dynamic v3 WaaS wallet to the network. The server derives chain and wallet address from `walletId`, verifies the signed payload belongs to the wallet, owns provider selection and bounded retry/failover of the identical signed bytes, and replays a stored result when `x-idempotency-key` repeats.
912
+ * Relays an already-signed transaction from a Dynamic v3 WaaS wallet to the network. The server derives chain and wallet address from `walletId`, verifies the signed payload belongs to the wallet, owns provider selection and bounded retry/failover of the identical signed bytes, and replays a stored result when `x-idempotency-key` repeats. Replacement or speed-up transactions use different signed bytes and require a new key; reusing an existing key with different bytes returns 409.
913
913
  * Broadcast a signed transaction from a Dynamic v3 WaaS wallet
914
914
  */
915
915
  async broadcastWaasTransaction(requestParameters, initOverrides) {
@@ -3702,7 +3702,7 @@ class SDKApi extends runtime.BaseAPI {
3702
3702
  await this.getBackupTokenOptionsRaw(requestParameters, initOverrides);
3703
3703
  }
3704
3704
  /**
3705
- * Returns the Composition account-Layer content for the business account — the Rules that apply to every wallet in the business account. BA owner/admin only. Returns 404 if the caller is not a qualifying owner/admin of the business account, or if the account-Layer has not been minted yet.
3705
+ * Returns the Composition account-Layer content for the business account — the Rules that apply to every wallet in the business account. BA owner/admin only. Returns 404 if the caller is not a qualifying owner/admin of the business account, or if the account-Layer has not been minted yet (it\'s created by the first PATCH to this path, or the first time a signer is added to a wallet in this business account with Composition enabled — see the PATCH docs on this same path).
3706
3706
  * Get the business account\'s account-Layer Rules
3707
3707
  */
3708
3708
  async getBusinessAccountPolicyLayerRaw(requestParameters, initOverrides) {
@@ -3730,7 +3730,7 @@ class SDKApi extends runtime.BaseAPI {
3730
3730
  return new runtime.JSONApiResponse(response, (jsonValue) => WaasPolicyLayerResponse.WaasPolicyLayerResponseFromJSON(jsonValue));
3731
3731
  }
3732
3732
  /**
3733
- * Returns the Composition account-Layer content for the business account — the Rules that apply to every wallet in the business account. BA owner/admin only. Returns 404 if the caller is not a qualifying owner/admin of the business account, or if the account-Layer has not been minted yet.
3733
+ * Returns the Composition account-Layer content for the business account — the Rules that apply to every wallet in the business account. BA owner/admin only. Returns 404 if the caller is not a qualifying owner/admin of the business account, or if the account-Layer has not been minted yet (it\'s created by the first PATCH to this path, or the first time a signer is added to a wallet in this business account with Composition enabled — see the PATCH docs on this same path).
3734
3734
  * Get the business account\'s account-Layer Rules
3735
3735
  */
3736
3736
  async getBusinessAccountPolicyLayer(requestParameters, initOverrides) {
@@ -10739,6 +10739,47 @@ class SDKApi extends runtime.BaseAPI {
10739
10739
  async updateAdditionalAddressesOptions(requestParameters, initOverrides) {
10740
10740
  await this.updateAdditionalAddressesOptionsRaw(requestParameters, initOverrides);
10741
10741
  }
10742
+ /**
10743
+ * Applies a single per-Rule upsert (create when ruleId is new, update when it already exists) or remove operation to the business account\'s account-Layer, which applies to every wallet in the business account. BA owner/admin only. ruleId may be omitted on an upsert; the enclave then mints one and returns it in the response\'s layerContent.rules. Creates the account-Layer if this business account has none yet, so a first write succeeds rather than 404ing; it is otherwise minted the first time a signer is added to a wallet in the business account with Composition enabled. Set op to batch to apply several operations atomically in one enclave cycle.
10744
+ * Create, update, or remove a Rule on the business account\'s account-Layer
10745
+ */
10746
+ async updateBusinessAccountPolicyLayerRaw(requestParameters, initOverrides) {
10747
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
10748
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling updateBusinessAccountPolicyLayer.');
10749
+ }
10750
+ if (requestParameters.businessAccountId === null || requestParameters.businessAccountId === undefined) {
10751
+ throw new runtime.RequiredError('businessAccountId', 'Required parameter requestParameters.businessAccountId was null or undefined when calling updateBusinessAccountPolicyLayer.');
10752
+ }
10753
+ if (requestParameters.waasPolicyLayerUpdateRequest === null || requestParameters.waasPolicyLayerUpdateRequest === undefined) {
10754
+ throw new runtime.RequiredError('waasPolicyLayerUpdateRequest', 'Required parameter requestParameters.waasPolicyLayerUpdateRequest was null or undefined when calling updateBusinessAccountPolicyLayer.');
10755
+ }
10756
+ const queryParameters = {};
10757
+ const headerParameters = {};
10758
+ headerParameters['Content-Type'] = 'application/json';
10759
+ if (this.configuration && this.configuration.accessToken) {
10760
+ const token = this.configuration.accessToken;
10761
+ const tokenString = await token("bearerAuth", []);
10762
+ if (tokenString) {
10763
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
10764
+ }
10765
+ }
10766
+ const response = await this.request({
10767
+ path: `/sdk/{environmentId}/businessAccounts/{businessAccountId}/policy-layer`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"businessAccountId"}}`, encodeURIComponent(String(requestParameters.businessAccountId))),
10768
+ method: 'PATCH',
10769
+ headers: headerParameters,
10770
+ query: queryParameters,
10771
+ body: WaasPolicyLayerUpdateRequest.WaasPolicyLayerUpdateRequestToJSON(requestParameters.waasPolicyLayerUpdateRequest),
10772
+ }, initOverrides);
10773
+ return new runtime.JSONApiResponse(response, (jsonValue) => WaasPolicyLayerResponse.WaasPolicyLayerResponseFromJSON(jsonValue));
10774
+ }
10775
+ /**
10776
+ * Applies a single per-Rule upsert (create when ruleId is new, update when it already exists) or remove operation to the business account\'s account-Layer, which applies to every wallet in the business account. BA owner/admin only. ruleId may be omitted on an upsert; the enclave then mints one and returns it in the response\'s layerContent.rules. Creates the account-Layer if this business account has none yet, so a first write succeeds rather than 404ing; it is otherwise minted the first time a signer is added to a wallet in the business account with Composition enabled. Set op to batch to apply several operations atomically in one enclave cycle.
10777
+ * Create, update, or remove a Rule on the business account\'s account-Layer
10778
+ */
10779
+ async updateBusinessAccountPolicyLayer(requestParameters, initOverrides) {
10780
+ const response = await this.updateBusinessAccountPolicyLayerRaw(requestParameters, initOverrides);
10781
+ return await response.value();
10782
+ }
10742
10783
  /**
10743
10784
  * Updates the V2 recovery email address for the authenticated user.
10744
10785
  * Update a user\'s V2 recovery email