Skip to content

Conversation

@Ilevk
Copy link

@Ilevk Ilevk commented Jan 16, 2026

Description

Tests

INFO:     127.0.0.1:54477 - "GET /weather?city=San%20Francisco HTTP/1.1" 402 Payment Required

=== Before verify ===
{'payload_bytes': None,
 'payment_payload': PaymentPayload(x402_version=2, payload={'authorization': {'from': '0x000ABc46CBc95f9FCC6d860d5827bA70f04f62Ab', 'to': '0x60e73E3A49319C267682f1E07e872a53e7D7cc36', 'value': '10000', 'validAfter': '1768567841', 'validBefore': '1768568171', 'nonce': '0x6bae5013b84cb2cc2fb4b8fb623cdff4982fb9cdae10b4fb183e8c60dc1bd8e2'}, 'signature': '0x332f94ff5e1d848f2e511590a9ecf400cf33ac18d61e3b4c9b7a11f0c01fcc3b4f66fe98567bad4698d59b0e68ccf5c767de0c9d0984e1ea0f58d42ee87e96201c'}, accepted=PaymentRequirements(scheme='exact', network='eip155:84532', asset='0x036CbD53842c5426634e7929541eC2318f3dCF7e', amount='10000', pay_to='0x60e73E3A49319C267682f1E07e872a53e7D7cc36', max_timeout_seconds=300, extra={'name': 'USDC', 'version': '2'}), resource=ResourceInfo(url='http://localhost:4021/weather?city=San%20Francisco', description='Weather report', mime_type='application/json'), extensions={'bazaar': {'info': {'input': {'type': 'http', 'queryParams': {'city': 'San Francisco'}, 'method': 'GET'}, 'output': {'type': 'json', 'example': {'weather': 'sunny', 'temperature': 70}}}, 'schema': {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'type': 'object', 'properties': {'input': {'type': 'object', 'properties': {'type': {'type': 'string', 'const': 'http'}, 'method': {'type': 'string', 'enum': ['GET', 'HEAD', 'DELETE']}, 'queryParams': {'type': 'object', 'properties': {'city': {'type': 'string'}}, 'required': ['city']}}, 'required': ['type', 'method'], 'additionalProperties': False}, 'output': {'type': 'object', 'properties': {'type': {'type': 'string'}, 'example': {'type': 'object', 'properties': {'weather': {'type': 'string'}, 'temperature': {'type': 'number'}}, 'required': ['weather', 'temperature']}}, 'required': ['type']}}, 'required': ['input']}}}),
 'requirements': PaymentRequirements(scheme='exact', network='eip155:84532', asset='0x036CbD53842c5426634e7929541eC2318f3dCF7e', amount='10000', pay_to='0x60e73E3A49319C267682f1E07e872a53e7D7cc36', max_timeout_seconds=300, extra={'name': 'USDC', 'version': '2'}),
 'requirements_bytes': None}

=== After verify ===
{'payload_bytes': None,
 'payment_payload': PaymentPayload(x402_version=2, payload={'authorization': {'from': '0x000ABc46CBc95f9FCC6d860d5827bA70f04f62Ab', 'to': '0x60e73E3A49319C267682f1E07e872a53e7D7cc36', 'value': '10000', 'validAfter': '1768567841', 'validBefore': '1768568171', 'nonce': '0x6bae5013b84cb2cc2fb4b8fb623cdff4982fb9cdae10b4fb183e8c60dc1bd8e2'}, 'signature': '0x332f94ff5e1d848f2e511590a9ecf400cf33ac18d61e3b4c9b7a11f0c01fcc3b4f66fe98567bad4698d59b0e68ccf5c767de0c9d0984e1ea0f58d42ee87e96201c'}, accepted=PaymentRequirements(scheme='exact', network='eip155:84532', asset='0x036CbD53842c5426634e7929541eC2318f3dCF7e', amount='10000', pay_to='0x60e73E3A49319C267682f1E07e872a53e7D7cc36', max_timeout_seconds=300, extra={'name': 'USDC', 'version': '2'}), resource=ResourceInfo(url='http://localhost:4021/weather?city=San%20Francisco', description='Weather report', mime_type='application/json'), extensions={'bazaar': {'info': {'input': {'type': 'http', 'queryParams': {'city': 'San Francisco'}, 'method': 'GET'}, 'output': {'type': 'json', 'example': {'weather': 'sunny', 'temperature': 70}}}, 'schema': {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'type': 'object', 'properties': {'input': {'type': 'object', 'properties': {'type': {'type': 'string', 'const': 'http'}, 'method': {'type': 'string', 'enum': ['GET', 'HEAD', 'DELETE']}, 'queryParams': {'type': 'object', 'properties': {'city': {'type': 'string'}}, 'required': ['city']}}, 'required': ['type', 'method'], 'additionalProperties': False}, 'output': {'type': 'object', 'properties': {'type': {'type': 'string'}, 'example': {'type': 'object', 'properties': {'weather': {'type': 'string'}, 'temperature': {'type': 'number'}}, 'required': ['weather', 'temperature']}}, 'required': ['type']}}, 'required': ['input']}}}),
 'requirements': PaymentRequirements(scheme='exact', network='eip155:84532', asset='0x036CbD53842c5426634e7929541eC2318f3dCF7e', amount='10000', pay_to='0x60e73E3A49319C267682f1E07e872a53e7D7cc36', max_timeout_seconds=300, extra={'name': 'USDC', 'version': '2'}),
 'requirements_bytes': None,
 'result': VerifyResponse(is_valid=True, invalid_reason=None, payer='0x000ABc46CBc95f9FCC6d860d5827bA70f04f62Ab')}

=== Before settle ===
{'payload_bytes': None,
 'payment_payload': PaymentPayload(x402_version=2, payload={'authorization': {'from': '0x000ABc46CBc95f9FCC6d860d5827bA70f04f62Ab', 'to': '0x60e73E3A49319C267682f1E07e872a53e7D7cc36', 'value': '10000', 'validAfter': '1768567841', 'validBefore': '1768568171', 'nonce': '0x6bae5013b84cb2cc2fb4b8fb623cdff4982fb9cdae10b4fb183e8c60dc1bd8e2'}, 'signature': '0x332f94ff5e1d848f2e511590a9ecf400cf33ac18d61e3b4c9b7a11f0c01fcc3b4f66fe98567bad4698d59b0e68ccf5c767de0c9d0984e1ea0f58d42ee87e96201c'}, accepted=PaymentRequirements(scheme='exact', network='eip155:84532', asset='0x036CbD53842c5426634e7929541eC2318f3dCF7e', amount='10000', pay_to='0x60e73E3A49319C267682f1E07e872a53e7D7cc36', max_timeout_seconds=300, extra={'name': 'USDC', 'version': '2'}), resource=ResourceInfo(url='http://localhost:4021/weather?city=San%20Francisco', description='Weather report', mime_type='application/json'), extensions={'bazaar': {'info': {'input': {'type': 'http', 'queryParams': {'city': 'San Francisco'}, 'method': 'GET'}, 'output': {'type': 'json', 'example': {'weather': 'sunny', 'temperature': 70}}}, 'schema': {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'type': 'object', 'properties': {'input': {'type': 'object', 'properties': {'type': {'type': 'string', 'const': 'http'}, 'method': {'type': 'string', 'enum': ['GET', 'HEAD', 'DELETE']}, 'queryParams': {'type': 'object', 'properties': {'city': {'type': 'string'}}, 'required': ['city']}}, 'required': ['type', 'method'], 'additionalProperties': False}, 'output': {'type': 'object', 'properties': {'type': {'type': 'string'}, 'example': {'type': 'object', 'properties': {'weather': {'type': 'string'}, 'temperature': {'type': 'number'}}, 'required': ['weather', 'temperature']}}, 'required': ['type']}}, 'required': ['input']}}}),
 'requirements': PaymentRequirements(scheme='exact', network='eip155:84532', asset='0x036CbD53842c5426634e7929541eC2318f3dCF7e', amount='10000', pay_to='0x60e73E3A49319C267682f1E07e872a53e7D7cc36', max_timeout_seconds=300, extra={'name': 'USDC', 'version': '2'}),
 'requirements_bytes': None}

=== After settle ===
{'payload_bytes': None,
 'payment_payload': PaymentPayload(x402_version=2, payload={'authorization': {'from': '0x000ABc46CBc95f9FCC6d860d5827bA70f04f62Ab', 'to': '0x60e73E3A49319C267682f1E07e872a53e7D7cc36', 'value': '10000', 'validAfter': '1768567841', 'validBefore': '1768568171', 'nonce': '0x6bae5013b84cb2cc2fb4b8fb623cdff4982fb9cdae10b4fb183e8c60dc1bd8e2'}, 'signature': '0x332f94ff5e1d848f2e511590a9ecf400cf33ac18d61e3b4c9b7a11f0c01fcc3b4f66fe98567bad4698d59b0e68ccf5c767de0c9d0984e1ea0f58d42ee87e96201c'}, accepted=PaymentRequirements(scheme='exact', network='eip155:84532', asset='0x036CbD53842c5426634e7929541eC2318f3dCF7e', amount='10000', pay_to='0x60e73E3A49319C267682f1E07e872a53e7D7cc36', max_timeout_seconds=300, extra={'name': 'USDC', 'version': '2'}), resource=ResourceInfo(url='http://localhost:4021/weather?city=San%20Francisco', description='Weather report', mime_type='application/json'), extensions={'bazaar': {'info': {'input': {'type': 'http', 'queryParams': {'city': 'San Francisco'}, 'method': 'GET'}, 'output': {'type': 'json', 'example': {'weather': 'sunny', 'temperature': 70}}}, 'schema': {'$schema': 'https://json-schema.org/draft/2020-12/schema', 'type': 'object', 'properties': {'input': {'type': 'object', 'properties': {'type': {'type': 'string', 'const': 'http'}, 'method': {'type': 'string', 'enum': ['GET', 'HEAD', 'DELETE']}, 'queryParams': {'type': 'object', 'properties': {'city': {'type': 'string'}}, 'required': ['city']}}, 'required': ['type', 'method'], 'additionalProperties': False}, 'output': {'type': 'object', 'properties': {'type': {'type': 'string'}, 'example': {'type': 'object', 'properties': {'weather': {'type': 'string'}, 'temperature': {'type': 'number'}}, 'required': ['weather', 'temperature']}}, 'required': ['type']}}, 'required': ['input']}}}),
 'requirements': PaymentRequirements(scheme='exact', network='eip155:84532', asset='0x036CbD53842c5426634e7929541eC2318f3dCF7e', amount='10000', pay_to='0x60e73E3A49319C267682f1E07e872a53e7D7cc36', max_timeout_seconds=300, extra={'name': 'USDC', 'version': '2'}),
 'requirements_bytes': None,
 'result': SettleResponse(success=True, error_reason=None, payer='0x000ABc46CBc95f9FCC6d860d5827bA70f04f62Ab', transaction='0x328d109ec2b0ee6d52c28e81db6404ff7d667e5375063c791719696ba544e67e', network='eip155:84532')}
INFO:     127.0.0.1:54477 - "GET /weather?city=San%20Francisco HTTP/1.1" 200 OK

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commits are signed (required for merge) -- you may need to rebase if you initially pushed unsigned commits

@vercel
Copy link

vercel bot commented Jan 16, 2026

@Ilevk is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the examples Changes to examples label Jan 16, 2026
@Ilevk
Copy link
Author

Ilevk commented Jan 16, 2026

@phdargen I've applied the review in last PR. sorry to be late.

@Ilevk Ilevk marked this pull request as ready for review January 16, 2026 12:52
@phdargen
Copy link
Contributor

Appreciated @Ilevk, but I already applied the changes as part of a larger refactor in #975. At this point, easier to just merge that one. Thanks for your understanding

@phdargen phdargen closed this Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Changes to examples

Development

Successfully merging this pull request may close these issues.

2 participants