x402 icon indicating copy to clipboard operation
x402 copied to clipboard

Refactor SVM client and verification logic to remove create ATA instruction

Open notorious-d-e-v opened this issue 2 months ago • 4 comments

Description

Refactor SVM client and verification logic to remove create ATA instruction handling

  • Removed create associated token account (ATA) instruction logic from SVM client and tests.
  • Updated transfer instruction handling to assume destination ATA exists.
  • Adjusted verification functions to reflect changes in instruction expectations.
  • Cleaned up related test cases to remove references to create ATA instructions.

Tests

Updated existing tests.

Checklist

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

notorious-d-e-v avatar Nov 07 '25 12:11 notorious-d-e-v

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

cb-heimdall avatar Nov 07 '25 12:11 cb-heimdall

@notorious-d-e-v is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 07 '25 12:11 vercel[bot]

IMO this is a good change. Facilitator should be responsible for keeping their ATA open. Might be worth documenting expected transaction structure in x402-specification.md or a readme in typescript/packages/x402/src/schemes/exact/svm/facilitator/. This hits on some of the elements of #421 -- I think we could tackle the rest of that after this merges.

amilz avatar Nov 07 '25 20:11 amilz

Thanks, agreed! You're right, should update the docs.

Ideally there will be a way for facilitators to help merchants set up their ATA. It could also be a sponsored tx where the merchant pays in USDC.

But for now it's simplest to just remove it.

notorious-d-e-v avatar Nov 08 '25 02:11 notorious-d-e-v