@fairmint/canton-node-sdk 0.0.238 → 0.0.239

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 (163) hide show
  1. package/build/src/clients/ledger-json-api/LedgerJsonApiClient.generated.d.ts +51 -51
  2. package/build/src/clients/ledger-json-api/LedgerJsonApiClient.generated.d.ts.map +1 -1
  3. package/build/src/clients/ledger-json-api/LedgerJsonApiClient.generated.js +51 -51
  4. package/build/src/clients/ledger-json-api/LedgerJsonApiClient.generated.js.map +1 -1
  5. package/build/src/clients/ledger-json-api/operations/v2/commands/async/submit.d.ts +26 -26
  6. package/build/src/clients/ledger-json-api/operations/v2/commands/completions.d.ts +1 -2
  7. package/build/src/clients/ledger-json-api/operations/v2/commands/completions.d.ts.map +1 -1
  8. package/build/src/clients/ledger-json-api/operations/v2/commands/completions.js +2 -2
  9. package/build/src/clients/ledger-json-api/operations/v2/commands/completions.js.map +1 -1
  10. package/build/src/clients/ledger-json-api/operations/v2/commands/submit-and-wait-for-transaction.d.ts +26 -26
  11. package/build/src/clients/ledger-json-api/operations/v2/events/get-events-by-contract-id.d.ts.map +1 -1
  12. package/build/src/clients/ledger-json-api/operations/v2/events/get-events-by-contract-id.js +1 -0
  13. package/build/src/clients/ledger-json-api/operations/v2/events/get-events-by-contract-id.js.map +1 -1
  14. package/build/src/clients/ledger-json-api/operations/v2/interactive-submission/get-preferred-packages.d.ts.map +1 -1
  15. package/build/src/clients/ledger-json-api/operations/v2/interactive-submission/get-preferred-packages.js +1 -0
  16. package/build/src/clients/ledger-json-api/operations/v2/interactive-submission/get-preferred-packages.js.map +1 -1
  17. package/build/src/clients/ledger-json-api/operations/v2/interactive-submission/prepare.d.ts.map +1 -1
  18. package/build/src/clients/ledger-json-api/operations/v2/interactive-submission/prepare.js +1 -0
  19. package/build/src/clients/ledger-json-api/operations/v2/interactive-submission/prepare.js.map +1 -1
  20. package/build/src/clients/ledger-json-api/operations/v2/parties/aggregate-parties.d.ts +2 -2
  21. package/build/src/clients/ledger-json-api/operations/v2/parties/aggregate-parties.d.ts.map +1 -1
  22. package/build/src/clients/ledger-json-api/operations/v2/parties/aggregate-parties.js +25 -8
  23. package/build/src/clients/ledger-json-api/operations/v2/parties/aggregate-parties.js.map +1 -1
  24. package/build/src/clients/ledger-json-api/operations/v2/parties/external/generate-topology.d.ts.map +1 -1
  25. package/build/src/clients/ledger-json-api/operations/v2/parties/external/generate-topology.js +1 -0
  26. package/build/src/clients/ledger-json-api/operations/v2/parties/external/generate-topology.js.map +1 -1
  27. package/build/src/clients/ledger-json-api/operations/v2/parties/get.d.ts +2 -2
  28. package/build/src/clients/ledger-json-api/operations/v2/parties/get.d.ts.map +1 -1
  29. package/build/src/clients/ledger-json-api/operations/v2/parties/get.js +3 -2
  30. package/build/src/clients/ledger-json-api/operations/v2/parties/get.js.map +1 -1
  31. package/build/src/clients/ledger-json-api/operations/v2/parties/list.d.ts +2 -2
  32. package/build/src/clients/ledger-json-api/operations/v2/parties/list.d.ts.map +1 -1
  33. package/build/src/clients/ledger-json-api/operations/v2/parties/list.js +3 -2
  34. package/build/src/clients/ledger-json-api/operations/v2/parties/list.js.map +1 -1
  35. package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-by-id.d.ts.map +1 -1
  36. package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-by-id.js +1 -0
  37. package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-by-id.js.map +1 -1
  38. package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-by-offset.d.ts.map +1 -1
  39. package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-by-offset.js +1 -0
  40. package/build/src/clients/ledger-json-api/operations/v2/updates/get-transaction-by-offset.js.map +1 -1
  41. package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.d.ts.map +1 -1
  42. package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.js +1 -0
  43. package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-id.js.map +1 -1
  44. package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-offset.d.ts.map +1 -1
  45. package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-offset.js +1 -0
  46. package/build/src/clients/ledger-json-api/operations/v2/updates/get-update-by-offset.js.map +1 -1
  47. package/build/src/clients/scan-api/ScanApiClient.d.ts +7 -6
  48. package/build/src/clients/scan-api/ScanApiClient.d.ts.map +1 -1
  49. package/build/src/clients/scan-api/ScanApiClient.generated.d.ts +62 -62
  50. package/build/src/clients/scan-api/ScanApiClient.generated.d.ts.map +1 -1
  51. package/build/src/clients/scan-api/ScanApiClient.generated.js +62 -62
  52. package/build/src/clients/scan-api/ScanApiClient.generated.js.map +1 -1
  53. package/build/src/clients/scan-api/ScanApiClient.js +75 -35
  54. package/build/src/clients/scan-api/ScanApiClient.js.map +1 -1
  55. package/build/src/clients/scan-api/operations/v0/registry/allocation-instruction/v1/get-allocation-factory-from-registry.d.ts.map +1 -1
  56. package/build/src/clients/scan-api/operations/v0/registry/allocation-instruction/v1/get-allocation-factory-from-registry.js +1 -0
  57. package/build/src/clients/scan-api/operations/v0/registry/allocation-instruction/v1/get-allocation-factory-from-registry.js.map +1 -1
  58. package/build/src/clients/scan-api/operations/v0/scan.d.ts.map +1 -1
  59. package/build/src/clients/scan-api/operations/v0/scan.js +17 -0
  60. package/build/src/clients/scan-api/operations/v0/scan.js.map +1 -1
  61. package/build/src/clients/validator-api/ValidatorApiClient.generated.d.ts +61 -61
  62. package/build/src/clients/validator-api/ValidatorApiClient.generated.d.ts.map +1 -1
  63. package/build/src/clients/validator-api/ValidatorApiClient.generated.js +61 -61
  64. package/build/src/clients/validator-api/ValidatorApiClient.generated.js.map +1 -1
  65. package/build/src/clients/validator-api/operations/v0/admin/generate-external-party-topology.d.ts.map +1 -1
  66. package/build/src/clients/validator-api/operations/v0/admin/generate-external-party-topology.js +1 -0
  67. package/build/src/clients/validator-api/operations/v0/admin/generate-external-party-topology.js.map +1 -1
  68. package/build/src/clients/validator-api/operations/v0/admin/prepare-accept-external-party-setup-proposal.d.ts.map +1 -1
  69. package/build/src/clients/validator-api/operations/v0/admin/prepare-accept-external-party-setup-proposal.js +1 -0
  70. package/build/src/clients/validator-api/operations/v0/admin/prepare-accept-external-party-setup-proposal.js.map +1 -1
  71. package/build/src/clients/validator-api/operations/v0/admin/prepare-transfer-preapproval-send.d.ts.map +1 -1
  72. package/build/src/clients/validator-api/operations/v0/admin/prepare-transfer-preapproval-send.js +1 -0
  73. package/build/src/clients/validator-api/operations/v0/admin/prepare-transfer-preapproval-send.js.map +1 -1
  74. package/build/src/clients/validator-api/operations/v0/ans/get-rules.d.ts.map +1 -1
  75. package/build/src/clients/validator-api/operations/v0/ans/get-rules.js +1 -0
  76. package/build/src/clients/validator-api/operations/v0/ans/get-rules.js.map +1 -1
  77. package/build/src/clients/validator-api/operations/v0/scan-proxy/get-member-traffic-status.d.ts +2 -1
  78. package/build/src/clients/validator-api/operations/v0/scan-proxy/get-member-traffic-status.d.ts.map +1 -1
  79. package/build/src/clients/validator-api/operations/v0/scan-proxy/get-member-traffic-status.js +47 -9
  80. package/build/src/clients/validator-api/operations/v0/scan-proxy/get-member-traffic-status.js.map +1 -1
  81. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocation-instruction/v1/get-allocation-factory.d.ts.map +1 -1
  82. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocation-instruction/v1/get-allocation-factory.js +1 -0
  83. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocation-instruction/v1/get-allocation-factory.js.map +1 -1
  84. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-cancel-context.d.ts.map +1 -1
  85. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-cancel-context.js +1 -0
  86. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-cancel-context.js.map +1 -1
  87. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-transfer-context.d.ts.map +1 -1
  88. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-transfer-context.js +1 -0
  89. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-transfer-context.js.map +1 -1
  90. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-withdraw-context.d.ts.map +1 -1
  91. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-withdraw-context.js +1 -0
  92. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/allocations/v1/get-allocation-withdraw-context.js.map +1 -1
  93. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-factory.d.ts.map +1 -1
  94. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-factory.js +1 -0
  95. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-factory.js.map +1 -1
  96. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-accept-context.d.ts.map +1 -1
  97. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-accept-context.js +1 -0
  98. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-accept-context.js.map +1 -1
  99. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-reject-context.d.ts.map +1 -1
  100. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-reject-context.js +1 -0
  101. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-reject-context.js.map +1 -1
  102. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-withdraw-context.d.ts.map +1 -1
  103. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-withdraw-context.js +1 -0
  104. package/build/src/clients/validator-api/operations/v0/scan-proxy/registry/transfer-instruction/v1/get-transfer-instruction-withdraw-context.js.map +1 -1
  105. package/build/src/clients/validator-api/operations/v0/wallet/buy-traffic-requests/get-status.d.ts.map +1 -1
  106. package/build/src/clients/validator-api/operations/v0/wallet/buy-traffic-requests/get-status.js +1 -0
  107. package/build/src/clients/validator-api/operations/v0/wallet/buy-traffic-requests/get-status.js.map +1 -1
  108. package/build/src/clients/validator-api/operations/v0/wallet/transfer-offers/get-status.d.ts.map +1 -1
  109. package/build/src/clients/validator-api/operations/v0/wallet/transfer-offers/get-status.js +1 -0
  110. package/build/src/clients/validator-api/operations/v0/wallet/transfer-offers/get-status.js.map +1 -1
  111. package/build/src/core/BaseClient.d.ts +5 -4
  112. package/build/src/core/BaseClient.d.ts.map +1 -1
  113. package/build/src/core/BaseClient.js +8 -8
  114. package/build/src/core/BaseClient.js.map +1 -1
  115. package/build/src/core/errors.d.ts +26 -1
  116. package/build/src/core/errors.d.ts.map +1 -1
  117. package/build/src/core/errors.js +30 -9
  118. package/build/src/core/errors.js.map +1 -1
  119. package/build/src/core/http/HttpClient.d.ts +41 -31
  120. package/build/src/core/http/HttpClient.d.ts.map +1 -1
  121. package/build/src/core/http/HttpClient.js +391 -118
  122. package/build/src/core/http/HttpClient.js.map +1 -1
  123. package/build/src/core/http/abort.d.ts +9 -0
  124. package/build/src/core/http/abort.d.ts.map +1 -0
  125. package/build/src/core/http/abort.js +54 -0
  126. package/build/src/core/http/abort.js.map +1 -0
  127. package/build/src/core/http/index.d.ts +1 -0
  128. package/build/src/core/http/index.d.ts.map +1 -1
  129. package/build/src/core/http/index.js +1 -0
  130. package/build/src/core/http/index.js.map +1 -1
  131. package/build/src/core/http/request-retry.d.ts +130 -0
  132. package/build/src/core/http/request-retry.d.ts.map +1 -0
  133. package/build/src/core/http/request-retry.js +14 -0
  134. package/build/src/core/http/request-retry.js.map +1 -0
  135. package/build/src/core/http/request-value.d.ts +5 -0
  136. package/build/src/core/http/request-value.d.ts.map +1 -0
  137. package/build/src/core/http/request-value.js +63 -0
  138. package/build/src/core/http/request-value.js.map +1 -0
  139. package/build/src/core/operations/ApiOperation.d.ts +7 -5
  140. package/build/src/core/operations/ApiOperation.d.ts.map +1 -1
  141. package/build/src/core/operations/ApiOperation.js +19 -11
  142. package/build/src/core/operations/ApiOperation.js.map +1 -1
  143. package/build/src/core/operations/ApiOperationFactory.d.ts +20 -4
  144. package/build/src/core/operations/ApiOperationFactory.d.ts.map +1 -1
  145. package/build/src/core/operations/ApiOperationFactory.js +48 -8
  146. package/build/src/core/operations/ApiOperationFactory.js.map +1 -1
  147. package/build/src/core/operations/index.d.ts +2 -0
  148. package/build/src/core/operations/index.d.ts.map +1 -1
  149. package/build/src/core/operations/index.js +2 -0
  150. package/build/src/core/operations/index.js.map +1 -1
  151. package/build/src/core/operations/operation-execute-options.d.ts +68 -0
  152. package/build/src/core/operations/operation-execute-options.d.ts.map +1 -0
  153. package/build/src/core/operations/operation-execute-options.js +36 -0
  154. package/build/src/core/operations/operation-execute-options.js.map +1 -0
  155. package/build/src/core/operations/operation-request-options.d.ts +15 -0
  156. package/build/src/core/operations/operation-request-options.d.ts.map +1 -0
  157. package/build/src/core/operations/operation-request-options.js +106 -0
  158. package/build/src/core/operations/operation-request-options.js.map +1 -0
  159. package/build/src/utils/mining/mining-rounds.d.ts +4 -3
  160. package/build/src/utils/mining/mining-rounds.d.ts.map +1 -1
  161. package/build/src/utils/mining/mining-rounds.js +4 -4
  162. package/build/src/utils/mining/mining-rounds.js.map +1 -1
  163. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OperationError = exports.OperationErrorCode = exports.NetworkError = exports.ValidationError = exports.ApiError = exports.AuthenticationError = exports.ConfigurationError = exports.CantonError = exports.ErrorCode = void 0;
3
+ exports.OperationError = exports.OperationErrorCode = exports.UnknownMutationOutcomeError = exports.NetworkError = exports.ValidationError = exports.ApiError = exports.AuthenticationError = exports.ConfigurationError = exports.CantonError = exports.ErrorCode = void 0;
4
4
  exports.normalizeCantonError = normalizeCantonError;
5
5
  exports.isDefiniteCantonMutationRejection = isDefiniteCantonMutationRejection;
6
6
  exports.readCantonDefiniteAnswer = readCantonDefiniteAnswer;
@@ -13,6 +13,7 @@ exports.ErrorCode = {
13
13
  API_ERROR: 'API_ERROR',
14
14
  VALIDATION_ERROR: 'VALIDATION_ERROR',
15
15
  NETWORK_ERROR: 'NETWORK_ERROR',
16
+ UNKNOWN_MUTATION_OUTCOME: 'UNKNOWN_MUTATION_OUTCOME',
16
17
  };
17
18
  /**
18
19
  * Base error class for all Canton SDK errors. Extends `@hardlydifficult/rest-client`'s `RestClientError` so errors are
@@ -75,6 +76,32 @@ class NetworkError extends CantonError {
75
76
  }
76
77
  }
77
78
  exports.NetworkError = NetworkError;
79
+ /**
80
+ * Error thrown when a mutation was dispatched but the transport could not determine whether the server applied it.
81
+ *
82
+ * Request bodies, signatures, and tokens are deliberately excluded from the message and serializable context. Callers
83
+ * may opt into a retry strategy and supply explicitly redacted attempt identifiers when an operation is safe to retry.
84
+ */
85
+ class UnknownMutationOutcomeError extends CantonError {
86
+ constructor(details, cause) {
87
+ const attemptIdentifiers = Object.freeze([...(details.attemptIdentifiers ?? [])]);
88
+ const context = {
89
+ method: details.method,
90
+ endpoint: details.endpoint,
91
+ attempts: details.attempts,
92
+ ...(attemptIdentifiers.length > 0 ? { attemptIdentifiers } : {}),
93
+ };
94
+ super(`The outcome of ${details.method} ${details.endpoint} is unknown after ${details.attempts} request attempt${details.attempts === 1 ? '' : 's'}`, exports.ErrorCode.UNKNOWN_MUTATION_OUTCOME, context);
95
+ this.name = 'UnknownMutationOutcomeError';
96
+ this.method = details.method;
97
+ this.endpoint = details.endpoint;
98
+ this.attempts = details.attempts;
99
+ this.attemptIdentifiers = attemptIdentifiers;
100
+ this.cause = cause;
101
+ Object.defineProperty(this, 'cause', { enumerable: false });
102
+ }
103
+ }
104
+ exports.UnknownMutationOutcomeError = UnknownMutationOutcomeError;
78
105
  /** Error codes for operation-specific errors. */
79
106
  exports.OperationErrorCode = {
80
107
  MISSING_CONTRACT: 'MISSING_CONTRACT',
@@ -101,6 +128,7 @@ const CANTON_SDK_ERROR_NAMES = new Set([
101
128
  'ConfigurationError',
102
129
  'NetworkError',
103
130
  'OperationError',
131
+ 'UnknownMutationOutcomeError',
104
132
  'ValidationError',
105
133
  ]);
106
134
  /** Normalize a Canton SDK-shaped error into serializable details for logging or API responses. */
@@ -124,14 +152,12 @@ function normalizeCantonError(error) {
124
152
  ...(context !== undefined ? { context, response: context } : {}),
125
153
  };
126
154
  }
127
- /** Return true when a Canton error represents a non-retryable 4xx mutation rejection. */
155
+ /** Return true when a Canton response proves that a mutation was rejected, independently from retryability. */
128
156
  function isDefiniteCantonMutationRejection(error) {
129
157
  const details = normalizeCantonError(error);
130
158
  const status = details?.status;
131
159
  if (status === undefined)
132
160
  return false;
133
- if (isRetryableCantonApiCode(status, details?.code))
134
- return false;
135
161
  return status >= 400 && status < 500 && status !== 408 && status !== 425 && status !== 429;
136
162
  }
137
163
  /** Read Canton's structured mutation-outcome signal when the API supplies one. */
@@ -147,11 +173,6 @@ function readDefiniteAnswerProperty(source) {
147
173
  const value = source['definiteAnswer'] ?? source['definite_answer'];
148
174
  return typeof value === 'boolean' ? value : undefined;
149
175
  }
150
- /** Return true when a Canton API status/code pair is known to be transient. */
151
- function isRetryableCantonApiCode(status, code) {
152
- return ((status === 400 && code === 'UNKNOWN_CONTRACT_SYNCHRONIZERS') ||
153
- (status === 409 && code === 'SEQUENCER_BACKPRESSURE'));
154
- }
155
176
  /** Read normalized error context from current and legacy SDK error fields. */
156
177
  function readErrorContext(source) {
157
178
  const { context } = source;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../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,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC;AAED,wEAAwE;AACxE,SAAS,uBAAuB,CAAC,MAA+B,EAAE,QAAgB;IAChF,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAED,0EAA0E;AAC1E,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -1,12 +1,13 @@
1
1
  import { type Logger } from '../logging';
2
2
  import { type RequestConfig } from '../types';
3
+ import { type HttpReadRequestOptions, type HttpRequestOptions } from './request-retry';
3
4
  export interface HttpClientRetryConfig {
4
- /** Number of retries after the initial attempt. */
5
+ /** Number of retries after the initial attempt for requests explicitly classified as semantic reads. */
5
6
  readonly maxRetries: number;
6
- /** Delay between retries in milliseconds. */
7
+ /** Delay between read-only retries in milliseconds. */
7
8
  readonly delayMs: number;
8
9
  }
9
- /** Handles HTTP requests with authentication, logging, and error handling */
10
+ /** Handles HTTP requests with authentication, logging, cancellation, and explicit retry safety. */
10
11
  export declare class HttpClient {
11
12
  private readonly axiosInstance;
12
13
  private readonly bearerTokenProvider;
@@ -15,40 +16,49 @@ export declare class HttpClient {
15
16
  private static readonly CAUSE_TRUNCATE_LENGTH;
16
17
  private static readonly CONTEXT_VALUE_TRUNCATE_LENGTH;
17
18
  private static readonly MAX_CONTEXT_KEYS;
19
+ private static readonly MAX_ATTEMPT_IDENTIFIER_LENGTH;
18
20
  constructor(logger?: Logger, bearerTokenProvider?: () => Promise<string>);
21
+ /** Configure the default retry policy used only by requests classified as semantic reads. */
19
22
  setRetryConfig(config: HttpClientRetryConfig): void;
20
- makeGetRequest<T>(url: string, config?: RequestConfig, _retryCount?: number): Promise<T>;
21
- makePostRequest<T>(url: string, data: unknown, config?: RequestConfig, _retryCount?: number): Promise<T>;
22
- makeDeleteRequest<T>(url: string, config?: RequestConfig, _retryCount?: number): Promise<T>;
23
- makePatchRequest<T>(url: string, data: unknown, config?: RequestConfig, _retryCount?: number): Promise<T>;
23
+ makeGetRequest<T>(url: string, config?: RequestConfig, options?: HttpReadRequestOptions<undefined>): Promise<T>;
24
+ makePostRequest<T, Body = unknown>(url: string, data: Body, config?: RequestConfig, options?: HttpRequestOptions<Body>): Promise<T>;
25
+ makeDeleteRequest<T>(url: string, config?: RequestConfig, options?: HttpRequestOptions<undefined>): Promise<T>;
26
+ makePatchRequest<T, Body = unknown>(url: string, data: Body, config?: RequestConfig, options?: HttpRequestOptions<Body>): Promise<T>;
27
+ private makeRequest;
28
+ private resolveRetryStrategy;
29
+ private validateMaxAttempts;
30
+ private shouldRetry;
31
+ private waitForRetry;
32
+ private createAttemptContext;
33
+ private createReadonlyBody;
34
+ private cloneBody;
35
+ /** Convert a deeply readonly callback result back into an isolated mutable transport snapshot. */
36
+ private cloneDerivedBody;
37
+ private dispatchRequest;
24
38
  private buildHeaders;
25
- private logRequestResponse;
39
+ /** Invoke logging as a detached observer. Logger behavior can never affect request control flow. */
40
+ private observeLog;
41
+ /** Isolate logger-owned values so a custom logger cannot mutate request or response control-flow state. */
42
+ private createLogSnapshot;
43
+ /** Remove credentials from logger-owned header snapshots without changing dispatch headers. */
44
+ private redactSensitiveLogHeaders;
45
+ private logFailedRequest;
46
+ private logRetry;
26
47
  private handleRequestError;
27
- /**
28
- * Formats a context object into a summary string for error messages. Shows up to MAX_CONTEXT_KEYS keys with truncated
29
- * values.
30
- */
48
+ /** Formats a context object into a summary string. Shows up to MAX_CONTEXT_KEYS keys with truncated values. */
31
49
  private formatContextSummary;
32
- /**
33
- * Safely converts a context value to a string representation. Handles null, undefined, strings, and objects (with
34
- * circular reference protection).
35
- */
50
+ /** Safely converts a context value to a string representation. */
36
51
  private stringifyContextValue;
37
- /**
38
- * Determines whether a request error is retryable. Retries on:
39
- *
40
- * - HTTP 404 (transient during Canton node restarts)
41
- * - HTTP 5xx server errors
42
- * - Network errors
43
- * - Canton-specific transient errors: UNKNOWN_CONTRACT_SYNCHRONIZERS (400), SEQUENCER_BACKPRESSURE (409), HTTP 503
44
- */
52
+ /** Return true for transport failures that the SDK has historically classified as transient. */
45
53
  private isRetryableError;
46
- /** Sleep for the specified number of milliseconds */
47
- private sleep;
48
- /**
49
- * Prepares request data for retry by updating commandId fields to avoid duplicate command rejection. If the data
50
- * contains a commandId field, appends a retry suffix with timestamp to make it unique.
51
- */
52
- private prepareDataForRetry;
54
+ private classifyRequestError;
55
+ private toTerminalError;
56
+ private preservePriorAmbiguity;
57
+ private hasAmbiguousAttempt;
58
+ private normalizeCallbackError;
59
+ private redactEndpoint;
60
+ private redactAttemptIdentifier;
61
+ private isCanceledError;
62
+ private abortableSleep;
53
63
  }
54
64
  //# sourceMappingURL=HttpClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../../../src/core/http/HttpClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,6EAA6E;AAC7E,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAsC;IAC1E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;I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