Mechanisms

mechanisms/evm/upto/client

github.com/x402-foundation/x402/go/v2/mechanisms/evm/upto/client

import "github.com/x402-foundation/x402/go/v2/mechanisms/evm/upto/client"

Constants

Source: mechanisms/evm/upto/client/errors.go:4

const (
	ErrInvalidAmount                    = "invalid_upto_evm_client_amount"
	ErrFailedToSignPermit2Authorization = "invalid_upto_evm_client_failed_to_sign_permit2_authorization"
	ErrMissingFacilitatorAddress        = "invalid_upto_evm_client_missing_facilitator_address"
)

Functions

func CreateUptoPermit2Payload( ctx context.Context, signer evm.ClientEvmSigner, requirements types.PaymentRequirements, ) (types.PaymentPayload, error)

Source: mechanisms/evm/upto/client/permit2.go:15

CreateUptoPermit2Payload creates a Permit2 payload using the x402UptoPermit2Proxy witness pattern. The upto witness includes a facilitator address, which must be provided in requirements.Extra.

func NewUptoEvmScheme(signer evm.ClientEvmSigner, config *UptoEvmSchemeConfig) *UptoEvmScheme

Source: mechanisms/evm/upto/client/scheme.go:25

Types

type UptoEvmChainConfig

Source: mechanisms/evm/upto/client/rpc.go:10

UptoEvmChainConfig configures RPC behavior for one chain.

type UptoEvmChainConfig = evm.RPCChainConfig

type UptoEvmScheme

Source: mechanisms/evm/upto/client/scheme.go:20

UptoEvmScheme implements SchemeNetworkClient and ExtensionAwareClient for EVM upto payments. Always uses Permit2 (no EIP-3009 path).

type UptoEvmScheme struct {
	// contains filtered or unexported fields
}

func CreatePaymentPayload( ctx context.Context, requirements types.PaymentRequirements, ) (types.PaymentPayload, error)

Source: mechanisms/evm/upto/client/scheme.go:37

CreatePaymentPayload creates a V2 payment payload for the upto scheme (always Permit2).

func CreatePaymentPayloadWithExtensions( ctx context.Context, requirements types.PaymentRequirements, extensions map[string]interface{}, ) (types.PaymentPayload, error)

Source: mechanisms/evm/upto/client/scheme.go:45

CreatePaymentPayloadWithExtensions creates a payment payload with extension support.

func Scheme) Scheme() string

Source: mechanisms/evm/upto/client/scheme.go:32

type UptoEvmSchemeConfig

Source: mechanisms/evm/upto/client/rpc.go:14

UptoEvmSchemeConfig configures RPC behavior for Upto EVM clients. If both RPCByChainID and RPCURL are set, chain-specific entries take precedence.

type UptoEvmSchemeConfig = evm.RPCConfig