{"_id":"@altaga/x402-sui","_rev":"12-2b0bd632ff4ac701d81e7e096ec66b95","name":"@altaga/x402-sui","dist-tags":{"latest":"1.2.3"},"versions":{"1.0.1":{"name":"@altaga/x402-sui","version":"1.0.1","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.0.1","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"40f42f1b766fba9fddf48dca1c132bfb1bfc6171","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.0.1.tgz","fileCount":10,"integrity":"sha512-ykwZ49MLMalnfqhPWzQA8op50LtzRnjIVZl4nxz3wJZFGgp/zDpqHwRLgS7NJTwdDe6yyGX/q3jnW2G+OGxyIQ==","signatures":[{"sig":"MEYCIQCnVFaj+i+xkoP0KRAEltwDGZRKYVwI73x7p0bkbc1CwwIhALaF2L+/2jHLcvHFVpb0T4QNalBdpIgDxVlKLpEfPOnm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24256},"main":"dist/core/client.js","type":"module","exports":{"./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"7c614966363159878fd0d812a26d005eead83b83","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"esbuild core/*.mjs sui/exact/*.mjs --outdir=dist --minify --format=esm --target=es2022"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.0"},"peerDependencies":{"express":"^4.21.2","@mysten/bcs":"^1.2.0","@mysten/sui":"^1.14.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.0.1_1780611267207_0.0940085096941845","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@altaga/x402-sui","version":"1.0.2","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.0.2","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"79a5abcb59e2e9a9b9d098461755ad2a95def771","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.0.2.tgz","fileCount":11,"integrity":"sha512-+uKUYtX5WrnfRUkDh6lk0jk6OjrTjlhONDYiM9vKAMo/vtJY1tz1+Mk1FU+RxDjkCoHF9JxEQofPPUC+XY29gw==","signatures":[{"sig":"MEUCIQD2Yv2NxYd1D/05T7IudgGlYlVHvHmd0UWi05DYP6QZ0wIgfqsCPK2e7F9g0Ggt1zZOuZezOmwEqdRqyXwA12VzzEI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15482},"main":"dist/core/client.js","type":"module","exports":{".":"./dist/index.js","./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"7c614966363159878fd0d812a26d005eead83b83","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"esbuild index.mjs core/*.mjs sui/exact/*.mjs --outdir=dist --minify --format=esm --target=es2022"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.0"},"peerDependencies":{"express":"^4.21.2","@mysten/bcs":"^1.2.0","@mysten/sui":"^1.14.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.0.2_1780612482969_0.549330735153768","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@altaga/x402-sui","version":"1.0.3","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.0.3","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"d355f8daa00c78ea0c6c6410a0cba6a14089d4bc","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.0.3.tgz","fileCount":11,"integrity":"sha512-5KvtF73O6mgi1qXteyOIKf7P0/oo4bEGoHOKL7jDOGTc1V10/KCPsB89zLeBiOvlbkEaFwQww98rG+oWVaJZqg==","signatures":[{"sig":"MEQCIGL3tI5rGsGnrUnlGdpkA1uGiBFRhFcxgN5JD3Btmn2uAiA5fc657cJGpzEMqsbqQr/5PMMqH7OK+xBLGtviRILLDw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17651},"main":"dist/core/client.js","type":"module","exports":{".":"./dist/index.js","./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"7c614966363159878fd0d812a26d005eead83b83","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"esbuild index.mjs core/*.mjs sui/exact/*.mjs --outdir=dist --minify --format=esm --target=es2022"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.0"},"peerDependencies":{"express":"^4.21.2","@mysten/bcs":"^1.2.0","@mysten/sui":"^1.14.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.0.3_1780872682415_0.970916271908923","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@altaga/x402-sui","version":"1.0.5","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.0.5","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"c077e8149e2671c4d290263bbef2562f4d81664c","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.0.5.tgz","fileCount":11,"integrity":"sha512-eJ8NLSeN+LCU+ZfPuGGnOuHPphYKAjssoC6539/7tYTkVcYWGRWD13lzvciycXSSmt2l6YBVq3tiOCri/t0Xyw==","signatures":[{"sig":"MEYCIQCTq+LutMhoVpYZAfuuWmFsSwn+7OrPVbn9sMMdXOP3PgIhAOwLhwYzUnp4XEZ9vVc24DN9+5Egb3O8Fp5HXIv7gcXX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17681},"main":"dist/core/client.js","type":"module","exports":{".":"./dist/index.js","./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"7c614966363159878fd0d812a26d005eead83b83","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"esbuild index.mjs core/*.mjs sui/exact/*.mjs --outdir=dist --minify --format=esm --target=es2022"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.0"},"peerDependencies":{"express":"^4.21.2","@mysten/bcs":"^1.2.0","@mysten/sui":"^1.14.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.0.5_1780876083662_0.20093704053530947","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@altaga/x402-sui","version":"1.0.6","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.0.6","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"349b6c1a40afac9716927a55cc7802b35ca20191","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.0.6.tgz","fileCount":11,"integrity":"sha512-wrnQR0U/vpPduDaaOFhgCFb2VDprXcvhxxuH+0AfPhNSMN8eQMMQ1APnuxyK22yFnpGu2aEd2wjUG2RVfU8TOw==","signatures":[{"sig":"MEQCIHlf42dBxq97sHnzaUt8vuq1CPEZCOW0S4Ku3+PYLT2dAiAlL7fwlVv2XKhfOoR5kq0EO1VxkRW7mG6eJO473NsZEw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18333},"main":"dist/core/client.js","type":"module","exports":{".":"./dist/index.js","./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"7c614966363159878fd0d812a26d005eead83b83","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"esbuild index.mjs core/*.mjs sui/exact/*.mjs --outdir=dist --minify --format=esm --target=es2022"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.0"},"peerDependencies":{"express":"^4.21.2","@mysten/bcs":"^1.2.0","@mysten/sui":"^1.14.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.0.6_1780910612521_0.6331807138855625","host":"s3://npm-registry-packages-npm-production"}},"1.0.9":{"name":"@altaga/x402-sui","version":"1.0.9","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.0.9","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"6d9055282ff0c56d1bcbc1277f8d8ca6e33b056f","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.0.9.tgz","fileCount":12,"integrity":"sha512-VxuEw0eeAKr3kxq3BvwwnEY4edaKqwk8Kg1LjLGSid0BykArRfTcC5wERGOstORJzN2vfQrk3DrsJYVzh+dp3A==","signatures":[{"sig":"MEQCIBH4awT4vuznMZuahFBWBxP+/fprSEN75TDUD+GU5sYKAiBbGYZqofMxcnpY09lIp+RuZGUWbTKZZ3qYgmzmvAimgw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54356},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./dist/index.js","./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./core/facilitator-http":"./dist/core/facilitator-http.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"7c614966363159878fd0d812a26d005eead83b83","scripts":{"test":"npm run build && node -e \"import('./dist/index.js')\"","build":"node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && esbuild index.mjs --bundle --platform=neutral --format=esm --target=es2022 --outfile=dist/index.js --external:express --external:@mysten/* && esbuild core/client.mjs core/facilitator.mjs core/facilitator-http.mjs core/http.mjs core/server.mjs core/server-http.mjs sui/exact/client.mjs sui/exact/server.mjs sui/exact/facilitator.mjs --outdir=dist --format=esm --target=es2022","prepack":"npm run build"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"sideEffects":false,"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.28.0"},"peerDependencies":{"express":"^4.21.2 || ^5.0.0","@mysten/bcs":"^1.2.0","@mysten/sui":"^1.14.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.0.9_1781064581993_0.24095406342594505","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@altaga/x402-sui","version":"1.2.0","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.2.0","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"f9966434691f59d51c7387fabf33ca84b0f411c8","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.2.0.tgz","fileCount":13,"integrity":"sha512-AWndFGP7tnVHiYX0VnmGnw8TYGUE+lK1OiRTHKIRrdkyve0W00GWlQhhsE3shQQisaGJS3D3lHnBBZab3g4dFw==","signatures":[{"sig":"MEYCIQDwJtDzeUj/QT69i3VpPUGSq5GeM0d41HqLupH3u12TTAIhAOZCMTYba/e5ZDDdsqc02td1kEYvwNaUlTQKEaYIISow","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71018},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./dist/index.js","./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/errors":"./dist/core/errors.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./core/facilitator-http":"./dist/core/facilitator-http.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"3369aafbc190caa7c2fbc20365897f947fa7c053","scripts":{"test":"npm run build && vitest run","build":"node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && esbuild index.mjs --bundle --platform=neutral --format=esm --target=es2022 --outfile=dist/index.js --external:express --external:@mysten/* && esbuild core/client.mjs core/facilitator.mjs core/facilitator-http.mjs core/http.mjs core/server.mjs core/server-http.mjs core/errors.mjs sui/exact/client.mjs sui/exact/server.mjs sui/exact/facilitator.mjs --outdir=dist --format=esm --target=es2022","prepack":"npm run build"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"sideEffects":false,"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","esbuild":"^0.28.0"},"peerDependencies":{"express":"^5.2.1","@mysten/bcs":"^2.1.0","@mysten/sui":"^2.20.2"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.2.0_1784673539759_0.8400051287060228","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@altaga/x402-sui","version":"1.2.1","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.2.1","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"4a58d7e8ecd58673d232d064581b1723c66ec2e7","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.2.1.tgz","fileCount":13,"integrity":"sha512-l//96DWTtkUkYUVcNuXFArNiLnkrnsQ0mqTdWIv01NJCMINlxNlLXVWE2LOyr+p9qgRVOAhmD3+IYd7C9sF16Q==","signatures":[{"sig":"MEYCIQDCxSzcE48gmvJLglsMZ8F/mDmKfUTiC6A72Mz+TQjBegIhAP7UEoWfKJi3HxUSXRTth1ow7TW2jQbNMOevbx/RBB/a","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86137},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./dist/index.js","./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/errors":"./dist/core/errors.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./core/facilitator-http":"./dist/core/facilitator-http.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"3369aafbc190caa7c2fbc20365897f947fa7c053","scripts":{"test":"npm run test:src && npm run test:dist","build":"node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && esbuild index.mjs --bundle --platform=neutral --format=esm --target=es2022 --outfile=dist/index.js --external:express --external:@mysten/* && esbuild core/client.mjs core/facilitator.mjs core/facilitator-http.mjs core/http.mjs core/server.mjs core/server-http.mjs core/errors.mjs sui/exact/client.mjs sui/exact/server.mjs sui/exact/facilitator.mjs --outdir=dist --format=esm --target=es2022","prepack":"npm run build","release":"node scripts/publish.js","test:src":"vitest run tests/e2e.test.mjs","test:dist":"npm run build && cross-env TEST_DIST=1 vitest run tests/e2e.test.mjs"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"sideEffects":false,"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"4.1.10","esbuild":"0.28.1","cross-env":"^10.1.0","@mysten/sui":"2.20.3"},"peerDependencies":{"express":"^5.2.1","@mysten/bcs":"^2.1.0","@mysten/sui":"^2.20.2"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.2.1_1784696584446_0.8187058271291585","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"name":"@altaga/x402-sui","version":"1.2.2","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"author":{"name":"Altaga"},"license":"MIT","_id":"@altaga/x402-sui@1.2.2","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"dist":{"shasum":"3a62bf4f8e8bd555f8bf9a1051dbcf3e4e4a2c3d","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.2.2.tgz","fileCount":13,"integrity":"sha512-3EQ8kPXkpBzjwE57dIfvQcjn3sOk9n9b1wfz3On1XhHkLEKDio5c9pHVHu/7ihUqMRx27DOeApRpK7fiKiMAqg==","signatures":[{"sig":"MEYCIQDWmBcLL8gIdkWTwbyY4AbiPsDYUCl7ycrTfhBmgQ9kTgIhALVXWiZHDY5mQrnEn+TwCFnpejnGo9awI1JQD1RzLfOI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86222},"main":"dist/index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./dist/index.js","./core/http":"./dist/core/http.js","./core/client":"./dist/core/client.js","./core/errors":"./dist/core/errors.js","./core/server":"./dist/core/server.js","./core/facilitator":"./dist/core/facilitator.js","./core/server-http":"./dist/core/server-http.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./core/facilitator-http":"./dist/core/facilitator-http.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"gitHead":"3369aafbc190caa7c2fbc20365897f947fa7c053","scripts":{"test":"npm run test:src && npm run test:dist","build":"node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && esbuild index.mjs --bundle --platform=neutral --format=esm --target=es2022 --outfile=dist/index.js --external:express --external:@mysten/* && esbuild core/client.mjs core/facilitator.mjs core/facilitator-http.mjs core/http.mjs core/server.mjs core/server-http.mjs core/errors.mjs sui/exact/client.mjs sui/exact/server.mjs sui/exact/facilitator.mjs --outdir=dist --format=esm --target=es2022","prepack":"npm run build","release":"node scripts/publish.js","test:src":"vitest run tests/e2e.test.mjs","test:dist":"npm run build && cross-env TEST_DIST=1 vitest run tests/e2e.test.mjs"},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"_npmVersion":"11.12.1","description":"Modular x402 implementation for Sui Sponsored Transactions","directories":{},"sideEffects":false,"_nodeVersion":"22.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"4.1.10","esbuild":"0.28.1","cross-env":"^10.1.0","@mysten/sui":"2.20.3"},"peerDependencies":{"express":"^5.2.1","@mysten/bcs":"^2.1.0","@mysten/sui":"^2.20.2"},"_npmOperationalInternal":{"tmp":"tmp/x402-sui_1.2.2_1784697425381_0.9368989527859399","host":"s3://npm-registry-packages-npm-production"}},"1.2.3":{"name":"@altaga/x402-sui","version":"1.2.3","description":"Modular x402 implementation for Sui Sponsored Transactions","main":"dist/index.js","type":"module","publishConfig":{"access":"public"},"sideEffects":false,"scripts":{"build":"node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && esbuild index.mjs --bundle --platform=neutral --format=esm --target=es2022 --outfile=dist/index.js --external:express --external:@mysten/* && esbuild core/client.mjs core/facilitator.mjs core/facilitator-http.mjs core/http.mjs core/server.mjs core/server-http.mjs core/errors.mjs sui/exact/client.mjs sui/exact/server.mjs sui/exact/facilitator.mjs --outdir=dist --format=esm --target=es2022","prepack":"npm run build","test":"npm run test:src && npm run test:dist","test:src":"vitest run tests/e2e.test.mjs","test:dist":"npm run build && cross-env TEST_DIST=1 vitest run tests/e2e.test.mjs","release":"node scripts/publish.js"},"exports":{".":"./dist/index.js","./core/client":"./dist/core/client.js","./core/http":"./dist/core/http.js","./core/server":"./dist/core/server.js","./core/server-http":"./dist/core/server-http.js","./core/facilitator":"./dist/core/facilitator.js","./core/facilitator-http":"./dist/core/facilitator-http.js","./core/errors":"./dist/core/errors.js","./sui/exact/client":"./dist/sui/exact/client.js","./sui/exact/server":"./dist/sui/exact/server.js","./sui/exact/facilitator":"./dist/sui/exact/facilitator.js"},"keywords":["sui","x402","sponsored","transactions","crypto","payments"],"engines":{"node":">=18"},"author":{"name":"Altaga"},"license":"MIT","peerDependencies":{"@mysten/bcs":"^2.1.0","@mysten/sui":"^2.20.2","express":"^5.2.1"},"devDependencies":{"@mysten/sui":"2.20.3","cross-env":"^10.1.0","esbuild":"0.28.1","vitest":"4.1.10"},"gitHead":"3369aafbc190caa7c2fbc20365897f947fa7c053","_id":"@altaga/x402-sui@1.2.3","_nodeVersion":"22.13.1","_npmVersion":"11.12.1","dist":{"integrity":"sha512-guh6EGnmtB1XFIypY6HKBahnjfcGPra7DeCPGLHV96/c2JQTEv4IpAY9+gznX6T5jagZo6lQeOm5IWAJNjH0Pg==","shasum":"4dccb3e76435a96828933fe7a95e91e80145fb70","tarball":"https://registry.npmjs.org/@altaga/x402-sui/-/x402-sui-1.2.3.tgz","fileCount":13,"unpackedSize":86249,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDSTcS6QdBE+9asIKIFFFsrUFNldNKJVUyF1fgyIKwRGgIhAOruxY09OLELDFwHZoSifBn/3cVrWQzQvMIh1mv3HM1i"}]},"_npmUser":{"name":"altaga","email":"v.a.i@hotmail.com"},"directories":{},"maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x402-sui_1.2.3_1784698649118_0.8865359382677671"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T22:14:26.993Z","modified":"2026-07-22T05:37:29.379Z","1.0.0":"2026-06-04T20:24:48.879Z","1.0.1":"2026-06-04T22:14:27.384Z","1.0.2":"2026-06-04T22:34:43.115Z","1.0.3":"2026-06-07T22:51:22.556Z","1.0.5":"2026-06-07T23:48:03.806Z","1.0.6":"2026-06-08T09:23:32.647Z","1.0.9":"2026-06-10T04:09:42.129Z","1.2.0":"2026-07-21T22:39:00.028Z","1.2.1":"2026-07-22T05:03:04.601Z","1.2.2":"2026-07-22T05:17:05.518Z","1.2.3":"2026-07-22T05:37:29.228Z"},"author":{"name":"Altaga"},"license":"MIT","keywords":["sui","x402","sponsored","transactions","crypto","payments"],"description":"Modular x402 implementation for Sui Sponsored Transactions","maintainers":[{"name":"altaga","email":"v.a.i@hotmail.com"}],"readme":"# @altaga/x402-sui\n\n[![npm version](https://img.shields.io/npm/v/@altaga/x402-sui)](https://www.npmjs.com/package/@altaga/x402-sui)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Node.js ≥18](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)\n\n> **x402 v2** implementation for **Sui Sponsored Transactions** (gas-station model), with **client + server + facilitator** compatibility.\n\n---\n\n## Why this package?\n\nBuilding paid APIs on Web3 traditionally forces every buyer to hold SUI for gas, and every server to run a hot wallet. **x402-sui** eliminates both constraints:\n\n| Role | Without x402-sui | With x402-sui |\n| :--- | :--- | :--- |\n| **Seller (Server)** | Manages a hot wallet, writes custom verification logic | Declares a price per route. Zero private keys. |\n| **Buyer (Client)** | Needs SUI for gas on top of the payment token | Signs once. Gas is sponsored. Works with any token. |\n| **Facilitator (Gas Station)** | Custom per-project infrastructure | Drop-in Express router with fine-grained ACLs. |\n\n**How it works:**\n1. Buyer hits a paid endpoint → server returns `HTTP 402 Payment Required`\n2. Buyer builds a Sui PTB (Programmable Transaction Block) paying the seller\n3. Buyer sends the unsigned PTB to the Facilitator, who co-signs as the gas owner\n4. Buyer signs and attaches the `PAYMENT-SIGNATURE` header — replays the request\n5. Server validates via the Facilitator → returns the resource\n\n---\n\n## Compatibility\n\n```text\nx402 version:  v2\nchain:         Sui (testnet / mainnet)\nroles:         client · server · facilitator\ntransport:     HTTP (402 challenge / response)\nscheme:        exact (Sui sponsored transactions)\n```\n\n---\n\n## Installation\n\n```bash\nnpm install @altaga/x402-sui\n```\n\nInstall peer dependencies based on your role:\n\n| Role | Required peer deps |\n| :--- | :--- |\n| **Client (Buyer) — Node.js** | `@mysten/sui @mysten/bcs` |\n| **Client (Buyer) — Browser dApp** | `@mysten/sui @mysten/bcs @mysten/dapp-kit` |\n| **Server (Seller)** | `@mysten/sui @mysten/bcs express` |\n| **Facilitator** | `@mysten/sui @mysten/bcs express` |\n\n```bash\n# Node.js client / server / facilitator\nnpm install @mysten/sui @mysten/bcs express\n\n# Browser dApp client only\nnpm install @mysten/sui @mysten/bcs @mysten/dapp-kit\n```\n\n> **Note (TypeScript users):** This package is pure ESM. Set `\"moduleResolution\": \"bundler\"` (or `\"nodenext\"`) in your `tsconfig.json`.\n\n---\n\n## Architecture & Role Setup\n\n### Role 1 — The Seller (Resource Server)\n\nThe Seller exposes paid API endpoints. It trusts a Facilitator to verify and settle payments. **It never holds a private key or touches gas.**\n\n```js\nimport express from \"express\";\nimport {\n  x402ResourceServer,\n  HTTPFacilitatorClient,\n  x402HTTPResourceServer,\n  ExactSuiServerScheme\n} from \"@altaga/x402-sui\";\n\nconst app = express();\n\n// Point at your trusted Facilitator\nconst facilitator = new HTTPFacilitatorClient({ url: \"https://facilitator.example.com\" });\nconst resourceServer = new x402ResourceServer(facilitator);\n\n// Register which payment schemes you accept\nresourceServer.register(\"exact:sui:mainnet\", new ExactSuiServerScheme());\n\n// Define your paid routes\nconst routes = {\n  \"GET /premium\": {\n    description: \"Premium analytics feed\",      // [Optional] shown in 402 challenge\n    accepts: {\n      scheme: \"exact\",\n      network: \"sui:mainnet\",\n      asset: \"0x2::sui::SUI\",\n      payTo: \"0xCOMPANY_TREASURY_WALLET\",\n      amount: \"1000000\"   // 0.001 SUI (amounts in MIST — 1 SUI = 1,000,000,000 MIST)\n    }\n  },\n  \"POST /upload\": {\n    description: \"Paid file upload\",\n    accepts: {\n      scheme: \"exact\",\n      network: \"sui:mainnet\",\n      asset: \"0x2::sui::SUI\",\n      payTo: \"0xINFRASTRUCTURE_WALLET\",  // ← completely different receiver\n      amount: \"5000000\"   // 0.005 SUI\n    }\n  },\n  \"GET /stable-feed\": {\n    description: \"Data feed priced in USDC\",\n    accepts: {\n      scheme: \"exact\",\n      network: \"sui:mainnet\",\n      // Native USDC on Sui mainnet\n      asset: \"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC\",\n      payTo: \"0xSTABLECOIN_TREASURY_WALLET\",  // ← stablecoins go here\n      amount: \"1000000\"   // 1 USDC (USDC has 6 decimals)\n    }\n  }\n};\n\napp.use(new x402HTTPResourceServer(resourceServer, routes).middleware());\n\n// req.payment contains the settle result once the buyer has paid\napp.get(\"/premium\", (req, res) => res.json({ data: \"...\", paid: req.payment }));\napp.post(\"/upload\", (req, res) => res.json({ ok: true, paid: req.payment }));\n\napp.listen(3000);\n```\n\n#### Route Configuration Specification\n\n| Field | Required | Description |\n| :--- | :---: | :--- |\n| `scheme` | ✅ | Payment scheme — always `\"exact\"` for this package |\n| `network` | ✅ | Blockchain network — `\"sui:mainnet\"` or `\"sui:testnet\"` |\n| `asset` | ✅ | Fully-qualified Move coin type (e.g. `\"0x2::sui::SUI\"`) |\n| `payTo` | ✅ | Seller's wallet address that receives the payment |\n| `amount` | ✅ | Price in the asset's smallest unit. `price` / `maxAmountRequired` are accepted aliases for backwards compatibility |\n| `description` | ☐ | Human-readable label shown to the buyer in the 402 challenge. Defaults to `\"Protected Resource\"` |\n| `mimeType` | ☐ | MIME type of the resource (e.g. `\"application/json\"`) |\n\n#### Advanced Capabilities\n\n1. **Dynamic Revenue Splitting (`payTo`)**: Each route can specify a completely different `payTo` address. You can pay a creator directly on `GET /creator/:id`, pay infrastructure costs on `POST /upload`, and route to your treasury on `GET /premium` — all from a single server with zero fund management.\n\n2. **Any Token (`asset`)**: The `asset` field accepts any Sui coin type. Mix SUI, USDC, USDT, or custom tokens per route. The Facilitator always pays gas in SUI regardless of the token your buyer uses.\n\n3. **Granular Pricing (`amount` vs Facilitator `minRequiredPayment`)**: Prices are defined per-route by the Seller. The Facilitator has its own `minRequiredPayment` which acts as a spam-filter floor. **Your route's `amount` must be ≥ the Facilitator's `minRequiredPayment`**, otherwise the Facilitator will refuse to sponsor the transaction.\n\n---\n\n### Role 2 — The Buyer (Client)\n\nThe Buyer consumes paid endpoints. They sign a payment transaction but **never pay gas**.\n\n#### Option A — Node.js / Server-side (Keypair)\n\nUse `ExactSuiClientScheme` when you have a raw Ed25519 keypair (e.g. a bot or backend service).\n\n```js\nimport { SuiClient } from \"@mysten/sui/client\";\nimport { Ed25519Keypair } from \"@mysten/sui/keypairs/ed25519\";\nimport { x402Client, x402HTTPClient, ExactSuiClientScheme } from \"@altaga/x402-sui\";\n\nconst sui = new SuiClient({ url: \"https://fullnode.mainnet.sui.io:443\" });\nconst keypair = Ed25519Keypair.fromSecretKey(process.env.BUYER_SECRET);\n\nconst core = new x402Client();\ncore.register(\"exact:sui:mainnet\", new ExactSuiClientScheme(sui, keypair));\n\nconst http = new x402HTTPClient(core);\n\n// http.fetch() handles the 402 flow automatically\nconst res = await http.fetch(\"https://api.example.com/premium\");\nconst data = await res.json();\nconsole.log(data);\n```\n\n#### Option B — Browser dApp (Wallet Adapter)\n\nUse `ExactSuiDappScheme` when you are building a frontend that uses a Sui wallet (Slush, Phantom, etc.) via `@mysten/dapp-kit`.\n\n```js\nimport { useSuiClient, useSignTransaction, useCurrentAccount } from \"@mysten/dapp-kit\";\nimport { x402Client, x402HTTPClient, ExactSuiDappScheme } from \"@altaga/x402-sui\";\n\nfunction usePaidFetch() {\n  const client = useSuiClient();\n  const account = useCurrentAccount();\n  const { mutateAsync: signTransactionBlock } = useSignTransaction();\n\n  const core = new x402Client();\n  core.register(\n    \"exact:sui:mainnet\",\n    new ExactSuiDappScheme(client, account.address, signTransactionBlock)\n  );\n\n  return new x402HTTPClient(core);\n}\n\n// In your component:\nconst http = usePaidFetch();\nconst res = await http.fetch(\"https://api.example.com/premium\");\n```\n\n#### Manual Flow (Advanced)\n\nIf you need fine-grained control over the request lifecycle:\n\n```js\n// 1. Initial request\nlet res = await fetch(\"https://api.example.com/premium\");\n\nif (res.status === 402) {\n  // 2. Parse the 402 challenge from response headers\n  const paymentRequired = http.getPaymentRequiredResponse(\n    (name) => res.headers.get(name),\n    null\n  );\n\n  // 3. Build, sign, and sponsor the payment transaction\n  const payload = await http.createPaymentPayload(paymentRequired);\n\n  // 4. Replay the request with the payment attached\n  res = await fetch(\"https://api.example.com/premium\", {\n    headers: http.encodePaymentSignatureHeader(payload),\n  });\n}\n\n// 5. Read settlement info from the response headers\nconst settleInfo = http.getPaymentSettleResponse((n) => res.headers.get(n));\nconsole.log(\"data:\", await res.json(), \"settle:\", settleInfo);\n```\n\n---\n\n### Role 3 — The Facilitator (Gas Station)\n\nThe Facilitator holds a hot wallet with SUI. It co-signs buyer transactions to cover gas, then broadcasts them. It can restrict who it sponsors via ACLs and charge a fee for the service.\n\n```js\nimport express from \"express\";\nimport { SuiClient } from \"@mysten/sui/client\";\nimport { Ed25519Keypair } from \"@mysten/sui/keypairs/ed25519\";\nimport { x402Facilitator, ExactSuiFacilitatorScheme, createX402FacilitatorRouter } from \"@altaga/x402-sui\";\n\nconst client = new SuiClient({ url: \"https://fullnode.mainnet.sui.io:443\" });\nconst keypair = Ed25519Keypair.fromSecretKey(process.env.FACILITATOR_SECRET);\n\nconst schemeConfig = {\n  // ── Financial limits ──────────────────────────────────────────────────────\n  maxGasBudget:       50_000_000, // [Optional] Max gas per tx in MIST (default: 50M = 0.05 SUI)\n  minRequiredPayment: 1_000,      // [Optional] Min seller payment in MIST. Blocks spam.\n  facilitatorFee:     0,          // [Optional] Extra fee in MIST paid to facilitator's own address.\n\n  // ── Access Control Lists (all optional, empty = wildcard / no restriction) ─\n  allowedReceivers: [\"0xYOUR_SELLER_ADDRESS\"], // Only sponsor txs paying these sellers\n  blockedReceivers: [],                         // Never sponsor txs paying these addresses\n  allowedPayers:    [],                         // Only sponsor txs from these buyers\n  blockedPayers:    [],                         // Never sponsor txs from these buyers\n};\n\nconst facilitator = new x402Facilitator();\nfacilitator.register(\"exact:sui:mainnet\", new ExactSuiFacilitatorScheme(client, keypair, schemeConfig));\n\nconst app = express();\napp.use(express.json());\n\n// Mount all facilitator endpoints: GET /supported, POST /sponsor, /verify, /settle\napp.use(\"/\", createX402FacilitatorRouter({ facilitator, basePath: \"\" }));\n\napp.listen(4000, () => console.log(\"Facilitator running on :4000\"));\n```\n\n---\n\n## Scheme Configuration Reference\n\n### Financial & Security Limits\n\n| Parameter | Type | Default | Description |\n| :--- | :--- | :--- | :--- |\n| `maxGasBudget` | `Number` | `50_000_000` | Maximum gas the Facilitator will pay per transaction (in MIST). Keep this low to prevent gas draining attacks. |\n| `minRequiredPayment` | `Number` | `undefined` | Minimum payment (in MIST) the transaction must send to a seller. Transactions below this threshold are rejected. Set this to prevent spam. |\n| `facilitatorFee` | `Number` | `0` | Additional fee (in MIST) the Facilitator requires for itself. If `> 0`, the transaction **must** include a payment to the Facilitator's own address or it will be rejected. |\n\n### Access Control Lists (ACLs)\n\nAll ACL arrays are optional and default to `[]`. An **empty allowlist is a wildcard** (no restriction). An **empty denylist blocks nothing**.\n\n| Parameter | Type | Default | Behavior |\n| :--- | :--- | :--- | :--- |\n| `allowedReceivers` | `Array<string>` | `[]` | If non-empty, only sponsor transactions paying one of these seller addresses. Use this to run a private gas station for your own DApp. |\n| `blockedReceivers` | `Array<string>` | `[]` | Never sponsor transactions paying these addresses, regardless of other settings. |\n| `allowedPayers` | `Array<string>` | `[]` | If non-empty, only sponsor transactions from one of these buyer addresses. Use for KYC'd users or closed beta. |\n| `blockedPayers` | `Array<string>` | `[]` | Never sponsor transactions from these buyer addresses. Useful for banning known spammers. |\n\n---\n\n## Error Handling\n\nAll errors thrown by this package are instances of `X402Error`:\n\n```js\nimport { X402Error, ErrorCodes } from \"@altaga/x402-sui\";\n\ntry {\n  const payload = await http.createPaymentPayload(paymentRequired);\n} catch (err) {\n  if (err instanceof X402Error) {\n    console.error(err.code, err.message);\n    // err.code is one of the ErrorCodes constants below\n  }\n}\n```\n\n### Error Code Reference\n\n| Code | Constant | Thrown By | Meaning |\n| :--- | :--- | :--- | :--- |\n| `ERR_BUYER_INSUFFICIENT_FUNDS` | `BUYER_INSUFFICIENT_FUNDS` | Client | Buyer wallet has zero coins for the required asset |\n| `ERR_SPONSOR_REQUEST_FAILED` | `SPONSOR_REQUEST_FAILED` | Client | Facilitator's `/sponsor` endpoint returned a non-OK response |\n| `ERR_SIGNATURE_FAILED` | `SIGNATURE_FAILED` | Client | Keypair or wallet adapter rejected the signing request |\n| `ERR_FACILITATOR_NO_GAS` | `FACILITATOR_NO_GAS` | Facilitator | Facilitator wallet has no SUI coins to pay gas |\n| `ERR_FACILITATOR_MERGE_FAILED` | `FACILITATOR_MERGE_FAILED` | Facilitator | Auto-merge of small gas coins failed |\n| `ERR_VERIFICATION_PAYMENT_MISMATCH` | `VERIFICATION_PAYMENT_MISMATCH` | Facilitator | Transaction doesn't pay the required amount to the required address |\n| `ERR_EXECUTION_CORRUPTED_GAS` | `EXECUTION_CORRUPTED_GAS` | Facilitator | Gas coin object ownership is corrupted (node sync issue) |\n| `ERR_SETTLEMENT_FAILED` | `SETTLEMENT_FAILED` | Facilitator | Transaction execution failed on-chain |\n| `ERR_RPC_CONNECTION_FAILED` | `RPC_CONNECTION_FAILED` | Facilitator | Could not connect to the Sui RPC node |\n| `ERR_INVALID_PAYLOAD` | `INVALID_PAYLOAD` | Facilitator | Malformed or missing fields in the payment payload |\n| `ERR_MISSING_REQUIREMENT` | `MISSING_REQUIREMENT` | Client/Facilitator | Payment requirement object is missing required fields |\n\n---\n\n## Advanced API Reference\n\n### `x402Client` — Core Client Registry\n\n```js\nimport { x402Client } from \"@altaga/x402-sui\";\n\nconst core = new x402Client();\n\n// Register with an exact scheme:network pattern\ncore.register(\"exact:sui:mainnet\", schemeImpl);\n\n// Or with wildcards — matched in order: exact > scheme:* > *:*\ncore.register(\"exact:sui:*\", wildcardNetworkImpl);  // any sui network\ncore.register(\"*:*\",          catchAllImpl);          // any scheme + network\n```\n\n### `x402HTTPClient` — HTTP Wrapper\n\n```js\nimport { x402HTTPClient } from \"@altaga/x402-sui\";\n\nconst http = new x402HTTPClient(core);\n\n// Auto-handles 402: builds, signs, sponsors, and retries automatically\nconst res = await http.fetch(url, fetchInit);\n\n// Manual flow:\nconst paymentRequired = http.getPaymentRequiredResponse(headerFn, bodyJson);\nconst payload         = await http.createPaymentPayload(paymentRequired);\nconst headers         = http.encodePaymentSignatureHeader(payload);\nconst settleInfo      = http.getPaymentSettleResponse(headerFn);\n```\n\n### `createX402FacilitatorRouter` — Express Router\n\nMounts four endpoints under the given `basePath`:\n\n| Method | Path | Description |\n| :--- | :--- | :--- |\n| `GET` | `/supported` | Lists registered scheme/network pairs |\n| `POST` | `/sponsor` | Accepts `{ txBytes, sender, scheme, network }` — returns `{ sponsoredTxBytes, sponsorSignature }` |\n| `POST` | `/verify` | Accepts `{ paymentPayload, paymentRequirement }` — returns `{ isValid: true }` |\n| `POST` | `/settle` | Accepts `{ paymentPayload, paymentRequirement }` — returns `{ transactionDigest }` |\n\n```js\nimport { createX402FacilitatorRouter } from \"@altaga/x402-sui\";\n\napp.use(\"/\", createX402FacilitatorRouter({ facilitator, basePath: \"\" }));\n```\n\n---\n\n## Security & x402 v2 Protocol Adherence\n\nThis package follows the **x402 v2** standard and implements specific security measures for Sui Programmable Transaction Blocks (PTBs) to protect Facilitators from common attack vectors.\n\n### 1. Correct x402 v2 Protocol Usage\n- **Strict Envelope Formatting:** Enforces `x402Version: 2` envelopes. Legacy v1 or malformed headers are instantly rejected.\n- **Requirement Negotiation:** The client natively parses multiple requirements (e.g. `sui:mainnet` vs `sui:testnet`) from the server's 402 challenge, automatically negotiates the matching capability, and explicitly communicates the *exact* fulfilled requirement back to the server in the signed `x-payment-signature` header.\n- **Stateless Verification:** The server utilizes the exact matched requirement to statelessly verify the payment via the Facilitator without any desync or state-locking.\n\n### 2. Sui PTB Security Measures\nWhen a Facilitator signs a sponsored transaction, it exposes its `GasCoin` to the network. This package implements several restrictions on PTBs to mitigate the risk of fund loss:\n- **Command Whitelisting:** The facilitator iterates through every command in the PTB. It rejects the transaction if it contains commands other than `TransferObjects` and `SplitCoins`. \n- **Smart Contract Restrictions:** Commands such as `MoveCall`, `Publish`, `Upgrade`, and `MakeMoveVec` are blocked to prevent the Facilitator from sponsoring arbitrary smart contract executions.\n- **Gas Manipulation Prevention:** The facilitator prevents explicit manipulation or transfers of its own `tx.gas` coin by the sender.\n- **Command Limits:** Transactions are capped at 10 commands to mitigate multi-command attacks designed to exhaust gas budgets.\n- **Signature Validation:** Cryptographic scheme flags are validated to ensure they match the provided signature payload.\n\n---\n\n## Changelog\n\n### 1.2.0\n- **Security:** Implemented PTB command restrictions (blocked MoveCall/Publish/Upgrade) to protect Facilitators from unexpected smart contract executions.\n- **Security:** Added signature scheme malleability checks and null sender validation.\n- **Security:** Added a 10-command limit per PTB to mitigate gas draining vectors.\n- Fixed `amount` field resolution priority: `amount` → `price` → `maxAmountRequired` (x402 v2 canonical order).\n- Fixed `compareRequirements` algorithm for precise network selection (e.g. `sui:mainnet` vs `sui:testnet`).\n- Fixed: Client no longer sets `setGasPayment()` or `setGasBudget()` — these are exclusively the Facilitator's responsibility.\n- Added `maxGasBudget` to `ExactSuiFacilitatorScheme` config object.\n- **Testing:** Added 22 E2E tests verifying standard flows and edge-cases on Sui Testnet.\n### 1.1.0\n- Migrated to `@mysten/sui` v2 (`@mysten/sui/client`) and `@mysten/dapp-kit` v1.x\n- Added `createX402FacilitatorRouter` helper\n\n### 1.0.0\n- Initial release\n","readmeFilename":"README.MD"}