@dynamic-labs/sdk-api-core 0.1.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.1.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) {
@@ -3701,6 +3701,42 @@ class SDKApi extends runtime.BaseAPI {
3701
3701
  async getBackupTokenOptions(requestParameters, initOverrides) {
3702
3702
  await this.getBackupTokenOptionsRaw(requestParameters, initOverrides);
3703
3703
  }
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 (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
+ * Get the business account\'s account-Layer Rules
3707
+ */
3708
+ async getBusinessAccountPolicyLayerRaw(requestParameters, initOverrides) {
3709
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
3710
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling getBusinessAccountPolicyLayer.');
3711
+ }
3712
+ if (requestParameters.businessAccountId === null || requestParameters.businessAccountId === undefined) {
3713
+ throw new runtime.RequiredError('businessAccountId', 'Required parameter requestParameters.businessAccountId was null or undefined when calling getBusinessAccountPolicyLayer.');
3714
+ }
3715
+ const queryParameters = {};
3716
+ const headerParameters = {};
3717
+ if (this.configuration && this.configuration.accessToken) {
3718
+ const token = this.configuration.accessToken;
3719
+ const tokenString = await token("bearerAuth", []);
3720
+ if (tokenString) {
3721
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
3722
+ }
3723
+ }
3724
+ const response = await this.request({
3725
+ path: `/sdk/{environmentId}/businessAccounts/{businessAccountId}/policy-layer`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"businessAccountId"}}`, encodeURIComponent(String(requestParameters.businessAccountId))),
3726
+ method: 'GET',
3727
+ headers: headerParameters,
3728
+ query: queryParameters,
3729
+ }, initOverrides);
3730
+ return new runtime.JSONApiResponse(response, (jsonValue) => WaasPolicyLayerResponse.WaasPolicyLayerResponseFromJSON(jsonValue));
3731
+ }
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 (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
+ * Get the business account\'s account-Layer Rules
3735
+ */
3736
+ async getBusinessAccountPolicyLayer(requestParameters, initOverrides) {
3737
+ const response = await this.getBusinessAccountPolicyLayerRaw(requestParameters, initOverrides);
3738
+ return await response.value();
3739
+ }
3704
3740
  /**
3705
3741
  * Deprecated: use GET /sdk/{environmentId}/flow/{flowId} instead.
3706
3742
  * Get a checkout transaction by ID
@@ -8879,6 +8915,32 @@ class SDKApi extends runtime.BaseAPI {
8879
8915
  async sdkBusinessAccountMembersOptions(requestParameters, initOverrides) {
8880
8916
  await this.sdkBusinessAccountMembersOptionsRaw(requestParameters, initOverrides);
8881
8917
  }
8918
+ /**
8919
+ * Options call for this endpoint
8920
+ */
8921
+ async sdkBusinessAccountPolicyLayerOptionsRaw(requestParameters, initOverrides) {
8922
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
8923
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling sdkBusinessAccountPolicyLayerOptions.');
8924
+ }
8925
+ if (requestParameters.businessAccountId === null || requestParameters.businessAccountId === undefined) {
8926
+ throw new runtime.RequiredError('businessAccountId', 'Required parameter requestParameters.businessAccountId was null or undefined when calling sdkBusinessAccountPolicyLayerOptions.');
8927
+ }
8928
+ const queryParameters = {};
8929
+ const headerParameters = {};
8930
+ const response = await this.request({
8931
+ path: `/sdk/{environmentId}/businessAccounts/{businessAccountId}/policy-layer`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"businessAccountId"}}`, encodeURIComponent(String(requestParameters.businessAccountId))),
8932
+ method: 'OPTIONS',
8933
+ headers: headerParameters,
8934
+ query: queryParameters,
8935
+ }, initOverrides);
8936
+ return new runtime.VoidApiResponse(response);
8937
+ }
8938
+ /**
8939
+ * Options call for this endpoint
8940
+ */
8941
+ async sdkBusinessAccountPolicyLayerOptions(requestParameters, initOverrides) {
8942
+ await this.sdkBusinessAccountPolicyLayerOptionsRaw(requestParameters, initOverrides);
8943
+ }
8882
8944
  /**
8883
8945
  * Options call for this endpoint
8884
8946
  */
@@ -10677,6 +10739,47 @@ class SDKApi extends runtime.BaseAPI {
10677
10739
  async updateAdditionalAddressesOptions(requestParameters, initOverrides) {
10678
10740
  await this.updateAdditionalAddressesOptionsRaw(requestParameters, initOverrides);
10679
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
+ }
10680
10783
  /**
10681
10784
  * Updates the V2 recovery email address for the authenticated user.
10682
10785
  * Update a user\'s V2 recovery email