GLIN buyer-local purchase adapter — Node.js 22+ This optional adapter completes a real paid API request only after the buyer explicitly approves it. It is not a browser checkout. Use your existing trusted wallet signer; never send keys or seed words to TELAGO. Download purchase-client.mjs and request-builder.mjs into the SAME local directory. Install in your own project: npm install --save-exact @x402/core@2.28.0 @x402/evm@2.28.0 Keep your project lockfile. Use your existing viem-compatible signer; do not create or fund a wallet through this guide. import { x402Client } from '@x402/core/client'; import { ExactEvmScheme } from '@x402/evm/exact/client'; import { preparePurchase, openPurchaseJournal, purchaseOnce } from './purchase-client.mjs'; // signer is your already-configured local wallet signer. const paymentClient = new x402Client().register('eip155:8453', new ExactEvmScheme(signer)); const product = 'import-preflight'; // $0.02; 'landed-cost' is $0.03 const input = {counterparty: 'Your supplier legal name', hts: '8517.13.0000', origin: 'KR', customsValueUsd: 10000}; const plan = preparePurchase(product, input); // Present plan to your human/operator policy and obtain authorization BEFORE the call below. // Use the exact same purchaseKey and journal directory for retries of the same order revision. // Set approved:true only AFTER approval. It is not a default or a request for TELAGO to approve spending. const approval = { approved: true, requestFingerprint: plan.requestFingerprint, maxAmountAtomic: plan.request.expectedPayment.amount, expiresAt: new Date(Date.now() + 120000).toISOString() }; const journal = await openPurchaseJournal('./glin-purchase-journal'); const result = await purchaseOnce({product, input, approval, purchaseKey: 'PO-001:revision-1', journal, paymentClient}); console.log(result.state); // inspect result.data and keep result.receipt locally The adapter sends no payment unless invoked with a matching, unexpired approval. It pins the product path, Base USDC asset, receiver and exact price; it strips unexpected payment extensions and forbids redirects. The same purchaseKey cannot create a second paid attempt while its journal file exists. Do not delete journal files or change the key to retry an unresolved purchase. Files must reside on persistent local storage shared by the callers needing duplicate protection; separate machines/directories are NOT covered. Timeout, lost response, malformed data or missing receipt means RECONCILIATION_REQUIRED. Check the wallet and provider before doing anything else; never automatically repeat the payment. A server receipt is not independent chain verification. Obtaining data is not customs clearance or confirmed supplier identity. Testing: mocked transport/signing regression tests only. No buyer wallet was used, no funds were moved, and this client has not been independently verified in a real paid transaction. Existing $0.02 marketplace route: https://payapi.market/api/glin-us-import-preflight API contract: https://ozeejewwpjmabshxyitc.supabase.co/functions/v1/glin-us-import-preflight-x402-v1/openapi.json SDK references: https://docs.x402.org/getting-started/quickstart-for-buyers https://docs.x402.org/advanced-concepts/lifecycle-hooks