@silvana-one/orderbook 1.2.9 → 1.2.11
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/dist/node/index.cjs +60 -6
- package/dist/node/proto/silvana/ledger/v1/bridge_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/cip56_pb.d.ts +10 -0
- package/dist/node/proto/silvana/ledger/v1/cip56_pb.js +2 -2
- package/dist/node/proto/silvana/ledger/v1/cip56_pb.js.map +1 -1
- package/dist/node/proto/silvana/ledger/v1/common_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/dvp_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/faucet_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/fees_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/lock_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/multicall_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/onboarding_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/pay_fee_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/preapproval_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/queries_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/recurring_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/service_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/transactions_pb.js +1 -1
- package/dist/node/proto/silvana/ledger/v1/transfer_pb.js +1 -1
- package/dist/node/proto/silvana/news/v1/news_pb.js +1 -1
- package/dist/node/proto/silvana/orderbook/v1/orderbook_pb.js +1 -1
- package/dist/node/proto/silvana/pricing/v1/pricing_pb.js +1 -1
- package/dist/node/proto/silvana/rfqv2/v1/atomic_ledger_pb.js +1 -1
- package/dist/node/proto/silvana/rfqv2/v1/rfqv2_pb.d.ts +23 -0
- package/dist/node/proto/silvana/rfqv2/v1/rfqv2_pb.js +2 -2
- package/dist/node/proto/silvana/rfqv2/v1/rfqv2_pb.js.map +1 -1
- package/dist/node/proto/silvana/settlement/v1/settlement_pb.d.ts +217 -0
- package/dist/node/proto/silvana/settlement/v1/settlement_pb.js +22 -2
- package/dist/node/proto/silvana/settlement/v1/settlement_pb.js.map +1 -1
- package/dist/node/rfqv2.d.ts +10 -0
- package/dist/node/rfqv2.js +6 -0
- package/dist/node/rfqv2.js.map +1 -1
- package/dist/node/settlement.d.ts +66 -2
- package/dist/node/settlement.js +41 -2
- package/dist/node/settlement.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tsconfig.web.tsbuildinfo +1 -1
- package/dist/web/proto/silvana/ledger/v1/bridge_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/cip56_pb.d.ts +10 -0
- package/dist/web/proto/silvana/ledger/v1/cip56_pb.js +2 -2
- package/dist/web/proto/silvana/ledger/v1/cip56_pb.js.map +1 -1
- package/dist/web/proto/silvana/ledger/v1/common_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/dvp_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/faucet_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/fees_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/lock_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/multicall_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/onboarding_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/pay_fee_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/preapproval_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/queries_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/recurring_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/service_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/transactions_pb.js +1 -1
- package/dist/web/proto/silvana/ledger/v1/transfer_pb.js +1 -1
- package/dist/web/proto/silvana/news/v1/news_pb.js +1 -1
- package/dist/web/proto/silvana/orderbook/v1/orderbook_pb.js +1 -1
- package/dist/web/proto/silvana/pricing/v1/pricing_pb.js +1 -1
- package/dist/web/proto/silvana/rfqv2/v1/atomic_ledger_pb.js +1 -1
- package/dist/web/proto/silvana/rfqv2/v1/rfqv2_pb.d.ts +23 -0
- package/dist/web/proto/silvana/rfqv2/v1/rfqv2_pb.js +2 -2
- package/dist/web/proto/silvana/rfqv2/v1/rfqv2_pb.js.map +1 -1
- package/dist/web/proto/silvana/settlement/v1/settlement_pb.d.ts +217 -0
- package/dist/web/proto/silvana/settlement/v1/settlement_pb.js +22 -2
- package/dist/web/proto/silvana/settlement/v1/settlement_pb.js.map +1 -1
- package/dist/web/rfqv2.d.ts +10 -0
- package/dist/web/rfqv2.js +6 -0
- package/dist/web/rfqv2.js.map +1 -1
- package/dist/web/settlement.d.ts +66 -2
- package/dist/web/settlement.js +41 -2
- package/dist/web/settlement.js.map +1 -1
- package/package.json +1 -1
- package/src/proto/silvana/ledger/v1/bridge_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/cip56_pb.ts +13 -2
- package/src/proto/silvana/ledger/v1/common_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/dvp_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/faucet_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/fees_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/lock_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/multicall_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/onboarding_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/pay_fee_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/preapproval_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/queries_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/recurring_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/service_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/transactions_pb.ts +1 -1
- package/src/proto/silvana/ledger/v1/transfer_pb.ts +1 -1
- package/src/proto/silvana/news/v1/news_pb.ts +1 -1
- package/src/proto/silvana/orderbook/v1/orderbook_pb.ts +1 -1
- package/src/proto/silvana/pricing/v1/pricing_pb.ts +1 -1
- package/src/proto/silvana/rfqv2/v1/atomic_ledger_pb.ts +1 -1
- package/src/proto/silvana/rfqv2/v1/rfqv2_pb.ts +28 -2
- package/src/proto/silvana/settlement/v1/settlement_pb.ts +255 -2
- package/src/rfqv2.ts +10 -0
- package/src/settlement.ts +96 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Transport } from "@connectrpc/connect";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import type { JsonObject } from "@bufbuild/protobuf";
|
|
3
|
+
import { type GetPendingProposalsResponse, type GetSettlementStatusResponse, type SaveDisclosedContractResponse, type GetDisclosedContractsResponse, type RecordSettlementResponse, type RecordTransactionResponse, type GetTransactionHistoryResponse, type RecordSettlementEventResponse, type GetSettlementHistoryResponse, type UpdateProposalStatusResponse, type GetSettlementProposalByIdResponse, type CancelSettlementResponse, type DisclosedContractMessage, type PreconfirmationDecision, type CantonToServerMessage, type ReportErrorsResponse, TransactionType, SenderType, TransactionResult, SettlementEventType, RecordedByRole, SettlementEventResult, UpdateProposalStatusRequest_NewStatus } from "./proto/silvana/settlement/v1/settlement_pb.js";
|
|
4
|
+
export { file_silvana_settlement_v1_settlement, type CantonNodeAuth, CantonNodeAuthSchema, type SettlementInstrument, SettlementInstrumentSchema, type SettlementProposalMessage, SettlementProposalMessageSchema, type PreconfirmationRequest, PreconfirmationRequestSchema, type PreconfirmationDecision, PreconfirmationDecisionSchema, type DvpContractCreated, DvpContractCreatedSchema, type DvpContractAccepted, DvpContractAcceptedSchema, type AllocationStatus, AllocationStatusSchema, type SettlementExecutionStatus, SettlementExecutionStatusSchema, type UserServiceInfo, UserServiceInfoSchema, type SettlementHandshake, SettlementHandshakeSchema, type HandshakeAck, HandshakeAckSchema, type Heartbeat, HeartbeatSchema, type LiquidityProviderPing, LiquidityProviderPingSchema, type LiquidityProviderPong, LiquidityProviderPongSchema, type ServerToCantonMessage, ServerToCantonMessageSchema, type CantonToServerMessage, CantonToServerMessageSchema, type DvpCreationReport, DvpCreationReportSchema, type DvpAcceptanceReport, DvpAcceptanceReportSchema, type AllocationReport, AllocationReportSchema, type SettlementReport, SettlementReportSchema, type ErrorReport, ErrorReportSchema, type StatusUpdate, StatusUpdateSchema, type SettlementCommand, SettlementCommandSchema, type GetPendingProposalsRequest, GetPendingProposalsRequestSchema, type GetPendingProposalsResponse, GetPendingProposalsResponseSchema, type GetSettlementStatusRequest, GetSettlementStatusRequestSchema, type GetSettlementStatusResponse, GetSettlementStatusResponseSchema, type SubmitPreconfirmationRequest, SubmitPreconfirmationRequestSchema, type SaveDisclosedContractRequest, SaveDisclosedContractRequestSchema, type SaveDisclosedContractResponse, SaveDisclosedContractResponseSchema, type GetDisclosedContractsRequest, GetDisclosedContractsRequestSchema, type GetDisclosedContractsResponse, GetDisclosedContractsResponseSchema, type DisclosedContractMessage, DisclosedContractMessageSchema, type RecordSettlementRequest, RecordSettlementRequestSchema, type RecordSettlementResponse, RecordSettlementResponseSchema, type RecordTransactionRequest, RecordTransactionRequestSchema, type RecordTransactionResponse, RecordTransactionResponseSchema, type GetTransactionHistoryRequest, GetTransactionHistoryRequestSchema, type GetTransactionHistoryResponse, GetTransactionHistoryResponseSchema, type TransactionHistoryEntry, TransactionHistoryEntrySchema, type RecordSettlementEventRequest, RecordSettlementEventRequestSchema, type RecordSettlementEventResponse, RecordSettlementEventResponseSchema, type GetSettlementHistoryRequest, GetSettlementHistoryRequestSchema, type GetSettlementHistoryResponse, GetSettlementHistoryResponseSchema, type SettlementHistoryEntry, SettlementHistoryEntrySchema, type UpdateProposalStatusRequest, UpdateProposalStatusRequestSchema, UpdateProposalStatusRequest_NewStatus, UpdateProposalStatusRequest_NewStatusSchema, type UpdateProposalStatusResponse, UpdateProposalStatusResponseSchema, type GetSettlementProposalByIdRequest, GetSettlementProposalByIdRequestSchema, type GetSettlementProposalByIdResponse, GetSettlementProposalByIdResponseSchema, type CancelSettlementRequest, CancelSettlementRequestSchema, type CancelSettlementResponse, CancelSettlementResponseSchema, type DvpStepStatus, DvpStepStatusSchema, SettlementStage, SettlementStageSchema, PreconfirmationResponse, PreconfirmationResponseSchema, PartyRole, PartyRoleSchema, TransactionType, TransactionTypeSchema, SenderType, SenderTypeSchema, TransactionResult, TransactionResultSchema, SettlementEventType, SettlementEventTypeSchema, RecordedByRole, RecordedByRoleSchema, SettlementEventResult, SettlementEventResultSchema, DvpStepStatusEnum, DvpStepStatusEnumSchema, type RfqRequest, RfqRequestSchema, type RfqQuote, RfqQuoteSchema, type RfqReject, RfqRejectSchema, RfqDirection, RfqDirectionSchema, RfqRejectionReason, RfqRejectionReasonSchema, NextAction, NextActionSchema, type ErrorEvent, ErrorEventSchema, type ReportErrorsRequest, ReportErrorsRequestSchema, type ReportErrorsResponse, ReportErrorsResponseSchema, type ErrorRejection, ErrorRejectionSchema, SettlementService, } from "./proto/silvana/settlement/v1/settlement_pb.js";
|
|
4
5
|
/**
|
|
5
6
|
* Custom error class for Settlement client errors
|
|
6
7
|
*/
|
|
@@ -174,4 +175,67 @@ export declare class SettlementClient {
|
|
|
174
175
|
limit?: number;
|
|
175
176
|
offset?: number;
|
|
176
177
|
}): Promise<GetTransactionHistoryResponse>;
|
|
178
|
+
/**
|
|
179
|
+
* Report structured errors (best-effort ingestion; max 50 per batch —
|
|
180
|
+
* a larger batch fails WHOLE with INVALID_ARGUMENT, no per-event
|
|
181
|
+
* rejections).
|
|
182
|
+
*
|
|
183
|
+
* Auth is EXCLUSIVELY the Bearer JWT — the server derives the reporter
|
|
184
|
+
* from it and may overwrite partyId/venueName per its caller-class rules
|
|
185
|
+
* (untrusted callers cannot attribute errors to other parties). The
|
|
186
|
+
* response carries accepted/rejected counts plus per-event rejections
|
|
187
|
+
* with reason "rate_limited" | "invalid" ("too_large" is reserved but
|
|
188
|
+
* currently unused — oversize payloads are truncated server-side
|
|
189
|
+
* instead); callers should drop rejected events, never retry them.
|
|
190
|
+
* Requests over the per-IP pre-auth rate limit fail with
|
|
191
|
+
* RESOURCE_EXHAUSTED.
|
|
192
|
+
*
|
|
193
|
+
* Pass plain objects — this wrapper owns create() (constructing the
|
|
194
|
+
* request yourself and passing it here loses Struct fields; see the
|
|
195
|
+
* double-create() pitfall).
|
|
196
|
+
*/
|
|
197
|
+
reportErrors(params: {
|
|
198
|
+
errors: Array<{
|
|
199
|
+
/** "frontend-orderbook" | "frontend-swap" | "agent" (server-whitelisted) */
|
|
200
|
+
source?: string;
|
|
201
|
+
/** "debug"|"info"|"warning"|"error"|"critical"; empty => "error" */
|
|
202
|
+
severity?: string;
|
|
203
|
+
/**
|
|
204
|
+
* Error classification. For non-Trusted callers, values outside the
|
|
205
|
+
* server's vocabulary are STORED AS "CLIENT_ERROR" with the raw label
|
|
206
|
+
* moved into error_code (the column is an indexed analytics dimension
|
|
207
|
+
* and must not be free-text).
|
|
208
|
+
*/
|
|
209
|
+
errorType: string;
|
|
210
|
+
errorCode?: string;
|
|
211
|
+
errorMessage?: string;
|
|
212
|
+
/** Subject party (whose flow failed) */
|
|
213
|
+
partyId?: string;
|
|
214
|
+
updateId?: string;
|
|
215
|
+
commandId?: string;
|
|
216
|
+
submissionId?: string;
|
|
217
|
+
contractId?: string;
|
|
218
|
+
damlTemplateId?: string;
|
|
219
|
+
damlChoice?: string;
|
|
220
|
+
settlementProposalId?: string;
|
|
221
|
+
marketId?: string;
|
|
222
|
+
orderId?: string;
|
|
223
|
+
venueName?: string;
|
|
224
|
+
venueBranch?: string;
|
|
225
|
+
/** Session / trace id (frontends: per-tab uuid v7) */
|
|
226
|
+
correlationId?: string;
|
|
227
|
+
/** Build/commit stamp, e.g. NEXT_PUBLIC_GIT_COMMIT */
|
|
228
|
+
appVersion?: string;
|
|
229
|
+
/** Code path, e.g. "useSwapSettlement" */
|
|
230
|
+
module?: string;
|
|
231
|
+
/**
|
|
232
|
+
* google.protobuf.Struct — JSON-serializable values ONLY, <= 16 KiB
|
|
233
|
+
* serialized. Pass `err.stack` as a string; an Error or Date object
|
|
234
|
+
* silently encodes as {} (non-enumerable/unsupported fields).
|
|
235
|
+
*/
|
|
236
|
+
metadata?: JsonObject;
|
|
237
|
+
/** When the error occurred (client clock; converted to a Timestamp) */
|
|
238
|
+
occurredAt?: Date;
|
|
239
|
+
}>;
|
|
240
|
+
}): Promise<ReportErrorsResponse>;
|
|
177
241
|
}
|
package/dist/node/settlement.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { createClient, ConnectError } from "@connectrpc/connect";
|
|
2
2
|
import { create } from "@bufbuild/protobuf";
|
|
3
|
+
import { TimestampSchema } from "@bufbuild/protobuf/wkt";
|
|
3
4
|
// Import types needed for internal implementation
|
|
4
|
-
import { SettlementService, GetPendingProposalsRequestSchema, GetSettlementStatusRequestSchema, SubmitPreconfirmationRequestSchema, SaveDisclosedContractRequestSchema, GetDisclosedContractsRequestSchema, RecordSettlementRequestSchema, RecordTransactionRequestSchema, GetTransactionHistoryRequestSchema, RecordSettlementEventRequestSchema, GetSettlementHistoryRequestSchema, UpdateProposalStatusRequestSchema, GetSettlementProposalByIdRequestSchema, CancelSettlementRequestSchema, } from "./proto/silvana/settlement/v1/settlement_pb.js";
|
|
5
|
+
import { SettlementService, GetPendingProposalsRequestSchema, GetSettlementStatusRequestSchema, SubmitPreconfirmationRequestSchema, SaveDisclosedContractRequestSchema, GetDisclosedContractsRequestSchema, RecordSettlementRequestSchema, RecordTransactionRequestSchema, GetTransactionHistoryRequestSchema, RecordSettlementEventRequestSchema, GetSettlementHistoryRequestSchema, UpdateProposalStatusRequestSchema, GetSettlementProposalByIdRequestSchema, CancelSettlementRequestSchema, ReportErrorsRequestSchema, } from "./proto/silvana/settlement/v1/settlement_pb.js";
|
|
5
6
|
// Export all types and schemas from the generated protobuf file
|
|
6
|
-
export { file_silvana_settlement_v1_settlement, CantonNodeAuthSchema, SettlementInstrumentSchema, SettlementProposalMessageSchema, PreconfirmationRequestSchema, PreconfirmationDecisionSchema, DvpContractCreatedSchema, DvpContractAcceptedSchema, AllocationStatusSchema, SettlementExecutionStatusSchema, UserServiceInfoSchema, SettlementHandshakeSchema, HandshakeAckSchema, HeartbeatSchema, LiquidityProviderPingSchema, LiquidityProviderPongSchema, ServerToCantonMessageSchema, CantonToServerMessageSchema, DvpCreationReportSchema, DvpAcceptanceReportSchema, AllocationReportSchema, SettlementReportSchema, ErrorReportSchema, StatusUpdateSchema, SettlementCommandSchema, GetPendingProposalsRequestSchema, GetPendingProposalsResponseSchema, GetSettlementStatusRequestSchema, GetSettlementStatusResponseSchema, SubmitPreconfirmationRequestSchema, SaveDisclosedContractRequestSchema, SaveDisclosedContractResponseSchema, GetDisclosedContractsRequestSchema, GetDisclosedContractsResponseSchema, DisclosedContractMessageSchema, RecordSettlementRequestSchema, RecordSettlementResponseSchema, RecordTransactionRequestSchema, RecordTransactionResponseSchema, GetTransactionHistoryRequestSchema, GetTransactionHistoryResponseSchema, TransactionHistoryEntrySchema, RecordSettlementEventRequestSchema, RecordSettlementEventResponseSchema, GetSettlementHistoryRequestSchema, GetSettlementHistoryResponseSchema, SettlementHistoryEntrySchema, UpdateProposalStatusRequestSchema, UpdateProposalStatusRequest_NewStatus, UpdateProposalStatusRequest_NewStatusSchema, UpdateProposalStatusResponseSchema, GetSettlementProposalByIdRequestSchema, GetSettlementProposalByIdResponseSchema, CancelSettlementRequestSchema, CancelSettlementResponseSchema, DvpStepStatusSchema, SettlementStage, SettlementStageSchema, PreconfirmationResponse, PreconfirmationResponseSchema, PartyRole, PartyRoleSchema, TransactionType, TransactionTypeSchema, SenderType, SenderTypeSchema, TransactionResult, TransactionResultSchema, SettlementEventType, SettlementEventTypeSchema, RecordedByRole, RecordedByRoleSchema, SettlementEventResult, SettlementEventResultSchema, DvpStepStatusEnum, DvpStepStatusEnumSchema, RfqRequestSchema, RfqQuoteSchema, RfqRejectSchema, RfqDirection, RfqDirectionSchema, RfqRejectionReason, RfqRejectionReasonSchema, NextAction, NextActionSchema, SettlementService, } from "./proto/silvana/settlement/v1/settlement_pb.js";
|
|
7
|
+
export { file_silvana_settlement_v1_settlement, CantonNodeAuthSchema, SettlementInstrumentSchema, SettlementProposalMessageSchema, PreconfirmationRequestSchema, PreconfirmationDecisionSchema, DvpContractCreatedSchema, DvpContractAcceptedSchema, AllocationStatusSchema, SettlementExecutionStatusSchema, UserServiceInfoSchema, SettlementHandshakeSchema, HandshakeAckSchema, HeartbeatSchema, LiquidityProviderPingSchema, LiquidityProviderPongSchema, ServerToCantonMessageSchema, CantonToServerMessageSchema, DvpCreationReportSchema, DvpAcceptanceReportSchema, AllocationReportSchema, SettlementReportSchema, ErrorReportSchema, StatusUpdateSchema, SettlementCommandSchema, GetPendingProposalsRequestSchema, GetPendingProposalsResponseSchema, GetSettlementStatusRequestSchema, GetSettlementStatusResponseSchema, SubmitPreconfirmationRequestSchema, SaveDisclosedContractRequestSchema, SaveDisclosedContractResponseSchema, GetDisclosedContractsRequestSchema, GetDisclosedContractsResponseSchema, DisclosedContractMessageSchema, RecordSettlementRequestSchema, RecordSettlementResponseSchema, RecordTransactionRequestSchema, RecordTransactionResponseSchema, GetTransactionHistoryRequestSchema, GetTransactionHistoryResponseSchema, TransactionHistoryEntrySchema, RecordSettlementEventRequestSchema, RecordSettlementEventResponseSchema, GetSettlementHistoryRequestSchema, GetSettlementHistoryResponseSchema, SettlementHistoryEntrySchema, UpdateProposalStatusRequestSchema, UpdateProposalStatusRequest_NewStatus, UpdateProposalStatusRequest_NewStatusSchema, UpdateProposalStatusResponseSchema, GetSettlementProposalByIdRequestSchema, GetSettlementProposalByIdResponseSchema, CancelSettlementRequestSchema, CancelSettlementResponseSchema, DvpStepStatusSchema, SettlementStage, SettlementStageSchema, PreconfirmationResponse, PreconfirmationResponseSchema, PartyRole, PartyRoleSchema, TransactionType, TransactionTypeSchema, SenderType, SenderTypeSchema, TransactionResult, TransactionResultSchema, SettlementEventType, SettlementEventTypeSchema, RecordedByRole, RecordedByRoleSchema, SettlementEventResult, SettlementEventResultSchema, DvpStepStatusEnum, DvpStepStatusEnumSchema, RfqRequestSchema, RfqQuoteSchema, RfqRejectSchema, RfqDirection, RfqDirectionSchema, RfqRejectionReason, RfqRejectionReasonSchema, NextAction, NextActionSchema, ErrorEventSchema, ReportErrorsRequestSchema, ReportErrorsResponseSchema, ErrorRejectionSchema, SettlementService, } from "./proto/silvana/settlement/v1/settlement_pb.js";
|
|
8
|
+
/**
|
|
9
|
+
* Converts a Date to a Timestamp message
|
|
10
|
+
*/
|
|
11
|
+
function dateToTimestamp(date) {
|
|
12
|
+
const seconds = BigInt(Math.floor(date.getTime() / 1000));
|
|
13
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
14
|
+
return create(TimestampSchema, { seconds, nanos });
|
|
15
|
+
}
|
|
7
16
|
/**
|
|
8
17
|
* Custom error class for Settlement client errors
|
|
9
18
|
*/
|
|
@@ -175,5 +184,35 @@ export class SettlementClient {
|
|
|
175
184
|
return await this.client.getTransactionHistory(request, this.callOptions());
|
|
176
185
|
}, 'getTransactionHistory');
|
|
177
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Report structured errors (best-effort ingestion; max 50 per batch —
|
|
189
|
+
* a larger batch fails WHOLE with INVALID_ARGUMENT, no per-event
|
|
190
|
+
* rejections).
|
|
191
|
+
*
|
|
192
|
+
* Auth is EXCLUSIVELY the Bearer JWT — the server derives the reporter
|
|
193
|
+
* from it and may overwrite partyId/venueName per its caller-class rules
|
|
194
|
+
* (untrusted callers cannot attribute errors to other parties). The
|
|
195
|
+
* response carries accepted/rejected counts plus per-event rejections
|
|
196
|
+
* with reason "rate_limited" | "invalid" ("too_large" is reserved but
|
|
197
|
+
* currently unused — oversize payloads are truncated server-side
|
|
198
|
+
* instead); callers should drop rejected events, never retry them.
|
|
199
|
+
* Requests over the per-IP pre-auth rate limit fail with
|
|
200
|
+
* RESOURCE_EXHAUSTED.
|
|
201
|
+
*
|
|
202
|
+
* Pass plain objects — this wrapper owns create() (constructing the
|
|
203
|
+
* request yourself and passing it here loses Struct fields; see the
|
|
204
|
+
* double-create() pitfall).
|
|
205
|
+
*/
|
|
206
|
+
async reportErrors(params) {
|
|
207
|
+
return await this.wrapCall(async () => {
|
|
208
|
+
const request = create(ReportErrorsRequestSchema, {
|
|
209
|
+
errors: params.errors.map((e) => ({
|
|
210
|
+
...e,
|
|
211
|
+
occurredAt: e.occurredAt ? dateToTimestamp(e.occurredAt) : undefined,
|
|
212
|
+
})),
|
|
213
|
+
});
|
|
214
|
+
return await this.client.reportErrors(request, this.callOptions());
|
|
215
|
+
}, 'reportErrors');
|
|
216
|
+
}
|
|
178
217
|
}
|
|
179
218
|
//# sourceMappingURL=settlement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settlement.js","sourceRoot":"","sources":["../../src/settlement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,kDAAkD;AAClD,OAAO,EACL,iBAAiB,EAiBjB,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,EAClC,kCAAkC,EAClC,kCAAkC,EAClC,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,kCAAkC,EAClC,iCAAiC,EACjC,iCAAiC,EACjC,sCAAsC,EACtC,6BAA6B,
|
|
1
|
+
{"version":3,"file":"settlement.js","sourceRoot":"","sources":["../../src/settlement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,kDAAkD;AAClD,OAAO,EACL,iBAAiB,EAiBjB,gCAAgC,EAChC,gCAAgC,EAChC,kCA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