T402 API Reference - v2.8.0
    Preparing search index...

    Class ExactLegacyEvmServerScheme

    EVM server implementation for the exact-legacy payment scheme. Supports legacy tokens that use approve + transferFrom pattern.

    Implements

    Index

    Constructors

    Properties

    scheme: "exact-legacy"

    Methods

    • Check if a network has legacy token support

      Parameters

      • network: string

        The network identifier to check

      Returns boolean

      True if the network has legacy token support

    • Parses a price into an asset amount for legacy tokens.

      Parameters

      • price: Price

        The price to parse (Money or AssetAmount)

      • network: Network

        The network identifier in CAIP-2 format

      Returns Promise<AssetAmount>

      Promise resolving to the parsed asset amount

    • Build payment requirements for this scheme/network combination. Adds the spender (facilitator) address to the extra field.

      Parameters

      • paymentRequirements: PaymentRequirements

        The base payment requirements to enhance

      • supportedKind: {
            t402Version: number;
            scheme: string;
            network: Network;
            extra?: Record<string, unknown>;
        }

        The supported kind from facilitator

        • t402Version: number

          The t402 protocol version

        • scheme: string

          The logical payment scheme identifier

        • network: Network

          The network identifier in CAIP-2 format

        • Optionalextra?: Record<string, unknown>

          Optional extra metadata with spender address

      • extensionKeys: string[]

        Extension keys supported by the facilitator (unused)

      Returns Promise<PaymentRequirements>

      Promise resolving to enhanced payment requirements