Skip to main content

PricingDocument

The pricing document. Its complete JSON Schema is https://co-relayer.com/schemas/pricing-v1.json. This schema types the top-level keys and the tier record, and leaves the rest to that schema.

schemastring<uri>required
documentVersionintegerrequired
updatedAtMsinteger<int64>required

Unix time in milliseconds.

Possible values: >= 0

network objectrequired

Each network publishes its own pricing document. Compare network.chainId with the chainID of every transaction you sign.

property name*any

Each network publishes its own pricing document. Compare network.chainId with the chainID of every transaction you sign.

Examples:
Example: {"caip2":"mvx:1","x402Network":"multiversx:1","chainId":"1","roundDurationMs":600}
source objectrequired

source.views lists the contract views the document is generated from: getConfig, getPricingConfig, getTiers, getTariff, getRuSchedule, getRateClasses, getSwapBudget.

property name*any

source.views lists the contract views the document is generated from: getConfig, getPricingConfig, getTiers, getTariff, getRuSchedule, getRateClasses, getSwapBudget.

paymentToken objectrequired

Read from the contract's getConfig(): USDC-c76f1f on mainnet, USDC-350c4e on devnet.

property name*any

Read from the contract's getConfig(): USDC-c76f1f on mainnet, USDC-350c4e on devnet.

refundablebooleanrequired
Constant value: false
tariff objectrequired
unitstringrequired
effectiveDecimalStringrequired

Non-negative integer as decimal string (pricing document family).

Possible values: Value must match regular expression ^[0-9]+$

versionintegerrequired
effectiveSinceMsinteger<int64>

Unix time in milliseconds.

Possible values: >= 0

pendingstring | nullnullablerequired
pendingEffectiveMs(integer | null)<int64>nullablerequired
rules objectrequired
property name*any
formulas objectrequired
property name*any
relayUnit objectrequired
property name*any
admission objectrequired
property name*any
deposit objectrequired
property name*any
lifecycle objectrequired
property name*any
payg objectrequired
property name*any
rateClasses objectrequired
policyVersionintegerrequired
classes object[]required
  • Array [
  • rateClassintegerrequired

    Possible values: >= 1

    ruPerSecSustainedintegerrequired
    ruPerSecBurstintegerrequired
    gasLimitPerSecPerShardDecimalStringrequired

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    gasBurstDecimalString

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    maxGasLimitDecimalString

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    maxRuPerTxDecimalString

    Per-transaction RU ceiling of the class, including the data term: 15 for classes 1 and 6, 25 for classes 2-5. admission.maxRuPerTx is the largest value of any class (admission.maxRuPerTxNote).

    Possible values: Value must match regular expression ^[0-9]+$

    ruPerHourinteger
  • ]
  • tiers object[]required
  • Array [
  • tierIdintegerrequired
    slugstringrequired
    namestringrequired
    audiencestringrequired

    Possible values: [human, agent]

    statusstringrequired

    Possible values: [draft, active, legacy, retired]

    availableboolean

    False while a listed tier cannot be bought. On mainnet, tiers 4, 5 and 13 stay draft until the relayer float for their rate class is funded; all eight tiers are active on devnet.

    unavailableReasonstring

    Present only when available is false.

    Possible values: [CAPACITY]

    periodMsinteger<int64>required

    Possible values: >= 0

    capRuDecimalStringrequired

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    priceUnitsDecimalStringrequired

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    paygBpsintegerrequired
    priceDecimalStringrequired

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    paygPricePerRuDecimalStringrequired

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    pendingPriceDecimalString

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    pendingPaygPricePerRuDecimalString

    Non-negative integer as decimal string (pricing document family).

    Possible values: Value must match regular expression ^[0-9]+$

    maxSendersintegerrequired
    flagsstring[]required

    Possible values: [agent, payg_allowed, priority_lane, dedicated_pool, sponsor_any_sender, custom]

    rateClassintegerrequired
    slaClassstringrequired

    Possible values: [best-effort, standard, priority, dedicated]

    successorTierIdinteger | nullnullablerequired
    singlePaymentPurchasablebooleanrequired
    notestring
  • ]
  • howToBuy objectrequired

    How to buy a plan. howToBuy.freeOperations lists the contract calls that are relayed free of charge. howToBuy.onChain.gasLimit and gasLimitFlags are measured on each network, so the values differ between devnet and mainnet.

    property name*any

    How to buy a plan. howToBuy.freeOperations lists the contract calls that are relayed free of charge. howToBuy.onChain.gasLimit and gasLimitFlags are measured on each network, so the values differ between devnet and mainnet.

    links objectrequired
    property name*any
    PricingDocument
    {
    "schema": "string",
    "documentVersion": 0,
    "updatedAtMs": 0,
    "network": {
    "caip2": "mvx:1",
    "x402Network": "multiversx:1",
    "chainId": "1",
    "roundDurationMs": 600
    },
    "source": {},
    "paymentToken": {},
    "refundable": true,
    "tariff": {
    "unit": "string",
    "effective": "string",
    "version": 0,
    "effectiveSinceMs": 0,
    "pending": "string",
    "pendingEffectiveMs": 0,
    "rules": {},
    "formulas": {}
    },
    "relayUnit": {},
    "admission": {},
    "deposit": {},
    "lifecycle": {},
    "payg": {},
    "rateClasses": {
    "policyVersion": 0,
    "classes": [
    {
    "rateClass": 1,
    "ruPerSecSustained": 1,
    "ruPerSecBurst": 15,
    "gasLimitPerSecPerShard": "20000000",
    "gasBurst": "200000000",
    "maxGasLimit": "100000000",
    "maxRuPerTx": "15",
    "ruPerHour": 300
    }
    ]
    },
    "tiers": [
    {
    "tierId": 0,
    "slug": "string",
    "name": "string",
    "audience": "human",
    "status": "draft",
    "available": true,
    "unavailableReason": "CAPACITY",
    "periodMs": 0,
    "capRu": "string",
    "priceUnits": "string",
    "paygBps": 0,
    "price": "string",
    "paygPricePerRu": "string",
    "pendingPrice": "string",
    "pendingPaygPricePerRu": "string",
    "maxSenders": 0,
    "flags": [
    "agent"
    ],
    "rateClass": 0,
    "slaClass": "best-effort",
    "successorTierId": 0,
    "singlePaymentPurchasable": true,
    "note": "string"
    }
    ],
    "howToBuy": {},
    "links": {}
    }