File tree Expand file tree Collapse file tree
smart-accounts-kit-x402/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ export class x402ExactEvmErc7710ServerScheme extends ExactEvmScheme {
2525 facilitatorExtensions ,
2626 ) ;
2727
28+ if ( baseRequirements . extra ?. assetTransferMethod !== 'erc7710' ) {
29+ return baseRequirements ;
30+ }
31+
2832 const enhancedRequirements = await this . #erc7710Server. enhancePaymentRequirements (
2933 baseRequirements ,
3034 supportedKind ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { config } from 'dotenv';
22import express from 'express' ;
33import { HTTPFacilitatorClient } from '@x402/core/server' ;
44import { paymentMiddleware , x402ResourceServer } from '@x402/express' ;
5+ import { ExactEvmScheme } from '@x402/evm/exact/server' ;
56import {
67 type Network ,
78} from '@x402/core/types' ;
@@ -31,15 +32,32 @@ app.use(
3132 paymentMiddleware (
3233 {
3334 'GET /random' : {
34- accepts : {
35- scheme : 'exact' ,
36- network,
37- payTo,
38- price : {
39- amount : price ,
40- asset : acceptedToken ,
35+ accepts : [
36+ {
37+ scheme : 'exact' ,
38+ network,
39+ payTo,
40+ price : {
41+ amount : price ,
42+ asset : acceptedToken ,
43+ } ,
44+ extra : {
45+ assetTransferMethod : 'erc7710' ,
46+ } ,
4147 } ,
42- } ,
48+ {
49+ scheme : 'exact' ,
50+ network,
51+ payTo,
52+ price : {
53+ amount : price ,
54+ asset : acceptedToken ,
55+ } ,
56+ extra : {
57+ assetTransferMethod : 'eip3009' ,
58+ } ,
59+ } ,
60+ ] ,
4361 description : 'Random integer from 1 to 10' ,
4462 mimeType : 'text/plain' ,
4563 } ,
You can’t perform that action at this time.
0 commit comments