PriceParser
Defined in: packages/scheme-qorechain/src/server.ts:24
Price handling shared by both PQ-402 server schemes: $… and … fUSD
prices resolve to the network’s default asset, in atomic units.
Extended by
Section titled “Extended by”Implements
Section titled “Implements”SchemeNetworkServer
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PriceParser(
qore):PriceParser
Defined in: packages/scheme-qorechain/src/server.ts:31
Parameters
Section titled “Parameters”Returns
Section titled “Returns”PriceParser
Properties
Section titled “Properties”defaultAssetTransferMethod
Section titled “defaultAssetTransferMethod”
readonlydefaultAssetTransferMethod:"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.
Implementation of
Section titled “Implementation of”SchemeNetworkServer.defaultAssetTransferMethod
paymentFlows
Section titled “paymentFlows”
readonlypaymentFlows:object
Defined in: packages/scheme-qorechain/src/server.ts:27
Payment flows supported per assetTransferMethod. Every ATM the scheme accepts must appear here.
default
Section titled “default”default:
object
default.default
Section titled “default.default”default:
"authorization"
default.supported
Section titled “default.supported”supported: readonly [
"authorization"]
Implementation of
Section titled “Implementation of”SchemeNetworkServer.paymentFlows
scheme
Section titled “scheme”
abstractreadonlyscheme:string
Defined in: packages/scheme-qorechain/src/server.ts:25
Implementation of
Section titled “Implementation of”SchemeNetworkServer.scheme
Methods
Section titled “Methods”enhancePaymentRequirements()
Section titled “enhancePaymentRequirements()”
abstractenhancePaymentRequirements(requirements,supportedKind,facilitatorExtensions):Promise<PaymentRequirements>
Defined in: packages/scheme-qorechain/src/server.ts:50
Build payment requirements for this scheme/network combination
Parameters
Section titled “Parameters”requirements
Section titled “requirements”PaymentRequirements
supportedKind
Section titled “supportedKind”SupportedKind
The supported kind from facilitator’s /supported endpoint
facilitatorExtensions
Section titled “facilitatorExtensions”string[]
Extensions supported by the facilitator
Returns
Section titled “Returns”Promise<PaymentRequirements>
Enhanced payment requirements ready to be sent to clients
Implementation of
Section titled “Implementation of”SchemeNetworkServer.enhancePaymentRequirements
getAssetDecimals()
Section titled “getAssetDecimals()”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
Parameters
Section titled “Parameters”string
Asset address or symbol
network
Section titled “network”`${string}:${string}`
Network identifier
Returns
Section titled “Returns”number | undefined
Decimal places, or undefined when unknown
Implementation of
Section titled “Implementation of”SchemeNetworkServer.getAssetDecimals
parsePrice()
Section titled “parsePrice()”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
Parameters
Section titled “Parameters”Price
User-friendly price (e.g., “$0.10”, “0.10”, { amount: “100000”, asset: “USDC” })
network
Section titled “network”`${string}:${string}`
The network identifier for context
Returns
Section titled “Returns”Promise<AssetAmount>
Promise that resolves to the converted amount, asset identifier, and any extra metadata
Example
Section titled “Example”// 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" }Implementation of
Section titled “Implementation of”SchemeNetworkServer.parsePrice