@dynamic-labs/sdk-api-core 0.2.0 → 0.4.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.4.0",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -301,6 +301,8 @@ require('../models/WaasTransactionEncoding.cjs');
301
301
  var WalletSanctionsResponse = require('../models/WalletSanctionsResponse.cjs');
302
302
  require('../models/WalletTransactionType.cjs');
303
303
  var WalletTransactionsResponse = require('../models/WalletTransactionsResponse.cjs');
304
+ var YieldVaultActionRequest = require('../models/YieldVaultActionRequest.cjs');
305
+ var YieldVaultActionResponse = require('../models/YieldVaultActionResponse.cjs');
304
306
  var YieldVaultDetails = require('../models/YieldVaultDetails.cjs');
305
307
  var YieldVaultListResponse = require('../models/YieldVaultListResponse.cjs');
306
308
  var YieldVaultPosition = require('../models/YieldVaultPosition.cjs');
@@ -870,7 +872,7 @@ class SDKApi extends runtime.BaseAPI {
870
872
  await this.broadcastFlowOptionsRaw(requestParameters, initOverrides);
871
873
  }
872
874
  /**
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.
875
+ * 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
876
  * Broadcast a signed transaction from a Dynamic v3 WaaS wallet
875
877
  */
876
878
  async broadcastWaasTransactionRaw(requestParameters, initOverrides) {
@@ -909,7 +911,7 @@ class SDKApi extends runtime.BaseAPI {
909
911
  return new runtime.JSONApiResponse(response, (jsonValue) => WaasTransactionBroadcastResponse.WaasTransactionBroadcastResponseFromJSON(jsonValue));
910
912
  }
911
913
  /**
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.
914
+ * 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
915
  * Broadcast a signed transaction from a Dynamic v3 WaaS wallet
914
916
  */
915
917
  async broadcastWaasTransaction(requestParameters, initOverrides) {
@@ -3702,7 +3704,7 @@ class SDKApi extends runtime.BaseAPI {
3702
3704
  await this.getBackupTokenOptionsRaw(requestParameters, initOverrides);
3703
3705
  }
3704
3706
  /**
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.
3707
+ * 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
3708
  * Get the business account\'s account-Layer Rules
3707
3709
  */
3708
3710
  async getBusinessAccountPolicyLayerRaw(requestParameters, initOverrides) {
@@ -3730,7 +3732,7 @@ class SDKApi extends runtime.BaseAPI {
3730
3732
  return new runtime.JSONApiResponse(response, (jsonValue) => WaasPolicyLayerResponse.WaasPolicyLayerResponseFromJSON(jsonValue));
3731
3733
  }
3732
3734
  /**
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.
3735
+ * 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
3736
  * Get the business account\'s account-Layer Rules
3735
3737
  */
3736
3738
  async getBusinessAccountPolicyLayer(requestParameters, initOverrides) {
@@ -10739,6 +10741,47 @@ class SDKApi extends runtime.BaseAPI {
10739
10741
  async updateAdditionalAddressesOptions(requestParameters, initOverrides) {
10740
10742
  await this.updateAdditionalAddressesOptionsRaw(requestParameters, initOverrides);
10741
10743
  }
10744
+ /**
10745
+ * 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.
10746
+ * Create, update, or remove a Rule on the business account\'s account-Layer
10747
+ */
10748
+ async updateBusinessAccountPolicyLayerRaw(requestParameters, initOverrides) {
10749
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
10750
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling updateBusinessAccountPolicyLayer.');
10751
+ }
10752
+ if (requestParameters.businessAccountId === null || requestParameters.businessAccountId === undefined) {
10753
+ throw new runtime.RequiredError('businessAccountId', 'Required parameter requestParameters.businessAccountId was null or undefined when calling updateBusinessAccountPolicyLayer.');
10754
+ }
10755
+ if (requestParameters.waasPolicyLayerUpdateRequest === null || requestParameters.waasPolicyLayerUpdateRequest === undefined) {
10756
+ throw new runtime.RequiredError('waasPolicyLayerUpdateRequest', 'Required parameter requestParameters.waasPolicyLayerUpdateRequest was null or undefined when calling updateBusinessAccountPolicyLayer.');
10757
+ }
10758
+ const queryParameters = {};
10759
+ const headerParameters = {};
10760
+ headerParameters['Content-Type'] = 'application/json';
10761
+ if (this.configuration && this.configuration.accessToken) {
10762
+ const token = this.configuration.accessToken;
10763
+ const tokenString = await token("bearerAuth", []);
10764
+ if (tokenString) {
10765
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
10766
+ }
10767
+ }
10768
+ const response = await this.request({
10769
+ path: `/sdk/{environmentId}/businessAccounts/{businessAccountId}/policy-layer`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"businessAccountId"}}`, encodeURIComponent(String(requestParameters.businessAccountId))),
10770
+ method: 'PATCH',
10771
+ headers: headerParameters,
10772
+ query: queryParameters,
10773
+ body: WaasPolicyLayerUpdateRequest.WaasPolicyLayerUpdateRequestToJSON(requestParameters.waasPolicyLayerUpdateRequest),
10774
+ }, initOverrides);
10775
+ return new runtime.JSONApiResponse(response, (jsonValue) => WaasPolicyLayerResponse.WaasPolicyLayerResponseFromJSON(jsonValue));
10776
+ }
10777
+ /**
10778
+ * 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.
10779
+ * Create, update, or remove a Rule on the business account\'s account-Layer
10780
+ */
10781
+ async updateBusinessAccountPolicyLayer(requestParameters, initOverrides) {
10782
+ const response = await this.updateBusinessAccountPolicyLayerRaw(requestParameters, initOverrides);
10783
+ return await response.value();
10784
+ }
10742
10785
  /**
10743
10786
  * Updates the V2 recovery email address for the authenticated user.
10744
10787
  * Update a user\'s V2 recovery email
@@ -11817,6 +11860,66 @@ class SDKApi extends runtime.BaseAPI {
11817
11860
  async walletsVerifyOptions(requestParameters, initOverrides) {
11818
11861
  await this.walletsVerifyOptionsRaw(requestParameters, initOverrides);
11819
11862
  }
11863
+ /**
11864
+ * Builds an unsigned deposit signing payload for the given vault and wallet address. When the payload includes an approval step, the SDK signs and sends it before the main transaction.
11865
+ * Build a vault deposit signing payload
11866
+ */
11867
+ async yieldVaultDepositRaw(requestParameters, initOverrides) {
11868
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
11869
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling yieldVaultDeposit.');
11870
+ }
11871
+ if (requestParameters.vaultId === null || requestParameters.vaultId === undefined) {
11872
+ throw new runtime.RequiredError('vaultId', 'Required parameter requestParameters.vaultId was null or undefined when calling yieldVaultDeposit.');
11873
+ }
11874
+ if (requestParameters.yieldVaultActionRequest === null || requestParameters.yieldVaultActionRequest === undefined) {
11875
+ throw new runtime.RequiredError('yieldVaultActionRequest', 'Required parameter requestParameters.yieldVaultActionRequest was null or undefined when calling yieldVaultDeposit.');
11876
+ }
11877
+ const queryParameters = {};
11878
+ const headerParameters = {};
11879
+ headerParameters['Content-Type'] = 'application/json';
11880
+ const response = await this.request({
11881
+ path: `/sdk/{environmentId}/yield/vaults/{vaultId}/deposit`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"vaultId"}}`, encodeURIComponent(String(requestParameters.vaultId))),
11882
+ method: 'POST',
11883
+ headers: headerParameters,
11884
+ query: queryParameters,
11885
+ body: YieldVaultActionRequest.YieldVaultActionRequestToJSON(requestParameters.yieldVaultActionRequest),
11886
+ }, initOverrides);
11887
+ return new runtime.JSONApiResponse(response, (jsonValue) => YieldVaultActionResponse.YieldVaultActionResponseFromJSON(jsonValue));
11888
+ }
11889
+ /**
11890
+ * Builds an unsigned deposit signing payload for the given vault and wallet address. When the payload includes an approval step, the SDK signs and sends it before the main transaction.
11891
+ * Build a vault deposit signing payload
11892
+ */
11893
+ async yieldVaultDeposit(requestParameters, initOverrides) {
11894
+ const response = await this.yieldVaultDepositRaw(requestParameters, initOverrides);
11895
+ return await response.value();
11896
+ }
11897
+ /**
11898
+ * Options call for this endpoint
11899
+ */
11900
+ async yieldVaultDepositOptionsRaw(requestParameters, initOverrides) {
11901
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
11902
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling yieldVaultDepositOptions.');
11903
+ }
11904
+ if (requestParameters.vaultId === null || requestParameters.vaultId === undefined) {
11905
+ throw new runtime.RequiredError('vaultId', 'Required parameter requestParameters.vaultId was null or undefined when calling yieldVaultDepositOptions.');
11906
+ }
11907
+ const queryParameters = {};
11908
+ const headerParameters = {};
11909
+ const response = await this.request({
11910
+ path: `/sdk/{environmentId}/yield/vaults/{vaultId}/deposit`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"vaultId"}}`, encodeURIComponent(String(requestParameters.vaultId))),
11911
+ method: 'OPTIONS',
11912
+ headers: headerParameters,
11913
+ query: queryParameters,
11914
+ }, initOverrides);
11915
+ return new runtime.VoidApiResponse(response);
11916
+ }
11917
+ /**
11918
+ * Options call for this endpoint
11919
+ */
11920
+ async yieldVaultDepositOptions(requestParameters, initOverrides) {
11921
+ await this.yieldVaultDepositOptionsRaw(requestParameters, initOverrides);
11922
+ }
11820
11923
  /**
11821
11924
  * Options call for this endpoint
11822
11925
  */