@dynamic-labs/sdk-api-core 0.152.0 → 0.153.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.152.0",
3
+ "version": "0.153.0",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -1072,6 +1072,73 @@ class SDKApi extends runtime.BaseAPI {
1072
1072
  async broadcastWaasTransactionOptions(requestParameters, initOverrides) {
1073
1073
  await this.broadcastWaasTransactionOptionsRaw(requestParameters, initOverrides);
1074
1074
  }
1075
+ /**
1076
+ * 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.
1077
+ * Build Token-2022 confidential-transfer transactions
1078
+ */
1079
+ async buildWaasConfidentialTransactionRaw(requestParameters, initOverrides) {
1080
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
1081
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling buildWaasConfidentialTransaction.');
1082
+ }
1083
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
1084
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling buildWaasConfidentialTransaction.');
1085
+ }
1086
+ if (requestParameters.waasSignConfidentialTransferRequest === null || requestParameters.waasSignConfidentialTransferRequest === undefined) {
1087
+ throw new runtime.RequiredError('waasSignConfidentialTransferRequest', 'Required parameter requestParameters.waasSignConfidentialTransferRequest was null or undefined when calling buildWaasConfidentialTransaction.');
1088
+ }
1089
+ const queryParameters = {};
1090
+ const headerParameters = {};
1091
+ headerParameters['Content-Type'] = 'application/json';
1092
+ if (this.configuration && this.configuration.accessToken) {
1093
+ const token = this.configuration.accessToken;
1094
+ const tokenString = await token("bearerAuth", []);
1095
+ if (tokenString) {
1096
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1097
+ }
1098
+ }
1099
+ const response = await this.request({
1100
+ path: `/sdk/{environmentId}/waas/{walletId}/buildConfidentialTransaction`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
1101
+ method: 'POST',
1102
+ headers: headerParameters,
1103
+ query: queryParameters,
1104
+ body: WaasSignConfidentialTransferRequest.WaasSignConfidentialTransferRequestToJSON(requestParameters.waasSignConfidentialTransferRequest),
1105
+ }, initOverrides);
1106
+ return new runtime.JSONApiResponse(response, (jsonValue) => WaasSignConfidentialTransferResponse.WaasSignConfidentialTransferResponseFromJSON(jsonValue));
1107
+ }
1108
+ /**
1109
+ * 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.
1110
+ * Build Token-2022 confidential-transfer transactions
1111
+ */
1112
+ async buildWaasConfidentialTransaction(requestParameters, initOverrides) {
1113
+ const response = await this.buildWaasConfidentialTransactionRaw(requestParameters, initOverrides);
1114
+ return await response.value();
1115
+ }
1116
+ /**
1117
+ * Options call for this endpoint
1118
+ */
1119
+ async buildWaasConfidentialTransactionOptionsRaw(requestParameters, initOverrides) {
1120
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
1121
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling buildWaasConfidentialTransactionOptions.');
1122
+ }
1123
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
1124
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling buildWaasConfidentialTransactionOptions.');
1125
+ }
1126
+ const queryParameters = {};
1127
+ const headerParameters = {};
1128
+ const response = await this.request({
1129
+ path: `/sdk/{environmentId}/waas/{walletId}/buildConfidentialTransaction`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
1130
+ method: 'OPTIONS',
1131
+ headers: headerParameters,
1132
+ query: queryParameters,
1133
+ }, initOverrides);
1134
+ return new runtime.VoidApiResponse(response);
1135
+ }
1136
+ /**
1137
+ * Options call for this endpoint
1138
+ */
1139
+ async buildWaasConfidentialTransactionOptions(requestParameters, initOverrides) {
1140
+ await this.buildWaasConfidentialTransactionOptionsRaw(requestParameters, initOverrides);
1141
+ }
1075
1142
  /**
1076
1143
  * Deprecated: use POST /sdk/{environmentId}/flow/{flowId}/cancel instead. Cancels a pre-broadcast transaction. Only allowed before the transaction is broadcasted.
1077
1144
  * Cancel a checkout transaction
@@ -11698,6 +11765,73 @@ class SDKApi extends runtime.BaseAPI {
11698
11765
  async signMessageOptions(requestParameters, initOverrides) {
11699
11766
  await this.signMessageOptionsRaw(requestParameters, initOverrides);
11700
11767
  }
11768
+ /**
11769
+ * Second half of the confidential-transfer flow. Provisions one MPC signing room for the operation (Solana v1 packs it into a single transaction) and hands the enclave-built transaction and its `transactionsTag` to the enclave\'s `SignConfidentialTransactions` action, which verifies the tag — rejecting tampered, extra or expired transactions — and joins the room to co-sign. MFA step-up is enforced once for the whole operation. The response returns immediately with the room id; join it with the wallet\'s client share to complete the threshold signature.
11770
+ * Co-sign enclave-built confidential-transfer transactions
11771
+ */
11772
+ async signWaasConfidentialTransactionRaw(requestParameters, initOverrides) {
11773
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
11774
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling signWaasConfidentialTransaction.');
11775
+ }
11776
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
11777
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling signWaasConfidentialTransaction.');
11778
+ }
11779
+ if (requestParameters.waasSignConfidentialTransactionsRequest === null || requestParameters.waasSignConfidentialTransactionsRequest === undefined) {
11780
+ throw new runtime.RequiredError('waasSignConfidentialTransactionsRequest', 'Required parameter requestParameters.waasSignConfidentialTransactionsRequest was null or undefined when calling signWaasConfidentialTransaction.');
11781
+ }
11782
+ const queryParameters = {};
11783
+ const headerParameters = {};
11784
+ headerParameters['Content-Type'] = 'application/json';
11785
+ if (this.configuration && this.configuration.accessToken) {
11786
+ const token = this.configuration.accessToken;
11787
+ const tokenString = await token("bearerAuth", []);
11788
+ if (tokenString) {
11789
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
11790
+ }
11791
+ }
11792
+ const response = await this.request({
11793
+ path: `/sdk/{environmentId}/waas/{walletId}/signConfidentialTransaction`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
11794
+ method: 'POST',
11795
+ headers: headerParameters,
11796
+ query: queryParameters,
11797
+ body: WaasSignConfidentialTransactionsRequest.WaasSignConfidentialTransactionsRequestToJSON(requestParameters.waasSignConfidentialTransactionsRequest),
11798
+ }, initOverrides);
11799
+ return new runtime.JSONApiResponse(response, (jsonValue) => WaasSignConfidentialTransactionsResponse.WaasSignConfidentialTransactionsResponseFromJSON(jsonValue));
11800
+ }
11801
+ /**
11802
+ * Second half of the confidential-transfer flow. Provisions one MPC signing room for the operation (Solana v1 packs it into a single transaction) and hands the enclave-built transaction and its `transactionsTag` to the enclave\'s `SignConfidentialTransactions` action, which verifies the tag — rejecting tampered, extra or expired transactions — and joins the room to co-sign. MFA step-up is enforced once for the whole operation. The response returns immediately with the room id; join it with the wallet\'s client share to complete the threshold signature.
11803
+ * Co-sign enclave-built confidential-transfer transactions
11804
+ */
11805
+ async signWaasConfidentialTransaction(requestParameters, initOverrides) {
11806
+ const response = await this.signWaasConfidentialTransactionRaw(requestParameters, initOverrides);
11807
+ return await response.value();
11808
+ }
11809
+ /**
11810
+ * Options call for this endpoint
11811
+ */
11812
+ async signWaasConfidentialTransactionOptionsRaw(requestParameters, initOverrides) {
11813
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
11814
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling signWaasConfidentialTransactionOptions.');
11815
+ }
11816
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
11817
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling signWaasConfidentialTransactionOptions.');
11818
+ }
11819
+ const queryParameters = {};
11820
+ const headerParameters = {};
11821
+ const response = await this.request({
11822
+ path: `/sdk/{environmentId}/waas/{walletId}/signConfidentialTransaction`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
11823
+ method: 'OPTIONS',
11824
+ headers: headerParameters,
11825
+ query: queryParameters,
11826
+ }, initOverrides);
11827
+ return new runtime.VoidApiResponse(response);
11828
+ }
11829
+ /**
11830
+ * Options call for this endpoint
11831
+ */
11832
+ async signWaasConfidentialTransactionOptions(requestParameters, initOverrides) {
11833
+ await this.signWaasConfidentialTransactionOptionsRaw(requestParameters, initOverrides);
11834
+ }
11701
11835
  /**
11702
11836
  * Second half of the confidential-transfer flow. Provisions one MPC signing room for the operation (Solana v1 packs it into a single transaction) and hands the enclave-built transaction and its `transactionsTag` to the enclave\'s `SignConfidentialTransactions` action, which verifies the tag — rejecting tampered, extra or expired transactions — and joins the room to co-sign. MFA step-up is enforced once for the whole operation. The response returns immediately with the room id; join it with the wallet\'s client share to complete the threshold signature.
11703
11837
  * Co-sign enclave-built confidential-transfer transactions