@dynamic-labs/sdk-api-core 0.152.0 → 0.154.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 (38) hide show
  1. package/package.json +1 -1
  2. package/src/apis/SDKApi.cjs +196 -0
  3. package/src/apis/SDKApi.cjs.map +1 -1
  4. package/src/apis/SDKApi.d.ts +82 -1
  5. package/src/apis/SDKApi.js +196 -0
  6. package/src/apis/SDKApi.js.map +1 -1
  7. package/src/index.cjs +20 -0
  8. package/src/index.cjs.map +1 -1
  9. package/src/index.js +5 -0
  10. package/src/index.js.map +1 -1
  11. package/src/models/FlowSourceTokenOption.cjs +39 -0
  12. package/src/models/FlowSourceTokenOption.cjs.map +1 -0
  13. package/src/models/FlowSourceTokenOption.d.ts +42 -0
  14. package/src/models/FlowSourceTokenOption.js +33 -0
  15. package/src/models/FlowSourceTokenOption.js.map +1 -0
  16. package/src/models/FlowSourceTokenOptionChain.cjs +36 -0
  17. package/src/models/FlowSourceTokenOptionChain.cjs.map +1 -0
  18. package/src/models/FlowSourceTokenOptionChain.d.ts +34 -0
  19. package/src/models/FlowSourceTokenOptionChain.js +30 -0
  20. package/src/models/FlowSourceTokenOptionChain.js.map +1 -0
  21. package/src/models/FlowSourceTokenOptionNetwork.cjs +37 -0
  22. package/src/models/FlowSourceTokenOptionNetwork.cjs.map +1 -0
  23. package/src/models/FlowSourceTokenOptionNetwork.d.ts +39 -0
  24. package/src/models/FlowSourceTokenOptionNetwork.js +31 -0
  25. package/src/models/FlowSourceTokenOptionNetwork.js.map +1 -0
  26. package/src/models/FlowSourceTokenOptionToken.cjs +39 -0
  27. package/src/models/FlowSourceTokenOptionToken.cjs.map +1 -0
  28. package/src/models/FlowSourceTokenOptionToken.d.ts +45 -0
  29. package/src/models/FlowSourceTokenOptionToken.js +33 -0
  30. package/src/models/FlowSourceTokenOptionToken.js.map +1 -0
  31. package/src/models/FlowSourceTokenOptionsResponse.cjs +33 -0
  32. package/src/models/FlowSourceTokenOptionsResponse.cjs.map +1 -0
  33. package/src/models/FlowSourceTokenOptionsResponse.d.ts +28 -0
  34. package/src/models/FlowSourceTokenOptionsResponse.js +27 -0
  35. package/src/models/FlowSourceTokenOptionsResponse.js.map +1 -0
  36. package/src/models/index.d.ts +5 -0
  37. package/src/version.cjs +1 -1
  38. 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.152.0",
3
+ "version": "0.154.0",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -155,6 +155,7 @@ var FlowRecordBroadcastRequest = require('../models/FlowRecordBroadcastRequest.c
155
155
  require('../models/FlowRiskStateEnum.cjs');
156
156
  require('../models/FlowSettlementStateEnum.cjs');
157
157
  var FlowSourceResponse = require('../models/FlowSourceResponse.cjs');
158
+ var FlowSourceTokenOptionsResponse = require('../models/FlowSourceTokenOptionsResponse.cjs');
158
159
  require('../models/OnrampProviders.cjs');
159
160
  var GeneratedTokenResponse = require('../models/GeneratedTokenResponse.cjs');
160
161
  var GetAvailableEVMGaslessRelayerResponse = require('../models/GetAvailableEVMGaslessRelayerResponse.cjs');
@@ -1072,6 +1073,73 @@ class SDKApi extends runtime.BaseAPI {
1072
1073
  async broadcastWaasTransactionOptions(requestParameters, initOverrides) {
1073
1074
  await this.broadcastWaasTransactionOptionsRaw(requestParameters, initOverrides);
1074
1075
  }
1076
+ /**
1077
+ * 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.
1078
+ * Build Token-2022 confidential-transfer transactions
1079
+ */
1080
+ async buildWaasConfidentialTransactionRaw(requestParameters, initOverrides) {
1081
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
1082
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling buildWaasConfidentialTransaction.');
1083
+ }
1084
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
1085
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling buildWaasConfidentialTransaction.');
1086
+ }
1087
+ if (requestParameters.waasSignConfidentialTransferRequest === null || requestParameters.waasSignConfidentialTransferRequest === undefined) {
1088
+ throw new runtime.RequiredError('waasSignConfidentialTransferRequest', 'Required parameter requestParameters.waasSignConfidentialTransferRequest was null or undefined when calling buildWaasConfidentialTransaction.');
1089
+ }
1090
+ const queryParameters = {};
1091
+ const headerParameters = {};
1092
+ headerParameters['Content-Type'] = 'application/json';
1093
+ if (this.configuration && this.configuration.accessToken) {
1094
+ const token = this.configuration.accessToken;
1095
+ const tokenString = await token("bearerAuth", []);
1096
+ if (tokenString) {
1097
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1098
+ }
1099
+ }
1100
+ const response = await this.request({
1101
+ path: `/sdk/{environmentId}/waas/{walletId}/buildConfidentialTransaction`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
1102
+ method: 'POST',
1103
+ headers: headerParameters,
1104
+ query: queryParameters,
1105
+ body: WaasSignConfidentialTransferRequest.WaasSignConfidentialTransferRequestToJSON(requestParameters.waasSignConfidentialTransferRequest),
1106
+ }, initOverrides);
1107
+ return new runtime.JSONApiResponse(response, (jsonValue) => WaasSignConfidentialTransferResponse.WaasSignConfidentialTransferResponseFromJSON(jsonValue));
1108
+ }
1109
+ /**
1110
+ * 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.
1111
+ * Build Token-2022 confidential-transfer transactions
1112
+ */
1113
+ async buildWaasConfidentialTransaction(requestParameters, initOverrides) {
1114
+ const response = await this.buildWaasConfidentialTransactionRaw(requestParameters, initOverrides);
1115
+ return await response.value();
1116
+ }
1117
+ /**
1118
+ * Options call for this endpoint
1119
+ */
1120
+ async buildWaasConfidentialTransactionOptionsRaw(requestParameters, initOverrides) {
1121
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
1122
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling buildWaasConfidentialTransactionOptions.');
1123
+ }
1124
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
1125
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling buildWaasConfidentialTransactionOptions.');
1126
+ }
1127
+ const queryParameters = {};
1128
+ const headerParameters = {};
1129
+ const response = await this.request({
1130
+ path: `/sdk/{environmentId}/waas/{walletId}/buildConfidentialTransaction`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
1131
+ method: 'OPTIONS',
1132
+ headers: headerParameters,
1133
+ query: queryParameters,
1134
+ }, initOverrides);
1135
+ return new runtime.VoidApiResponse(response);
1136
+ }
1137
+ /**
1138
+ * Options call for this endpoint
1139
+ */
1140
+ async buildWaasConfidentialTransactionOptions(requestParameters, initOverrides) {
1141
+ await this.buildWaasConfidentialTransactionOptionsRaw(requestParameters, initOverrides);
1142
+ }
1075
1143
  /**
1076
1144
  * Deprecated: use POST /sdk/{environmentId}/flow/{flowId}/cancel instead. Cancels a pre-broadcast transaction. Only allowed before the transaction is broadcasted.
1077
1145
  * Cancel a checkout transaction
@@ -4771,6 +4839,67 @@ class SDKApi extends runtime.BaseAPI {
4771
4839
  async getFlowQuoteOptions(requestParameters, initOverrides) {
4772
4840
  await this.getFlowQuoteOptionsRaw(requestParameters, initOverrides);
4773
4841
  }
4842
+ /**
4843
+ * Returns the supported tokens for deposit address source, for a given flow, grouped by the network they are sent on. Only the deposit_address source type is supported.
4844
+ * Get the supported tokens for a flow source
4845
+ */
4846
+ async getFlowSourceTokenOptionsRaw(requestParameters, initOverrides) {
4847
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
4848
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling getFlowSourceTokenOptions.');
4849
+ }
4850
+ if (requestParameters.flowId === null || requestParameters.flowId === undefined) {
4851
+ throw new runtime.RequiredError('flowId', 'Required parameter requestParameters.flowId was null or undefined when calling getFlowSourceTokenOptions.');
4852
+ }
4853
+ if (requestParameters.sourceType === null || requestParameters.sourceType === undefined) {
4854
+ throw new runtime.RequiredError('sourceType', 'Required parameter requestParameters.sourceType was null or undefined when calling getFlowSourceTokenOptions.');
4855
+ }
4856
+ const queryParameters = {};
4857
+ if (requestParameters.sourceType !== undefined) {
4858
+ queryParameters['sourceType'] = requestParameters.sourceType;
4859
+ }
4860
+ const headerParameters = {};
4861
+ const response = await this.request({
4862
+ path: `/sdk/{environmentId}/flow/{flowId}/sourceTokenOptions`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"flowId"}}`, encodeURIComponent(String(requestParameters.flowId))),
4863
+ method: 'GET',
4864
+ headers: headerParameters,
4865
+ query: queryParameters,
4866
+ }, initOverrides);
4867
+ return new runtime.JSONApiResponse(response, (jsonValue) => FlowSourceTokenOptionsResponse.FlowSourceTokenOptionsResponseFromJSON(jsonValue));
4868
+ }
4869
+ /**
4870
+ * Returns the supported tokens for deposit address source, for a given flow, grouped by the network they are sent on. Only the deposit_address source type is supported.
4871
+ * Get the supported tokens for a flow source
4872
+ */
4873
+ async getFlowSourceTokenOptions(requestParameters, initOverrides) {
4874
+ const response = await this.getFlowSourceTokenOptionsRaw(requestParameters, initOverrides);
4875
+ return await response.value();
4876
+ }
4877
+ /**
4878
+ * Options call for this endpoint
4879
+ */
4880
+ async getFlowSourceTokenOptionsOptionsRaw(requestParameters, initOverrides) {
4881
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
4882
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling getFlowSourceTokenOptionsOptions.');
4883
+ }
4884
+ if (requestParameters.flowId === null || requestParameters.flowId === undefined) {
4885
+ throw new runtime.RequiredError('flowId', 'Required parameter requestParameters.flowId was null or undefined when calling getFlowSourceTokenOptionsOptions.');
4886
+ }
4887
+ const queryParameters = {};
4888
+ const headerParameters = {};
4889
+ const response = await this.request({
4890
+ path: `/sdk/{environmentId}/flow/{flowId}/sourceTokenOptions`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"flowId"}}`, encodeURIComponent(String(requestParameters.flowId))),
4891
+ method: 'OPTIONS',
4892
+ headers: headerParameters,
4893
+ query: queryParameters,
4894
+ }, initOverrides);
4895
+ return new runtime.VoidApiResponse(response);
4896
+ }
4897
+ /**
4898
+ * Options call for this endpoint
4899
+ */
4900
+ async getFlowSourceTokenOptionsOptions(requestParameters, initOverrides) {
4901
+ await this.getFlowSourceTokenOptionsOptionsRaw(requestParameters, initOverrides);
4902
+ }
4774
4903
  /**
4775
4904
  * Returns the global wallet settings configured for the specified environment.
4776
4905
  * Get the global wallet settings for the environment
@@ -11698,6 +11827,73 @@ class SDKApi extends runtime.BaseAPI {
11698
11827
  async signMessageOptions(requestParameters, initOverrides) {
11699
11828
  await this.signMessageOptionsRaw(requestParameters, initOverrides);
11700
11829
  }
11830
+ /**
11831
+ * 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.
11832
+ * Co-sign enclave-built confidential-transfer transactions
11833
+ */
11834
+ async signWaasConfidentialTransactionRaw(requestParameters, initOverrides) {
11835
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
11836
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling signWaasConfidentialTransaction.');
11837
+ }
11838
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
11839
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling signWaasConfidentialTransaction.');
11840
+ }
11841
+ if (requestParameters.waasSignConfidentialTransactionsRequest === null || requestParameters.waasSignConfidentialTransactionsRequest === undefined) {
11842
+ throw new runtime.RequiredError('waasSignConfidentialTransactionsRequest', 'Required parameter requestParameters.waasSignConfidentialTransactionsRequest was null or undefined when calling signWaasConfidentialTransaction.');
11843
+ }
11844
+ const queryParameters = {};
11845
+ const headerParameters = {};
11846
+ headerParameters['Content-Type'] = 'application/json';
11847
+ if (this.configuration && this.configuration.accessToken) {
11848
+ const token = this.configuration.accessToken;
11849
+ const tokenString = await token("bearerAuth", []);
11850
+ if (tokenString) {
11851
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
11852
+ }
11853
+ }
11854
+ const response = await this.request({
11855
+ path: `/sdk/{environmentId}/waas/{walletId}/signConfidentialTransaction`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
11856
+ method: 'POST',
11857
+ headers: headerParameters,
11858
+ query: queryParameters,
11859
+ body: WaasSignConfidentialTransactionsRequest.WaasSignConfidentialTransactionsRequestToJSON(requestParameters.waasSignConfidentialTransactionsRequest),
11860
+ }, initOverrides);
11861
+ return new runtime.JSONApiResponse(response, (jsonValue) => WaasSignConfidentialTransactionsResponse.WaasSignConfidentialTransactionsResponseFromJSON(jsonValue));
11862
+ }
11863
+ /**
11864
+ * 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.
11865
+ * Co-sign enclave-built confidential-transfer transactions
11866
+ */
11867
+ async signWaasConfidentialTransaction(requestParameters, initOverrides) {
11868
+ const response = await this.signWaasConfidentialTransactionRaw(requestParameters, initOverrides);
11869
+ return await response.value();
11870
+ }
11871
+ /**
11872
+ * Options call for this endpoint
11873
+ */
11874
+ async signWaasConfidentialTransactionOptionsRaw(requestParameters, initOverrides) {
11875
+ if (requestParameters.environmentId === null || requestParameters.environmentId === undefined) {
11876
+ throw new runtime.RequiredError('environmentId', 'Required parameter requestParameters.environmentId was null or undefined when calling signWaasConfidentialTransactionOptions.');
11877
+ }
11878
+ if (requestParameters.walletId === null || requestParameters.walletId === undefined) {
11879
+ throw new runtime.RequiredError('walletId', 'Required parameter requestParameters.walletId was null or undefined when calling signWaasConfidentialTransactionOptions.');
11880
+ }
11881
+ const queryParameters = {};
11882
+ const headerParameters = {};
11883
+ const response = await this.request({
11884
+ path: `/sdk/{environmentId}/waas/{walletId}/signConfidentialTransaction`.replace(`{${"environmentId"}}`, encodeURIComponent(String(requestParameters.environmentId))).replace(`{${"walletId"}}`, encodeURIComponent(String(requestParameters.walletId))),
11885
+ method: 'OPTIONS',
11886
+ headers: headerParameters,
11887
+ query: queryParameters,
11888
+ }, initOverrides);
11889
+ return new runtime.VoidApiResponse(response);
11890
+ }
11891
+ /**
11892
+ * Options call for this endpoint
11893
+ */
11894
+ async signWaasConfidentialTransactionOptions(requestParameters, initOverrides) {
11895
+ await this.signWaasConfidentialTransactionOptionsRaw(requestParameters, initOverrides);
11896
+ }
11701
11897
  /**
11702
11898
  * 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
11899
  * Co-sign enclave-built confidential-transfer transactions