@dynamic-labs/sdk-api-core 0.148.0 → 0.149.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 (30) hide show
  1. package/package.json +1 -1
  2. package/src/apis/SDKApi.cjs +73 -4
  3. package/src/apis/SDKApi.cjs.map +1 -1
  4. package/src/apis/SDKApi.d.ts +32 -5
  5. package/src/apis/SDKApi.js +73 -4
  6. package/src/apis/SDKApi.js.map +1 -1
  7. package/src/index.cjs +8 -0
  8. package/src/index.cjs.map +1 -1
  9. package/src/index.js +2 -0
  10. package/src/index.js.map +1 -1
  11. package/src/models/WaasSignConfidentialTransactionsRequest.cjs +39 -0
  12. package/src/models/WaasSignConfidentialTransactionsRequest.cjs.map +1 -0
  13. package/src/models/WaasSignConfidentialTransactionsRequest.d.ts +45 -0
  14. package/src/models/WaasSignConfidentialTransactionsRequest.js +33 -0
  15. package/src/models/WaasSignConfidentialTransactionsRequest.js.map +1 -0
  16. package/src/models/WaasSignConfidentialTransactionsResponse.cjs +43 -0
  17. package/src/models/WaasSignConfidentialTransactionsResponse.cjs.map +1 -0
  18. package/src/models/WaasSignConfidentialTransactionsResponse.d.ts +27 -0
  19. package/src/models/WaasSignConfidentialTransactionsResponse.js +37 -0
  20. package/src/models/WaasSignConfidentialTransactionsResponse.js.map +1 -0
  21. package/src/models/WaasSignConfidentialTransferRequest.d.ts +1 -1
  22. package/src/models/WaasSignConfidentialTransferResponse.cjs +2 -2
  23. package/src/models/WaasSignConfidentialTransferResponse.cjs.map +1 -1
  24. package/src/models/WaasSignConfidentialTransferResponse.d.ts +4 -4
  25. package/src/models/WaasSignConfidentialTransferResponse.js +2 -2
  26. package/src/models/WaasSignConfidentialTransferResponse.js.map +1 -1
  27. package/src/models/WaasSvmConfidentialBalanceRequest.d.ts +1 -1
  28. package/src/models/index.d.ts +2 -0
  29. package/src/version.cjs +1 -1
  30. package/src/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-api-core",
3
- "version": "0.148.0",
3
+ "version": "0.149.0",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -341,6 +341,8 @@ require('../models/WaasPolicyLayerTranslationWarning.cjs');
341
341
  var WaasPolicyLayerUpdateRequest = require('../models/WaasPolicyLayerUpdateRequest.cjs');
342
342
  require('../models/WaasReshareIntent.cjs');
343
343
  var WaasSignAndBroadcastRequest = require('../models/WaasSignAndBroadcastRequest.cjs');
344
+ var WaasSignConfidentialTransactionsRequest = require('../models/WaasSignConfidentialTransactionsRequest.cjs');
345
+ var WaasSignConfidentialTransactionsResponse = require('../models/WaasSignConfidentialTransactionsResponse.cjs');
344
346
  var WaasSignConfidentialTransferRequest = require('../models/WaasSignConfidentialTransferRequest.cjs');
345
347
  var WaasSignConfidentialTransferResponse = require('../models/WaasSignConfidentialTransferResponse.cjs');
346
348
  var WaasSignerPolicyLayerUpdateRequest = require('../models/WaasSignerPolicyLayerUpdateRequest.cjs');
@@ -11616,8 +11618,75 @@ class SDKApi extends runtime.BaseAPI {
11616
11618
  await this.signMessageOptionsRaw(requestParameters, initOverrides);
11617
11619
  }
11618
11620
  /**
11619
- * Decrypts the wallet\'s stored confidential seed inside the enclave, generates the zero-knowledge proofs the requested operation requires, builds the Token-2022 confidential-transfer instructions and returns the MPC-signed transactions in broadcast order, ready to submit. The enclave is offline: the caller supplies the token accounts\' raw on-chain state (`accountState`, `destinationAccountState`), the cluster rent constant (`lamportsPerByte`) and a fresh `recentBlockhash`/`lastValidBlockHeight`. Confidential amounts are opaque on-chain — policy screens the operation, mint and addresses but cannot evaluate the transferred amount.
11620
- * Build and sign a Token-2022 confidential transfer
11621
+ * Second half of the confidential-transfer flow. Provisions one MPC signing room per transaction and hands the enclave-built transactions and their `transactionsTag` to the enclave\'s `SignConfidentialTransactions` action, which verifies the tag — rejecting tampered, reordered, extra or expired transactions — and joins each room to co-sign. MFA step-up is enforced once for the whole operation, not per transaction. The response returns immediately with the room ids; join each room with the wallet\'s client share to complete the threshold signature for each transaction.
11622
+ * Co-sign enclave-built confidential-transfer transactions
11623
+ */
11624
+ async signWaasConfidentialTransactionsRaw(requestParameters, initOverrides) {
11625
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
11626
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling signWaasConfidentialTransactions.');
11627
+ }
11628
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
11629
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling signWaasConfidentialTransactions.');
11630
+ }
11631
+ if (requestParameters.waasSignConfidentialTransactionsRequest === null || requestParameters.waasSignConfidentialTransactionsRequest === undefined) {
11632
+ throw new runtime.RequiredError('waasSignConfidentialTransactionsRequest', 'Required parameter requestParameters.waasSignConfidentialTransactionsRequest was null or undefined when calling signWaasConfidentialTransactions.');
11633
+ }
11634
+ const queryParameters = {};
11635
+ const headerParameters = {};
11636
+ headerParameters['Content-Type'] = 'application/json';
11637
+ if (this.configuration && this.configuration.accessToken) {
11638
+ const token = this.configuration.accessToken;
11639
+ const tokenString = await token("bearerAuth", []);
11640
+ if (tokenString) {
11641
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
11642
+ }
11643
+ }
11644
+ const response = await this.request({
11645
+ path: `/sdk/{environmentId}/waas/{walletId}/signConfidentialTransactions`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
11646
+ method: 'POST',
11647
+ headers: headerParameters,
11648
+ query: queryParameters,
11649
+ body: WaasSignConfidentialTransactionsRequest.WaasSignConfidentialTransactionsRequestToJSON(requestParameters.waasSignConfidentialTransactionsRequest),
11650
+ }, initOverrides);
11651
+ return new runtime.JSONApiResponse(response, (jsonValue) => WaasSignConfidentialTransactionsResponse.WaasSignConfidentialTransactionsResponseFromJSON(jsonValue));
11652
+ }
11653
+ /**
11654
+ * Second half of the confidential-transfer flow. Provisions one MPC signing room per transaction and hands the enclave-built transactions and their `transactionsTag` to the enclave\'s `SignConfidentialTransactions` action, which verifies the tag — rejecting tampered, reordered, extra or expired transactions — and joins each room to co-sign. MFA step-up is enforced once for the whole operation, not per transaction. The response returns immediately with the room ids; join each room with the wallet\'s client share to complete the threshold signature for each transaction.
11655
+ * Co-sign enclave-built confidential-transfer transactions
11656
+ */
11657
+ async signWaasConfidentialTransactions(requestParameters, initOverrides) {
11658
+ const response = await this.signWaasConfidentialTransactionsRaw(requestParameters, initOverrides);
11659
+ return await response.value();
11660
+ }
11661
+ /**
11662
+ * Options call for this endpoint
11663
+ */
11664
+ async signWaasConfidentialTransactionsOptionsRaw(requestParameters, initOverrides) {
11665
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
11666
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling signWaasConfidentialTransactionsOptions.');
11667
+ }
11668
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
11669
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling signWaasConfidentialTransactionsOptions.');
11670
+ }
11671
+ const queryParameters = {};
11672
+ const headerParameters = {};
11673
+ const response = await this.request({
11674
+ path: `/sdk/{environmentId}/waas/{walletId}/signConfidentialTransactions`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
11675
+ method: 'OPTIONS',
11676
+ headers: headerParameters,
11677
+ query: queryParameters,
11678
+ }, initOverrides);
11679
+ return new runtime.VoidApiResponse(response);
11680
+ }
11681
+ /**
11682
+ * Options call for this endpoint
11683
+ */
11684
+ async signWaasConfidentialTransactionsOptions(requestParameters, initOverrides) {
11685
+ await this.signWaasConfidentialTransactionsOptionsRaw(requestParameters, initOverrides);
11686
+ }
11687
+ /**
11688
+ * Decrypts the wallet\'s stored confidential seed inside the enclave, generates the zero-knowledge proofs the requested operation requires, builds the Token-2022 confidential-transfer instructions and returns the transactions unsigned (the wallet\'s signature slot is zeroed) in broadcast order, plus a `transactionsTag` binding them. Signing is a separate step: submit the transactions and tag unchanged to `POST /waas/{walletId}/signConfidentialTransactions`, which co-signs inside caller-visible MPC rooms. The enclave is offline: the caller supplies the token accounts\' raw on-chain state (`accountState`, `destinationAccountState`), the cluster rent constant (`lamportsPerByte`) and a fresh `recentBlockhash`/`lastValidBlockHeight`. Confidential amounts are opaque on-chain — policy screens the operation, mint and addresses but cannot evaluate the transferred amount.
11689
+ * Build Token-2022 confidential-transfer transactions
11621
11690
  */
11622
11691
  async signWaasConfidentialTransferRaw(requestParameters, initOverrides) {
11623
11692
  if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
@@ -11649,8 +11718,8 @@ class SDKApi extends runtime.BaseAPI {
11649
11718
  return new runtime.JSONApiResponse(response, (jsonValue) => WaasSignConfidentialTransferResponse.WaasSignConfidentialTransferResponseFromJSON(jsonValue));
11650
11719
  }
11651
11720
  /**
11652
- * Decrypts the wallet\'s stored confidential seed inside the enclave, generates the zero-knowledge proofs the requested operation requires, builds the Token-2022 confidential-transfer instructions and returns the MPC-signed transactions in broadcast order, ready to submit. The enclave is offline: the caller supplies the token accounts\' raw on-chain state (`accountState`, `destinationAccountState`), the cluster rent constant (`lamportsPerByte`) and a fresh `recentBlockhash`/`lastValidBlockHeight`. Confidential amounts are opaque on-chain — policy screens the operation, mint and addresses but cannot evaluate the transferred amount.
11653
- * Build and sign a Token-2022 confidential transfer
11721
+ * Decrypts the wallet\'s stored confidential seed inside the enclave, generates the zero-knowledge proofs the requested operation requires, builds the Token-2022 confidential-transfer instructions and returns the transactions unsigned (the wallet\'s signature slot is zeroed) in broadcast order, plus a `transactionsTag` binding them. Signing is a separate step: submit the transactions and tag unchanged to `POST /waas/{walletId}/signConfidentialTransactions`, which co-signs inside caller-visible MPC rooms. The enclave is offline: the caller supplies the token accounts\' raw on-chain state (`accountState`, `destinationAccountState`), the cluster rent constant (`lamportsPerByte`) and a fresh `recentBlockhash`/`lastValidBlockHeight`. Confidential amounts are opaque on-chain — policy screens the operation, mint and addresses but cannot evaluate the transferred amount.
11722
+ * Build Token-2022 confidential-transfer transactions
11654
11723
  */
11655
11724
  async signWaasConfidentialTransfer(requestParameters, initOverrides) {
11656
11725
  const response = await this.signWaasConfidentialTransferRaw(requestParameters, initOverrides);