Skip to content

PqErc20ServerScheme

Defined in: packages/scheme-qorechain/src/server.ts:67

x402 SchemeNetworkServer for pq-erc20: turns a price into requirements and adds the escrow address and protocol version to extra.

new PqErc20ServerScheme(options): PqErc20ServerScheme

Defined in: packages/scheme-qorechain/src/server.ts:70

PqErc20ServerOptions

PqErc20ServerScheme

PriceParser.constructor

readonly defaultAssetTransferMethod: "default" = "default"

Defined in: packages/scheme-qorechain/src/server.ts:26

ATM used when requirements.extra.assetTransferMethod is absent. Use "default" only as SDK plumbing when the scheme has no on-wire ATM.

PriceParser.defaultAssetTransferMethod


readonly paymentFlows: object

Defined in: packages/scheme-qorechain/src/server.ts:27

Payment flows supported per assetTransferMethod. Every ATM the scheme accepts must appear here.

default: object

default: "authorization"

supported: readonly ["authorization"]

PriceParser.paymentFlows


readonly scheme: "pq-erc20" = SCHEME_ERC20

Defined in: packages/scheme-qorechain/src/server.ts:68

PriceParser.scheme

enhancePaymentRequirements(requirements, _supportedKind?, _facilitatorExtensions?): Promise<PaymentRequirements>

Defined in: packages/scheme-qorechain/src/server.ts:74

Build payment requirements for this scheme/network combination

PaymentRequirements

SupportedKind

The supported kind from facilitator’s /supported endpoint

string[]

Extensions supported by the facilitator

Promise<PaymentRequirements>

Enhanced payment requirements ready to be sent to clients

PriceParser.enhancePaymentRequirements


getAssetDecimals(asset, network): number | undefined

Defined in: packages/scheme-qorechain/src/server.ts:44

Optional asset decimals for $… settlement overrides. Core throws when this is missing or returns undefined

string

Asset address or symbol

`${string}:${string}`

Network identifier

number | undefined

Decimal places, or undefined when unknown

PriceParser.getAssetDecimals


parsePrice(price, network): Promise<AssetAmount>

Defined in: packages/scheme-qorechain/src/server.ts:33

Convert a user-friendly price to the scheme’s specific amount and asset format Always returns a Promise for consistency

Price

User-friendly price (e.g., “$0.10”, “0.10”, { amount: “100000”, asset: “USDC” })

`${string}:${string}`

The network identifier for context

Promise<AssetAmount>

Promise that resolves to the converted amount, asset identifier, and any extra metadata

// For EVM networks with USDC:
await parsePrice("$0.10", "eip155:8453") => { amount: "100000", asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }
// For custom schemes:
await parsePrice("10 points", "custom:network") => { amount: "10", asset: "points" }

PriceParser.parsePrice