Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/scan/src/lib/x402/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type InputSchema = OutputSchema['input'];
* the database in a common format for v1 and v2.
*/
export const normalizedAcceptSchema = z3.object({
scheme: z3.literal('exact'),
scheme: z3.enum(['exact', 'escrow']),
network: z3.string(),
maxAmountRequired: z3.string(),
payTo: z3.string(),
Expand Down Expand Up @@ -71,7 +71,7 @@ function normalizePaymentRequirement(
): NormalizedAccept {
if (isV2PaymentRequirement(accept)) {
return {
scheme: accept.scheme as 'exact',
scheme: accept.scheme as 'exact' | 'escrow',
network: normalizeChainId(accept.network),
maxAmountRequired: accept.amount,
payTo: accept.payTo,
Expand Down
2 changes: 1 addition & 1 deletion apps/scan/src/services/db/resources/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const upsertResourceSchema = z.object({
metadata: z.record(z.string(), z.any()).optional(),
accepts: z.array(
z.object({
scheme: z.enum(['exact']),
scheme: z.enum(['exact', 'escrow']),
network: z.union([
z.enum([
'base_sepolia',
Expand Down
1 change: 1 addition & 0 deletions packages/internal/databases/scan/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ model Resources {
}

enum AcceptsScheme {
escrow
exact
}

Expand Down