{"_id":"@baking-bad/free-route-tezos-x","_rev":"9-5d839434a38f4af0f3187657bf246500","name":"@baking-bad/free-route-tezos-x","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@baking-bad/free-route-tezos-x","version":"0.1.0","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"author":{"name":"Baking Bad"},"license":"MIT","_id":"@baking-bad/free-route-tezos-x@0.1.0","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"homepage":"https://github.com/3route/free-route-tezos-x#readme","bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"dist":{"shasum":"10c3eb50984996378a7e5184902ce52f8c8f183c","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.1.0.tgz","fileCount":45,"integrity":"sha512-Nm9Z8mfHH0O7myH38YT5eDNJrdA/093c8vD3+1YirTyvE7VunUivxIKCjD8Yc5jCaqyAQ1qZ778zjy0lWqOzIw==","signatures":[{"sig":"MEUCIQCbMcRE+080VtrE2NP1XC734xwirxlL7Jhu4ksPlpH6+QIgGQPXiO80ZD3b47EXOaSTRYQe1VlRL78S+rueIruiRq0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41876},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"3012cdb1bef41097d6a2e31c2ac833bccd94299e","scripts":{"lint":"eslint .","test":"tsx --test src/tests/*.test.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc --noEmit","setup":"tsx scripts/setup.ts","prepare":"npm run build","addresses":"tsx scripts/addresses.ts","deploy:fa2":"tsx scripts/deploy-fa2.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","example-buy":"tsx scripts/example-buy.ts","deploy:objkt":"tsx scripts/deploy-objkt.ts"},"_npmUser":{"name":"maxima-net","email":"maximkucherov@gmail.com"},"repository":{"url":"git+https://github.com/3route/free-route-tezos-x.git","type":"git"},"_npmVersion":"11.12.1","description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","directories":{},"sideEffects":false,"_nodeVersion":"22.17.0","dependencies":{"@noble/hashes":"^1.8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","eslint":"^10.5.0","@eslint/js":"^10.0.1","typescript":"^5.7.0","@types/node":"^22.10.0","@taquito/utils":"~24.2.0","@taquito/signer":"~24.2.0","@taquito/taquito":"~24.2.0","typescript-eslint":"^8.61.1","@taquito/michelson-encoder":"~24.2.0"},"peerDependencies":{"@taquito/utils":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/michelson-encoder":"^24.2.0"},"_npmOperationalInternal":{"tmp":"tmp/free-route-tezos-x_0.1.0_1782130882429_0.47977028546150846","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@baking-bad/free-route-tezos-x","version":"0.1.1","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"author":{"name":"Baking Bad"},"license":"MIT","_id":"@baking-bad/free-route-tezos-x@0.1.1","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"homepage":"https://github.com/3route/free-route-tezos-x#readme","bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"dist":{"shasum":"362d7d46ee07f5a9ff14eda0766f4e8a1b63f657","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.1.1.tgz","fileCount":45,"integrity":"sha512-G9+mUx6E5aHrbRMNE78tKxHE7n7mRoU9AFDJCifbzJcXI+BQKYQGFM1yxw3maNEAfmperZM4CJn1ivFHKZOZoA==","signatures":[{"sig":"MEQCIFC5Th+nX+SoQQwADQ/cnWd+6pMvaydSa6mduwozlaPlAiAZXy656yN9IbOUdM2AppnALBsAZGhB0STs4oHK2F46iw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@baking-bad%2ffree-route-tezos-x@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":42008},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"cf276c31bdbe3b865ea4a7d66695602b4d521809","scripts":{"lint":"eslint .","test":"tsx --test src/tests/*.test.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc --noEmit","setup":"tsx scripts/setup.ts","prepare":"npm run build","addresses":"tsx scripts/addresses.ts","deploy:fa2":"tsx scripts/deploy-fa2.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","example-buy":"tsx scripts/example-buy.ts","deploy:objkt":"tsx scripts/deploy-objkt.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:66595697-06a9-46ee-868d-1ab7b24d35bb"}},"repository":{"url":"git+https://github.com/3route/free-route-tezos-x.git","type":"git"},"_npmVersion":"11.17.0","description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@noble/hashes":"^1.8.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","eslint":"^10.5.0","@eslint/js":"^10.0.1","typescript":"^5.7.0","@types/node":"^22.10.0","@taquito/utils":"~24.2.0","@taquito/signer":"~24.2.0","@taquito/taquito":"~24.2.0","typescript-eslint":"^8.61.1","@taquito/michelson-encoder":"~24.2.0"},"peerDependencies":{"@taquito/utils":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/michelson-encoder":"^24.2.0"},"_npmOperationalInternal":{"tmp":"tmp/free-route-tezos-x_0.1.1_1782134315717_0.364346388757147","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@baking-bad/free-route-tezos-x","version":"0.1.2","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"author":{"name":"Baking Bad"},"license":"MIT","_id":"@baking-bad/free-route-tezos-x@0.1.2","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"homepage":"https://github.com/3route/free-route-tezos-x#readme","bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"dist":{"shasum":"afc39a95c938c62489c3acb4018160aa7882eeb4","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.1.2.tgz","fileCount":45,"integrity":"sha512-ngAbUqyHi3o6g//wEuxh/hVBba/i/d59IobJKOnGpa6esmAPkw36aEBVjUjG3jzT+wnVa713tb+iNXqW8ExrXA==","signatures":[{"sig":"MEYCIQCvdIJW1TuKiadsBdGSVwpBSj0PjENHDP0PPc3KA8gQ/AIhALPUShFgQnDORyE8ID0U5bbsV1qUNNWjdtRYXmVsKMxN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@baking-bad%2ffree-route-tezos-x@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":42019},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"c7e4f2fd6f6f4c6ad33cce9f29e7af71a423b158","scripts":{"lint":"eslint .","test":"tsx --test src/tests/*.test.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc --noEmit","setup":"tsx scripts/setup.ts","prepare":"npm run build","addresses":"tsx scripts/addresses.ts","deploy:fa2":"tsx scripts/deploy-fa2.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","example-buy":"tsx scripts/example-buy.ts","deploy:objkt":"tsx scripts/deploy-objkt.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:66595697-06a9-46ee-868d-1ab7b24d35bb"}},"repository":{"url":"git+https://github.com/3route/free-route-tezos-x.git","type":"git"},"_npmVersion":"11.17.0","description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@noble/hashes":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","eslint":"^10.5.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.0.0","@taquito/utils":"~24.3.0","@taquito/signer":"~24.3.0","@taquito/taquito":"~24.3.0","typescript-eslint":"^8.61.1","@taquito/michelson-encoder":"~24.3.0"},"peerDependencies":{"@taquito/utils":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/michelson-encoder":"^24.2.0"},"_npmOperationalInternal":{"tmp":"tmp/free-route-tezos-x_0.1.2_1782144738380_0.5667457498376298","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@baking-bad/free-route-tezos-x","version":"0.2.0","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"author":{"name":"Baking Bad"},"license":"MIT","_id":"@baking-bad/free-route-tezos-x@0.2.0","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"homepage":"https://github.com/3route/free-route-tezos-x#readme","bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"dist":{"shasum":"6c2fa465dbd529520042f38f083d430ce46a2a79","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.2.0.tgz","fileCount":45,"integrity":"sha512-I1Dopv9HKjh3wwOP7loeyIA2k/FJ7boMTxK6+uI/QitoJkKbpCPlqg6ZDOs4KLZKYfpw/TsFDgtMcUrnnDJh4Q==","signatures":[{"sig":"MEQCIG2rcaVHEGt4cIkFET5M3b3k/FfUiUXFIVSVPuRkl06YAiA56dJbh6KO1wX4Mdd1RSAx9qjD9ANZYjJI6Dup5eP+AQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@baking-bad%2ffree-route-tezos-x@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":42187},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"410684aefe1cae745ff67c12c519484f2840eac2","scripts":{"lint":"eslint .","test":"tsx --test src/tests/*.test.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc --noEmit","setup":"tsx scripts/setup.ts","prepare":"npm run build","addresses":"tsx scripts/addresses.ts","deploy:fa2":"tsx scripts/deploy-fa2.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","example-buy":"tsx scripts/example-buy.ts","deploy:objkt":"tsx scripts/deploy-objkt.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:66595697-06a9-46ee-868d-1ab7b24d35bb"}},"repository":{"url":"git+https://github.com/3route/free-route-tezos-x.git","type":"git"},"_npmVersion":"11.17.0","description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@noble/hashes":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","eslint":"^10.5.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.0.0","@taquito/utils":"~24.3.0","@taquito/signer":"~24.3.0","@taquito/taquito":"~24.3.0","typescript-eslint":"^8.61.1","@taquito/michelson-encoder":"~24.3.0"},"peerDependencies":{"@taquito/utils":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/michelson-encoder":"^24.2.0"},"_npmOperationalInternal":{"tmp":"tmp/free-route-tezos-x_0.2.0_1782219651995_0.48194180380067886","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@baking-bad/free-route-tezos-x","version":"0.2.1","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"author":{"name":"Baking Bad"},"license":"MIT","_id":"@baking-bad/free-route-tezos-x@0.2.1","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"homepage":"https://github.com/3route/free-route-tezos-x#readme","bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"dist":{"shasum":"377045b3884bf589a7f5bc6ef02042a48d25f070","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.2.1.tgz","fileCount":45,"integrity":"sha512-ZJxSc4Q/+nQTTOpnnyh/DGBfNg8s78TJ54yZboXykNdE+WUnmId4J1SJmCmtmfDowwzWC5FcVNq9HBE3JkdX0g==","signatures":[{"sig":"MEQCIHnJjtel7H3bk+Yj2fzY2kTSEGDiHUlSl13RLbncLJW5AiAx18lWFRoNs+997sidMjlsq+oWqe/zk2aY3Y9UPCBQvA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@baking-bad%2ffree-route-tezos-x@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":44431},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"660a106b6f003920901cc60731d659b319985847","scripts":{"lint":"eslint .","test":"tsx --test src/tests/*.test.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc --noEmit","setup":"tsx scripts/setup.ts","prepare":"npm run build","addresses":"tsx scripts/addresses.ts","deploy:fa2":"tsx scripts/deploy-fa2.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","example-buy":"tsx scripts/example-buy.ts","deploy:objkt":"tsx scripts/deploy-objkt.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:66595697-06a9-46ee-868d-1ab7b24d35bb"}},"repository":{"url":"git+https://github.com/3route/free-route-tezos-x.git","type":"git"},"_npmVersion":"11.17.0","description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@noble/hashes":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","eslint":"^10.5.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.0.0","@taquito/utils":"~24.3.0","@taquito/signer":"~24.3.0","@taquito/taquito":"~24.3.0","typescript-eslint":"^8.61.1","@taquito/michelson-encoder":"~24.3.0"},"peerDependencies":{"@taquito/utils":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/michelson-encoder":"^24.2.0"},"_npmOperationalInternal":{"tmp":"tmp/free-route-tezos-x_0.2.1_1782231454925_0.6039370121946686","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@baking-bad/free-route-tezos-x","version":"0.2.2","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"author":{"name":"Baking Bad"},"license":"MIT","_id":"@baking-bad/free-route-tezos-x@0.2.2","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"homepage":"https://github.com/3route/free-route-tezos-x#readme","bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"dist":{"shasum":"3aeeef4e15bd38cc33a14d87c24e6237fc734788","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.2.2.tgz","fileCount":73,"integrity":"sha512-c715wMCSzg8g5XpKkB1rdNWXehy2lh+FdH+d0oOxvaABQIiFK3e8ikeUripUZjgA/aoF2dN5duSaztu0g8373A==","signatures":[{"sig":"MEUCIFRUasD5apg7JtpL4bBMHu0VOVbQxhedC/bePgtRIQbIAiEA7WsP4eccjqsvqZ4glhWiY15EKcZT+URQcO/WgBX6cG4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@baking-bad%2ffree-route-tezos-x@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":64529},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./evm":{"types":"./dist/evm/index.d.ts","default":"./dist/evm/index.js"},"./michelson":{"types":"./dist/michelson/index.d.ts","default":"./dist/michelson/index.js"}},"gitHead":"9882c811853151f8753781592908d2474bbf89ca","scripts":{"lint":"eslint .","test":"tsx --test src/tests/*/*.test.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc --noEmit","setup":"tsx scripts/shared/setup.ts","prepare":"npm run build","bridge:evm":"tsx scripts/evm/bridge.ts","deploy:fa2":"tsx scripts/shared/deploy-fa2.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","deploy:objkt":"tsx scripts/shared/deploy-objkt.ts","addresses:evm":"tsx scripts/evm/addresses.ts","example-buy:evm":"tsx scripts/evm/example-buy.ts","addresses:michelson":"tsx scripts/michelson/addresses.ts","example-buy:michelson":"tsx scripts/michelson/example-buy.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:66595697-06a9-46ee-868d-1ab7b24d35bb"}},"repository":{"url":"git+https://github.com/3route/free-route-tezos-x.git","type":"git"},"_npmVersion":"11.17.0","description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.0","dependencies":{"@noble/hashes":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","viem":"^2.53.1","eslint":"^10.5.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.0.0","@taquito/utils":"~24.3.0","@taquito/signer":"~24.3.0","@taquito/taquito":"~24.3.0","typescript-eslint":"^8.61.1","@taquito/michel-codec":"~24.3.0","@taquito/michelson-encoder":"~24.3.0"},"peerDependencies":{"@taquito/utils":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/michel-codec":"^24.2.0","@taquito/michelson-encoder":"^24.2.0"},"peerDependenciesMeta":{"@taquito/taquito":{"optional":true},"@taquito/michel-codec":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/free-route-tezos-x_0.2.2_1782417370736_0.9123332174031544","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@baking-bad/free-route-tezos-x","version":"0.3.0","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"author":{"name":"Baking Bad"},"license":"MIT","_id":"@baking-bad/free-route-tezos-x@0.3.0","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"homepage":"https://github.com/3route/free-route-tezos-x#readme","bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"dist":{"shasum":"87c54fea3d5c8d7793f22988c7871b0ebc559d2e","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.3.0.tgz","fileCount":73,"integrity":"sha512-p6i6d0n6pjZoRkzY2UZezcfqhZNBpVJvEYP6mTnM/y+5A5YcjsKeUNSCDSkXjG328cc7+1UINElCqLxPvXHGCQ==","signatures":[{"sig":"MEUCIEY8c2LxY4c2UwivcsFXsAT+PPXdQn20stgIL2V/hO2IAiEA949GDVGeUeWRPOz96O/dwrVMw3dJUsckz1TORrnorcA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@baking-bad%2ffree-route-tezos-x@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":71876},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./evm":{"types":"./dist/evm/index.d.ts","default":"./dist/evm/index.js"},"./michelson":{"types":"./dist/michelson/index.d.ts","default":"./dist/michelson/index.js"},"./package.json":"./package.json"},"gitHead":"f9f40f1e1435f8941ccdd0f738a241e41f310fea","scripts":{"lint":"eslint .","test":"tsx --test src/tests/*/*.test.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc --noEmit","setup":"tsx scripts/shared/setup.ts","prepare":"npm run build","bridge:evm":"tsx scripts/evm/bridge.ts","deploy:fa2":"tsx scripts/shared/deploy-fa2.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","deploy:objkt":"tsx scripts/shared/deploy-objkt.ts","addresses:evm":"tsx scripts/evm/addresses.ts","example-buy:evm":"tsx scripts/evm/example-buy.ts","addresses:michelson":"tsx scripts/michelson/addresses.ts","example-buy:michelson":"tsx scripts/michelson/example-buy.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:66595697-06a9-46ee-868d-1ab7b24d35bb"}},"repository":{"url":"git+https://github.com/3route/free-route-tezos-x.git","type":"git"},"_npmVersion":"11.17.0","description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.0","dependencies":{"@noble/hashes":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","viem":"^2.53.1","eslint":"^10.5.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.0.0","@taquito/utils":"~24.3.0","@taquito/signer":"~24.3.0","@taquito/taquito":"~24.3.0","typescript-eslint":"^8.61.1","@taquito/michel-codec":"~24.3.0","@taquito/michelson-encoder":"~24.3.0"},"peerDependencies":{"@taquito/utils":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/michel-codec":"^24.2.0","@taquito/michelson-encoder":"^24.2.0"},"peerDependenciesMeta":{"@taquito/taquito":{"optional":true},"@taquito/michel-codec":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/free-route-tezos-x_0.3.0_1782481564347_0.6100579631329546","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@baking-bad/free-route-tezos-x","version":"0.3.1","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"author":{"name":"Baking Bad"},"license":"MIT","_id":"@baking-bad/free-route-tezos-x@0.3.1","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"homepage":"https://github.com/3route/free-route-tezos-x#readme","bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"dist":{"shasum":"175acf08be93c4037b7709afdfc0a55037ec6d0a","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.3.1.tgz","fileCount":73,"integrity":"sha512-wv2XqW3/X9TWm+NGoXLSweGK0zxQOfTyh/9ANdxSsL/PSyU1DdCi2VSBeMqhWbw2RbRDEE2bcWIZLugSaMSETQ==","signatures":[{"sig":"MEUCIHTrJYvOovJWkRMF6ZTl1VfyrCFcJ5lS6a+Hg4kJ+lWkAiEA9YSbYNppS0SGTjlmQz/LZOFDOpJ0w1BrObTB4NGkZhU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@baking-bad%2ffree-route-tezos-x@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72579},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./evm":{"types":"./dist/evm/index.d.ts","default":"./dist/evm/index.js"},"./michelson":{"types":"./dist/michelson/index.d.ts","default":"./dist/michelson/index.js"},"./package.json":"./package.json"},"gitHead":"2804858314ab183a9e055b3842ed58294be94512","scripts":{"lint":"eslint .","test":"tsx --test src/tests/*/*.test.ts","build":"rm -rf dist && tsc -p tsconfig.build.json","check":"tsc --noEmit","setup":"tsx scripts/shared/setup.ts","prepare":"npm run build","test:e2e":"tsx --test scripts/e2e/*.test.ts","bridge:evm":"tsx scripts/evm/bridge.ts","deploy:fa2":"tsx scripts/shared/deploy-fa2.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","deploy:objkt":"tsx scripts/shared/deploy-objkt.ts","addresses:evm":"tsx scripts/evm/addresses.ts","example-buy:evm":"tsx scripts/evm/example-buy.ts","bridge:michelson":"tsx scripts/michelson/bridge.ts","addresses:michelson":"tsx scripts/michelson/addresses.ts","example-buy:michelson":"tsx scripts/michelson/example-buy.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:66595697-06a9-46ee-868d-1ab7b24d35bb"}},"repository":{"url":"git+https://github.com/3route/free-route-tezos-x.git","type":"git"},"_npmVersion":"11.17.0","description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.0","dependencies":{"@noble/hashes":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","viem":"^2.53.1","eslint":"^10.5.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^26.0.0","@taquito/utils":"~24.3.0","@taquito/signer":"~24.3.0","@taquito/taquito":"~24.3.0","typescript-eslint":"^8.61.1","@taquito/michel-codec":"~24.3.0","@taquito/michelson-encoder":"~24.3.0"},"peerDependencies":{"@taquito/utils":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/michel-codec":"^24.2.0","@taquito/michelson-encoder":"^24.2.0"},"peerDependenciesMeta":{"@taquito/taquito":{"optional":true},"@taquito/michel-codec":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/free-route-tezos-x_0.3.1_1782742166675_0.8268336367242402","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@baking-bad/free-route-tezos-x","version":"0.4.0","type":"module","publishConfig":{"access":"public"},"description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","license":"MIT","author":{"name":"Baking Bad"},"keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"homepage":"https://github.com/3route/free-route-tezos-x#readme","repository":{"type":"git","url":"git+https://github.com/3route/free-route-tezos-x.git"},"bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./michelson":{"types":"./dist/michelson/index.d.ts","default":"./dist/michelson/index.js"},"./evm":{"types":"./dist/evm/index.d.ts","default":"./dist/evm/index.js"},"./package.json":"./package.json"},"main":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"scripts":{"check":"tsc --noEmit","lint":"eslint .","build":"rm -rf dist && tsc -p tsconfig.build.json","prepare":"npm run build","test":"tsx --test src/tests/*/*.test.ts","test:e2e":"tsx --test scripts/e2e/*.test.ts","setup":"tsx scripts/shared/setup.ts","example-buy:michelson":"tsx scripts/michelson/example-buy.ts","example-buy:evm":"tsx scripts/evm/example-buy.ts","bridge:evm":"tsx scripts/evm/bridge.ts","bridge:michelson":"tsx scripts/michelson/bridge.ts","addresses:michelson":"tsx scripts/michelson/addresses.ts","addresses:evm":"tsx scripts/evm/addresses.ts","compile:fa2":"ligo compile contract contracts/fa2_nft.mligo --michelson-format json -o contracts/fa2_nft.json","deploy:fa2":"tsx scripts/shared/deploy-fa2.ts","deploy:objkt":"tsx scripts/shared/deploy-objkt.ts"},"dependencies":{"@noble/hashes":"^2.2.0"},"peerDependencies":{"@taquito/michel-codec":"^24.2.0","@taquito/michelson-encoder":"^24.2.0","@taquito/taquito":"^24.2.0","@taquito/utils":"^24.2.0"},"peerDependenciesMeta":{"@taquito/michel-codec":{"optional":true},"@taquito/taquito":{"optional":true}},"devDependencies":{"@eslint/js":"^10.0.1","@taquito/michel-codec":"~24.3.0","@taquito/michelson-encoder":"~24.3.0","@taquito/signer":"~24.3.0","@taquito/taquito":"~24.3.0","@taquito/utils":"~24.3.0","@types/node":"^26.0.0","eslint":"^10.5.0","tsx":"^4.19.0","typescript":"^6.0.3","typescript-eslint":"^8.61.1","viem":"^2.53.1"},"gitHead":"8b7e30b113cd7ba4c4b4954c1c40c0f06c7d0702","_id":"@baking-bad/free-route-tezos-x@0.4.0","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-h0myWRyoxYbUdqjVFsdDhZtXLCidL7phHWHGAMxMyPz2AYSEy8VT0cKmAfiWLmXuNIOs/vi004Q4OYwPzhImQw==","shasum":"636e201ea38231cebe0fcf21fc5f054d1ef87532","tarball":"https://registry.npmjs.org/@baking-bad/free-route-tezos-x/-/free-route-tezos-x-0.4.0.tgz","fileCount":75,"unpackedSize":82047,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@baking-bad%2ffree-route-tezos-x@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDsCwYlCrGR4dkmKQGgMK4GqCKWER1PfMqUdXE4UBCotAIhAPuKbM+1BNqOlsCRcd/ZGBxgKHJbpsWVXpmRSQ0lhe2L"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:66595697-06a9-46ee-868d-1ab7b24d35bb"}},"directories":{},"maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/free-route-tezos-x_0.4.0_1787739978491_0.8945100539568289"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-22T12:21:22.114Z","modified":"2026-08-26T10:26:19.089Z","0.1.0":"2026-06-22T12:21:22.610Z","0.1.1":"2026-06-22T13:18:35.848Z","0.1.2":"2026-06-22T16:12:18.509Z","0.2.0":"2026-06-23T13:00:52.147Z","0.2.1":"2026-06-23T16:17:35.102Z","0.2.2":"2026-06-25T19:56:10.875Z","0.3.0":"2026-06-26T13:46:04.497Z","0.3.1":"2026-06-29T14:09:26.804Z","0.4.0":"2026-08-26T10:26:18.651Z"},"bugs":{"url":"https://github.com/3route/free-route-tezos-x/issues"},"author":{"name":"Baking Bad"},"license":"MIT","homepage":"https://github.com/3route/free-route-tezos-x#readme","keywords":["tezos","tezos-x","free-route","swap","dex","erc20","objkt","nft","marketplace","michelson","etherlink","defi"],"repository":{"type":"git","url":"git+https://github.com/3route/free-route-tezos-x.git"},"description":"SDK for free-route swaps on Tezos X — turn any ERC20/XTZ swap into ready-to-sign Tezos operations, signed from the Michelson side.","maintainers":[{"name":"m_kus","email":"mz@baking-bad.org"},{"name":"skubarenko","email":"andrew.skubarenko@gmail.com"},{"name":"dmirg","email":"dm@baking-bad.org"},{"name":"maxima-net","email":"maximkucherov@gmail.com"},{"name":"big-smike","email":"mi.smirnov24@gmail.com"},{"name":"zaariel","email":"na@baking-bad.org"}],"readme":"# @baking-bad/free-route-tezos-x\n\n[![npm](https://img.shields.io/npm/v/@baking-bad/free-route-tezos-x)](https://www.npmjs.com/package/@baking-bad/free-route-tezos-x) [![CI](https://github.com/3route/free-route-tezos-x/actions/workflows/ci.yml/badge.svg)](https://github.com/3route/free-route-tezos-x/actions/workflows/ci.yml)\n\nTurn **free-route** swaps (any ERC20/XTZ pair) on **Tezos X** into ready-to-sign transactions — from the **Michelson side** (Taquito op-groups, e.g. Temple) or the **EVM side** (tx requests, e.g. MetaMask). Compose with marketplace ops (e.g. [objkt](https://objkt.com)) into one atomic action — for example, **pay any ERC20 for an XTZ-priced NFT**.\n\nA small, dependency-light, **isomorphic** (browser + Node) ESM library. It only *prepares* operations — you sign and broadcast them with your own wallet ([Taquito](https://taquito.io) on the Michelson side, an EVM wallet on the EVM side).\n\n> **Live demo dApp:** [**3route/free-route-tezos-x-example**](https://github.com/3route/free-route-tezos-x-example) (Next.js) — buy / bridge / mint-list from both wallet sides (Temple + MetaMask), showing the server/client API-key split. The canonical example of consuming this SDK.\n\n## How it works\n\nTezos X is one chain with two interfaces — Michelson (Tezlink) and EVM (Etherlink) — that can call each other atomically within a single transaction. This library prepares the calls for whichever side signs:\n\n- **Michelson-native** (your tz1 signs): the op-group calls the EVM-side free-route router via `call_evm`, acting as your account's **EVM alias** (a `0x` derived from your tz1). The ERC20→XTZ swap's native-XTZ output lands on that alias, which **auto-forwards** it to your tz1 (the alias is an `AliasForwarder` that returns any tez to its native account). Your tz1 then funds a Michelson op (e.g. a marketplace purchase) — all in one atomic, single-signature group.\n- **EVM-native** (your 0x signs): the free-route `/swap` response is already a raw EVM transaction, so you send it directly; to reach a Michelson contract you call `callMichelson` on the EVM→Michelson gateway, acting as your account's **Michelson alias** (a `KT1` derived from your 0x) — so the NFT lands on that alias. A wallet batches `approve + swap + fulfill` atomically via [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) `wallet_sendCalls`.\n\n## Install\n\n```sh\nnpm i @baking-bad/free-route-tezos-x\n```\n\nRequires **Node ≥ 20** or a modern browser (uses global `fetch`; on older runtimes pass your own via the `fetch` option).\n\nPeer dependencies (install only the side(s) you use — see [Entrypoints](#entrypoints)):\n\n- both sides: `@taquito/michelson-encoder`, `@taquito/utils`\n- Michelson side: `@taquito/taquito` *(optional peer)*\n- EVM side: `@taquito/michel-codec` *(optional peer)*\n\n## Quick start — Michelson (Temple)\n\nBuy an XTZ-priced objkt NFT paying USDC, in one atomic op-group:\n\n```ts\nimport { TezosToolkit } from '@taquito/taquito';\nimport {\n  FreeRouteTezosX, tezosXMainnet, XTZ, toEvmUnits, targetForMinOut,\n  michelsonToEvmAlias, resolveApproval, buildBatchTransaction, objkt,\n} from '@baking-bad/free-route-tezos-x';\n\nconst tezos = new TezosToolkit(MICHELSON_RPC); // bring your own signer / wallet\nconst freeRoute = new FreeRouteTezosX({\n  baseUrl: FREE_ROUTE_API,\n  network: tezosXMainnet,\n  apiKey: FREE_ROUTE_API_KEY, // free-route API key\n});\n\nconst buyerAddress = await tezos.signer.publicKeyHash(); // your Michelson address\nconst buyerAlias = michelsonToEvmAlias(buyerAddress);  // its EVM-side identity (holds the ERC20)\nconst payToken = (await freeRoute.getTokens()).find((token) => token.symbol === 'USDC')!;\n\nconst priceMutez = 4_000n;  // the ask price (read it from the marketplace)\nconst slippageBps = 200;    // 2%\n\n// exact-out swap, sized so the on-chain floor (target − slippage) still covers the price\nconst minOutTarget = targetForMinOut(priceMutez, slippageBps);\nconst swapAmount = toEvmUnits(minOutTarget, XTZ.address); // mutez -> wei for the EVM API\n\nconst swap = await freeRoute.getSwap({\n  src: payToken.address,\n  dst: XTZ.address,\n  amount: swapAmount,\n  isExactOut: true,\n  from: buyerAlias,\n  receiver: buyerAlias,\n  slippageBps,\n});\n\n// read the on-chain allowance -> pick the minimal safe approval mode (none / approve / reset+approve)\nconst approval = await resolveApproval({\n  evmRpc: EVM_RPC,\n  token: payToken.address,\n  owner: buyerAlias,\n  spender: swap.tx.to,\n  amount: swap.srcAmount,\n});\n\n// approve(s) + swap, composed with the marketplace fulfill -> one atomic group\nconst swapOps = freeRoute.michelson.buildSwapOperation({\n  swap,\n  srcAddress: payToken.address,\n  approval,\n});\nconst fulfill = objkt.buildMichelsonFulfillAskOperation({\n  marketplace: OBJKT_MARKETPLACE,\n  askId: '1',\n  editions: 1,\n  amountMutez: priceMutez,\n});\n\nconst ops = buildBatchTransaction(swapOps, fulfill);\n// size the group on the node (also checks it end-to-end before signing) — see \"Gas on the Michelson side\"\nconst readyOps = await freeRoute.michelson.estimateOperation({ tezos, ops });\nconst batch = await tezos.contract.batch().with(readyOps).send(); // a single signature\nawait batch.confirmation();\n```\n\nJust need a swap (no marketplace)? Stop after `freeRoute.michelson.buildSwapOperation` and send `swapOps`.\n\n### Gas on the Michelson side\n\nThe gas a Michelson op *declares* becomes the EVM budget of its nested `call_evm` call, and the node's own\nestimate of such an op runs short of what must be declared (up to ~1.4×), so a bare wallet/Taquito estimate fails\nwith `tezlink_error`. The SDK handles it two ways:\n\n- **Offline pins (default).** Every `call_evm` op from the builders carries `gasLimit` / `storageLimit` / `fee`\n  sized from the aggregator's EVM gas estimate, capped under the per-op gas limit. No RPC; a generous margin\n  (you pay some extra fee).\n- **`estimateOperation` (preferred at send time).** Simulates the whole group once, sizes the `call_evm` ops at\n  the node's estimate × 2 (fee priced at the node's rates) and leaves pure-Michelson ops at the node's estimate.\n  Cheaper, tracks protocol changes, and fails *before* signing if the group would revert (e.g. the ask is gone).\n  Call it once, right before signing; pass any signer- or wallet-backed `TezosToolkit`.\n\nThe EVM side needs neither: `EvmTxRequest` carries no gas and the wallet's estimate is accurate.\n\n## Quick start — EVM (MetaMask)\n\nThe same buy from a native EVM account. The builders return `EvmTxRequest[]` — a ready batch for one atomic `wallet_sendCalls`:\n\n```ts\nimport {\n  FreeRouteTezosXEvm, tezosXMainnet, XTZ, toEvmUnits, targetForMinOut,\n  evmToMichelsonAlias, resolveApproval, objkt,\n} from '@baking-bad/free-route-tezos-x/evm';\n\nconst freeRoute = new FreeRouteTezosXEvm({\n  baseUrl: FREE_ROUTE_API,\n  network: tezosXMainnet,\n  apiKey: FREE_ROUTE_API_KEY, // free-route API key\n});\n\nconst buyerAccount = '0x…';                           // the MetaMask account (holds the ERC20, pays gas)\nconst buyerAlias = evmToMichelsonAlias(buyerAccount); // the KT1 where the NFT lands\nconst payToken = (await freeRoute.getTokens()).find((token) => token.symbol === 'USDC')!;\n\nconst priceMutez = 4_000n;  // the ask price (read it from the marketplace)\nconst slippageBps = 200;    // 2%\n\n// exact-out swap, sized so the on-chain floor (target − slippage) still covers the price\nconst minOutTarget = targetForMinOut(priceMutez, slippageBps);\nconst swapAmount = toEvmUnits(minOutTarget, XTZ.address); // mutez -> wei for the EVM API\n\nconst swap = await freeRoute.getSwap({\n  src: payToken.address,\n  dst: XTZ.address,\n  amount: swapAmount,\n  isExactOut: true,\n  from: buyerAccount,\n  receiver: buyerAccount,\n  slippageBps,\n});\n\n// read the on-chain allowance -> pick the minimal safe approval mode (none / approve / reset+approve)\nconst approval = await resolveApproval({\n  evmRpc: EVM_RPC,\n  token: payToken.address,\n  owner: buyerAccount,\n  spender: swap.tx.to,\n  amount: swap.srcAmount,\n});\n\n// approve(s) + swap, composed with the marketplace fulfill (via callMichelson) -> one EvmTxRequest[] batch\nconst swapTxs = freeRoute.evm.buildSwapTransaction({\n  swap,\n  srcAddress: payToken.address,\n  approval,\n});\nconst fulfill = objkt.buildEvmFulfillAskTransaction({\n  marketplace: OBJKT_MARKETPLACE,\n  askId: '1',\n  editions: 1,\n  amountMutez: priceMutez,\n});\n\nawait walletClient.sendCalls({ calls: [...swapTxs, fulfill] }); // EIP-5792 (MetaMask); the NFT lands on `buyerAlias`\n```\n\n`EvmTxRequest` carries no gas/fees — the wallet estimates them. A wallet without EIP-5792 can send the array sequentially (not atomic).\n\n## Entrypoints\n\nOne package, three entrypoints — import the side you sign with so you only pull its peer deps:\n\n| Import | Facade | Builders | Pulls (beyond core) |\n|---|---|---|---|\n| `@baking-bad/free-route-tezos-x` | `FreeRouteTezosX` — `.michelson.*` + `.evm.*` | both | `@taquito/taquito` + `@taquito/michel-codec` |\n| `…/michelson` | `FreeRouteTezosXMichelson` — `.michelson.*` | Taquito op-groups | `@taquito/taquito` |\n| `…/evm` | `FreeRouteTezosXEvm` — `.evm.*` | EVM tx requests | `@taquito/michel-codec` |\n\nAll facades share the free-route reads (`getTokens` / `getQuote` / `getSwap`) and both gateway addresses. `@taquito/taquito` and `@taquito/michel-codec` are **optional peers**; `@taquito/michelson-encoder` and `@taquito/utils` are required by every entrypoint.\n\n## Keep your API key server-side\n\nThe Quick start builds the client in one place for brevity. To keep a hosted free-route API key off the browser, split the read surface: run a keyed `FreeRouteClient` on your server behind thin proxy routes, and implement the `FreeRouteApi` interface on the client against those routes. `serialize*` / `parse*` carry quotes and swaps across the JSON boundary without losing their bigint fields, and `serialize*Query` / `parse*Query` do the same for the request params (`parse*Query` also validates untrusted input). Token reads are plain JSON — no codec step.\n\n**Server** — the API key lives here, never in the browser:\n\n```ts\nimport {\n  FreeRouteClient, tezosXMainnet, parseQuoteQuery, parseSwapQuery, serializeQuote, serializeSwap,\n} from '@baking-bad/free-route-tezos-x';\n\nconst freeRoute = new FreeRouteClient({\n  baseUrl: FREE_ROUTE_API,\n  chainId: tezosXMainnet.chainId,\n  apiKey: FREE_ROUTE_API_KEY,\n});\n\n// behind your own routes (Next, Express, …); parse* validates the untrusted query, serialize* makes the model JSON-safe (bigint -> string)\nexport const routes = {\n  tokens: () => freeRoute.getTokens(),\n  quote: async (params: URLSearchParams) => serializeQuote(await freeRoute.getQuote(parseQuoteQuery(params))),\n  swap: async (params: URLSearchParams) => serializeSwap(await freeRoute.getSwap(parseSwapQuery(params))),\n};\n```\n\n**Client** — talks to your own endpoints (no key), parses DTOs back into typed models:\n\n```ts\nimport { parseQuote, parseSwap, serializeQuoteQuery, serializeSwapQuery } from '@baking-bad/free-route-tezos-x';\nimport type {\n  FreeRouteApi, FreeRouteToken, QuoteResponseDto, SwapResponseDto,\n} from '@baking-bad/free-route-tezos-x';\n\n// your transport to the server routes above\nconst get = <T>(path: string, params?: URLSearchParams): Promise<T> =>\n  fetch(`/free-route/${path}` + (params ? `?${params}` : '')).then((r) => r.json()) as Promise<T>;\n\n// implement FreeRouteApi over your proxy — serialize the query, parse the response (both via the SDK codec)\nexport const freeRoute: FreeRouteApi = {\n  getTokens: () => get<FreeRouteToken[]>('tokens'),\n  getQuote: async (q) => parseQuote(await get<QuoteResponseDto>('quote', serializeQuoteQuery(q))),\n  getSwap: async (q) => parseSwap(await get<SwapResponseDto>('swap', serializeSwapQuery(q))),\n};\n\n// ── elsewhere in your app (browser): build ops off the keyless `freeRoute` above + a network-keyed\n//    builder — the builder needs only the gateway, so no API key leaves the server. ──\nimport { createMichelsonOpsBuilder, tezosXMainnet } from '@baking-bad/free-route-tezos-x';\n\nconst michelson = createMichelsonOpsBuilder(tezosXMainnet.michelsonGateway); // pure builder, runs anywhere\n\nconst swap = await freeRoute.getSwap({ src, dst, amount, isExactOut: true, from, receiver });\nconst swapOps = michelson.buildSwapOperation({ swap, srcAddress: src });\n// size on the node with the wallet-backed toolkit (needs only the public RPC, no API key), then sign\nconst readyOps = await michelson.estimateOperation({ tezos, ops: swapOps });\n// (or compose with a marketplace op first — see Quick start)\n```\n\nThe [demo dApp](https://github.com/3route/free-route-tezos-x-example) wires exactly this — Next.js route handlers plus a browser shim.\n\n## API\n\nThree tiers for building ops — pick one and stay there:\n\n1. **Facade** (monolith) — `FreeRouteTezosX` bundles the free-route reads and both builder sets, pre-wired to the network. This is the Quick start; use it when one place can hold the API key.\n2. **Client + ops builder** (client/server split) — `FreeRouteClient` does the keyed reads on your server; `createMichelsonOpsBuilder(network.michelsonGateway)` / `createEvmOpsBuilder(network.evmGateway)` build ops anywhere, keyless. See [Keep your API key server-side](#keep-your-api-key-server-side).\n3. **Standalone builders** (low-level) — `buildMichelsonSwapOperation` / `buildEvmSwapTransaction` / `buildCallMichelsonTransaction` … are the plain functions the two tiers above wrap; the factory/facade only pre-inject the gateway and drop the chain prefix (`buildEvmSwapTransaction` → `evm.buildSwapTransaction`). Reach for them to compose by hand or against a custom gateway.\n\n| Export | Tier | What |\n|---|---|---|\n| `FreeRouteTezosX` / `…Michelson` / `…Evm` | facade | free-route reads + builders, pre-wired for the network. Root has `.michelson` + `.evm`; the side facades have one. |\n| `FreeRouteClient` | split | keyed HTTP client — free-route reads only (`getTokens` / `getQuote` / `getSwap`) |\n| `createMichelsonOpsBuilder` / `createEvmOpsBuilder` | split | gateway-bound builder set — keyless, pairs with `FreeRouteClient` |\n| `buildMichelsonSwapOperation` / `buildMichelsonApproveOperation` / `buildCallEvmOperation` | low-level | Michelson ops (`ParamsWithKind`) — sign with Taquito |\n| `buildEvmSwapTransaction` / `buildEvmApproveTransaction` / `buildCallMichelsonTransaction` | low-level | EVM tx requests (`EvmTxRequest`) — send with an EVM wallet; `buildCallMichelsonTransaction` takes the gateway explicitly |\n| `objkt.buildMichelsonFulfillAskOperation` / `objkt.buildEvmFulfillAskTransaction` | helper | objkt v4 `fulfill_ask` — Michelson op / EVM tx |\n| `resolveApproval` / `readAllowance` | helper | read an ERC20 allowance and pick the minimal safe `ApprovalMode` |\n| `buildBatchTransaction` | helper | flatten Michelson ops into one atomic group |\n| `estimateMichelsonOperation` | helper | simulate a Michelson op-group on the node and size its `call_evm` ops (estimate × `CALL_EVM_ESTIMATE_MARGIN`, capped) — facade: `michelson.estimateOperation`; see [Gas on the Michelson side](#gas-on-the-michelson-side) |\n| `callEvmGas`, `CALL_EVM_GAS_CAP` / `CALL_EVM_ESTIMATE_MARGIN` / `CALL_EVM_STORAGE_LIMIT` | helper | the offline `call_evm` sizing policy the builders pin by default, and its constants |\n| `forgeMichelson` | helper | forge a Micheline value for `callMichelson` data (EVM side) |\n| `targetForMinOut` | helper | gross up an exact-out target so the post-slippage floor covers a hard minimum |\n| `michelsonToEvmAlias` / `evmToMichelsonAlias` / `aliasOf` | helper | map an address to its alias on the other runtime (tz1 → 0x, 0x → KT1, or auto-detect) |\n| `toEvmUnits` / `fromEvmUnits`, `XTZ`, `XTZ_ADDRESS` | helper | XTZ mutez ⇄ wei + the native-XTZ token |\n| `tezosXMainnet` / `tezosXPreviewnet`, `EVM_GATEWAY` / `MICHELSON_GATEWAY` | const | network presets (chainId + both gateways) and the fixed cross-runtime gateway addresses (same on every network) |\n\nMichelson builders return Taquito `ParamsWithKind` (an **operation**); EVM builders return `EvmTxRequest` (a **transaction**) — hence the `…Operation` / `…Transaction` suffix. The facade exposes the same builders namespaced, dropping the chain prefix (`freeRoute.michelson.buildSwapOperation`, `freeRoute.evm.buildSwapTransaction`), with the gateway already wired in.\n\n## Demo / scripts\n\nThe [`scripts/`](scripts) folder has an end-to-end demo on Tezos X previewnet (deploy an NFT + marketplace, list an ask, then buy it from **either** the Michelson or the EVM side). See [scripts/README.md](scripts/README.md).\n\nThose same flows are covered by automated integration tests against the live previewnet gateway — `npm run test:e2e` (buy / buy-with-recipient / bridge / bridge-with-receiver on both sides, asserting the on-chain outcome). They need a funded `.env`; the offline unit suite (`npm test`) stays mock-only.\n\n## License\n\n[MIT](LICENSE) © Baking Bad\n","readmeFilename":"README.md"}