@antseed/node 0.2.182 → 0.2.184
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/README.md +2 -0
- package/dist/buyer-identity-context.d.ts.map +1 -1
- package/dist/buyer-identity-context.js +2 -2
- package/dist/buyer-identity-context.js.map +1 -1
- package/dist/discovery/announcer.d.ts +3 -20
- package/dist/discovery/announcer.d.ts.map +1 -1
- package/dist/discovery/announcer.js.map +1 -1
- package/dist/discovery/dht-health.d.ts.map +1 -1
- package/dist/discovery/dht-health.js.map +1 -1
- package/dist/discovery/dht-node.d.ts.map +1 -1
- package/dist/discovery/dht-node.js.map +1 -1
- package/dist/discovery/http-metadata-resolver.d.ts.map +1 -1
- package/dist/discovery/metadata/index.d.ts.map +1 -1
- package/dist/discovery/metadata/index.js +2 -1
- package/dist/discovery/metadata/index.js.map +1 -1
- package/dist/discovery/metadata/versions/v18.d.ts +9 -0
- package/dist/discovery/metadata/versions/v18.d.ts.map +1 -0
- package/dist/discovery/metadata/versions/v18.js +21 -0
- package/dist/discovery/metadata/versions/v18.js.map +1 -0
- package/dist/discovery/metadata/wire.d.ts.map +1 -1
- package/dist/discovery/metadata/wire.js.map +1 -1
- package/dist/discovery/metadata-server.d.ts.map +1 -1
- package/dist/discovery/peer-lookup.d.ts.map +1 -1
- package/dist/discovery/service-catalog.d.ts.map +1 -1
- package/dist/discovery/service-catalog.js +5 -3
- package/dist/discovery/service-catalog.js.map +1 -1
- package/dist/health/gas-auto-refuel.d.ts.map +1 -1
- package/dist/health/gas-auto-refuel.js.map +1 -1
- package/dist/health/gas-health-monitor.d.ts.map +1 -1
- package/dist/health/model-health-checker.d.ts.map +1 -1
- package/dist/health/model-health-checker.js +7 -4
- package/dist/health/model-health-checker.js.map +1 -1
- package/dist/health/self-health-error.d.ts +6 -0
- package/dist/health/self-health-error.d.ts.map +1 -1
- package/dist/health/self-health-error.js +33 -0
- package/dist/health/self-health-error.js.map +1 -1
- package/dist/health/service-performance.d.ts.map +1 -1
- package/dist/health/service-performance.js.map +1 -1
- package/dist/health/stream-outcome.d.ts.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/metering/receipt-generator.d.ts.map +1 -1
- package/dist/metering/receipt-verifier.d.ts.map +1 -1
- package/dist/metering/seller-session-tracker.d.ts +6 -1
- package/dist/metering/seller-session-tracker.d.ts.map +1 -1
- package/dist/metering/seller-session-tracker.js +14 -3
- package/dist/metering/seller-session-tracker.js.map +1 -1
- package/dist/metering/session-tracker.d.ts.map +1 -1
- package/dist/metering/storage.d.ts +6 -0
- package/dist/metering/storage.d.ts.map +1 -1
- package/dist/metering/storage.js +8 -0
- package/dist/metering/storage.js.map +1 -1
- package/dist/metering/usage-aggregator.d.ts.map +1 -1
- package/dist/metering/usage-aggregator.js.map +1 -1
- package/dist/node.d.ts +21 -2
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +37 -24
- package/dist/node.js.map +1 -1
- package/dist/p2p/connection-auth.d.ts.map +1 -1
- package/dist/p2p/connection-auth.js.map +1 -1
- package/dist/p2p/connection-manager.d.ts +26 -0
- package/dist/p2p/connection-manager.d.ts.map +1 -1
- package/dist/p2p/connection-manager.js +88 -6
- package/dist/p2p/connection-manager.js.map +1 -1
- package/dist/p2p/identity-envelope.js.map +1 -1
- package/dist/p2p/identity.d.ts.map +1 -1
- package/dist/p2p/identity.js.map +1 -1
- package/dist/p2p/inbound-idle-tracker.d.ts +13 -5
- package/dist/p2p/inbound-idle-tracker.d.ts.map +1 -1
- package/dist/p2p/inbound-idle-tracker.js +11 -4
- package/dist/p2p/inbound-idle-tracker.js.map +1 -1
- package/dist/p2p/keepalive.d.ts.map +1 -1
- package/dist/p2p/nat-traversal.d.ts.map +1 -1
- package/dist/p2p/secure-channel.d.ts.map +1 -1
- package/dist/p2p/secure-channel.js.map +1 -1
- package/dist/p2p/sweep-mux.d.ts.map +1 -1
- package/dist/payments/balance-manager.d.ts.map +1 -1
- package/dist/payments/channel-store.d.ts +2 -0
- package/dist/payments/channel-store.d.ts.map +1 -1
- package/dist/payments/channel-store.js +9 -0
- package/dist/payments/channel-store.js.map +1 -1
- package/dist/payments/contract-stack.d.ts.map +1 -1
- package/dist/payments/contract-stack.js.map +1 -1
- package/dist/payments/deposit-relayer.d.ts.map +1 -1
- package/dist/payments/evm/ants-token-client.d.ts.map +1 -1
- package/dist/payments/evm/block-range.js.map +1 -1
- package/dist/payments/evm/deposit-relay-client.d.ts.map +1 -1
- package/dist/payments/evm/emissions-client.d.ts.map +1 -1
- package/dist/payments/evm/emissions-gate-client.d.ts +10 -10
- package/dist/payments/evm/emissions-gate-client.d.ts.map +1 -1
- package/dist/payments/evm/free-usage-client.d.ts.map +1 -1
- package/dist/payments/evm/identity-client.d.ts.map +1 -1
- package/dist/payments/evm/multicall.js.map +1 -1
- package/dist/payments/evm/points-policy-registry-client.d.ts.map +1 -1
- package/dist/payments/evm/position-init-client.d.ts.map +1 -1
- package/dist/payments/evm/registry-client.d.ts.map +1 -1
- package/dist/payments/evm/seller-pools-client.d.ts.map +1 -1
- package/dist/payments/evm/seller-pools-rewards-client.d.ts.map +1 -1
- package/dist/payments/evm/seller-registry-client.d.ts.map +1 -1
- package/dist/payments/evm/seller-registry-client.js.map +1 -1
- package/dist/payments/evm/seller-rewards-pool-client.d.ts.map +1 -1
- package/dist/payments/evm/staking-client.d.ts.map +1 -1
- package/dist/payments/evm/stats-client.d.ts.map +1 -1
- package/dist/payments/evm/trust-signals-client.d.ts.map +1 -1
- package/dist/payments/evm/trust-signals-client.js.map +1 -1
- package/dist/payments/evm/usage-accounting-client.d.ts.map +1 -1
- package/dist/payments/evm/usage-rewards-client.d.ts.map +1 -1
- package/dist/payments/evm/usdc-eth-swap-client.d.ts.map +1 -1
- package/dist/payments/evm/verification-signals-client.d.ts.map +1 -1
- package/dist/payments/evm/verification-signals-client.js.map +1 -1
- package/dist/payments/evm/verifier-client.d.ts +2 -2
- package/dist/payments/evm/verifier-client.d.ts.map +1 -1
- package/dist/payments/evm/verifier-client.js.map +1 -1
- package/dist/payments/evm/wash-trading-registry-client.d.ts.map +1 -1
- package/dist/payments/evm/wash-trading-registry-client.js.map +1 -1
- package/dist/payments/free-tier-conversations.d.ts +59 -0
- package/dist/payments/free-tier-conversations.d.ts.map +1 -0
- package/dist/payments/free-tier-conversations.js +127 -0
- package/dist/payments/free-tier-conversations.js.map +1 -0
- package/dist/payments/free-tier-program.js.map +1 -1
- package/dist/payments/free-tier-stake-resolver.d.ts.map +1 -1
- package/dist/payments/free-tier-stake-resolver.js.map +1 -1
- package/dist/payments/generated-contract-addresses.d.ts +33 -33
- package/dist/payments/generated-contract-addresses.d.ts.map +1 -1
- package/dist/payments/index.d.ts +2 -2
- package/dist/payments/index.d.ts.map +1 -1
- package/dist/payments/index.js +1 -1
- package/dist/payments/index.js.map +1 -1
- package/dist/payments/reward-claims.js.map +1 -1
- package/dist/payments/rpc-health.d.ts.map +1 -1
- package/dist/payments/seller-buyer-limiter.d.ts.map +1 -1
- package/dist/payments/seller-buyer-limiter.js.map +1 -1
- package/dist/payments/seller-free-tier-limiter.d.ts +54 -0
- package/dist/payments/seller-free-tier-limiter.d.ts.map +1 -1
- package/dist/payments/seller-free-tier-limiter.js +89 -2
- package/dist/payments/seller-free-tier-limiter.js.map +1 -1
- package/dist/payments/seller-free-usage-manager.d.ts.map +1 -1
- package/dist/payments/seller-free-usage-manager.js.map +1 -1
- package/dist/payments/seller-payment-manager.d.ts +61 -2
- package/dist/payments/seller-payment-manager.d.ts.map +1 -1
- package/dist/payments/seller-payment-manager.js +218 -51
- package/dist/payments/seller-payment-manager.js.map +1 -1
- package/dist/reputation/identity-history.d.ts.map +1 -1
- package/dist/reputation/identity-history.js.map +1 -1
- package/dist/reputation/model-reputation.js.map +1 -1
- package/dist/reputation/public-json.js.map +1 -1
- package/dist/reputation/rating-manager.d.ts.map +1 -1
- package/dist/reputation/report-manager.d.ts.map +1 -1
- package/dist/reputation/sybil-risk.js.map +1 -1
- package/dist/reputation/trust-score.d.ts.map +1 -1
- package/dist/reputation/uptime-tracker.d.ts.map +1 -1
- package/dist/requested-service.d.ts +4 -0
- package/dist/requested-service.d.ts.map +1 -1
- package/dist/requested-service.js +21 -55
- package/dist/requested-service.js.map +1 -1
- package/dist/resources/resource-ownership-store.d.ts +5 -0
- package/dist/resources/resource-ownership-store.d.ts.map +1 -1
- package/dist/resources/resource-ownership-store.js +10 -0
- package/dist/resources/resource-ownership-store.js.map +1 -1
- package/dist/routing/default-router.d.ts.map +1 -1
- package/dist/routing/model-route-ranking.js.map +1 -1
- package/dist/routing/seller-health.d.ts.map +1 -1
- package/dist/routing/seller-health.js.map +1 -1
- package/dist/seller-request-handler.d.ts +31 -2
- package/dist/seller-request-handler.d.ts.map +1 -1
- package/dist/seller-request-handler.js +200 -68
- package/dist/seller-request-handler.js.map +1 -1
- package/dist/utils/file-lock.js.map +1 -1
- package/dist/utils/response-body.d.ts.map +1 -1
- package/dist/utils/response-body.js.map +1 -1
- package/dist/verification/samples.d.ts.map +1 -1
- package/dist/verification/samples.js.map +1 -1
- package/dist/verification/storage.d.ts.map +1 -1
- package/dist/verification/tee-status.d.ts +1 -1
- package/dist/verification/tee-status.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { ANTSEED_ATTEST_PATH, ANTSEED_CHANNEL_BINDING_HEADER } from './interfaces/plugin.js';
|
|
2
2
|
import { FREE_TIER_SERVED_COVERED, FREE_TIER_SERVED_HEADER, powerToAntsEpochs } from './payments/free-tier-program.js';
|
|
3
3
|
import { FREE_TIER_DELEGATIONS_HEADER } from './payments/free-tier-delegation.js';
|
|
4
|
+
function describeFreeTierScreenRefusal(refusal) {
|
|
5
|
+
return refusal.reason === 'new_buyer_context'
|
|
6
|
+
? `new buyer context inputTokens~${refusal.inputTokens} > ${refusal.maxInputTokens}`
|
|
7
|
+
: `moved conversation from ${refusal.owner} (${refusal.messages} messages, ~${refusal.tokens} tokens)`;
|
|
8
|
+
}
|
|
4
9
|
const FREE_TIER_EXHAUSTED_MESSAGES = {
|
|
5
10
|
address: 'This seller free tier has been exhausted for your buyer address.',
|
|
6
11
|
ip: 'This seller free tier has been exhausted for your IP address.',
|
|
7
12
|
stake: 'This seller staked free tier has been exhausted for your stake.',
|
|
8
13
|
stake_required: 'This model is free only for buyers staked on this seller.',
|
|
9
14
|
};
|
|
10
|
-
import { ProxyMux } from './proxy/proxy-mux.js';
|
|
15
|
+
import { ByteBudget, DEFAULT_MAX_UPLOAD_BODY_BYTES, ProxyMux } from './proxy/proxy-mux.js';
|
|
16
|
+
import { ConnectionState } from './types/connection.js';
|
|
11
17
|
import { computeCostUsdc, estimateTokensFromBytesSampled, } from './payments/pricing.js';
|
|
12
18
|
import { debugLog, debugWarn, isContentFreeLogging } from './utils/debug.js';
|
|
13
|
-
import { CONNECTION_CAPABILITY_RESPONSE_AUTH_V1, DEFAULT_FIRST_SIGN_CAP, DEFAULT_TOP_UP_SETTLED_THRESHOLD_BPS, computeOneOffChannelPlan, PAYMENT_CODE_CHANNEL_EXHAUSTED, PAYMENT_CODE_ONE_OFF_CHANNEL_REQUIRED, } from './types/protocol.js';
|
|
14
|
-
import { createResponseAuthPayload, createStreamingResponseHash } from './verification/response-auth.js';
|
|
19
|
+
import { CONNECTION_CAPABILITY_RESPONSE_AUTH_V1, DEFAULT_FIRST_SIGN_CAP, DEFAULT_TOP_UP_SETTLED_THRESHOLD_BPS, computeOneOffChannelPlan, PAYMENT_CODE_CHANNEL_EXHAUSTED, PAYMENT_CODE_ONE_OFF_CHANNEL_REQUIRED, VIDEO_JOB_HOLD_CODES, } from './types/protocol.js';
|
|
20
|
+
import { createResponseAuthPayload, createStreamingResponseHash, hashRequest } from './verification/response-auth.js';
|
|
15
21
|
import { ANTSEED_STREAMING_RESPONSE_HEADER, VIDEO_DOWNLOAD_STREAM_HEADER, VIDEO_DOWNLOAD_STREAM_VERSION } from '@antseed/protocol/http';
|
|
16
22
|
import { isServiceHealthFailing, preferHealthyUpstream, serviceHealthOf } from '@antseed/protocol/peer-metadata';
|
|
17
23
|
import { hasJsonContentType, tryParseJsonObject } from './utils/json-codec.js';
|
|
@@ -26,8 +32,8 @@ import { exposedResponseHeaders } from './utils/response-headers.js';
|
|
|
26
32
|
import { ExposedSseStream, exposedJsonBody } from './utils/response-body.js';
|
|
27
33
|
import { usageForBilling } from '@antseed/buyer-core';
|
|
28
34
|
import { isCanonicalRequestPath } from './proxy/request-path.js';
|
|
29
|
-
import { SERVICE_REQUIRED, billedRequestBody } from './requested-service.js';
|
|
30
|
-
import { buildSelfHealthErrorResponse, buildUpstreamRateLimitedResponse, buildUpstreamUnavailableResponse, isUpstreamAccountError, isUpstreamFailureStatus } from './health/self-health-error.js';
|
|
35
|
+
import { SERVICE_REQUIRED, billedRequestBody, requestedMaxOutputTokens } from './requested-service.js';
|
|
36
|
+
import { buildSelfHealthErrorResponse, buildUpstreamRateLimitedResponse, buildUpstreamUnavailableResponse, describeUpstreamError, isUpstreamAccountError, isUpstreamFailureStatus } from './health/self-health-error.js';
|
|
31
37
|
import { StreamOutcome } from './health/stream-outcome.js';
|
|
32
38
|
import { routingProtocolForPath, routingProtocolOf, routingRequestOf, routingWireProtocol, ROUTING_PROTOCOLS } from '@antseed/protocol/routing';
|
|
33
39
|
/** A seller's services of one routing protocol. */
|
|
@@ -133,6 +139,12 @@ function takeHeader(headers, name) {
|
|
|
133
139
|
}
|
|
134
140
|
return value;
|
|
135
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Most request body bytes a seller holds at once, uploads still arriving included.
|
|
144
|
+
* A request is held in memory until its response is sent, so this bounds what a
|
|
145
|
+
* burst of large requests can make the seller allocate.
|
|
146
|
+
*/
|
|
147
|
+
export const DEFAULT_MAX_IN_FLIGHT_REQUEST_BYTES = 256 * 1024 * 1024;
|
|
136
148
|
/** Debounce interval for metadata refresh after load changes. */
|
|
137
149
|
const METADATA_REFRESH_DEBOUNCE_MS = 200;
|
|
138
150
|
/** Time to wait for a catch-up SpendingAuth before returning 402. */
|
|
@@ -169,8 +181,11 @@ export class SellerRequestHandler {
|
|
|
169
181
|
/** The provider and service pairs already reported as sending no usage figure; each is reported once. */
|
|
170
182
|
_usageMissingReported = new Set();
|
|
171
183
|
_metadataRefreshTimer = null;
|
|
184
|
+
/** Request bodies in memory on every connection: uploads still arriving and requests being served. */
|
|
185
|
+
_inFlightRequestBytes;
|
|
172
186
|
constructor(deps) {
|
|
173
187
|
this._deps = deps;
|
|
188
|
+
this._inFlightRequestBytes = new ByteBudget(Math.max(deps.maxInFlightRequestBytes ?? DEFAULT_MAX_IN_FLIGHT_REQUEST_BYTES, deps.maxUploadBodyBytes ?? DEFAULT_MAX_UPLOAD_BODY_BYTES));
|
|
174
189
|
}
|
|
175
190
|
_allowAttest(buyerPeerId) {
|
|
176
191
|
const now = Date.now();
|
|
@@ -200,13 +215,14 @@ export class SellerRequestHandler {
|
|
|
200
215
|
handleConnection(conn, buyerPeerId, paymentMux, verificationMux) {
|
|
201
216
|
const mux = new ProxyMux(conn, {
|
|
202
217
|
maxUploadBodyBytes: this._deps.maxUploadBodyBytes,
|
|
218
|
+
sharedUploadBudget: this._inFlightRequestBytes,
|
|
203
219
|
});
|
|
204
220
|
/** A request's buyer-limit reservation, finished with the tokens it used however the request ends. */
|
|
205
221
|
const handleProxyRequest = async (request, usageHold) => {
|
|
206
222
|
debugLog(`[SellerHandler] Received request: ${request.method} ${request.path} (reqId=${request.requestId.slice(0, 8)})`);
|
|
207
223
|
// Response auth signs the request as the buyer sent it, so keep its headers before removing seller-only ones.
|
|
208
224
|
const wireHeaders = { ...request.headers };
|
|
209
|
-
|
|
225
|
+
let wireBody = request.body;
|
|
210
226
|
// Delegations are for this seller only: no route may pass them on to a provider or prover.
|
|
211
227
|
const delegationsHeader = takeHeader(request.headers, FREE_TIER_DELEGATIONS_HEADER);
|
|
212
228
|
// Handle /v1/models locally — free metadata endpoint, no payment required.
|
|
@@ -218,6 +234,12 @@ export class SellerRequestHandler {
|
|
|
218
234
|
mux.sendProxyResponse(modelsResponse);
|
|
219
235
|
return;
|
|
220
236
|
}
|
|
237
|
+
if (this._deps.isBuyerBlocked?.(buyerPeerId)) {
|
|
238
|
+
debugLog(`[SellerHandler] Refusing blocked buyer ${buyerPeerId.slice(0, 12)}... (reqId=${request.requestId.slice(0, 8)})`);
|
|
239
|
+
this._deps.emit('request:blocked', { buyerPeerId, requestId: request.requestId, path: pathOnly });
|
|
240
|
+
this._sendJsonError(mux, request.requestId, 403, 'buyer_blocked', 'This seller does not serve your requests.');
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
221
243
|
const routingRequest = routingRequestOf(request.method, request.path);
|
|
222
244
|
if (routingRequest?.action === 'catalog') {
|
|
223
245
|
mux.sendProxyResponse(await this._handleRoutingCatalog(request, buyerPeerId, routingRequest.protocol));
|
|
@@ -360,7 +382,10 @@ export class SellerRequestHandler {
|
|
|
360
382
|
requestBilling = this._captureSellerBillingContext(provider, request);
|
|
361
383
|
unitBillingModel = requestBilling ? this.resolveProviderUnitBillingModel(provider, requestBilling.context) : undefined;
|
|
362
384
|
const facts = requestBilling?.requestFacts;
|
|
363
|
-
|
|
385
|
+
// Refused before payment when the request names options the model can't price (a video's
|
|
386
|
+
// duration, an edit's number of input images).
|
|
387
|
+
const priceUpFront = facts?.kind === 'video' ? facts.video.action === 'create' : facts?.kind === 'image' && facts.image.inputImages !== undefined;
|
|
388
|
+
if (requestBilling && priceUpFront && unitBillingModel)
|
|
364
389
|
this._estimateUnitRequestCostUsdc(requestBilling, unitBillingModel);
|
|
365
390
|
}
|
|
366
391
|
catch (error) {
|
|
@@ -419,17 +444,19 @@ export class SellerRequestHandler {
|
|
|
419
444
|
let coveredByAllowance = false;
|
|
420
445
|
if (!isFreeService && !videoRoute && freeTierLimiter?.appliesTo(freeTierService, { paid: true })) {
|
|
421
446
|
try {
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
buyerPeerId,
|
|
425
|
-
service: freeTierService,
|
|
426
|
-
remoteIp: conn.remoteAddress ?? null,
|
|
427
|
-
standing,
|
|
428
|
-
paid: true,
|
|
447
|
+
const outcome = await this._screenAndConsumeFreeTier(freeTierLimiter, {
|
|
448
|
+
buyerPeerId, service: freeTierService, delegationsHeader, body: request.body, remoteAddress: conn.remoteAddress, paid: true,
|
|
429
449
|
});
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
450
|
+
if (outcome.kind === 'refused') {
|
|
451
|
+
// A request screening refuses is paid as usual and leaves the allowance untouched.
|
|
452
|
+
debugLog(`[SellerHandler] Free allowance does not cover ${freeTierService} for ${buyerPeerId.slice(0, 12)}...: screened out`);
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
const { decision } = outcome;
|
|
456
|
+
coveredByAllowance = decision.allowed;
|
|
457
|
+
debugLog(`[SellerHandler] Free allowance ${coveredByAllowance ? 'covers' : `does not cover (limitedBy=${decision.limitedBy})`} ` +
|
|
458
|
+
`${freeTierService} for ${decision.buyerAddress}`);
|
|
459
|
+
}
|
|
433
460
|
}
|
|
434
461
|
catch (err) {
|
|
435
462
|
// Failing to account leaves the request paid: it can only cost the buyer the listed price.
|
|
@@ -438,15 +465,10 @@ export class SellerRequestHandler {
|
|
|
438
465
|
}
|
|
439
466
|
const isServedFree = isFreeService || coveredByAllowance;
|
|
440
467
|
if (isFreeTierRequest && freeTierLimiter?.appliesTo(freeTierService)) {
|
|
441
|
-
let
|
|
468
|
+
let outcome;
|
|
442
469
|
try {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
decision = freeTierLimiter.consume({
|
|
446
|
-
buyerPeerId,
|
|
447
|
-
service: freeTierService,
|
|
448
|
-
remoteIp: conn.remoteAddress ?? null,
|
|
449
|
-
standing,
|
|
470
|
+
outcome = await this._screenAndConsumeFreeTier(freeTierLimiter, {
|
|
471
|
+
buyerPeerId, service: freeTierService, delegationsHeader, body: request.body, remoteAddress: conn.remoteAddress, paid: false,
|
|
450
472
|
});
|
|
451
473
|
}
|
|
452
474
|
catch (err) {
|
|
@@ -466,6 +488,17 @@ export class SellerRequestHandler {
|
|
|
466
488
|
});
|
|
467
489
|
return;
|
|
468
490
|
}
|
|
491
|
+
if (outcome.kind === 'refused') {
|
|
492
|
+
const { refusal } = outcome;
|
|
493
|
+
const message = refusal.reason === 'new_buyer_context'
|
|
494
|
+
? `This seller serves a new buyer's first ${refusal.requests} free requests up to ${refusal.maxInputTokens} input tokens; `
|
|
495
|
+
+ `this one has about ${refusal.inputTokens}. Start with a shorter conversation, or use a paid model.`
|
|
496
|
+
: 'This conversation was started from another buyer identity, so this seller does not serve it free here. '
|
|
497
|
+
+ 'Continue it from that identity, or use a paid model.';
|
|
498
|
+
this._sendJsonError(mux, request.requestId, 403, refusal.reason === 'new_buyer_context' ? 'free_tier_new_buyer_context' : 'free_tier_moved_conversation', message);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
const { decision } = outcome;
|
|
469
502
|
if (!decision.allowed) {
|
|
470
503
|
const limitedBy = decision.limitedBy ?? 'address';
|
|
471
504
|
const program = decision.program;
|
|
@@ -520,9 +553,13 @@ export class SellerRequestHandler {
|
|
|
520
553
|
const oneOff = spm.getOneOffChannelForRequest(buyerPeerId, request.requestId);
|
|
521
554
|
if (!oneOff) {
|
|
522
555
|
// Before the chain reads, and again with the plan: parallel creates can all pass the first check.
|
|
556
|
+
if (this._sendVideoJobHold(mux, request.requestId, buyerPeerId, spm.videoJobHold(buyerPeerId, request.requestId)))
|
|
557
|
+
return;
|
|
523
558
|
if (this._sendOneOffBackoff(mux, request.requestId, buyerPeerId, spm.oneOffRetryAfterSeconds(buyerPeerId, request.requestId)))
|
|
524
559
|
return;
|
|
525
560
|
const plan = await this._buildOneOffPlan(estimatedRequestCost);
|
|
561
|
+
if (this._sendVideoJobHold(mux, request.requestId, buyerPeerId, spm.videoJobHold(buyerPeerId, request.requestId)))
|
|
562
|
+
return;
|
|
526
563
|
if (this._sendOneOffBackoff(mux, request.requestId, buyerPeerId, spm.registerOneOffPlan(buyerPeerId, request.requestId, plan)))
|
|
527
564
|
return;
|
|
528
565
|
debugLog(`[SellerHandler] Video create ${request.requestId} needs a one-off channel (price=${estimatedRequestCost})`);
|
|
@@ -852,8 +889,24 @@ export class SellerRequestHandler {
|
|
|
852
889
|
}
|
|
853
890
|
return;
|
|
854
891
|
}
|
|
892
|
+
// The connection ended or the session was dropped while this request
|
|
893
|
+
// waited: don't start work that cannot reach the buyer or be billed.
|
|
894
|
+
const connectionEnded = conn.state === ConnectionState.Closed || conn.state === ConnectionState.Failed;
|
|
895
|
+
if (spmAuthorized && (connectionEnded || !spm.hasSession(buyerPeerId))) {
|
|
896
|
+
sendSessionExpired('the admission checks');
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
855
899
|
}
|
|
856
900
|
}
|
|
901
|
+
const buyerSupportsResponseAuth = conn.hasRemoteCapability(CONNECTION_CAPABILITY_RESPONSE_AUTH_V1);
|
|
902
|
+
// When the provider is handed a body the seller wrote, the buyer's is only needed for the hash
|
|
903
|
+
// response auth signs: it is hashed here, so both bodies are not held while the request is served.
|
|
904
|
+
let wireRequestHash;
|
|
905
|
+
if (wireBody !== request.body) {
|
|
906
|
+
if (buyerSupportsResponseAuth)
|
|
907
|
+
wireRequestHash = hashRequest({ ...request, headers: wireHeaders, body: wireBody });
|
|
908
|
+
wireBody = new Uint8Array(0);
|
|
909
|
+
}
|
|
857
910
|
const responseAuthRequest = {
|
|
858
911
|
...request,
|
|
859
912
|
headers: wireHeaders,
|
|
@@ -889,8 +942,12 @@ export class SellerRequestHandler {
|
|
|
889
942
|
let unitCostUsdc = 0n;
|
|
890
943
|
// Hold the channel open for the whole billable span — provider call,
|
|
891
944
|
// spend recording, and NeedAuth — so a buyer-requested close can't land
|
|
892
|
-
// between serving the request and claiming its cost.
|
|
893
|
-
|
|
945
|
+
// between serving the request and claiming its cost. The channel is fixed
|
|
946
|
+
// here: a buyer that disconnects before the answer ends still owes for it.
|
|
947
|
+
const billedChannelId = !isServedFree && !oneOffChannelId && spm?.hasSession(buyerPeerId)
|
|
948
|
+
? spm.getChannelByPeer(buyerPeerId)?.sessionId ?? null
|
|
949
|
+
: null;
|
|
950
|
+
const isBillable = billedChannelId !== null;
|
|
894
951
|
if (isBillable && spm.hasClosingChannel(buyerPeerId)) {
|
|
895
952
|
// A close takes seconds on-chain (a disconnect, an exhausted channel).
|
|
896
953
|
// Let it finish, then ask for a new channel: the buyer opens one and
|
|
@@ -959,6 +1016,8 @@ export class SellerRequestHandler {
|
|
|
959
1016
|
if (chunk.data.byteLength > 0)
|
|
960
1017
|
streamTail = [...streamTail, ...chunk.data.subarray(-2)].slice(-2);
|
|
961
1018
|
mux.sendProxyChunk(chunk);
|
|
1019
|
+
// A provider that awaits this stops reading its upstream while the buyer is behind.
|
|
1020
|
+
return mux.whenWritable();
|
|
962
1021
|
},
|
|
963
1022
|
}, isDownload);
|
|
964
1023
|
if (!streamedResponseStarted) {
|
|
@@ -975,10 +1034,12 @@ export class SellerRequestHandler {
|
|
|
975
1034
|
const upstreamBody = response.body ?? new Uint8Array(0);
|
|
976
1035
|
const upstreamError = statusCode >= 400 ? new TextDecoder().decode(upstreamBody.slice(0, 2_000)) : '';
|
|
977
1036
|
this._deps.emit('provider:response', { provider, service: requestedModel, statusCode, body: upstreamError, billable: videoRoute?.action !== 'retrieve' });
|
|
1037
|
+
const upstreamStatusCode = statusCode;
|
|
1038
|
+
let maskedAs = null;
|
|
978
1039
|
if (!streamedResponseStarted && isUpstreamAccountError(statusCode, upstreamError)) {
|
|
979
|
-
debugWarn(`[SellerHandler] Upstream account error: status=${statusCode} provider="${provider.name}" model="${requestedModel}" body=${upstreamError.slice(0, 200)}`);
|
|
980
1040
|
response = buildUpstreamUnavailableResponse(request.requestId, requestedModel);
|
|
981
1041
|
statusCode = response.statusCode;
|
|
1042
|
+
maskedAs = 'account';
|
|
982
1043
|
}
|
|
983
1044
|
else if (!streamedResponseStarted && statusCode === 429) {
|
|
984
1045
|
response = buildUpstreamRateLimitedResponse(request.requestId, requestedModel, takeHeader({ ...response.headers }, 'retry-after'));
|
|
@@ -987,6 +1048,14 @@ export class SellerRequestHandler {
|
|
|
987
1048
|
if (!streamedResponseStarted && isServiceHealthFailing(health) && isUpstreamFailureStatus(statusCode)) {
|
|
988
1049
|
response = buildSelfHealthErrorResponse(request.requestId, requestedModel, health, response);
|
|
989
1050
|
statusCode = response.statusCode;
|
|
1051
|
+
maskedAs ??= 'self-health';
|
|
1052
|
+
}
|
|
1053
|
+
if (maskedAs) {
|
|
1054
|
+
// The buyer gets a generic 503; the seller's log keeps what the upstream said.
|
|
1055
|
+
this._deps.emit('provider:error-masked', {
|
|
1056
|
+
provider: provider.name, service: requestedModel, reason: maskedAs, statusCode,
|
|
1057
|
+
upstreamStatusCode, detail: describeUpstreamError(upstreamStatusCode, upstreamError),
|
|
1058
|
+
});
|
|
990
1059
|
}
|
|
991
1060
|
responseBody = response.body ?? new Uint8Array(0);
|
|
992
1061
|
responseForAuth = response;
|
|
@@ -1094,6 +1163,12 @@ export class SellerRequestHandler {
|
|
|
1094
1163
|
billingUsageReport = finalBilling.billingUsage;
|
|
1095
1164
|
unitCostUsdc = finalBilling.costUsdc;
|
|
1096
1165
|
}
|
|
1166
|
+
// A failed request is never charged: the buyer got an error, not an answer,
|
|
1167
|
+
// even when the error body carries a usage figure or a unit adapter prices it.
|
|
1168
|
+
if (statusCode >= 400) {
|
|
1169
|
+
responseUsage = { inputTokens: 0, outputTokens: 0, freshInputTokens: 0, cachedInputTokens: 0 };
|
|
1170
|
+
unitCostUsdc = 0n;
|
|
1171
|
+
}
|
|
1097
1172
|
// Record metering
|
|
1098
1173
|
const finishedAt = Date.now();
|
|
1099
1174
|
const latencyMs = finishedAt - startTime;
|
|
@@ -1125,11 +1200,13 @@ export class SellerRequestHandler {
|
|
|
1125
1200
|
}
|
|
1126
1201
|
// Record spend and send NeedAuth with cost data after every request.
|
|
1127
1202
|
// The buyer validates the cost independently and responds with SpendingAuth.
|
|
1128
|
-
if (
|
|
1203
|
+
if (spm && isBillable) {
|
|
1129
1204
|
const usage = responseUsage;
|
|
1130
1205
|
const tokenCostUsdc = computeCostUsdc(usage.freshInputTokens, usage.outputTokens, requestPricing, usage.cachedInputTokens);
|
|
1131
1206
|
const costUsdc = tokenCostUsdc + unitCostUsdc;
|
|
1132
|
-
|
|
1207
|
+
// Only the channel that admitted this request, never one that replaced it.
|
|
1208
|
+
const current = spm.getChannelByPeer(buyerPeerId);
|
|
1209
|
+
const session = current?.sessionId === billedChannelId ? current : null;
|
|
1133
1210
|
if (session && spm.connectionsClosed) {
|
|
1134
1211
|
// The node is stopping and its connections are closed: this
|
|
1135
1212
|
// response never reached the buyer, so it is not billed.
|
|
@@ -1170,7 +1247,6 @@ export class SellerRequestHandler {
|
|
|
1170
1247
|
this._chargeDeliveredVideo(videoRoute, responseForAuth, buyerPeerId, paymentMux, request.requestId);
|
|
1171
1248
|
this._closeFailedVideoJob(videoRoute, responseForAuth, buyerPeerId);
|
|
1172
1249
|
}
|
|
1173
|
-
const buyerSupportsResponseAuth = conn.hasRemoteCapability(CONNECTION_CAPABILITY_RESPONSE_AUTH_V1);
|
|
1174
1250
|
if (responseForAuth && buyerSupportsResponseAuth) {
|
|
1175
1251
|
const channelId = oneOffChannelId ?? spm?.getChannelByPeer(buyerPeerId)?.sessionId ?? null;
|
|
1176
1252
|
this._sendResponseAuthBestEffort(verificationMux, responseAuthRequest, responseForAuth, {
|
|
@@ -1180,6 +1256,7 @@ export class SellerRequestHandler {
|
|
|
1180
1256
|
responseStartedAt,
|
|
1181
1257
|
responseCompletedAt: Date.now(),
|
|
1182
1258
|
channelId,
|
|
1259
|
+
requestHash: wireRequestHash,
|
|
1183
1260
|
});
|
|
1184
1261
|
}
|
|
1185
1262
|
}
|
|
@@ -1193,12 +1270,19 @@ export class SellerRequestHandler {
|
|
|
1193
1270
|
}
|
|
1194
1271
|
};
|
|
1195
1272
|
mux.onProxyRequest(async (request) => {
|
|
1273
|
+
// The body stays in memory until the response is sent, so it counts until then.
|
|
1274
|
+
const bodyBytes = request.body.length;
|
|
1275
|
+
if (!this._inFlightRequestBytes.tryReserve(bodyBytes)) {
|
|
1276
|
+
this._sendJsonError(mux, request.requestId, 503, 'seller_busy', 'Seller is at its limit for request bytes in flight; retry shortly', { 'retry-after': '1' });
|
|
1277
|
+
return;
|
|
1278
|
+
}
|
|
1196
1279
|
const usageHold = { reservation: null, estimate: 0, tokens: 0 };
|
|
1197
1280
|
try {
|
|
1198
1281
|
await handleProxyRequest(request, usageHold);
|
|
1199
1282
|
}
|
|
1200
1283
|
finally {
|
|
1201
1284
|
usageHold.reservation?.finish(usageHold.tokens);
|
|
1285
|
+
this._inFlightRequestBytes.release(bodyBytes);
|
|
1202
1286
|
}
|
|
1203
1287
|
});
|
|
1204
1288
|
return { mux };
|
|
@@ -1356,6 +1440,37 @@ export class SellerRequestHandler {
|
|
|
1356
1440
|
this._sendJsonError(mux, requestId, 429, 'one_off_channel_backoff', `This seller is not opening another video payment channel for this buyer yet; retry in ${retryAfterSeconds} seconds`, { 'retry-after': String(retryAfterSeconds) });
|
|
1357
1441
|
return true;
|
|
1358
1442
|
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Answers a video create the buyer's own earlier jobs here hold back, with
|
|
1445
|
+
* what the buyer can do about it and which jobs they are (`error.jobs`, the
|
|
1446
|
+
* IDs the buyer got when it started them). Only this buyer's jobs are
|
|
1447
|
+
* listed. Returns whether it answered.
|
|
1448
|
+
*/
|
|
1449
|
+
_sendVideoJobHold(mux, requestId, buyerPeerId, hold) {
|
|
1450
|
+
if (!hold)
|
|
1451
|
+
return false;
|
|
1452
|
+
debugWarn(`[SellerHandler] Buyer ${buyerPeerId.slice(0, 12)}... held back from another video: ${hold.code}`);
|
|
1453
|
+
const message = hold.code === VIDEO_JOB_HOLD_CODES.openLimit
|
|
1454
|
+
? `You have ${hold.limit} videos on this seller that are not downloaded yet. Download one before starting another here. Their job IDs are in error.jobs.`
|
|
1455
|
+
: hold.code === VIDEO_JOB_HOLD_CODES.paymentPending
|
|
1456
|
+
? 'A video you downloaded from this seller is not paid for yet. New videos start here once it is paid. Its job ID is in error.jobs.'
|
|
1457
|
+
: 'A video you started on this seller over an hour ago has not been downloaded. Download it, or check its status until it ends, before starting another here. Its job ID is in error.jobs.';
|
|
1458
|
+
let jobs = [];
|
|
1459
|
+
try {
|
|
1460
|
+
jobs = (this._deps.resourceOwnershipStore?.jobsForChannels(buyerPeerId.toLowerCase(), hold.channelIds) ?? [])
|
|
1461
|
+
.map((job) => ({ id: job.resourceId, protocol: job.protocol }));
|
|
1462
|
+
}
|
|
1463
|
+
catch (err) {
|
|
1464
|
+
debugWarn(`[SellerHandler] Could not list held video jobs: ${err instanceof Error ? err.message : err}`);
|
|
1465
|
+
}
|
|
1466
|
+
mux.sendProxyResponse({
|
|
1467
|
+
requestId,
|
|
1468
|
+
statusCode: 409,
|
|
1469
|
+
headers: { 'content-type': 'application/json', 'retry-after': String(hold.retryAfterSeconds) },
|
|
1470
|
+
body: new TextEncoder().encode(JSON.stringify({ error: { code: hold.code, message, jobs } })),
|
|
1471
|
+
});
|
|
1472
|
+
return true;
|
|
1473
|
+
}
|
|
1359
1474
|
_sendBuyerUsageLimited(mux, requestId, buyerPeerId, provider, retryAfterSeconds) {
|
|
1360
1475
|
debugWarn(`[SellerHandler] Buyer ${buyerPeerId.slice(0, 12)}... over its usage limit on provider "${provider}", retry in ${retryAfterSeconds}s`);
|
|
1361
1476
|
this._sendJsonError(mux, requestId, 429, 'buyer_usage_limited', 'This buyer has reached its usage limit with this seller; retry later', { 'retry-after': String(retryAfterSeconds) });
|
|
@@ -1371,6 +1486,44 @@ export class SellerRequestHandler {
|
|
|
1371
1486
|
this._usageMissingReported.add(key);
|
|
1372
1487
|
this._deps.emit('provider:usage-missing', { provider, service });
|
|
1373
1488
|
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Resolve the buyer's staked standing, screen a free request, and count it
|
|
1491
|
+
* unless screening refused it. An admitted request is recorded for
|
|
1492
|
+
* conversation matching.
|
|
1493
|
+
*/
|
|
1494
|
+
async _screenAndConsumeFreeTier(limiter, input) {
|
|
1495
|
+
const { buyerPeerId, service } = input;
|
|
1496
|
+
// No header means the buyer has no codes any more: '' forgets the remembered ones.
|
|
1497
|
+
const standing = await limiter.resolveStanding(buyerPeerId, input.delegationsHeader ?? '');
|
|
1498
|
+
// Token estimation and parsing happen only when a check needs them.
|
|
1499
|
+
const screen = limiter.screen({
|
|
1500
|
+
buyerPeerId,
|
|
1501
|
+
service,
|
|
1502
|
+
standing,
|
|
1503
|
+
paid: input.paid,
|
|
1504
|
+
inputTokens: () => estimateTokensFromBytesSampled(input.body),
|
|
1505
|
+
body: () => tryParseJsonObject(input.body),
|
|
1506
|
+
});
|
|
1507
|
+
const ip = input.remoteAddress ?? 'unknown';
|
|
1508
|
+
if (screen.refusal) {
|
|
1509
|
+
debugLog(`[SellerHandler] Free tier refused ${service} for ${buyerPeerId.slice(0, 12)}... ip=${ip}: ${describeFreeTierScreenRefusal(screen.refusal)}`);
|
|
1510
|
+
}
|
|
1511
|
+
else if (screen.wouldRefuse) {
|
|
1512
|
+
debugLog(`[SellerHandler] Free tier would refuse ${service} for ${buyerPeerId.slice(0, 12)}... ip=${ip} (log only): ${describeFreeTierScreenRefusal(screen.wouldRefuse)}`);
|
|
1513
|
+
}
|
|
1514
|
+
if (screen.refusal)
|
|
1515
|
+
return { kind: 'refused', refusal: screen.refusal };
|
|
1516
|
+
const decision = limiter.consume({
|
|
1517
|
+
buyerPeerId,
|
|
1518
|
+
service,
|
|
1519
|
+
remoteIp: input.remoteAddress ?? null,
|
|
1520
|
+
standing,
|
|
1521
|
+
...(input.paid ? { paid: true } : {}),
|
|
1522
|
+
});
|
|
1523
|
+
if (decision.allowed)
|
|
1524
|
+
screen.served();
|
|
1525
|
+
return { kind: 'counted', decision };
|
|
1526
|
+
}
|
|
1374
1527
|
_sendJsonError(mux, requestId, statusCode, code, message, extraHeaders = {}) {
|
|
1375
1528
|
mux.sendProxyResponse({
|
|
1376
1529
|
requestId,
|
|
@@ -1635,15 +1788,11 @@ export class SellerRequestHandler {
|
|
|
1635
1788
|
if (isZeroTokenPricing(pricing)) {
|
|
1636
1789
|
return { cost: 0n, inputTokens: 0, maxOutputTokens: 0 };
|
|
1637
1790
|
}
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
}
|
|
1641
|
-
const body = tryParseJsonObject(request.body);
|
|
1642
|
-
if (!body) {
|
|
1791
|
+
const maxOutputTokens = this._requestedMaxOutputTokens(request);
|
|
1792
|
+
if (maxOutputTokens === null) {
|
|
1643
1793
|
return null;
|
|
1644
1794
|
}
|
|
1645
1795
|
const inputTokens = estimateTokensFromBytesSampled(request.body);
|
|
1646
|
-
const maxOutputTokens = this._extractMaxOutputTokens(body);
|
|
1647
1796
|
return {
|
|
1648
1797
|
cost: computeCostUsdc(inputTokens, maxOutputTokens, pricing),
|
|
1649
1798
|
inputTokens,
|
|
@@ -1660,39 +1809,21 @@ export class SellerRequestHandler {
|
|
|
1660
1809
|
if (costEstimate && costEstimate.inputTokens > 0) {
|
|
1661
1810
|
return costEstimate.inputTokens + (costEstimate.maxOutputTokens || DEFAULT_OUTPUT_RESERVATION_TOKENS);
|
|
1662
1811
|
}
|
|
1663
|
-
|
|
1664
|
-
return estimateTokensFromBytesSampled(request.body) + ((body && this._extractMaxOutputTokens(body)) || DEFAULT_OUTPUT_RESERVATION_TOKENS);
|
|
1665
|
-
}
|
|
1666
|
-
_extractMaxOutputTokens(body) {
|
|
1667
|
-
const candidates = [
|
|
1668
|
-
body["max_tokens"],
|
|
1669
|
-
body["max_completion_tokens"],
|
|
1670
|
-
body["max_output_tokens"],
|
|
1671
|
-
body["maxTokens"],
|
|
1672
|
-
body["maxCompletionTokens"],
|
|
1673
|
-
body["maxOutputTokens"],
|
|
1674
|
-
];
|
|
1675
|
-
for (const value of candidates) {
|
|
1676
|
-
const parsed = this._parsePositiveInteger(value);
|
|
1677
|
-
if (parsed !== null)
|
|
1678
|
-
return parsed;
|
|
1679
|
-
}
|
|
1680
|
-
return 0;
|
|
1812
|
+
return estimateTokensFromBytesSampled(request.body) + (this._requestedMaxOutputTokens(request) || DEFAULT_OUTPUT_RESERVATION_TOKENS);
|
|
1681
1813
|
}
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
}
|
|
1690
|
-
else {
|
|
1691
|
-
return null;
|
|
1692
|
-
}
|
|
1693
|
-
if (!Number.isFinite(numeric) || numeric <= 0)
|
|
1814
|
+
/**
|
|
1815
|
+
* The most output tokens a JSON request asks for (0 when it names no limit), or null when its body
|
|
1816
|
+
* is not a JSON object. A body the seller wrote was read for this as it was written; any other is
|
|
1817
|
+
* parsed here.
|
|
1818
|
+
*/
|
|
1819
|
+
_requestedMaxOutputTokens(request) {
|
|
1820
|
+
if (!this._isJsonRequest(request))
|
|
1694
1821
|
return null;
|
|
1695
|
-
|
|
1822
|
+
const billed = this._requestedServices.get(request);
|
|
1823
|
+
if (billed && billed.service !== null && billed.body === request.body && billed.maxOutputTokens !== undefined)
|
|
1824
|
+
return billed.maxOutputTokens;
|
|
1825
|
+
const body = tryParseJsonObject(request.body);
|
|
1826
|
+
return body ? requestedMaxOutputTokens(body) : null;
|
|
1696
1827
|
}
|
|
1697
1828
|
async _executeRequest(provider, request, sellerCost, streamCallbacks, isDownload = false) {
|
|
1698
1829
|
// Every provider's response goes through here, so no plugin can expose its
|
|
@@ -1804,6 +1935,7 @@ export class SellerRequestHandler {
|
|
|
1804
1935
|
try {
|
|
1805
1936
|
const payload = createResponseAuthPayload({
|
|
1806
1937
|
request,
|
|
1938
|
+
...(context.requestHash ? { requestHash: context.requestHash } : {}),
|
|
1807
1939
|
response,
|
|
1808
1940
|
buyerPeerId: context.buyerPeerId,
|
|
1809
1941
|
sellerPeerId: this._deps.identity.peerId,
|